shortpipe reads urls from stdin and writes them to stdout after having unshortened them.
pip install shortpipe
cat urls.txt | shortpipe > new_urls.txt
If you have a bunch of CPUs you can parallelize the lookups with:
cat urls.txt | shortpipe --processes 4 > new_urls.txt
- CC0