diff options
author | fragonib <devnull@localhost> | 2010-12-06 16:26:29 +0100 |
---|---|---|
committer | fragonib <devnull@localhost> | 2010-12-06 16:26:29 +0100 |
commit | 01c071d125edcfecc1c9f87482203aff5f04d083 (patch) | |
tree | 331530210f64a731d1e664495679f4ad717876aa /module/plugins/crypter/NetfolderIn.py | |
parent | --status option, improved cli commands (diff) | |
download | pyload-01c071d125edcfecc1c9f87482203aff5f04d083.tar.xz |
Little fixes
Diffstat (limited to 'module/plugins/crypter/NetfolderIn.py')
-rw-r--r-- | module/plugins/crypter/NetfolderIn.py | 18 |
1 files changed, 7 insertions, 11 deletions
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<id1>\w+)/\w+|folder.php\?folder_id=(?P<id2>.+))" - __version__ = "0.2" + __pattern__ = r"http://(?:www\.)?netfolder.in/((?P<id1>\w+)/\w+|folder.php\?folder_id=(?P<id2>\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 '<div class="InPage_Error">' 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 |