-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UnauthorizedException is back #17
Comments
Yeah... PostNL made it a LOT harder. I appears that they are using: Akamai Bot Manager Based on the I'm not sure if/how we are able to bypass this. |
Damn... That sounds like they are actively blocking us.... |
USPS had the same case: home-assistant/core#13688 |
It's a possibility, if any PostNL devs are reading this: Let's have a beer and talk this over 🥂 |
I wonder if we set the update time to once a day, if we are being "unblocked" after like a week or so. Since it took some time for some people to get blocked. |
I got around it. Make the following changes in the code: Change:
To:
Change:
To:
You are now using their web login, which still gives you an access key which also works with the mobile end points. Potentially all end points could be rebuild to the web interface even.... |
We have to check whether that is in the design specs of Homeassistant though, since it's borderline webscraping. But I like the idea, I was just fiddling with the web api myself |
Well, it's still an API. So not really scraping an HTML page. On the other hand, PostNL didn't build a "bot protection" without reasons I suppose. |
Well I still have trouble to login. I changed the lines as you said, but still received an 403 http error :-( |
I am working on a fix, currently trying out new ways to interface with the multiple endpoints |
Did anyone have contact with PostNL regarding the API implementation? Possibly we could start the discussion and also discuss items like refresh time with them. |
Tried through their webcare team, but failed. Was thinking about reaching out to them through Linkedin, so let me see what I can do. |
Works for me! |
Not for me, still got 403 error. |
Does not work for me as well. |
Life got in the way, I had less time this week than expected. |
This works:
So some headers are not necessary...
|
Where (which file / code) do I need to change this? |
I tried the suggestions from above but with no luck.. it's still not working for me. I keep on getting;
I have opened a webcare ticket with postnl about 1.5 years ago with a request for a decent API or some form of IFTTT integration.. but they never got back to me. Everytime I ask them the ticket is still pending. |
I've also set the scan_interval to max once a day for now. Not sure if that solves the issue, together with the above mentioned work-around. |
Still working like a charm here... But once a day, guessing we might miss out some alerts. Do we know for sure at what time postnl updates the data? |
Okay it is working. But how can I get the latest python-postNL-api to work with LoveLace from https://community.home-assistant.io/u/ptnijssen ? Is there a recently updated howto? |
@0x00-0xFF, @peternijssen someone who would like to do a PR with the discussed changes? I could publish it asap and let's get it to HA core. |
Done |
Thanks @0x00-0xFF, it has been published on PyPi as version 1.2.3. @peternijssen, @IcyPalm, would you like to try it out? Let's have it thoroughly tested and get it back in HA. For me it works with those changes. |
Good work guys! I really miss my PostNL info in HA |
You could load it as a custom component, the fix is working for me. Clone this repo and add it to your your custom components and let us know if it's working for you as well. |
@0x00-0xFF Do you mean to load this new version of the api as a custom component? How should we do that? Or copy the postnl component and adjust it to use the new api? I followed these steps:
This is the result:
|
As you can see @iMicknl it isn't working for me. 😢 |
I have also tried to install the lib through pypi and that isn't working either. Same error message. |
It definitely is working for me though, a few days ago I had to fix the code again -> #20 |
I tried again: $ pip3 install postnl-api
$ python3 -m postnl_api.test_postnl_api someone@example.org PaSsW0rdwithlettersandnumbersonly Error again. Tried with my own internet, a VPN server in NL and one abroad. |
My latest fix in PR20 is not merged yet, and also not on pypi. |
I'm willing to give it a try, but how should I clone the API itself (not the postnl HA component) as a custom component? |
The
UnauthorizedException
is back like in the previous issue. Unclear is yet why, but apparently not everyone is suffering from this case, as noted in https://community.home-assistant.io/t/lovelace-postnl/112433/240I tried to debug, but having a hard time to track my requests on an android device.
The earlier mentioned user agents here don't solve the problem. So it's unclear if it's related to the header.
cc @IcyPalm
The text was updated successfully, but these errors were encountered: