summaryrefslogtreecommitdiffstats
path: root/module/plugins/crypter/FilebeerInfoFolder.py
diff options
context:
space:
mode:
authorGravatar Stefano <l.stickell@yahoo.it> 2013-07-21 15:03:21 +0200
committerGravatar Stefano <l.stickell@yahoo.it> 2013-07-21 15:03:21 +0200
commit4b61d36bf18931df0a9720047b3619ce245f8a1b (patch)
treefa6214ca6c85eb547dfe7de1ec7502ff3ce71793 /module/plugins/crypter/FilebeerInfoFolder.py
parentNormalize line endings to avoid line endings merge conflicts (diff)
downloadpyload-4b61d36bf18931df0a9720047b3619ce245f8a1b.tar.xz
Fixed PEP 8 violations in Crypters
Diffstat (limited to 'module/plugins/crypter/FilebeerInfoFolder.py')
-rw-r--r--module/plugins/crypter/FilebeerInfoFolder.py21
1 files changed, 11 insertions, 10 deletions
diff --git a/module/plugins/crypter/FilebeerInfoFolder.py b/module/plugins/crypter/FilebeerInfoFolder.py
index f45144f14..86ce5b697 100644
--- a/module/plugins/crypter/FilebeerInfoFolder.py
+++ b/module/plugins/crypter/FilebeerInfoFolder.py
@@ -3,6 +3,7 @@
import re
from module.plugins.Crypter import Crypter
+
class FilebeerInfoFolder(Crypter):
__name__ = "FilebeerInfoFolder"
__type__ = "crypter"
@@ -14,22 +15,22 @@ class FilebeerInfoFolder(Crypter):
LINK_PATTERN = r'<td title="[^"]*"><a href="([^"]+)" target="_blank">'
PAGE_COUNT_PATTERN = r'<p class="introText">\s*Total Pages (\d+)'
-
- def decrypt(self, pyfile):
- pyfile.url = re.sub(self.__pattern__, r'http://filebeer.info/\1?page=1', pyfile.url)
+
+ def decrypt(self, pyfile):
+ pyfile.url = re.sub(self.__pattern__, r'http://filebeer.info/\1?page=1', pyfile.url)
html = self.load(pyfile.url)
-
+
page_count = int(re.search(self.PAGE_COUNT_PATTERN, html).group(1))
new_links = []
-
- for i in range(1, page_count + 1):
- self.logInfo("Fetching links from page %i" % i)
+
+ for i in range(1, page_count + 1):
+ self.logInfo("Fetching links from page %i" % i)
new_links.extend(re.findall(self.LINK_PATTERN, html))
-
+
if i < page_count:
- html = self.load("%s?page=%d" % (pyfile.url, i+1))
+ html = self.load("%s?page=%d" % (pyfile.url, i + 1))
if new_links:
self.core.files.addLinks(new_links, self.pyfile.package().id)
else:
- self.fail('Could not extract any links') \ No newline at end of file
+ self.fail('Could not extract any links')