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 | |
|---|---|---|---|
| urlunshort3-0.3.tar.gz | 4.0 kB | Details |
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
|