Skip to content

Instantly share code, notes, and snippets.

@kkarakk
Created January 4, 2015 01:35
Show Gist options
  • Save kkarakk/5ab919fb3fd939d9e3af to your computer and use it in GitHub Desktop.
Save kkarakk/5ab919fb3fd939d9e3af to your computer and use it in GitHub Desktop.
Python Regex to extract torrent tracker names
'''http://bitsnoop.com/trackers/ has a list of active trackers so made a quick dirty regex to extract only the tracker names in order to quickly paste said tracker names to utorrent/deluge
regex is "(http|udp):\/\/[\d|\D]+?\s+([^a-z\/^\d]?)?" for easy copy/paste '''
import re
regex = re.compile("(http|udp):\/\/[\d|\D]+?\s+([^a-z\/^\d]?)?")
with open("trackers.txt") as f:
for line in f:
result=regex.search(line)
if result is not None:
print(result.group(0))
@kkarakk
Copy link
Author

kkarakk commented Jan 4, 2015

http://bitsnoop.com/trackers/ has a list of active trackers so made a quick dirty regex to extract only the tracker names in order to quickly paste said tracker names to utorrent/deluge torrent software.

I make a point to only torrent public domain stuff but since piratebay went down i've had to update my tracker list so this helps

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment