Created
January 31, 2021 04:52
-
-
Save calvang/f8c27280f6aa7a5d12c048baaf5790b8 to your computer and use it in GitHub Desktop.
Brief python3 script to recursively unmask url's that have been shortened.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sys import argv | |
from requests import head | |
def url_unshorten(url, verbose=True): | |
full_url = head(url, allow_redirects=True).url | |
verbose and print(full_url) | |
return full_url | |
if __name__ == '__main__': | |
url_unshorten(argv[1]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment