summaryrefslogtreecommitdiffstats
path: root/module/plugins/hooks/Ev0InFetcher.py
diff options
context:
space:
mode:
authorGravatar Stefano <l.stickell@yahoo.it> 2013-07-24 14:24:51 +0200
committerGravatar Stefano <l.stickell@yahoo.it> 2013-07-24 14:24:51 +0200
commit669b1e0ec048e1ed8aeb842b2570376e9ad96863 (patch)
tree4703826f0c65f84ec5e9f1bac2d9dbd50e3376fa /module/plugins/hooks/Ev0InFetcher.py
parentDebridItaliaCom: two more hosters supported (diff)
downloadpyload-669b1e0ec048e1ed8aeb842b2570376e9ad96863.tar.xz
Fixed PEP 8 violations in Hooks
Diffstat (limited to 'module/plugins/hooks/Ev0InFetcher.py')
-rw-r--r--module/plugins/hooks/Ev0InFetcher.py20
1 files changed, 11 insertions, 9 deletions
diff --git a/module/plugins/hooks/Ev0InFetcher.py b/module/plugins/hooks/Ev0InFetcher.py
index d29f89c2f..912cb5964 100644
--- a/module/plugins/hooks/Ev0InFetcher.py
+++ b/module/plugins/hooks/Ev0InFetcher.py
@@ -15,11 +15,12 @@
@author: mkaay
"""
-from module.lib import feedparser
from time import mktime, time
+from module.lib import feedparser
from module.plugins.Hook import Hook
+
class Ev0InFetcher(Hook):
__name__ = "Ev0InFetcher"
__version__ = "0.21"
@@ -29,7 +30,8 @@ class Ev0InFetcher(Hook):
("queue", "bool", "Move new shows directly to Queue", False),
("shows", "str", "Shows to check for (comma seperated)", ""),
("quality", "xvid;x264;rmvb", "Video Format", "xvid"),
- ("hoster", "str", "Hoster to use (comma seperated)", "NetloadIn,RapidshareCom,MegauploadCom,HotfileCom")]
+ ("hoster", "str", "Hoster to use (comma seperated)",
+ "NetloadIn,RapidshareCom,MegauploadCom,HotfileCom")]
__author_name__ = ("mkaay")
__author_mail__ = ("mkaay@mkaay.de")
@@ -39,34 +41,34 @@ class Ev0InFetcher(Hook):
def filterLinks(self, links):
results = self.core.pluginManager.parseUrls(links)
sortedLinks = {}
-
+
for url, hoster in results:
if hoster not in sortedLinks:
sortedLinks[hoster] = []
sortedLinks[hoster].append(url)
-
+
for h in self.getConfig("hoster").split(","):
try:
return sortedLinks[h.strip()]
except:
continue
return []
-
+
def periodical(self):
def normalizefiletitle(filename):
filename = filename.replace('.', ' ')
filename = filename.replace('_', ' ')
filename = filename.lower()
return filename
-
+
shows = [s.strip() for s in self.getConfig("shows").split(",")]
-
+
feed = feedparser.parse("http://feeds.feedburner.com/ev0in/%s?format=xml" % self.getConfig("quality"))
showStorage = {}
for show in shows:
showStorage[show] = int(self.getStorage("show_%s_lastfound" % show, 0))
-
+
found = False
for item in feed['items']:
for show, lastfound in showStorage.iteritems():
@@ -82,6 +84,6 @@ class Ev0InFetcher(Hook):
pass
for show, lastfound in self.getStorage().iteritems():
- if int(lastfound) > 0 and int(lastfound) + (3600*24*30) < int(time()):
+ if int(lastfound) > 0 and int(lastfound) + (3600 * 24 * 30) < int(time()):
self.delStorage("show_%s_lastfound" % show)
self.logDebug("Ev0InFetcher: cleaned '%s' record" % show)