Change enable TorrentBytes provider and improve handling of relative download links from providers.

This commit is contained in:
JackDandy 2017-10-15 01:19:10 +01:00
parent cdc3a7c2df
commit e35b67e06f
32 changed files with 45 additions and 61 deletions

View file

@ -112,6 +112,8 @@
* Change FreeBSD initscript to use command_interpreter
* Add Slack notifier
* Change allow Cheetah template engine version 2 and newer
* Change improve handling of relative download links from providers
* Change enable TorrentBytes provider
[develop changelog]

View file

@ -30,7 +30,7 @@ from . import alpharatio, beyondhd, bithdtv, bitmetv, btn, btscene, dh, \
fano, filelist, funfile, gftracker, grabtheinfo, hd4free, hdbits, hdspace, hdtorrents, \
iptorrents, limetorrents, magnetdl, morethan, nebulance, ncore, nyaa, pisexy, pretome, privatehd, ptf, \
rarbg, revtt, scenehd, scenetime, shazbat, skytorrents, speedcd, \
thepiratebay, torlock, torrentday, torrenting, torrentleech, \
thepiratebay, torlock, torrentbytes, torrentday, torrenting, torrentleech, \
torrentvault, torrentz2, tvchaosuk, wop, zooqle
# anime
from . import anizb, tokyotoshokan
@ -79,6 +79,7 @@ __all__ = ['omgwtfnzbs',
'speedcd',
'thepiratebay',
'torlock',
'torrentbytes',
'torrentday',
'torrenting',
'torrentleech',

View file

@ -39,8 +39,7 @@ class AlphaRatioProvider(generic.TorrentProvider):
'search': self.url_base + 'torrents.php?searchstr=%s%s&' + '&'.join(
['tags_type=1', 'order_by=time', 'order_way=desc'] +
['filter_cat[%s]=1' % c for c in 1, 2, 3, 4, 5] +
['action=basic', 'searchsubmit=1']),
'get': self.url_base + '%s'}
['action=basic', 'searchsubmit=1'])}
self.url = self.urls['config_provider_home_uri']

View file

@ -32,9 +32,9 @@ class BitHDTVProvider(generic.TorrentProvider):
self.url_home = ['https://www.bit-hdtv.com/']
self.url_vars = {'login': 'getrss.php', 'search': 'torrents.php?search=%s&%s', 'get': '%s'}
self.url_vars = {'login': 'getrss.php', 'search': 'torrents.php?search=%s&%s'}
self.url_tmpl = {'config_provider_home_uri': '%(home)s', 'login': '%(home)s%(vars)s',
'search': '%(home)s%(vars)s', 'get': '%(home)s%(vars)s'}
'search': '%(home)s%(vars)s'}
self.categories = {'Season': [12], 'Episode': [4, 5, 10], 'anime': [1]}
self.categories['Cache'] = self.categories['Season'] + self.categories['Episode']

View file

@ -34,8 +34,7 @@ class BitmetvProvider(generic.TorrentProvider):
self.urls = {'config_provider_home_uri': self.url_base,
'login': self.url_base + 'links.php',
'search': self.url_base + 'browse.php?%s&search=%s',
'get': self.url_base + '%s'}
'search': self.url_base + 'browse.php?%s&search=%s'}
self.categories = {'shows': 0, 'anime': 86} # exclusively one cat per key

View file

@ -42,7 +42,7 @@ class BTNProvider(generic.TorrentProvider):
self.url_api = 'https://api.broadcasthe.net'
self.urls = {'config_provider_home_uri': self.url_base, 'login': self.url_base + 'login.php',
'search': self.url_base + 'torrents.php?searchstr=%s&action=basic&%s', 'get': self.url_base + '%s'}
'search': self.url_base + 'torrents.php?searchstr=%s&action=basic&%s'}
self.proper_search_terms = ['%.proper.%', '%.repack.%']

View file

@ -33,8 +33,7 @@ class DHProvider(generic.TorrentProvider):
self.url_base = 'https://www.digitalhive.org/'
self.urls = {'config_provider_home_uri': self.url_base,
'login': self.url_base + 'getrss.php',
'search': self.url_base + 'browse.php?search=%s&%s&titleonly=1&incldead=%s',
'get': self.url_base + '%s'}
'search': self.url_base + 'browse.php?search=%s&%s&titleonly=1&incldead=%s'}
self.categories = {'Season': [34], 'Episode': [7, 32, 55, 57], 'anime': [2]}
self.categories['Cache'] = self.categories['Season'] + self.categories['Episode']

View file

@ -38,7 +38,7 @@ class FanoProvider(generic.TorrentProvider):
self.url_base = 'https://www.fano.in/'
self.urls = {'config_provider_home_uri': self.url_base,
'login_action': self.url_base + 'login.php', 'get': self.url_base + '%s',
'login_action': self.url_base + 'login.php',
'search': self.url_base + 'browse_old.php?search=%s&%s&incldead=0'}
self.categories = {'Season': [49], 'Episode': [6, 23, 32, 35], 'anime': [27]}

View file

@ -33,8 +33,7 @@ class FLProvider(generic.TorrentProvider):
self.url_base = 'https://filelist.ro/'
self.urls = {'config_provider_home_uri': self.url_base,
'login_action': self.url_base + 'login.php',
'search': self.url_base + 'browse.php?search=%s&%s&incldead=0',
'get': self.url_base + '%s'}
'search': self.url_base + 'browse.php?search=%s&%s&incldead=0'}
self.categories = {'Season': [14], 'Episode': [13, 21, 23], 'anime': [24]}
self.categories['Cache'] = self.categories['Season'] + self.categories['Episode']

View file

@ -34,8 +34,7 @@ class FunFileProvider(generic.TorrentProvider):
self.url_base = 'https://www.funfile.org/'
self.urls = {'config_provider_home_uri': self.url_base,
'login_action': self.url_base + 'login.php',
'search': self.url_base + 'browse.php?%s&search=%s&incldead=0&showspam=1',
'get': self.url_base + '%s'}
'search': self.url_base + 'browse.php?%s&search=%s&incldead=0&showspam=1'}
self.categories = {'shows': [7], 'anime': [44]}

View file

@ -329,11 +329,9 @@ class GenericProvider:
def _link(self, url, url_tmpl=None):
url = url and str(url).strip().replace('&', '&') or ''
try:
url_tmpl = url_tmpl or self.urls['get']
except (StandardError, Exception):
url_tmpl = '%s'
return url if re.match('(?i)(https?://|magnet:)', url) else (url_tmpl % url.lstrip('/'))
return url if re.match('(?i)(https?://|magnet:)', url) \
else (url_tmpl or self.urls.get('get', (getattr(self, 'url', '') or
getattr(self, 'url_base')) + '%s')) % url.lstrip('/')
@staticmethod
def _header_row(table_row, custom_match=None, custom_tags=None, header_strip=''):

View file

@ -36,8 +36,7 @@ class GFTrackerProvider(generic.TorrentProvider):
'login_init': self.url_base + 'login.php',
'login': self.url_base + 'loginsite.php',
'browse': self.url_base + 'browse.php?view=0&%s&searchtype=1%s',
'search': '&search=%s',
'get': self.url_base + '%s'}
'search': '&search=%s'}
self.categories = {'shows': [4, 17, 19, 26, 37, 47], 'anime': [16]}

View file

@ -34,8 +34,7 @@ class GrabTheInfoProvider(generic.TorrentProvider):
self.urls = {'config_provider_home_uri': self.url_base,
'login': self.url_base + 'rules.php',
'browse': self.url_base + 'browse.php?%s&incldead=%s&blah=0%s',
'search': '&search=%s',
'get': self.url_base + '%s'}
'search': '&search=%s'}
self.categories = {'shows': [36, 32, 43, 56, 8, 65, 61, 10]}

View file

@ -39,8 +39,7 @@ class HDSpaceProvider(generic.TorrentProvider):
'login_action': self.url_base + 'index.php?page=login',
'browse': self.url_base + 'index.php?page=torrents&' + '&'.join(
['options=0', 'active=1', 'category=']),
'search': '&search=%s',
'get': self.url_base + '%s'}
'search': '&search=%s'}
self.categories = {'shows': [21, 22, 24, 25, 27, 28]}

View file

@ -37,9 +37,9 @@ class HDTorrentsProvider(generic.TorrentProvider):
self.url_home = ['https://hd-torrents.%s/' % x for x in 'org', 'net', 'me'] + ['https://hdts.ru/']
self.url_vars = {'login_action': 'index.php',
'search': 'torrents.php?search=%s&active=0&options=0&%s', 'get': '%s'}
'search': 'torrents.php?search=%s&active=0&options=0&%s'}
self.url_tmpl = {'config_provider_home_uri': '%(home)s', 'login_action': '%(home)s%(vars)s',
'search': '%(home)s%(vars)s', 'get': '%(home)s%(vars)s'}
'search': '%(home)s%(vars)s'}
self.categories = {'Episode': [59, 60, 30, 38, 65], 'anime': ['Animation']}
self.categories['Season'] = self.categories['Cache'] = self.categories['Episode']

View file

@ -48,9 +48,9 @@ class IPTorrentsProvider(generic.TorrentProvider):
'Dc0GRHa', 'vo', 'Cdwl2L', 'FWZy5', 'bvJWL1k', '9mLzt2', 'wZy', '=GG=q']]
]]])
self.url_vars = {'login': 't', 'search': 't?%s;q=%s;qf=ti%s%s#torrents', 'get': '%s'}
self.url_vars = {'login': 't', 'search': 't?%s;q=%s;qf=ti%s%s#torrents'}
self.url_tmpl = {'config_provider_home_uri': '%(home)s', 'login': '%(home)s%(vars)s',
'search': '%(home)s%(vars)s', 'get': '%(home)s%(vars)s'}
'search': '%(home)s%(vars)s'}
self.categories = {'shows': [4, 5, 22, 23, 24, 25, 26, 55, 65, 66, 78, 79, 99], 'anime': [60]}

View file

@ -37,8 +37,7 @@ class MoreThanProvider(generic.TorrentProvider):
'login_action': self.url_base + 'login.php',
'search': self.url_base + 'torrents.php?searchstr=%s&' + '&'.join([
'tags_type=1', 'order_by=time', 'order_way=desc',
'filter_cat[2]=1', 'action=basic', 'searchsubmit=1']),
'get': self.url_base + '%s'}
'filter_cat[2]=1', 'action=basic', 'searchsubmit=1'])}
self.url = self.urls['config_provider_home_uri']

View file

@ -44,7 +44,6 @@ class OmgwtfnzbsProvider(generic.NZBProvider):
self.urls = {'config_provider_home_uri': self.url_base,
'cache': 'https://rss.omgwtfnzbs.me/rss-download.php?%s',
'search': self.url_api + 'json/?%s',
'get': self.url_base + '%s',
'cache_html': self.url_base + 'browse.php?cat=tv%s',
'search_html': self.url_base + 'browse.php?cat=tv&search=%s'}
@ -225,7 +224,7 @@ class OmgwtfnzbsProvider(generic.NZBProvider):
continue
if title and download_url and age:
results.append({'release': title, 'getnzb': self.urls['get'] % download_url['href'].lstrip('/'),
results.append({'release': title, 'getnzb': self._link(download_url['href']),
'usenetage': int(age.strip())})
except generic.HaltParseException:

View file

@ -31,8 +31,7 @@ class PiSexyProvider(generic.TorrentProvider):
self.url_base = 'https://pisexy.me/'
self.urls = {'config_provider_home_uri': self.url_base,
'login': self.url_base + 'takelogin.php',
'search': self.url_base + 'browseall.php?search=%s',
'get': self.url_base + '%s'}
'search': self.url_base + 'browseall.php?search=%s'}
self.url = self.urls['config_provider_home_uri']

View file

@ -38,8 +38,7 @@ class PTFProvider(generic.TorrentProvider):
self.url_base = 'https://ptfiles.net/'
self.urls = {'config_provider_home_uri': self.url_base,
'login': self.url_base + 'panel.php?tool=links',
'search': self.url_base + 'browse.php?search=%s&%s&incldead=0&title=0',
'get': self.url_base + '%s'}
'search': self.url_base + 'browse.php?search=%s&%s&incldead=0&title=0'}
self.categories = {'Season': [39], 'Episode': [7, 33, 42], 'anime': [23]}
self.categories['Cache'] = self.categories['Season'] + self.categories['Episode']

View file

@ -33,8 +33,7 @@ class RevTTProvider(generic.TorrentProvider):
self.url_base = 'https://revolutiontt.me/'
self.urls = {'config_provider_home_uri': self.url_base,
'login_action': self.url_base + 'login.php',
'search': self.url_base + 'browse.php?search=%s&%s&titleonly=1&incldead=0',
'get': self.url_base + '%s'}
'search': self.url_base + 'browse.php?search=%s&%s&titleonly=1&incldead=0'}
self.categories = {'Season': [43, 45], 'Episode': [7, 41, 42], 'anime': [23]}
self.categories['Cache'] = self.categories['Season'] + self.categories['Episode']

View file

@ -32,9 +32,9 @@ class SceneHDProvider(generic.TorrentProvider):
self.url_home = ['https://scenehd.org/']
self.url_vars = {'login_action': 'login.php', 'search': 'browse.php?search=%s&cat=%s&sort=5', 'get': '%s'}
self.url_vars = {'login_action': 'login.php', 'search': 'browse.php?search=%s&cat=%s&sort=5'}
self.url_tmpl = {'config_provider_home_uri': '%(home)s', 'login_action': '%(home)s%(vars)s',
'search': '%(home)s%(vars)s', 'get': '%(home)s%(vars)s'}
'search': '%(home)s%(vars)s'}
self.categories = {'shows': [5, 6, 7]}

View file

@ -40,8 +40,7 @@ class ShazbatProvider(generic.TorrentProvider):
'feeds': self.url_base + 'rss_feeds',
'browse': self.url_base + 'torrents?portlet=true',
'search': self.url_base + 'search?portlet=true&search=%s',
'show': self.url_base + 'show?id=%s&show_mode=torrents',
'get': self.url_base + '%s'}
'show': self.url_base + 'show?id=%s&show_mode=torrents'}
self.url = self.urls['config_provider_home_uri']

View file

@ -34,7 +34,7 @@ class SkytorrentsProvider(generic.TorrentProvider):
self.url_base = 'https://www.skytorrents.in/'
self.urls = {'config_provider_home_uri': self.url_base,
'search': self.url_base + 'search/all/ad/1/%s?l=en-us', 'get': self.url_base + '%s'}
'search': self.url_base + 'search/all/ad/1/%s?l=en-us'}
self.minseed, self.minleech = 2 * [None]
self.confirmed = False

View file

@ -31,8 +31,7 @@ class SpeedCDProvider(generic.TorrentProvider):
self.url_base = 'https://speed.cd/'
self.urls = {'config_provider_home_uri': self.url_base,
'login': self.url_base + 'rss.php',
'search': self.url_base + 'V3/API/API.php',
'get': self.url_base + '%s'}
'search': self.url_base + 'V3/API/API.php'}
self.categories = {'Season': [41, 53], 'Episode': [2, 49, 50, 55], 'anime': [30]}
self.categories['Cache'] = self.categories['Season'] + self.categories['Episode']

View file

@ -32,9 +32,9 @@ class TorrentBytesProvider(generic.TorrentProvider):
self.url_home = ['https://www.torrentbytes.%s/' % u for u in 'net', 'me']
self.url_vars = {'login_action': 'login.php', 'search': 'browse.php?search=%s&%s', 'get': '%s'}
self.url_vars = {'login_action': 'login.php', 'search': 'browse.php?search=%s&%s'}
self.url_tmpl = {'config_provider_home_uri': '%(home)s', 'login_action': '%(home)s%(vars)s',
'search': '%(home)s%(vars)s', 'get': '%(home)s%(vars)s'}
'search': '%(home)s%(vars)s'}
self.categories = {'Season': [41, 32], 'Episode': [33, 37, 38]}
self.categories['Cache'] = self.categories['Season'] + self.categories['Episode']

View file

@ -44,9 +44,9 @@ class TorrentDayProvider(generic.TorrentProvider):
'Vmbq', 'WL10', 'ZyZ', 'rFW', '5yc', '12bj', 'q=0']]
]]]
self.url_vars = {'login': 'rss.php', 'search': 'browse.php?cata=yes&%s%s&search=%s%s', 'get': '%s'}
self.url_vars = {'login': 'rss.php', 'search': 'browse.php?cata=yes&%s%s&search=%s%s'}
self.url_tmpl = {'config_provider_home_uri': '%(home)s', 'login': '%(home)s%(vars)s',
'search': '%(home)s%(vars)s', 'get': '%(home)s%(vars)s'}
'search': '%(home)s%(vars)s'}
self.categories = {'Season': [31, 33, 14], 'Episode': [24, 32, 26, 7, 34, 2], 'anime': [29]}
self.categories['Cache'] = self.categories['Season'] + self.categories['Episode']

View file

@ -32,9 +32,9 @@ class TorrentingProvider(generic.TorrentProvider):
self.url_home = ['https://%s/' % u for u in 'www.torrenting.com', 'ttonline.us']
self.url_vars = {'login': 'rss.php', 'search': 'browse.php?%s&search=%s', 'get': '%s'}
self.url_vars = {'login': 'rss.php', 'search': 'browse.php?%s&search=%s'}
self.url_tmpl = {'config_provider_home_uri': '%(home)s', 'login': '%(home)s%(vars)s',
'search': '%(home)s%(vars)s', 'get': '%(home)s%(vars)s'}
'search': '%(home)s%(vars)s'}
self.categories = {'shows': [4, 5]}

View file

@ -33,8 +33,7 @@ class TorrentLeechProvider(generic.TorrentProvider):
self.urls = {'config_provider_home_uri': self.url_base,
'login_action': self.url_base,
'browse': self.url_base + 'torrents/browse/index/categories/%(cats)s',
'search': self.url_base + 'torrents/browse/index/query/%(query)s/categories/%(cats)s',
'get': self.url_base + '%s'}
'search': self.url_base + 'torrents/browse/index/query/%(query)s/categories/%(cats)s'}
self.categories = {'shows': [2, 26, 27, 32], 'anime': [7, 34, 35]}

View file

@ -33,9 +33,9 @@ class TorrentVaultProvider(generic.TorrentProvider):
self.url_home = ['https://www.torrentvault.org/']
self.url_vars = {'login_action': 'login.php', 'search': 'torrents.php?%s' % '&'.join(
['searchstr=%s', 'order_by=s3', 'order_way=desc', 'action=basic', '%s']), 'get': '%s'}
['searchstr=%s', 'order_by=s3', 'order_way=desc', 'action=basic', '%s'])}
self.url_tmpl = {'config_provider_home_uri': '%(home)s', 'login_action': '%(home)s%(vars)s',
'search': '%(home)s%(vars)s', 'get': '%(home)s%(vars)s'}
'search': '%(home)s%(vars)s'}
self.categories = {'Season': [7, 32], 'Episode': [4, 8, 9]}
self.categories['Cache'] = self.categories['Season'] + self.categories['Episode']

View file

@ -35,8 +35,7 @@ class TVChaosUKProvider(generic.TorrentProvider):
self.url_base = 'https://www.tvchaosuk.com/'
self.urls = {'config_provider_home_uri': self.url_base,
'login_action': self.url_base + 'login.php',
'search': self.url_base + 'browse.php',
'get': self.url_base + '%s'}
'search': self.url_base + 'browse.php'}
self.url = self.urls['config_provider_home_uri']

View file

@ -33,9 +33,9 @@ class WOPProvider(generic.TorrentProvider):
self.url_home = ['https://www.worldofp2p.net/']
self.url_vars = {'login': 'getrss.php', 'search': 'browse.php?%s' % '&'.join(
['search=%s', 'searchin=title', 'incldead=0', 'sort=4', 'type=desc', '%s']), 'get': '%s'}
['search=%s', 'searchin=title', 'incldead=0', 'sort=4', 'type=desc', '%s'])}
self.url_tmpl = {'config_provider_home_uri': '%(home)s', 'login': '%(home)s%(vars)s',
'search': '%(home)s%(vars)s', 'get': '%(home)s%(vars)s'}
'search': '%(home)s%(vars)s'}
self.categories = {'Season': [41], 'Episode': [35, 5, 58, 42, 36, 55, 39, 37, 54, 38]}
self.categories['Cache'] = self.categories['Season'] + self.categories['Episode']