Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
torrent announce urls
#!/usr/bin/env python
import sys
from deluge._libtorrent import lt
for a in sys.argv[1:]:
try:
info = lt.torrent_info(lt.bdecode(open(a).read()))
print("{0} {1}".format(info.name(), ', '.join((ae.url for ae in info.trackers()))))
except RuntimeError as e:
print("could not decode torrent file {0}".format(a))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment