From 01c071d125edcfecc1c9f87482203aff5f04d083 Mon Sep 17 00:00:00 2001 From: fragonib Date: Mon, 6 Dec 2010 16:26:29 +0100 Subject: Little fixes --- module/plugins/crypter/NetfolderIn.py | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'module/plugins/crypter/NetfolderIn.py') diff --git a/module/plugins/crypter/NetfolderIn.py b/module/plugins/crypter/NetfolderIn.py index ce220d535..510f09396 100644 --- a/module/plugins/crypter/NetfolderIn.py +++ b/module/plugins/crypter/NetfolderIn.py @@ -3,12 +3,11 @@ from module.plugins.Crypter import Crypter import re - class NetfolderIn(Crypter): __name__ = "NetfolderIn" __type__ = "crypter" - __pattern__ = r"http://(?:www\.)?netfolder.in/((?P\w+)/\w+|folder.php\?folder_id=(?P.+))" - __version__ = "0.2" + __pattern__ = r"http://(?:www\.)?netfolder.in/((?P\w+)/\w+|folder.php\?folder_id=(?P\w+))" + __version__ = "0.3" __description__ = """NetFolder Crypter Plugin""" __author_name__ = ("RaNaN", "fragonib") __author_mail__ = ("RaNaN@pyload.org", "fragonib[AT]yahoo[DOT]es") @@ -28,10 +27,7 @@ class NetfolderIn(Crypter): (package_name, folder_name) = self.getPackageNameAndFolder() # Get package links - try: - package_links = self.getLinks() - except: - self.fail("Unable to extract links package") + package_links = self.getLinks() # Set package self.packages = [(package_name, package_links, folder_name)] @@ -46,13 +42,12 @@ class NetfolderIn(Crypter): def submitPassword(self): - # Gather data try: m = re.match(self.__pattern__, self.pyfile.url) id = max(m.group('id1'), m.group('id2')) except AttributeError: - self.log.debug("RelinkUs: Unable to get package id from url [%s]" % (url)) + self.log.debug("NetfolderIn: Unable to get package id from url [%s]" % (url)) return url = "http://netfolder.in/folder.php?folder_id=" + id password = self.pyfile.package().password @@ -64,7 +59,7 @@ class NetfolderIn(Crypter): # Check for invalid password if '
' in html: - self.log.debug("NetfolderIn: Incorrect password, please set right password on Add package form and retry") + self.log.debug("NetfolderIn: Incorrect password, please set right password on Edit package form and retry") return None return html @@ -85,6 +80,7 @@ class NetfolderIn(Crypter): def getLinks(self): - links = re.findall(r'href="(http://.{0,3}netload\.in/(datei|index.php?id=10&file_id=)[^"]+)', self.html) + links = re.findall('href="(http://(?:www\.)?netload\.in/(?:datei|index.php\?.*?file_id=)\w+)', self.html) links = [x[0] for x in links] + self.log.debug("NetfolderIn: Package has %d links" % len(links)) return links \ No newline at end of file -- cgit v1.2.3