summaryrefslogtreecommitdiffstats
path: root/pyload/plugins/crypter/MultiuploadCom.py
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2014-09-28 21:19:03 +0200
committerGravatar Walter Purcaro <vuolter@gmail.com> 2014-09-28 21:19:03 +0200
commit46c6fc74a4e423927554f024b78dbbbf33e982cd (patch)
treee7ff9580bb5e80b91e2bd9609409116a19c5941e /pyload/plugins/crypter/MultiuploadCom.py
parentApi : Add brackets and pipe to urlmatcher (diff)
parent[XFileSharingPro] Fixed typo (diff)
downloadpyload-46c6fc74a4e423927554f024b78dbbbf33e982cd.tar.xz
Merge branch 'stable' into 0.4.10
Conflicts: pyload/plugins/crypter/MultiuploadCom.py pyload/plugins/crypter/SerienjunkiesOrg.py pyload/plugins/hooks/ExternalScripts.py pyload/plugins/hooks/ExtractArchive.py pyload/plugins/hooks/MergeFiles.py pyload/plugins/hoster/CatShareNet.py pyload/plugins/hoster/FilezyNet.py pyload/plugins/hoster/IFileWs.py pyload/plugins/hoster/PremiumTo.py pyload/plugins/hoster/SpeedyshareCom.py pyload/plugins/hoster/UptoboxCom.py pyload/plugins/hoster/XFileSharingPro.py pyload/plugins/hoster/ZippyshareCom.py
Diffstat (limited to 'pyload/plugins/crypter/MultiuploadCom.py')
-rw-r--r--pyload/plugins/crypter/MultiuploadCom.py59
1 files changed, 5 insertions, 54 deletions
diff --git a/pyload/plugins/crypter/MultiuploadCom.py b/pyload/plugins/crypter/MultiuploadCom.py
index b1650b647..754247ec7 100644
--- a/pyload/plugins/crypter/MultiuploadCom.py
+++ b/pyload/plugins/crypter/MultiuploadCom.py
@@ -1,64 +1,15 @@
# -*- coding: utf-8 -*-
-import re
-from time import time
+from pyload.plugins.internal.DeadCrypter import DeadCrypter
-from pyload.plugins.Crypter import Crypter
-from pyload.utils import json_loads
-
-class MultiuploadCom(Crypter):
+class MultiuploadCom(DeadCrypter):
__name__ = "MultiuploadCom"
__type__ = "crypter"
- __version__ = "0.01"
+ __version__ = "0.02"
- __pattern__ = r'http://(?:www\.)?multiupload.com/(\w+)'
- __config__ = [("preferedHoster", "str", "Prefered hoster list (bar-separated) ", "multiupload"),
- ("ignoredHoster", "str", "Ignored hoster list (bar-separated) ", "")]
+ __pattern__ = r'http://(?:www\.)?multiupload\.(com|nl)/\w+'
- __description__ = """MultiUpload.com decrypter plugin"""
+ __description__ = """ MultiUpload.com decrypter plugin """
__author_name__ = "zoidberg"
__author_mail__ = "zoidberg@mujmail.cz"
-
- ML_LINK_PATTERN = r'<div id="downloadbutton_" style=""><a href="([^"]+)"'
-
-
- def decrypt(self, pyfile):
- self.html = self.load(pyfile.url)
- m = re.search(self.ML_LINK_PATTERN, self.html)
- ml_url = m.group(1) if m else None
-
- json_list = json_loads(self.load("http://multiupload.com/progress/", get={
- "d": re.match(self.__pattern__, pyfile.url).group(1),
- "r": str(int(time() * 1000))
- }))
-
- prefered_set = map(lambda s: s.lower().split('.')[0], set(self.getConfig("preferedHoster").split('|')))
-
- if ml_url and 'multiupload' in prefered_set:
- self.urls.append(ml_url)
-
- for link in json_list:
- if link['service'].lower() in prefered_set and int(link['status']) and not int(link['deleted']):
- url = self.getLocation(link['url'])
- if url:
- self.urls.append(url)
-
- if not self.urls:
- ignored_set = map(lambda s: s.lower().split('.')[0], set(self.getConfig("ignoredHoster").split('|')))
-
- if 'multiupload' not in ignored_set:
- self.urls.append(ml_url)
-
- for link in json_list:
- if link['service'].lower() not in ignored_set and int(link['status']) and not int(link['deleted']):
- url = self.getLocation(link['url'])
- if url:
- self.urls.append(url)
-
- if not self.urls:
- self.fail('Could not extract any links')
-
- def getLocation(self, url):
- header = self.load(url, just_header=True)
- return header['location'] if "location" in header else None