Commit 0d7cb9ae authored by echel0n's avatar echel0n
Browse files

Merge branch 'release/9.1.42'

parents 64476f7a f915a35b
# Changelog
- * 98a5062 - 2017-10-17: Release v9.1.40
- * 4fe4c47 - 2017-10-17: Release v9.1.42
- * 177461d - 2017-10-17: Fixed NyaaTorrents provider Refactored more provider code
- * 5563b94 - 2017-10-17: Fixed attribute error for postprocessing queue
- * fea50e2 - 2017-10-17: Release v9.1.40
- * 94e71c8 - 2017-10-17: Fixed issue #88 - Show are truncated when show set in different language
- * e6e0237 - 2017-10-17: Added Anizb Newznab provider
- * f45988b - 2017-10-17: Refactored Newznab provider code Refactored locations of static files and mako templates
......
......@@ -318,7 +318,7 @@ class GenericClient(object):
try:
# Sets per provider seed ratio
result.ratio = result.provider.seed_ratio()
result.ratio = result.provider.seed_ratio
# lazy fix for now, I'm sure we already do this somewhere else too
result = self._get_torrent_hash(result)
......
......@@ -499,8 +499,8 @@ class NameParser(object):
final_result.quality = self._combine_results(file_name_result, dir_name_result, 'quality')
if not final_result.show and self.validate_show:
raise InvalidShowException(
"Unable to match {} to a show in your database. Parser result: {}".format(name, str(final_result)))
raise InvalidShowException("Unable to match {result.original_name} to a show in your database. "
"Parser result: {result}".format(result=final_result))
# if there's no useful info in it then raise an exception
if final_result.season_number is None and not final_result.episode_numbers and final_result.air_date is None and not final_result.ab_episode_numbers and not final_result.series_name:
......
......@@ -54,7 +54,7 @@ class srPostProcessorQueue(srQueue):
:return: instance of PostProcessorItem or None
"""
for __, __, cur_item in self.queue + [(None, None, self.currentItem)]:
if isinstance(cur_item, PostProcessorItem) and cur_item.directory == dirName and cur_item.mode == proc_type:
if isinstance(cur_item, PostProcessorItem) and cur_item.dirName == dirName and cur_item.mode == proc_type:
return cur_item
return None
......
......@@ -6,9 +6,9 @@
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: sickrage 9.1.40\n"
"Project-Id-Version: sickrage 9.1.42\n"
"Report-Msgid-Bugs-To: [email protected]\n"
"POT-Creation-Date: 2017-10-17 20:08-0400\n"
"POT-Creation-Date: 2017-10-17 22:40-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <[email protected]>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
......
......@@ -88,6 +88,10 @@ class GenericProvider(object):
def imageName(self):
return ""
@property
def seed_ratio(self):
return ''
def _check_auth(self):
return True
......@@ -534,13 +538,6 @@ class GenericProvider(object):
return [Proper(x['name'], x['url'], datetime.datetime.fromtimestamp(x['time']), self.show) for x in
results]
def seed_ratio(self):
"""
Provider should override this value if custom seed ratio enabled
It should return the value of the provider seed ratio
"""
return ''
def add_cookies_from_ui(self):
"""
Adds the cookies configured from UI to the providers requests session
......@@ -617,6 +614,14 @@ class TorrentProvider(GenericProvider):
return self.id + '.png'
return self.type + '.png'
@property
def seed_ratio(self):
"""
Provider should override this value if custom seed ratio enabled
It should return the value of the provider seed ratio
"""
return self.ratio
def getResult(self, episodes):
"""
Returns a result of the correct type for this provider
......@@ -712,9 +717,6 @@ class TorrentProvider(GenericProvider):
return results
def seed_ratio(self):
return self.ratio
@classmethod
def getProviders(cls):
return super(TorrentProvider, cls).loadProviders(cls.type)
......
......@@ -31,7 +31,7 @@ class AlphaRatioProvider(TorrentProvider):
super(AlphaRatioProvider, self).__init__("AlphaRatio", 'http://alpharatio.cc', True)
self.username = None
self.password = None
self.ratio = None
self.minseed = None
self.minleech = None
......@@ -139,7 +139,4 @@ class AlphaRatioProvider(TorrentProvider):
# Sort all the items by seeders if available
results.sort(key=lambda k: try_int(k.get('seeders', 0)), reverse=True)
return results
def seed_ratio(self):
return self.ratio
return results
\ No newline at end of file
......@@ -33,15 +33,14 @@ class BitCannonProvider(TorrentProvider):
self.minseed = None
self.minleech = None
self.ratio = 0
self.cache = TVCache(self, min_time=20)
self.urls.update({
'search': '{base_url}/search/'.format(**self.urls),
'trackers': '{base_url}/stats'.format(**self.urls),
})
self.cache = TVCache(self, min_time=20)
def search(self, search_strings, age=0, ep_obj=None):
results = []
......@@ -104,5 +103,3 @@ class BitCannonProvider(TorrentProvider):
return results
def seed_ratio(self):
return self.ratio
......@@ -39,7 +39,7 @@ class BitSoupProvider(TorrentProvider):
self.username = None
self.password = None
self.ratio = None
self.minseed = None
self.minleech = None
......@@ -147,7 +147,4 @@ class BitSoupProvider(TorrentProvider):
# Sort all the items by seeders if available
results.sort(key=lambda k: try_int(k.get('seeders', 0)), reverse=True)
return results
def seed_ratio(self):
return self.ratio
return results
\ No newline at end of file
......@@ -40,10 +40,7 @@ class BTNProvider(TorrentProvider):
super(BTNProvider, self).__init__("BTN", 'http://api.broadcasthe.net', True)
self.supports_absolute_numbering = True
self.api_key = None
self.ratio = None
self.reject_m2ts = False
self.cache = BTNCache(self, min_time=15)
......@@ -263,8 +260,6 @@ class BTNProvider(TorrentProvider):
return results
def seed_ratio(self):
return self.ratio
class BTNCache(tv_cache.TVCache):
......
......@@ -28,7 +28,6 @@ class CpasbienProvider(TorrentProvider):
def __init__(self):
super(CpasbienProvider, self).__init__("Cpasbien", "http://www.cpasbien.io", False)
self.ratio = None
self.urls.update({
'download': '{base_url}/telechargement/%s'.format(**self.urls)
})
......@@ -115,5 +114,3 @@ class CpasbienProvider(TorrentProvider):
return results
def seed_ratio(self):
return self.ratio
......@@ -33,18 +33,18 @@ class GFTrackerProvider(TorrentProvider):
def __init__(self):
super(GFTrackerProvider, self).__init__("GFTracker", 'http://www.thegft.org', True)
self.username = None
self.password = None
self.ratio = None
self.minseed = None
self.minleech = None
self.urls.update({
'login': '{base_url}/loginsite.php'.format(**self.urls),
'search': '{base_url}/browse.php?view=%s%s'.format(**self.urls),
'download': '{base_url}/%s'.format(**self.urls)
})
self.username = None
self.password = None
self.minseed = None
self.minleech = None
self.cookies = None
self.categories = "0&c26=1&c37=1&c19=1&c47=1&c17=1&c4=1&search="
......@@ -165,6 +165,3 @@ class GFTrackerProvider(TorrentProvider):
results.sort(key=lambda k: try_int(k.get('seeders', 0)), reverse=True)
return results
def seed_ratio(self):
return self.ratio
......@@ -31,18 +31,17 @@ class HDBitsProvider(TorrentProvider):
def __init__(self):
super(HDBitsProvider, self).__init__("HDBits", 'https://hdbits.org', True)
self.username = None
self.passkey = None
self.ratio = None
self.cache = HDBitsCache(self, min_time=15)
self.urls.update({
'search': '{base_url}/api/torrents'.format(**self.urls),
'rss': '{base_url}/api/torrents'.format(**self.urls),
'download': '{base_url}/download.php'.format(**self.urls)
})
self.username = None
self.passkey = None
self.cache = HDBitsCache(self, min_time=15)
def _check_auth(self):
if not self.username or not self.passkey:
......@@ -177,8 +176,6 @@ class HDBitsProvider(TorrentProvider):
return json.dumps(post_data)
def seed_ratio(self):
return self.ratio
class HDBitsCache(tv_cache.TVCache):
......
......@@ -35,26 +35,27 @@ class HDSpaceProvider(TorrentProvider):
def __init__(self):
super(HDSpaceProvider, self).__init__("HDSpace", 'http://hd-space.org', True)
self.username = None
self.password = None
self.ratio = None
self.minseed = None
self.minleech = None
self.cache = TVCache(self, min_time=10)
self.urls.update({
'login': '{base_url}/index.php?page=login'.format(**self.urls),
'search': '{base_url}/index.php?page=torrents&search=%s&active=1&options=0&category='.format(**self.urls),
'rss': '{base_url}/rss_torrents.php?feed=dl'.format(**self.urls)
})
self.username = None
self.password = None
self.minseed = None
self.minleech = None
self.categories = [15, 21, 22, 24, 25, 40] # HDTV/DOC 1080/720, bluray, remux
for cat in self.categories:
self.urls['search'] += str(cat) + '%%3B'
self.urls['rss'] += '&cat[]=' + str(cat)
self.urls['search'] = self.urls['search'][:-4] # remove extra %%3B
self.cache = TVCache(self, min_time=10)
def _check_auth(self):
if not self.username or not self.password:
......@@ -168,5 +169,3 @@ class HDSpaceProvider(TorrentProvider):
return results
def seed_ratio(self):
return self.ratio
......@@ -34,12 +34,6 @@ class HDTorrentsProvider(TorrentProvider):
def __init__(self):
super(HDTorrentsProvider, self).__init__("HDTorrents", 'http://hd-torrents.org', True)
self.username = None
self.password = None
self.ratio = None
self.minseed = None
self.minleech = None
self.urls.update({
'login': '{base_url}/login.php'.format(**self.urls),
'search': '{base_url}/torrents.php?search=%s&active=1&options=0%s'.format(**self.urls),
......@@ -47,6 +41,12 @@ class HDTorrentsProvider(TorrentProvider):
'home': '{base_url}/%s'.format(**self.urls)
})
self.username = None
self.password = None
self.minseed = None
self.minleech = None
self.categories = "&category[]=59&category[]=60&category[]=30&category[]=38"
self.proper_strings = ['PROPER', 'REPACK']
......@@ -179,5 +179,3 @@ class HDTorrentsProvider(TorrentProvider):
return results
def seed_ratio(self):
return self.ratio
......@@ -30,19 +30,17 @@ class HoundDawgsProvider(TorrentProvider):
def __init__(self):
super(HoundDawgsProvider, self).__init__("HoundDawgs", 'http://hounddawgs.org', True)
self.username = None
self.password = None
self.ratio = None
self.minseed = None
self.minleech = None
self.cache = TVCache(self, min_time=20)
self.urls.update({
'search': '{base_url}/torrents.php'.format(**self.urls),
'login': '{base_url}/login.php'.format(**self.urls)
})
self.username = None
self.password = None
self.minseed = None
self.minleech = None
self.search_params = {
"filter_cat[85]": 1,
"filter_cat[58]": 1,
......@@ -59,6 +57,8 @@ class HoundDawgsProvider(TorrentProvider):
"searchtags": ''
}
self.cache = TVCache(self, min_time=20)
def login(self):
login_params = {'username': self.username,
......@@ -172,5 +172,3 @@ class HoundDawgsProvider(TorrentProvider):
return results
def seed_ratio(self):
return self.ratio
......@@ -33,24 +33,24 @@ class IPTorrentsProvider(TorrentProvider):
def __init__(self):
super(IPTorrentsProvider, self).__init__("IPTorrents", 'https://iptorrents.eu', True)
self.urls.update({
'login': '{base_url}/take_login.php'.format(**self.urls),
'search': '{base_url}/t?%s%s&q=%s&qf=#torrents'.format(**self.urls)
})
self.username = None
self.password = None
self.ratio = None
self.freeleech = False
self.enable_cookies = True
self.minseed = None
self.minleech = None
self.enable_cookies = True
self.categories = '73=&60='
self.cache = TVCache(self, min_time=10)
self.urls.update({
'login': '{base_url}/take_login.php'.format(**self.urls),
'search': '{base_url}/t?%s%s&q=%s&qf=#torrents'.format(**self.urls)
})
self.categories = '73=&60='
def _check_auth(self):
if not self.username or not self.password:
raise AuthException("Your authentication credentials for " + self.name + " are missing, check your config.")
......@@ -175,5 +175,3 @@ class IPTorrentsProvider(TorrentProvider):
return results
def seed_ratio(self):
return self.ratio
......@@ -34,15 +34,6 @@ class MoreThanTVProvider(TorrentProvider):
def __init__(self):
super(MoreThanTVProvider, self).__init__("MoreThanTV", 'http://www.morethan.tv', True)
self._uid = None
self._hash = None
self.username = None
self.password = None
self.ratio = None
self.minseed = None
self.minleech = None
# self.freeleech = False
self.urls.update({
'login': '{base_url}/login.php'.format(**self.urls),
'detail': '{base_url}/torrents.php'
......@@ -59,6 +50,14 @@ class MoreThanTVProvider(TorrentProvider):
'&id=%s'.format(**self.urls)
})
self._uid = None
self._hash = None
self.username = None
self.password = None
self.minseed = None
self.minleech = None
self.cookies = None
self.proper_strings = ['PROPER', 'REPACK']
......@@ -169,6 +168,3 @@ class MoreThanTVProvider(TorrentProvider):
results.sort(key=lambda k: try_int(k.get('seeders', 0)), reverse=True)
return results
def seed_ratio(self):
return self.ratio
......@@ -27,12 +27,11 @@ from sickrage.providers import TorrentProvider
class NebulanceProvider(TorrentProvider):
def __init__(self):
super(NebulanceProvider, self).__init__("Nebulance", 'http://nebulance.io', True)
self.username = None
self.password = None
self.ratio = None
self.minseed = None
self.minleech = None
......@@ -152,5 +151,3 @@ class NebulanceProvider(TorrentProvider):
return results
def seed_ratio(self):
return self.ratio
......@@ -30,23 +30,19 @@ from sickrage.providers import TorrentProvider
class NextorrentProvider(TorrentProvider):
def __init__(self):
super(NextorrentProvider, self).__init__("Nextorrent", 'http://nextorrent.pw', False)
self.urls.update({
'series': '{base_url}/torrents/series'.format(**self.urls)
})
self.confirmed = True
self.ratio = None
self.minseed = None
self.minleech = None
self.cache = TVCache(self, min_time=15)
self.urls.update({
'series': '{base_url}/torrents/series'.format(**self.urls)
})
def seed_ratio(self):
return self.ratio
def get_download_url(self, url):
try:
data = sickrage.srCore.srWebSession.get(urljoin(self.urls['base_url'], url)).text
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment