DHL (Germany) without user-provided API-Key - #230
relishdumpling wants to merge 6 commits into
Conversation
… and created a new service based on a open endpoint that dhl itself uses for the tracking page (itsvic-dev#81 (comment))
…ernational and DHL Germany
…the output, unlike DHL International (DHL International returns a more specific location string). Also fixed wrong reference for renamed locale.
…n same country, overwrite of null event locations
itsvic-dev
left a comment
There was a problem hiding this comment.
here's a preliminary review of the PR so far.
once the PR is ready, i will review again
| LocalDateTime.parse(it.date, DateTimeFormatter.ISO_DATE_TIME), | ||
| it.location | ||
| ?: if (!details.international) details.destinationLocation | ||
| else "Unknown location") |
There was a problem hiding this comment.
please use null instead of a hard-coded English string
There was a problem hiding this comment.
It looks like you can't null the parameter 'location' and need to use "" instead. For example InPostItaly works about the same with: item.agency ?: "".
|
Will work on a vpn fix soon.. if someone else also got any idea please comment edit:
What I still need to try:
|
Bad News: quick update on the VPN thing, might be wrong here but:looked a bit closer at the response headers/cookies and it seems to be a Akamai Bot Manager (_abck, ak_bmsc, bm_mi cookies show up). if that's really it. tried so far, doesn't seem to help (if my theory above is right):
not 100% sure on any of this tbh, just going off the cookie names. if someone knows more about Akamai bot detection feel free to comment :) if it is Akamai though, don't think this is fixable with plain OkHttp/Retrofit realistically in my current understanding. An Option would be webview (which we don't want)... tl:dr:fetching dhl (germany) with vpn isn't working most of the time, probably because of a akamai bot manager. Tried some bypasses but didn't work. Probably issue will persist until the use of webviews. maybe easiest to just document it as a known limitation for now? (But idk how many people regularly use vpn or not tho) (that's really disappointing mhpff) |
Hi! My First PR here :P
As discussed in #81 this approach tries to implement the open API endpoint that DHL uses for their tracking sites in Germany (#81 (comment)). The International Tracking sits behind a challenge instead.
What changed:
Problems:
Additions:
Endpoint for Deutsche Post Tracking Page:
https://www.deutschepost.de/int-verfolgen/data/search?piececode=00340435099029344393&language=en. So I think it's just DHL under the hood (As Deutsche Post also belongs to the "DHL Group").