summaryrefslogtreecommitdiffstats
path: root/module/plugins/crypter/SpeedLoadOrgFolder.py
diff options
context:
space:
mode:
authorGravatar Stefano <l.stickell@yahoo.it> 2013-03-07 20:17:29 +0100
committerGravatar Stefano <l.stickell@yahoo.it> 2013-03-07 20:17:29 +0100
commit02e6b873ad9971d4974a5b4f7a126dee3da60d2c (patch)
tree881795ef7532f26baf3296c024f0b58342665147 /module/plugins/crypter/SpeedLoadOrgFolder.py
parentMerge pull request #34 from stickell/fixes (diff)
downloadpyload-02e6b873ad9971d4974a5b4f7a126dee3da60d2c.tar.xz
SpeedLoadOrgFolder: crypter rewritten
Trivial changes to the SimpleCrypter class
Diffstat (limited to 'module/plugins/crypter/SpeedLoadOrgFolder.py')
-rw-r--r--module/plugins/crypter/SpeedLoadOrgFolder.py43
1 files changed, 5 insertions, 38 deletions
diff --git a/module/plugins/crypter/SpeedLoadOrgFolder.py b/module/plugins/crypter/SpeedLoadOrgFolder.py
index 002605233..a4a3e99e3 100644
--- a/module/plugins/crypter/SpeedLoadOrgFolder.py
+++ b/module/plugins/crypter/SpeedLoadOrgFolder.py
@@ -1,47 +1,14 @@
# -*- coding: utf-8 -*-
-from module.plugins.Crypter import Crypter
-import re
+from module.plugins.internal.SimpleCrypter import SimpleCrypter
-class SpeedLoadOrgFolder(Crypter):
+class SpeedLoadOrgFolder(SimpleCrypter):
__name__ = "SpeedLoadOrgFolder"
__type__ = "crypter"
- __pattern__ = r"http://(www\.)?speedload\.org/(?P<ID>\w+)~f$"
- __version__ = "0.1"
+ __pattern__ = r"http://(www\.)?speedload\.org/(\d+~f$|folder/\d+/)"
+ __version__ = "0.2"
__description__ = """Speedload Crypter Plugin"""
__author_name__ = ("stickell")
__author_mail__ = ("l.stickell@yahoo.it")
- def decrypt(self, pyfile):
- self.html = self.load(pyfile.url)
- (package_name, folder_name) = self.getPackageNameAndFolder()
- package_links = self.getLinks()
-
- self.packages = [(package_name, package_links, folder_name)]
-
- def getPackageNameAndFolder(self):
- title_re = r"Files Within Folder '(?P<title>.+)'"
- m = re.search(title_re, self.html)
- if m is not None:
- name = folder = m.group('title')
- self.logDebug("Found name [%s] and folder [%s] in package info" % (name, folder))
- return name, folder
- else:
- name = self.pyfile.package().name
- folder = self.pyfile.package().folder
- self.logDebug("Package info not found, defaulting to pyfile name [%s] and folder [%s]" % (name, folder))
- return name, folder
-
- def getLinks(self):
- pages = int(re.search('Total Pages (\d)', self.html).group(1))
-
- link_regex = re.compile('<a href="(http://speedload.org/\w+)"')
- links = link_regex.findall(self.html)
-
- if pages > 1:
- for p in range(2, pages + 1):
- self.html = self.load(self.pyfile.url + '?page=%d' % p)
- links += link_regex.findall(self.html)
-
- self.logDebug("Package has %d links" % len(links))
- return links
+ LINK_PATTERN = r'<div class="link"><a href="(http://speedload.org/\w+)"'