diff options
Diffstat (limited to 'pyload/plugins/addons/Ev0InFetcher.py')
-rw-r--r-- | pyload/plugins/addons/Ev0InFetcher.py | 18 |
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) |