From b427a44b479214d77c06e1811e1c4d29bf8a0be1 Mon Sep 17 00:00:00 2001 From: JackDandy Date: Wed, 14 Oct 2015 23:25:54 +0100 Subject: [PATCH] Remove FreshOnTV (TvT) torrent provider. --- CHANGES.md | 1 + gui/slick/images/providers/freshontv.png | Bin 3618 -> 0 bytes sickbeard/__init__.py | 2 +- sickbeard/providers/__init__.py | 1 - sickbeard/providers/freshontv.py | 153 ----------------------- 5 files changed, 2 insertions(+), 155 deletions(-) delete mode 100755 gui/slick/images/providers/freshontv.png delete mode 100755 sickbeard/providers/freshontv.py diff --git a/CHANGES.md b/CHANGES.md index e2a611ea..b7bf4ed1 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -50,6 +50,7 @@ * Fix add existing shows from folders that contain a plus char * Fix post process issue where items in history was processed out of turn * Change increase frequency of updating show data +* Remove FreshOnTV (TvT) torrent provider [develop changelog] Enable Alpha Ratio again now that the secure login page over https is fixed diff --git a/gui/slick/images/providers/freshontv.png b/gui/slick/images/providers/freshontv.png deleted file mode 100755 index 089d3479baac284e422f703cafdd3492746d6586..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3618 zcmV+-4&CvIP)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA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4xZs;&a^G&VM(X&OQZJe~?- z@fFtoT*Yd2^KfmI`=Jo^UN85W0?d|PsY^*am zIYm01rTN%VzPR`mSEjDAwzkgo*?=wq>H7M5=kV|_Gt<)?KGHxU5kpZ_78dT1PNzww zQhbYD_ omt|QW85z+H!_cGAXzH&40PwkUVo*E>tpET307*qoM6N<$f{;tmsQ>@~ diff --git a/sickbeard/__init__.py b/sickbeard/__init__.py index d9f5037e..08ca2b2a 100755 --- a/sickbeard/__init__.py +++ b/sickbeard/__init__.py @@ -38,7 +38,7 @@ from sickbeard import providers, metadata, config, webserveInit, searchBacklog, from sickbeard.providers.generic import GenericProvider from providers import btn, newznab, womble, thepiratebay, torrentleech, kat, iptorrents, grabtheinfo, scenetime, pretome, \ omgwtfnzbs, scc, torrentday, hdbits, speedcd, nyaatorrents, torrentbytes, beyondhd, gftracker, transmithe_net, \ - freshontv, bitsoup, tokyotoshokan, animenzb, rarbg, morethan, alpharatio, pisexy, strike, torrentshack, torrenting, funfile + bitsoup, tokyotoshokan, animenzb, rarbg, morethan, alpharatio, pisexy, strike, torrentshack, torrenting, funfile from sickbeard.config import CheckSection, check_setting_int, check_setting_str, check_setting_float, ConfigMigrator, \ naming_ep_type, minimax from indexers.indexer_api import indexerApi diff --git a/sickbeard/providers/__init__.py b/sickbeard/providers/__init__.py index 5e8ccdaa..c0a1bb67 100755 --- a/sickbeard/providers/__init__.py +++ b/sickbeard/providers/__init__.py @@ -29,7 +29,6 @@ __all__ = ['womble', 'speedcd', 'nyaatorrents', 'torrentbytes', - 'freshontv', 'bitsoup', 'tokyotoshokan', 'animenzb', diff --git a/sickbeard/providers/freshontv.py b/sickbeard/providers/freshontv.py deleted file mode 100755 index 80e42ada..00000000 --- a/sickbeard/providers/freshontv.py +++ /dev/null @@ -1,153 +0,0 @@ -# coding=utf-8 -# -# This file is part of SickGear. -# -# SickGear is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# SickGear is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with SickGear. If not, see . - -import re -import datetime -import traceback - -from . import generic -from sickbeard import logger, tvcache, helpers -from sickbeard.bs4_parser import BS4Parser -from lib.unidecode import unidecode - - -class FreshOnTVProvider(generic.TorrentProvider): - - def __init__(self): - generic.TorrentProvider.__init__(self, 'FreshOnTV') - - self.url_base = 'https://freshon.tv/' - self.urls = {'config_provider_home_uri': self.url_base, - 'login': self.url_base + 'login.php?action=makelogin', - 'search': self.url_base + 'browse.php?incldead=%s&words=0&cat=0&search=%s', - 'get': self.url_base + '%s'} - - self.url = self.urls['config_provider_home_uri'] - - self.username, self.password, self.minseed, self.minleech = 4 * [None] - self.freeleech = False - self.cache = FreshOnTVCache(self) - - def _do_login(self): - - logged_in = lambda: 'uid' in self.session.cookies and 'pass' in self.session.cookies - if logged_in(): - return True - - if self._check_auth(): - login_params = {'username': self.username, 'password': self.password, 'login': 'Do it!'} - response = helpers.getURL(self.urls['login'], post_data=login_params, session=self.session) - if response and logged_in(): - return True - - msg = u'Failed to authenticate with %s, abort provider' - if response: - if 'Username does not exist in the userbase or the account is not confirmed' in response: - msg = u'Invalid username or password for %s, check your config' - if 'DDoS protection by CloudFlare' in response: - msg = u'Unable to login to %s due to CloudFlare DDoS javascript check' - logger.log(msg % self.name, logger.ERROR) - - return False - - def _do_search(self, search_params, search_mode='eponly', epcount=0, age=0): - - results = [] - if not self._do_login(): - return results - - items = {'Season': [], 'Episode': [], 'Cache': []} - freeleech = '3' if self.freeleech else '0' - - rc = dict((k, re.compile('(?i)' + v)) - for (k, v) in {'info': 'detail', 'get': 'download', 'name': '_name'}.items()) - for mode in search_params.keys(): - for search_string in search_params[mode]: - search_string, url = self._get_title_and_url((search_string, self.urls['search'])) - if isinstance(search_string, unicode): - search_string = unidecode(search_string) - - # returns top 15 results by default, expandable in user profile to 100 - search_url = self.urls['search'] % (freeleech, search_string) - html = self.get_url(search_url) - - cnt = len(items[mode]) - try: - if not html or self._has_no_results(html): - raise generic.HaltParseException - - with BS4Parser(html, features=['html5lib', 'permissive']) as soup: - torrent_table = soup.find('table', attrs={'class': 'frame'}) - torrent_rows = [] if not torrent_table else torrent_table.find_all('tr') - - if 2 > len(torrent_rows): - raise generic.HaltParseException - - for tr in torrent_rows[1:]: - try: - if tr.find('img', alt='Nuked'): - continue - - seeders, leechers = [int(tr.find_all('td')[x].get_text().strip()) for x in (-2, -1)] - if 'Cache' != mode and (seeders < self.minseed or leechers < self.minleech): - continue - - info = tr.find('a', href=rc['info'], attrs={'class': rc['name']}) - title = 'title' in info.attrs and info.attrs['title'] or info.get_text().strip() - - download_url = self.urls['get'] % str(tr.find('a', href=rc['get'])['href']).lstrip('/') - except (AttributeError, TypeError): - continue - - if title and download_url: - items[mode].append((title, download_url, seeders)) - - except generic.HaltParseException: - pass - except Exception: - logger.log(u'Failed to parse. Traceback: %s' % traceback.format_exc(), logger.ERROR) - self._log_result(mode, len(items[mode]) - cnt, search_url) - - # For each search mode sort all the items by seeders - items[mode].sort(key=lambda tup: tup[2], reverse=True) - - results += items[mode] - - return results - - def find_propers(self, search_date=datetime.datetime.today()): - - return self._find_propers(search_date) - - def _get_episode_search_strings(self, ep_obj, add_string='', **kwargs): - - return generic.TorrentProvider._get_episode_search_strings(self, ep_obj, add_string, sep_date='|', use_or=False) - - -class FreshOnTVCache(tvcache.TVCache): - - def __init__(self, this_provider): - tvcache.TVCache.__init__(self, this_provider) - - self.minTime = 20 # cache update frequency - - def _getRSSData(self): - - return self.provider.get_cache_data() - - -provider = FreshOnTVProvider()