summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--module/plugins/crypter/FilebeerInfoFolder.py35
-rw-r--r--module/plugins/internal/MultiHoster.py15
2 files changed, 43 insertions, 7 deletions
diff --git a/module/plugins/crypter/FilebeerInfoFolder.py b/module/plugins/crypter/FilebeerInfoFolder.py
new file mode 100644
index 000000000..f45144f14
--- /dev/null
+++ b/module/plugins/crypter/FilebeerInfoFolder.py
@@ -0,0 +1,35 @@
+# -*- coding: utf-8 -*-
+
+import re
+from module.plugins.Crypter import Crypter
+
+class FilebeerInfoFolder(Crypter):
+ __name__ = "FilebeerInfoFolder"
+ __type__ = "crypter"
+ __pattern__ = r"http://(?:www\.)?filebeer\.info/(\d+~f).*"
+ __version__ = "0.01"
+ __description__ = """Filebeer.info Folder Plugin"""
+ __author_name__ = ("zoidberg")
+ __author_mail__ = ("zoidberg@mujmail.cz")
+
+ 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)
+ 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)
+ new_links.extend(re.findall(self.LINK_PATTERN, html))
+
+ if i < page_count:
+ 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
diff --git a/module/plugins/internal/MultiHoster.py b/module/plugins/internal/MultiHoster.py
index 044bc3423..04353dcc8 100644
--- a/module/plugins/internal/MultiHoster.py
+++ b/module/plugins/internal/MultiHoster.py
@@ -11,7 +11,7 @@ class MultiHoster(Hook):
Generic MultiHoster plugin
"""
- __version__ = "0.15"
+ __version__ = "0.16"
interval = 0
replacements = [("2shared.com", "twoshared.com"), ("4shared.com", "fourshared.com"), ("cloudnator.com", "shragle.com"),
@@ -124,7 +124,6 @@ class MultiHoster(Hook):
def unloadHoster(self, hoster):
dict = self.core.pluginManager.hosterPlugins[hoster]
- self.logDebug(dict)
if "module" in dict:
del dict["module"]
@@ -137,8 +136,10 @@ class MultiHoster(Hook):
self.unloadHoster(hoster)
def downloadFailed(self, pyfile):
- hdict = self.core.pluginManager.hosterPlugins[pyfile.pluginname]
- self.logDebug("Unload MultiHoster", pyfile.pluginname, hdict)
- if "new_name" in hdict and hdict['new_name'] == self.__name__:
- self.unloadHoster(pyfile.pluginname)
- pyfile.setStatus("queued") \ No newline at end of file
+ """remove plugin override if download fails but not if file is offline/temp.offline"""
+ if pyfile.hasStatus("failed"):
+ hdict = self.core.pluginManager.hosterPlugins[pyfile.pluginname]
+ self.logDebug("Unload MultiHoster", pyfile.pluginname, hdict)
+ if "new_name" in hdict and hdict['new_name'] == self.__name__:
+ self.unloadHoster(pyfile.pluginname)
+ pyfile.setStatus("queued") \ No newline at end of file