Skip to content

Instantly share code, notes, and snippets.

@florido
Forked from lyralemos/showrss.py
Created May 19, 2019 21:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save florido/868a3b36f7633cdf035a8547730296a9 to your computer and use it in GitHub Desktop.
Save florido/868a3b36f7633cdf035a8547730296a9 to your computer and use it in GitHub Desktop.
Downloads torrents from showrss and adds them to transmission; Dependencies: Feedparser and Transmissionrpc
import os
import feedparser
import transmissionrpc as tm
script_dir = os.path.dirname(__file__)
downloaded_file = os.path.join(script_dir, 'showrss.downloaded')
base_path = '/media/seagate/Video/Series/'
feed_url = 'http://showrss.info/user/448.rss'
feed = feedparser.parse(feed_url)
for show in feed.entries:
info_hash = show['tv_info_hash']
magnetic_link = show['link']
tv_show_name = show['tv_show_name']
with open(downloaded_file, "r+") as downloaded:
if info_hash not in downloaded.read().splitlines():
tc = tm.Client('localhost', user='transmission',password='transmission', port=9091)
tc.add_torrent(magnetic_link, download_dir=base_path+tv_show_name)
downloaded.write(info_hash+'\n\r')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment