summaryrefslogtreecommitdiffstats
path: root/module/plugins/crypter/MediafireComFolder.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/crypter/MediafireComFolder.py')
-rw-r--r--module/plugins/crypter/MediafireComFolder.py20
1 files changed, 11 insertions, 9 deletions
diff --git a/module/plugins/crypter/MediafireComFolder.py b/module/plugins/crypter/MediafireComFolder.py
index ddd61379c..3709d3349 100644
--- a/module/plugins/crypter/MediafireComFolder.py
+++ b/module/plugins/crypter/MediafireComFolder.py
@@ -5,6 +5,7 @@ from module.plugins.Crypter import Crypter
from module.plugins.hoster.MediafireCom import checkHTMLHeader
from module.common.json_layer import json_loads
+
class MediafireComFolder(Crypter):
__name__ = "MediafireComFolder"
__type__ = "crypter"
@@ -19,10 +20,10 @@ class MediafireComFolder(Crypter):
def decrypt(self, pyfile):
new_links = []
-
+
url, result = checkHTMLHeader(pyfile.url)
self.logDebug('Location (%d): %s' % (result, url))
-
+
if result == 0:
# load and parse html
html = self.load(pyfile.url)
@@ -33,23 +34,24 @@ class MediafireComFolder(Crypter):
else:
# folder page
found = re.search(self.FOLDER_KEY_PATTERN, html)
- if found:
+ if found:
folder_key = found.group(1)
self.logDebug("FOLDER KEY: %s" % folder_key)
-
- json_resp = json_loads(self.load("http://www.mediafire.com/api/folder/get_info.php?folder_key=%s&response_format=json&version=1" % folder_key))
+
+ json_resp = json_loads(self.load(
+ "http://www.mediafire.com/api/folder/get_info.php?folder_key=%s&response_format=json&version=1" % folder_key))
#self.logInfo(json_resp)
if json_resp['response']['result'] == "Success":
for link in json_resp['response']['folder_info']['files']:
- new_links.append("http://www.mediafire.com/file/%s" % link['quickkey'])
+ new_links.append("http://www.mediafire.com/file/%s" % link['quickkey'])
else:
self.fail(json_resp['response']['message'])
elif result == 1:
- self.offline()
+ self.offline()
else:
new_links.append(url)
-
+
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')