I found this pacakage which did exactly what I needed but in Python2 https://pypi.org/project/urlunshort/. I updated the code and moved the web logic to requests to simplify some things.
Some URLs for shortening came from https://gist.github.com/ninetyfivenorth/9322bfc20523ba2eb7521d57cf25f265.
This should handle many services reasonably, but I found a few that don’t respond normally to a HEAD requests and the tricks=True argument might help with some of those cases.
Metadata
Release files for urlunshort3 0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| urlunshort3-0.3.tar.gz | 4.0 kB | Without provenance | Details for urlunshort3-0.3.tar.gz |
Release files / urlunshort3-0.3.tar.gz
| Download URL | urlunshort3-0.3.tar.gz |
|---|---|
| Size | 4.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ecd792ee67ce52122a38394a1d95b5c78e79b87c714230e7529854737e5a504e
|
|
BLAKE2b-256 checksum How to use checksums |
8ae3a9c09215faf37e21c5571a9d50957e189b05b8d2e442fbf646e8eb41d1c8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.8
|
Security for urlunshort3 0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.