Skip to content

Instantly share code, notes, and snippets.

@sysradium
Created September 3, 2016 17:36
Show Gist options
  • Save sysradium/1a9b3709b22477cbdfb4733c2d8001b2 to your computer and use it in GitHub Desktop.
Save sysradium/1a9b3709b22477cbdfb4733c2d8001b2 to your computer and use it in GitHub Desktop.
Getting a list of files in torrent given a magnet link
magnet-info() {
hash=$(echo "${1,,}" | grep -oP "(?<=btih:).*?(?=&)")
echo "Magnet hash: $hash"
aria2c --bt-metadata-only=true --bt-save-metadata=true -q "$1"
aria2c "$hash.torrent" -S
rm "$hash.torrent"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment