Merge pull request #515 from JackDandy/feature/AddProviderPreToMe

Add PreToMe torrent provider.
This commit is contained in:
JackDandy 2015-09-14 17:37:15 +01:00
commit df30e0af83
6 changed files with 101 additions and 3 deletions

View file

@ -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

Binary file not shown.

After

Width:  |  Height:  |  Size: 860 B

View file

@ -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, \

View file

@ -45,6 +45,7 @@ __all__ = ['womble',
'transmithe_net',
'grabtheinfo',
'scenetime',
'pretome',
]
from os import sys

View file

@ -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 <http://www.gnu.org/licenses/>.
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()

View file

@ -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',