Skip to content

Instantly share code, notes, and snippets.

@MartinBrugnara
Created March 28, 2016 16:19
Show Gist options
  • Save MartinBrugnara/7cc32523537e966d8b22 to your computer and use it in GitHub Desktop.
Save MartinBrugnara/7cc32523537e966d8b22 to your computer and use it in GitHub Desktop.
tntvillage query result page to list of magnet links
#!/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