From a220d60e2a9e9e4ec9d0de7e4e23ff9bf58cec36 Mon Sep 17 00:00:00 2001 From: supergonkas Date: Tue, 26 Apr 2016 18:42:23 +0100 Subject: [PATCH] Change magnet to use 1 api --- sickbeard/providers/torrentproject.py | 25 ++----------------------- 1 file changed, 2 insertions(+), 23 deletions(-) diff --git a/sickbeard/providers/torrentproject.py b/sickbeard/providers/torrentproject.py index ff906d8f84..0b6045436f 100644 --- a/sickbeard/providers/torrentproject.py +++ b/sickbeard/providers/torrentproject.py @@ -1,7 +1,6 @@ # coding=utf-8 # Author: Gonçalo M. (aka duramato/supergonkas) # - # # This file is part of SickRage. # @@ -104,28 +103,8 @@ def search(self, search_strings, age=0, ep_obj=None): # pylint: disable=too-man t_hash = torrents[i].get("torrent_hash") torrent_size = torrents[i].get("torrent_size") size = convert_size(torrent_size) or -1 - - try: - assert seeders < 10 - assert mode != 'RSS' - logger.log(u"Torrent has less than 10 seeds getting dyn trackers: " + title, logger.DEBUG) - - if self.custom_url: - if not validators.url(self.custom_url): - logger.log("Invalid custom url set, please check your settings", logger.WARNING) - return results - trackers_url = self.custom_url - else: - trackers_url = self.url - - trackers_url = urljoin(trackers_url, t_hash) - trackers_url = urljoin(trackers_url, "/trackers_json") - jdata = self.get_url(trackers_url, returns='json') - - assert jdata != "maintenance" - download_url = "magnet:?xt=urn:btih:" + t_hash + "&dn=" + title + "".join(["&tr=" + s for s in jdata]) - except (Exception, AssertionError): - download_url = "magnet:?xt=urn:btih:" + t_hash + "&dn=" + title + self._custom_trackers + download_url = torrents[i].get("magnet") + self._custom_trackers + pubdate = '' #TBA if not all([title, download_url]): continue