From 90b2032e4f63ea16d02b1ad04f5423444707353d Mon Sep 17 00:00:00 2001 From: JackDandy Date: Fri, 25 Sep 2015 16:57:20 +0100 Subject: [PATCH] Change disable ToTV due to non-deletable yet reported hacker BTC inbox scam and also little to no new content listings. --- CHANGES.md | 1 + gui/slick/images/providers/totv.png | Bin 588 -> 0 bytes sickbeard/__init__.py | 2 +- sickbeard/providers/__init__.py | 1 - sickbeard/providers/totv.py | 131 ---------------------------- 5 files changed, 2 insertions(+), 133 deletions(-) delete mode 100644 gui/slick/images/providers/totv.png delete mode 100644 sickbeard/providers/totv.py diff --git a/CHANGES.md b/CHANGES.md index e3e46edc..01d0e0bb 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -42,6 +42,7 @@ * Add Torrenting provider * Add FunFile torrent provider * Remove unnecessary call to indexers during nameparsing +* Change disable ToTV due to non-deletable yet reported hacker BTC inbox scam and also little to no new content listings [develop changelog] Enable Alpha Ratio again now that the secure login page over https is fixed diff --git a/gui/slick/images/providers/totv.png b/gui/slick/images/providers/totv.png deleted file mode 100644 index c10e9ea57b30d063edb83e366aa77bf7813d320e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 588 zcmV-S0<-;zP)( zpZhxJzOHi-Dg|X{b~x`~4p6cDvov>GVS-dSfscOeQm%&Az<6+z6;!EEeH# z7zdO%N*J}jUatt>-`{b1cWE-2$Ye61P}uMHSF06O`eg=>$5SX2$K!FiT;4^yT&_qY zf)pCd<#J}TxzT8h$K%)6*H9?5+wBgALnf1fbQIITL1*wD1TL3ru~@L;vh(?jBZtF* z7uakzEEWg^$lM4hnog&kPUjZWXlk_@w!FQ)i9{l?Sd8RwIBd7udcFQmkjv#Nl`5G` zjz%MdHk)lQ7!(QxlgWf|v)RCLcxbg+?*zc>^*%m627|#;sU-XabVDnC8cB2*2n68l zU!wuUVliASl}b4r4vc<&el8Y^8jZ&9_e0pvS)zbn$1FTNJZ!gH(4L;2K>J=m{C2!Q a1Q-C*B`7X^AN*GU0000. - -import datetime -import urllib - -from . import generic -from sickbeard import logger, tvcache -from sickbeard.helpers import mapIndexersToShow -from sickbeard.exceptions import AuthException - - -class ToTVProvider(generic.TorrentProvider): - - def __init__(self): - generic.TorrentProvider.__init__(self, 'ToTV') - - self.url_base = 'https://titansof.tv/' - self.urls = {'config_provider_home_uri': self.url_base, - 'search': self.url_base + 'api/torrents?%s', - 'get': self.url_base + 'api/torrents/%s/download?apikey=%s'} - - self.url = self.urls['config_provider_home_uri'] - - self.api_key, self.minseed, self.minleech = 3 * [None] - self.cache = ToTVCache(self) - - def _check_auth_from_data(self, data_json): - - if 'error' not in data_json: - return True - - logger.log(u'Incorrect authentication credentials for %s : %s' % (self.name, data_json['error']), - logger.DEBUG) - raise AuthException('Your authentication credentials for %s are incorrect, check your config.' % self.name) - - def _do_search(self, search_params, mode='eponly', epcount=0, age=0): - - self._check_auth() - self.headers.update({'X-Authorization': self.api_key}) - results = [] - params = {'limit': 100} - mode = ('season' in search_params.keys() and 'Season') or \ - ('episode' in search_params.keys() and 'Episode') or 'Cache' - - if search_params: - params.update(search_params) - - search_url = self.urls['search'] % urllib.urlencode(params) - - data_json = self.get_url(search_url, json=True) - - cnt = len(results) - if data_json and 'results' in data_json and self._check_auth_from_data(data_json): - for result in data_json['results']: - try: - seeders, leechers = result['seeders'], result['leechers'] - if 'Cache' != mode and (seeders < self.minseed or leechers < self.minleech): - continue - - title, download_url = result['release_name'], str(self.urls['get'] % (result['id'], self.api_key)) - except (AttributeError, TypeError): - continue - - if title and download_url: - results.append((title, download_url)) - - self._log_result(mode, len(results) - cnt, search_url) - return results - - def find_propers(self, search_date=datetime.datetime.today()): - - return self._find_propers(search_date) - - def _get_season_search_strings(self, ep_obj, **kwargs): - - return self._build_search_str(ep_obj, {'season': 'Season %02d' % - int((ep_obj.season, ep_obj.scene_season)[bool(ep_obj.show.is_scene)])}) - - def _get_episode_search_strings(self, ep_obj, add_string='', **kwargs): - - if not ep_obj: - return [{}] - - # Do a general name search for the episode, formatted like SXXEYY - season, episode = ((ep_obj.season, ep_obj.episode), - (ep_obj.scene_season, ep_obj.scene_episode))[bool(ep_obj.show.is_scene)] - return self._build_search_str(ep_obj, {'episode': 'S%02dE%02d %s' % (season, episode, add_string)}) - - @staticmethod - def _build_search_str(ep_obj, search_params): - - if 1 == ep_obj.show.indexer: - search_params['series_id'] = ep_obj.show.indexerid - elif 2 == ep_obj.show.indexer: - tvdbid = mapIndexersToShow(ep_obj.show)[1] - if tvdbid: - search_params['series_id'] = tvdbid - - return [search_params] - - def get_cache_data(self, *args, **kwargs): - - return self._do_search({}) - - -class ToTVCache(tvcache.TVCache): - - def __init__(self, this_provider): - tvcache.TVCache.__init__(self, this_provider) - - def _getRSSData(self): - - return self.provider.get_cache_data() - - -provider = ToTVProvider()