From 48c0c42fd6faffc56432d5f037cd575979f180cc Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 14 Jul 2014 02:23:37 +0200 Subject: Removed all @author flags + key attributes cleanup for internal & hooks plugins --- module/plugins/hooks/Ev0InFetcher.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'module/plugins/hooks/Ev0InFetcher.py') diff --git a/module/plugins/hooks/Ev0InFetcher.py b/module/plugins/hooks/Ev0InFetcher.py index 1e2b62062..d2caa19ac 100644 --- a/module/plugins/hooks/Ev0InFetcher.py +++ b/module/plugins/hooks/Ev0InFetcher.py @@ -13,8 +13,6 @@ You should have received a copy of the GNU General Public License along with this program; if not, see . - - @author: mkaay """ from time import mktime, time @@ -25,7 +23,8 @@ from module.plugins.Hook import Hook class Ev0InFetcher(Hook): __name__ = "Ev0InFetcher" __version__ = "0.21" - __description__ = """Checks rss feeds for Ev0.in""" + __type__ = "hook" + __config__ = [("activated", "bool", "Activated", False), ("interval", "int", "Check interval in minutes", 10), ("queue", "bool", "Move new shows directly to Queue", False), @@ -33,9 +32,12 @@ class Ev0InFetcher(Hook): ("quality", "xvid;x264;rmvb", "Video Format", "xvid"), ("hoster", "str", "Hoster to use (comma seperated)", "NetloadIn,RapidshareCom,MegauploadCom,HotfileCom")] + + __description__ = """Checks rss feeds for Ev0.in""" __author_name__ = "mkaay" __author_mail__ = "mkaay@mkaay.de" + def setup(self): self.interval = self.getConfig("interval") * 60 -- cgit v1.2.3 From 5060e4c6374a5116d0d8b02528f910f8c5f8bcf9 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 15 Jul 2014 16:25:41 +0200 Subject: Fix code indentation, some bad whitespaces and missing authors + use 'not' instead 'is None' + replace __pattern__'s r" with r' + other minor cosmetics --- module/plugins/hooks/Ev0InFetcher.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'module/plugins/hooks/Ev0InFetcher.py') diff --git a/module/plugins/hooks/Ev0InFetcher.py b/module/plugins/hooks/Ev0InFetcher.py index d2caa19ac..3a98abbf7 100644 --- a/module/plugins/hooks/Ev0InFetcher.py +++ b/module/plugins/hooks/Ev0InFetcher.py @@ -57,7 +57,9 @@ class Ev0InFetcher(Hook): continue return [] + def periodical(self): + def normalizefiletitle(filename): filename = filename.replace('.', ' ') filename = filename.replace('_', ' ') -- cgit v1.2.3 From ba916633f2bedb04c7358000b91aed69f52e8e43 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 1 Aug 2014 19:35:59 +0200 Subject: Remove trailing whitespaces + remove license headers + import urllib methods directly + sort and fix key attributes + use save_join instead join + sort some import declarations + other minor code cosmetics --- module/plugins/hooks/Ev0InFetcher.py | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) (limited to 'module/plugins/hooks/Ev0InFetcher.py') diff --git a/module/plugins/hooks/Ev0InFetcher.py b/module/plugins/hooks/Ev0InFetcher.py index 3a98abbf7..c54c38bc6 100644 --- a/module/plugins/hooks/Ev0InFetcher.py +++ b/module/plugins/hooks/Ev0InFetcher.py @@ -1,29 +1,16 @@ # -*- coding: utf-8 -*- -""" - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, - or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, see . -""" from time import mktime, time from module.lib import feedparser + from module.plugins.Hook import Hook class Ev0InFetcher(Hook): __name__ = "Ev0InFetcher" - __version__ = "0.21" __type__ = "hook" + __version__ = "0.21" __config__ = [("activated", "bool", "Activated", False), ("interval", "int", "Check interval in minutes", 10), -- cgit v1.2.3 From 0d220d634e512d89bda540f91c643b361c82ea8a Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 27 Sep 2014 01:38:32 +0200 Subject: Logging string cosmetics --- module/plugins/hooks/Ev0InFetcher.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'module/plugins/hooks/Ev0InFetcher.py') diff --git a/module/plugins/hooks/Ev0InFetcher.py b/module/plugins/hooks/Ev0InFetcher.py index c54c38bc6..881cb36ef 100644 --- a/module/plugins/hooks/Ev0InFetcher.py +++ b/module/plugins/hooks/Ev0InFetcher.py @@ -67,15 +67,14 @@ class Ev0InFetcher(Hook): if show.lower() in normalizefiletitle(item['title']) and lastfound < int(mktime(item.date_parsed)): links = self.filterLinks(item['description'].split("
")) packagename = item['title'].encode("utf-8") - self.logInfo("Ev0InFetcher: new episode '%s' (matched '%s')" % (packagename, show)) + self.logInfo(_("New episode '%s' (matched '%s')") % (packagename, show)) self.core.api.addPackage(packagename, links, 1 if self.getConfig("queue") else 0) self.setStorage("show_%s_lastfound" % show, int(mktime(item.date_parsed))) found = True if not found: - #self.logDebug("Ev0InFetcher: no new episodes found") pass for show, lastfound in self.getStorage().iteritems(): 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) + self.logDebug("Cleaned '%s' record" % show) -- cgit v1.2.3 From a9117257f71984d553811a605150acb5d1b499ce Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 5 Oct 2014 02:27:07 +0200 Subject: Better import lib header --- module/plugins/hooks/Ev0InFetcher.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hooks/Ev0InFetcher.py') diff --git a/module/plugins/hooks/Ev0InFetcher.py b/module/plugins/hooks/Ev0InFetcher.py index 881cb36ef..35a5c207c 100644 --- a/module/plugins/hooks/Ev0InFetcher.py +++ b/module/plugins/hooks/Ev0InFetcher.py @@ -1,8 +1,8 @@ # -*- coding: utf-8 -*- -from time import mktime, time +import feedparser -from module.lib import feedparser +from time import mktime, time from module.plugins.Hook import Hook -- cgit v1.2.3 From e5499906077a51df1c3b29e22234f37cec4a58ed Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 5 Oct 2014 03:35:49 +0200 Subject: Remove old Ev0InFetcher hook --- module/plugins/hooks/Ev0InFetcher.py | 80 ------------------------------------ 1 file changed, 80 deletions(-) delete mode 100644 module/plugins/hooks/Ev0InFetcher.py (limited to 'module/plugins/hooks/Ev0InFetcher.py') diff --git a/module/plugins/hooks/Ev0InFetcher.py b/module/plugins/hooks/Ev0InFetcher.py deleted file mode 100644 index 35a5c207c..000000000 --- a/module/plugins/hooks/Ev0InFetcher.py +++ /dev/null @@ -1,80 +0,0 @@ -# -*- coding: utf-8 -*- - -import feedparser - -from time import mktime, time - -from module.plugins.Hook import Hook - - -class Ev0InFetcher(Hook): - __name__ = "Ev0InFetcher" - __type__ = "hook" - __version__ = "0.21" - - __config__ = [("activated", "bool", "Activated", False), - ("interval", "int", "Check interval in minutes", 10), - ("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")] - - __description__ = """Checks rss feeds for Ev0.in""" - __author_name__ = "mkaay" - __author_mail__ = "mkaay@mkaay.de" - - - def setup(self): - self.interval = self.getConfig("interval") * 60 - - 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(): - if show.lower() in normalizefiletitle(item['title']) and lastfound < int(mktime(item.date_parsed)): - links = self.filterLinks(item['description'].split("
")) - packagename = item['title'].encode("utf-8") - self.logInfo(_("New episode '%s' (matched '%s')") % (packagename, show)) - self.core.api.addPackage(packagename, links, 1 if self.getConfig("queue") else 0) - self.setStorage("show_%s_lastfound" % show, int(mktime(item.date_parsed))) - found = True - if not found: - pass - - for show, lastfound in self.getStorage().iteritems(): - if int(lastfound) > 0 and int(lastfound) + (3600 * 24 * 30) < int(time()): - self.delStorage("show_%s_lastfound" % show) - self.logDebug("Cleaned '%s' record" % show) -- cgit v1.2.3