Created
October 16, 2012 20:08
-
-
Save MrDOS/3901661 to your computer and use it in GitHub Desktop.
Generate log file URLs for all torrents with logs recently uploaded to What.CD.
This file contains 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
#! /usr/bin/python | |
"""Use values from one of your personal RSS feed URLs.""" | |
USER="" | |
AUTH="" | |
PASSKEY="" | |
AUTHKEY="" | |
import urllib, re | |
try: | |
import xml.etree.cElementTree as ET | |
except ImportError: | |
import xml.etree.ElementTree as ET | |
ID_PATTERN="id=([0-9]+)" | |
rssf = urllib.urlopen("https://what.cd/feeds.php?feed=torrents_flac&user=%s&auth=%s&passkey=%s&authkey=%s" \ | |
% (USER, AUTH, PASSKEY, AUTHKEY)) | |
rss = ET.parse(rssf) | |
rssf.close() | |
for item in rss.getroot()[0].findall("item"): | |
if "FLAC / Lossless / Log / 100%" in item.find("title").text: | |
torrentid = re.search(ID_PATTERN, item.find("link").text).group(1) | |
groupid = re.search(ID_PATTERN, item.find("comments").text).group(1) | |
print "https://what.cd/torrents.php?action=viewlog&torrentid=%s&groupid=%s" \ | |
% (torrentid, groupid) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment