Private GIT

Skip to content
Snippets Groups Projects
Commit 89a6cdfb authored by miigotu's avatar miigotu
Browse files

Remove use of search_mode param for determining categories to use in scc, and lint

parent b5a2815c
Branches
Tags
No related merge requests found
......@@ -29,7 +29,7 @@ from sickbeard.bs4_parser import BS4Parser
from sickrage.providers.TorrentProvider import TorrentProvider
class SCCProvider(TorrentProvider):
class SCCProvider(TorrentProvider): # pylint: disable=too-many-instance-attributes
def __init__(self):
......@@ -43,22 +43,29 @@ class SCCProvider(TorrentProvider):
self.cache = SCCCache(self)
self.urls = {'base_url': 'https://sceneaccess.eu',
self.urls = {
'base_url': 'https://sceneaccess.eu',
'login': 'https://sceneaccess.eu/login',
'detail': 'https://www.sceneaccess.eu/details?id=%s',
'search': 'https://sceneaccess.eu/all?search=%s&method=1&%s',
'download': 'https://www.sceneaccess.eu/%s'}
'download': 'https://www.sceneaccess.eu/%s'
}
self.url = self.urls['base_url']
self.categories = { 'sponly': 'c26=26&c44=44&c45=45', # Archive, non-scene HD, non-scene SD; need to include non-scene because WEB-DL packs get added to those categories
'eponly': 'c27=27&c17=17&c44=44&c45=45&c33=33&c34=34'} # TV HD, TV SD, non-scene HD, non-scene SD, foreign XviD, foreign x264
self.categories = {
'Season': 'c26=26&c44=44&c45=45', # Archive, non-scene HD, non-scene SD; need to include non-scene because WEB-DL packs get added to those categories
'Episode': 'c17=17&c27=27&c33=33&c34=34&c44=44&c45=45', # TV HD, TV SD, non-scene HD, non-scene SD, foreign XviD, foreign x264
'RSS': 'c17=17&c26=26&c27=27&c33=33&c34=34&c44=44&c45=45' # Season + Episode
}
def login(self):
login_params = {'username': self.username,
login_params = {
'username': self.username,
'password': self.password,
'submit': 'come on in'}
'submit': 'come on in'
}
response = self.get_url(self.urls['login'], post_data=login_params, timeout=30)
if not response:
......@@ -72,19 +79,19 @@ class SCCProvider(TorrentProvider):
return True
def _isSection(self, section, text):
@staticmethod
def _isSection(section, text):
title = r'<title>.+? \| %s</title>' % section
return re.search(title, text, re.IGNORECASE)
def search(self, search_strings, search_mode='eponly', age=0, ep_obj=None):
def search(self, search_strings, search_mode='eponly', age=0, ep_obj=None): # pylint: disable=too-many-locals,too-many-branches
items = {'Season': [], 'Episode': [], 'RSS': []}
results = []
if not self.login():
return results
items = {'Season': [], 'Episode': [], 'RSS': []}
for mode in search_strings.keys():
if mode != 'RSS':
logger.log(u"Search Mode: %s" % mode, logger.DEBUG)
......@@ -92,7 +99,7 @@ class SCCProvider(TorrentProvider):
if mode != 'RSS':
logger.log(u"Search string: %s " % search_string, logger.DEBUG)
searchURL = self.urls['search'] % (urllib.quote(search_string), self.categories[search_mode])
searchURL = self.urls['search'] % (urllib.quote(search_string), self.categories[mode])
try:
logger.log(u"Search URL: %s" % searchURL, logger.DEBUG)
......@@ -157,7 +164,8 @@ class SCCProvider(TorrentProvider):
def seed_ratio(self):
return self.ratio
def _convertSize(self, size):
@staticmethod
def _convertSize(size):
size, base = size.split()
size = float(size)
if base in 'KB':
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment