fronzbot / blinkpy

A Python library for the Blink Camera system

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Login with blinkpy>=0.22.0 fails

fronzbot opened this issue · comments

Discussed in #815

Originally posted by swerb73 November 19, 2023
@fronzbot, I've been working to upgrade to the latest version of blinkpy, converting to the asyncio, await, etc... I think I have the code setup correctly per the documentation and am always getting:

Connection error. Endpoint https://rest-prod.immedia-semi.com/api/v5/account/login possibly down or throttled.
Login endpoint failed. Try again later.
Cannot setup Blink platform.
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x10b7d2990>

Here's my code:

import asyncio
from aiohttp import ClientSession
from blinkpy.blinkpy import Blink

async def start():
blink = Blink(session=ClientSession())
await blink.start()
return blink

blink = asyncio.run(start())

Tried curling that URL from both the EU and the US and I'm getting respectively a 404 and a 406, so yeah there's something going on

HA people are having a huge problem around this, but it looks more and more like a problem on Blink's side: home-assistant/core#107143

IE:

Log: 2024-01-05 14:00:13.787 ERROR (MainThread) [blinkpy.auth] Connection error. Endpoint https://rest-e001.immedia-semi.com/api/v3/accounts/15098/homescreen possibly down or throttled.

Hopefully, they're not again trying to force us into their app

Old Code (sync) still working.

Yeah it's not uncommon for A) Blink to change API endpoints or B) API endpoints to be down regionally some times. I can also confirm on my end that the Blink API is working fine (I'm in the US).

Many times in the past where similar things have cropped up, the API issues resolved within 24-48hrs so I think we should wait and see if it's still a problem after then

i am having issues with this since 2-3 days ago
fist the videos would return 406
and now the "homescreen" endpoint return some cloudfront not found html page

did they change the API ? since the official iOS client still works ok

Ditto....I am having the same issues here and getting 406 errors but happy to wait and see if it resolves itself. Had similar issues as others updating to the v0.22 async release but think I've done something daft ;o)

I am having the same issue. It works, then after running the same code again, it randomly fails to connect and if I run the code another time it connects again.

Looks like this should be fix with #848

Hey there - I started getting similar 406 errors a couple of days ago and was behind one version and so upgraded to 0.22.4 and I am still seeing some errors:

2024-01-07 09:48:38,743 [DEBUG] Making POST request to https://rest-u003.immedia-semi.com/network/XXXX/update
2024-01-07 09:48:38,819 [ERROR] error message='Attempt to decode JSON with unexpected mimetype: text/plain; charset=utf-8', url=URL('https://rest-u003.immedia-semi.com/network/XXXX/update')

2024-01-07 09:48:49,313 [DEBUG] Making GET request to https://rest-u003.immedia-semi.com/network/XXXX/camera/XXXX/signals
2024-01-07 09:48:49,383 [ERROR] error message='Attempt to decode JSON with unexpected mimetype: text/plain; charset=utf-8', url=URL('https://rest-u003.immedia-semi.com/network/XXXX/camera/XXXX/signals')

I wanted to see if this change would fix those, and so I tried to grab and build the dev branch but there is no setup.py file anymore so how does one go about doing that?

Ah, out of date readme. Shoot, I'll have to fix that

You should just be able to run pip install . inside of the repo dir. Let me know if that works

Thank you the install ran after I upgraded to Python 3.9, and the first run of downloading a recent thumbnail from every camera worked with no errors!

This runs twice a day (hour after sunrise and an hour before sunset), will let you know if I run into any issues in the coming days.