Skip to content

Add USPS - #239

Open
arthurmelton wants to merge 1 commit into
itsvic-dev:masterfrom
arthurmelton:usps
Open

Add USPS#239
arthurmelton wants to merge 1 commit into
itsvic-dev:masterfrom
arthurmelton:usps

Conversation

@arthurmelton

Copy link
Copy Markdown

This adds usps support without any api keys needed.

How this works is it tries to directly make a connection to https://tools.usps.com/go/TrackConfirmAction?qtc_tLabels1= to get the status of the code. But the main problem has been that it has aggresive bot detection on it. So if it detects that it is bot detected, it will open up an invisible WebView to get around the Akamai js challenge.

The reason it first tries to make a normal request then the web view is because the webview take a "bit" of network to run since it also downloading everything on the page (I did whitelist it only to usps so it does not get google tracking links and stuff), but it still grabs quite a bit.

This method could be used for anything else that surfaces a js challenge, but I think this should 100% be a last resort type of thing.

If you have any questions or thoughts lmk.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant