Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
Thread: modify pyton script to parse rss
10-01-2009, 11:51 PM #1
- Join Date
- Apr 2008
- Thanked 1 Time in 1 Post
modify pyton script to parse rss
I use this script: http://leecher.pastebin.com/f197a7770 (from this http://code.google.com/p/leechr/ )
Basically it searches myepisodes.com for what programmes I watch, and then uses that search criteria to download .nzb files from newzleech.com (it doesnt actually download any tv shows, just .nzb files which are just xml information files)
But its been broken for some time now - the way it searches newzleech.com is just to append the search string to the rss part of their page, which no longer works. I was looking to change the code so instead it would parse a proper rss feed (eg: http://www.tvnzb.com/tvnzb_new.rss )for the search string..
Ive come up with this snippet:
import feedparser d = feedparser.parse("http://www.tvnzb.com/tvnzb_new.rss") for entry in d['entries']: if entry['title'] == "INSERT MYEPS EP HERE": goGetTheURL(entry['link'])
Any pointers would be much appreciated...
03-24-2010, 03:01 PM #2
Simple hack. Maybe there's a better way?
import feedparser # List of the titles you're interested in. my_eps = ["Something"] d = feedparser.parse("http://www.tvnzb.com/tvnzb_new.rss") for entry in d['entries']: # Old if. # if entry['title'] == "INSERT MYEPS EP HERE": # New if. Look for the entry title in your list of titles. if entry["title"] in my_eps: goGetTheURL(entry['link'])I am a Man of Truth. I am a Free Human Person. I am a Peacemaker.
** Independent Multimedia Artist in Pasig **