summaryrefslogtreecommitdiffstats
path: root/pyload/plugins/addons/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:36:59 +0200
commit9be1035b2945f82b269487a009c02bd5a83028b0 (patch)
tree83c2496c60ddb5de3821151b80d69b639f007fe3 /pyload/plugins/addons/Ev0InFetcher.py
parentTwo more replace module import rules (diff)
downloadpyload-9be1035b2945f82b269487a009c02bd5a83028b0.tar.xz
Fixed PEP 8 violations in Hooks
(cherry picked from commit 669b1e0ec048e1ed8aeb842b2570376e9ad96863) Conflicts: pyload/plugins/addons/CaptchaTrader.py pyload/plugins/addons/ClickAndLoad.py pyload/plugins/addons/Ev0InFetcher.py pyload/plugins/addons/ExternalScripts.py pyload/plugins/addons/ExtractArchive.py pyload/plugins/addons/HotFolder.py pyload/plugins/addons/MergeFiles.py pyload/plugins/addons/MultiHome.py pyload/plugins/addons/XMPPInterface.py
Diffstat (limited to 'pyload/plugins/addons/Ev0InFetcher.py')
-rw-r--r--pyload/plugins/addons/Ev0InFetcher.py18
1 files changed, 10 insertions, 8 deletions
diff --git a/pyload/plugins/addons/Ev0InFetcher.py b/pyload/plugins/addons/Ev0InFetcher.py
index 970c70cd5..4c89f5265 100644
--- a/pyload/plugins/addons/Ev0InFetcher.py
+++ b/pyload/plugins/addons/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.Addon import Addon
+
class Ev0InFetcher(Addon):
__name__ = "Ev0InFetcher"
__version__ = "0.21"
@@ -29,7 +30,8 @@ class Ev0InFetcher(Addon):
("queue", "bool", "Move new shows directly to Queue", False),
("shows", "str", "Shows to check for (comma separated)", ""),
("quality", "xvid;x264;rmvb", "Video Format", "xvid"),
- ("hoster", "str", "Hoster to use (comma separated)", "NetloadIn,RapidshareCom,MegauploadCom,HotfileCom")]
+ ("hoster", "str", "Hoster to use (comma separated)",
+ "NetloadIn,RapidshareCom,MegauploadCom,HotfileCom")]
__author_name__ = ("mkaay")
__author_mail__ = ("mkaay@mkaay.de")
@@ -44,29 +46,29 @@ class Ev0InFetcher(Addon):
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(Addon):
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)