mirror of
https://github.com/moparisthebest/SickRage
synced 2024-11-16 22:35:03 -05:00
Merge pull request #681 from adam111316/fanzub_tidy
Tidy fanzub proper code and PEP8
This commit is contained in:
commit
493f9af02e
@ -29,6 +29,7 @@ from sickbeard.common import *
|
|||||||
from sickbeard import tvcache
|
from sickbeard import tvcache
|
||||||
from lib.dateutil.parser import parse as parseDate
|
from lib.dateutil.parser import parse as parseDate
|
||||||
|
|
||||||
|
|
||||||
class Fanzub(generic.NZBProvider):
|
class Fanzub(generic.NZBProvider):
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
@ -51,9 +52,6 @@ class Fanzub(generic.NZBProvider):
|
|||||||
def imageName(self):
|
def imageName(self):
|
||||||
return 'fanzub.gif'
|
return 'fanzub.gif'
|
||||||
|
|
||||||
def _checkAuth(self):
|
|
||||||
return True
|
|
||||||
|
|
||||||
def _get_season_search_strings(self, ep_obj):
|
def _get_season_search_strings(self, ep_obj):
|
||||||
return [x for x in show_name_helpers.makeSceneSeasonSearchString(self.show, ep_obj)]
|
return [x for x in show_name_helpers.makeSceneSeasonSearchString(self.show, ep_obj)]
|
||||||
|
|
||||||
@ -102,8 +100,7 @@ class Fanzub(generic.NZBProvider):
|
|||||||
|
|
||||||
results = []
|
results = []
|
||||||
|
|
||||||
for i in [2, 3, 4]: # we will look for a version 2, 3 and 4
|
for item in self._doSearch("v2|v3|v4|v5"):
|
||||||
for item in self._doSearch("v" + str(i)):
|
|
||||||
|
|
||||||
(title, url) = self._get_title_and_url(item)
|
(title, url) = self._get_title_and_url(item)
|
||||||
|
|
||||||
@ -121,6 +118,7 @@ class Fanzub(generic.NZBProvider):
|
|||||||
|
|
||||||
return results
|
return results
|
||||||
|
|
||||||
|
|
||||||
class FanzubCache(tvcache.TVCache):
|
class FanzubCache(tvcache.TVCache):
|
||||||
|
|
||||||
def __init__(self, provider):
|
def __init__(self, provider):
|
||||||
@ -128,12 +126,12 @@ class FanzubCache(tvcache.TVCache):
|
|||||||
tvcache.TVCache.__init__(self, provider)
|
tvcache.TVCache.__init__(self, provider)
|
||||||
|
|
||||||
# only poll Fanzub every 20 minutes max
|
# only poll Fanzub every 20 minutes max
|
||||||
# we get 100 post each call !
|
|
||||||
self.minTime = 20
|
self.minTime = 20
|
||||||
|
|
||||||
def _getRSSData(self):
|
def _getRSSData(self):
|
||||||
|
|
||||||
params = {"cat": "anime".encode('utf-8'),
|
params = {
|
||||||
|
"cat": "anime".encode('utf-8'),
|
||||||
"max": "100".encode('utf-8')
|
"max": "100".encode('utf-8')
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -143,7 +141,5 @@ class FanzubCache(tvcache.TVCache):
|
|||||||
|
|
||||||
return self.getRSSFeed(rss_url)
|
return self.getRSSFeed(rss_url)
|
||||||
|
|
||||||
def _checkItemAuth(self, title, url):
|
|
||||||
return True
|
|
||||||
|
|
||||||
provider = Fanzub()
|
provider = Fanzub()
|
||||||
|
Loading…
Reference in New Issue
Block a user