diff --git a/CHANGES.md b/CHANGES.md index c037d267..a6338c24 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -31,6 +31,7 @@ * Change displayShow page episode colours when a minimum quality is met with "End upgrade on first match" * Add seed time per provider for torrent clients that support seed time per torrent, i.e. currently only uTorrent * Remove seed time display for Transmission in config/Torrent Search page because the torrent client doesn't support it +* Add PreToMe torrent provider * Add SceneTime torrent provider * Change TtN provider to parse new layout * Improve recognition of SD quality diff --git a/gui/slick/images/providers/pretome.png b/gui/slick/images/providers/pretome.png new file mode 100644 index 00000000..efcefc51 Binary files /dev/null and b/gui/slick/images/providers/pretome.png differ diff --git a/sickbeard/__init__.py b/sickbeard/__init__.py index 486c0fc7..d3a86cc7 100755 --- a/sickbeard/__init__.py +++ b/sickbeard/__init__.py @@ -36,7 +36,7 @@ from sickbeard import providers, metadata, config, webserveInit, searchBacklog, autoPostProcesser, subtitles, traktChecker, helpers, db, exceptions, show_queue, search_queue, scheduler, \ show_name_helpers, logger, naming, searchRecent, searchProper, scene_numbering, scene_exceptions, name_cache from sickbeard.providers.generic import GenericProvider -from providers import btn, newznab, womble, thepiratebay, torrentleech, kat, iptorrents, grabtheinfo, scenetime, \ +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, totv, rarbg, morethan, alpharatio, pisexy, strike, torrentshack from sickbeard.config import CheckSection, check_setting_int, check_setting_str, check_setting_float, ConfigMigrator, \ diff --git a/sickbeard/providers/__init__.py b/sickbeard/providers/__init__.py index 87ab99e2..1b063ac9 100755 --- a/sickbeard/providers/__init__.py +++ b/sickbeard/providers/__init__.py @@ -45,6 +45,7 @@ __all__ = ['womble', 'transmithe_net', 'grabtheinfo', 'scenetime', + 'pretome', ] from os import sys diff --git a/sickbeard/providers/pretome.py b/sickbeard/providers/pretome.py new file mode 100644 index 00000000..c010431e --- /dev/null +++ b/sickbeard/providers/pretome.py @@ -0,0 +1,98 @@ +# 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 datetime + +from . import generic +from sickbeard import tvcache +from sickbeard.rssfeeds import RSSFeeds +from lib.unidecode import unidecode + + +class PreToMeProvider(generic.TorrentProvider): + + def __init__(self): + generic.TorrentProvider.__init__(self, 'PreToMe') + + self.url_base = 'https://pretome.info/' + + self.urls = {'config_provider_home_uri': self.url_base, + 'cache': self.url_base + 'rss.php?cat[]=7&sort=0&type=d&key=%s', + 'search': '&st=1&tf=all&search=%s'} + + self.url = self.urls['config_provider_home_uri'] + + self.passkey = None + self.cache = PreToMeCache(self) + + def _do_login(self): + + return self._check_auth() + + def _do_search(self, search_params, search_mode='eponly', epcount=0, age=0): + + self._do_login() + results = [] + + items = {'Season': [], 'Episode': [], 'Cache': []} + + url = self.urls['cache'] % self.passkey + for mode in search_params.keys(): + for search_string in search_params[mode]: + if isinstance(search_string, unicode): + search_string = unidecode(search_string) + + search_url = (url + self.urls['search'] % search_string, url)['Cache' == mode] + data = RSSFeeds(self).get_feed(search_url) + + cnt = len(items[mode]) + if data and 'entries' in data: + for entry in data['entries']: + try: + if entry['title'] and 'download' in entry['link']: + items[mode].append((entry['title'], entry['link'])) + except KeyError: + continue + + self._log_result(mode, len(items[mode]) - cnt, search_url) + + 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, use_or=False) + + +class PreToMeCache(tvcache.TVCache): + + def __init__(self, this_provider): + tvcache.TVCache.__init__(self, this_provider) + + self.minTime = 6 # cache update frequency + + def _getRSSData(self): + + return self.provider.get_cache_data() + + +provider = PreToMeProvider() diff --git a/sickbeard/providers/scenetime.py b/sickbeard/providers/scenetime.py index 78cb98bf..8bfc3fd5 100644 --- a/sickbeard/providers/scenetime.py +++ b/sickbeard/providers/scenetime.py @@ -30,8 +30,6 @@ class SceneTimeProvider(generic.TorrentProvider): def __init__(self): generic.TorrentProvider.__init__(self, 'SceneTime') -# https://www.scenetime.com/download.php/860856/Whose.Line.is.it.Anyway.US.S11E13.HDTV.x264-BAJSKORV.torrent -# Whose Line is it Anyway US S11E13 HDTV x264-BAJSKORV self.url_base = 'https://www.scenetime.com/' self.urls = {'config_provider_home_uri': self.url_base, 'login': self.url_base + 'takelogin.php',