diff options
author | Stefano <l.stickell@yahoo.it> | 2013-07-16 18:26:23 +0200 |
---|---|---|
committer | Stefano <l.stickell@yahoo.it> | 2013-07-16 18:26:23 +0200 |
commit | 5a8774b26ce4f7b20eefa9dbf4a7dfd1c3c630b9 (patch) | |
tree | 5e5f33620d3986d51952c2cae87f02a58ae7e45e /module/plugins/crypter | |
parent | Captcha9kw: fixed bad gettext use (diff) | |
download | pyload-5a8774b26ce4f7b20eefa9dbf4a7dfd1c3c630b9.tar.xz |
SimpleCrypter is now able to handle links on multiple pages
Diffstat (limited to 'module/plugins/crypter')
-rw-r--r-- | module/plugins/crypter/EasybytezComFolder.py | 33 |
1 files changed, 4 insertions, 29 deletions
diff --git a/module/plugins/crypter/EasybytezComFolder.py b/module/plugins/crypter/EasybytezComFolder.py index 1b887e421..83ec6472e 100644 --- a/module/plugins/crypter/EasybytezComFolder.py +++ b/module/plugins/crypter/EasybytezComFolder.py @@ -15,8 +15,6 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. # ############################################################################ -import re - from module.plugins.internal.SimpleCrypter import SimpleCrypter @@ -24,37 +22,14 @@ class EasybytezComFolder(SimpleCrypter): __name__ = "EasybytezComFolder" __type__ = "crypter" __pattern__ = r"https?://(www\.)?easybytez\.com/users/\w+/\w+" - __version__ = "0.01" + __version__ = "0.02" __description__ = """Easybytez Crypter Plugin""" __author_name__ = ("stickell") __author_mail__ = ("l.stickell@yahoo.it") LINK_PATTERN = r'<div class="link"><a href="(http://www\.easybytez\.com/\w+)" target="_blank">.+</a></div>' TITLE_PATTERN = r'<Title>Files of (?P<title>.+) folder</Title>' - PAGES_PATTERN = r"<a href='[^']+'>(\d+)</a><a href='[^']+'>Next »</a><br><small>\(\d+ total\)</small></div>" - - def decrypt(self, pyfile): - self.html = self.load(pyfile.url, decode=True) - - package_name, folder_name = self.getPackageNameAndFolder() - - package_links = re.findall(self.LINK_PATTERN, self.html) - - pages = re.search(self.PAGES_PATTERN, self.html) - if pages: - pages = int(pages.group(1)) - else: - pages = 1 - - p = 2 - while p <= pages: - self.html = self.load(pyfile.url, get={'page': p}, decode=True) - package_links += re.findall(self.LINK_PATTERN, self.html) - p += 1 - - self.logDebug('Package has %d links' % len(package_links)) + PAGES_PATTERN = r"<a href='[^']+'>(?P<pages>\d+)</a><a href='[^']+'>Next »</a><br><small>\(\d+ total\)</small></div>" - if package_links: - self.packages = [(package_name, package_links, folder_name)] - else: - self.fail('Could not extract any links')
\ No newline at end of file + def loadPage(self, page_n): + return self.load(self.pyfile.url, get={'page': page_n}, decode=True) |