Created
January 4, 2015 01:35
-
-
Save kkarakk/5ab919fb3fd939d9e3af to your computer and use it in GitHub Desktop.
Python Regex to extract torrent tracker names
This file contains hidden or 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
'''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)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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