Created
March 28, 2016 16:19
-
-
Save MartinBrugnara/7cc32523537e966d8b22 to your computer and use it in GitHub Desktop.
tntvillage query result page to list of magnet links
This file contains 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
#!/bin/bash | |
if [ "$#" -ne 1 ]; then | |
echo "Usage $0 tntpage.htm" | |
exit 1 | |
fi | |
cat "$1" | grep 'showtopic' | sed -e "s/.*href=['\"]\([^\"']*?showtopic=[^\"']*\)['\"].*/\1/" \ | |
| grep '^http' | grep index | xargs -n 1 curl \ | |
| grep 'magnet:?' | sed -e "s/.*href=['\"]\(magnet:?[^\"']*\)['\"].*/\1/" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment