Skip to content

Instantly share code, notes, and snippets.

@lyralemos
Created February 4, 2018 20:29
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save lyralemos/88a0c976cb880b94943d449fd67b4bc1 to your computer and use it in GitHub Desktop.
Save lyralemos/88a0c976cb880b94943d449fd67b4bc1 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