From 68248f809d1cad27c10bac1e84afb52d5bf49ed0 Mon Sep 17 00:00:00 2001 From: zoidberg10 Date: Sat, 10 Dec 2011 00:12:58 +0100 Subject: megaupload #451, uploadedto #443 --- module/plugins/hoster/MegauploadCom.py | 23 +++++++++++------------ module/plugins/hoster/MultishareCz.py | 26 +++++++++----------------- 2 files changed, 20 insertions(+), 29 deletions(-) (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/MegauploadCom.py b/module/plugins/hoster/MegauploadCom.py index 87ac3f7f9..100553ebf 100644 --- a/module/plugins/hoster/MegauploadCom.py +++ b/module/plugins/hoster/MegauploadCom.py @@ -65,13 +65,15 @@ class MegauploadCom(Hoster): __name__ = "MegauploadCom" __type__ = "hoster" __pattern__ = r"http://[\w\.]*?(megaupload)\.com/.*?(\?|&)d=(?P[0-9A-Za-z]+)" - __version__ = "0.27" + __version__ = "0.28" __description__ = """Megaupload.com Download Hoster""" __author_name__ = ("spoob") __author_mail__ = ("spoob@pyload.org") API_URL = "http://megaupload.com/mgr_linkcheck.php" - API_STATUS_MAPPING = {"0": statusMap['online'], "1": statusMap['offline'], "3": statusMap['temp. offline']} + API_STATUS_MAPPING = {"0": statusMap['online'], "1": statusMap['offline'], "3": statusMap['temp. offline']} + + FILE_URL_PATTERN = r'\d+).*" + __version__ = "0.34" __description__ = """MultiShare.cz""" __author_name__ = ("zoidberg") - FILE_ID_PATTERN = r'/stahnout/(?P\d+)/' FILE_INFO_PATTERN = ur'(?:
  • Název|Soubor): (?P[^<]+)<(?:/li>Velikost: (?P[^<]+)' FILE_OFFLINE_PATTERN = ur'

    Stáhnout soubor

    Požadovaný soubor neexistuje.

    ' FILE_SIZE_REPLACEMENTS = [(' ', '')] def process(self, pyfile): - if re.match(self.__pattern__, pyfile.url): + msurl = re.match(self.__pattern__, pyfile.url) + if msurl: + self.fileID = msurl.group('ID') self.html = self.load(pyfile.url, decode = True) - self.getFileInfo() + self.getFileInfo() + if self.premium: self.handlePremium() else: @@ -45,18 +47,14 @@ class MultishareCz(SimpleHoster): self.handleOverriden() def handleFree(self): - self.download("http://www.multishare.cz/html/download_free.php", get={ - "ID": self.getFileID() - }) + self.download("http://www.multishare.cz/html/download_free.php?ID=%s" % self.fileID) def handlePremium(self): if not self.checkCredit(): self.logWarning("Not enough credit left to download file") self.resetAccount() - self.download("http://www.multishare.cz/html/download_premium.php", get={ - "ID": self.getFileID() - }) + self.download("http://www.multishare.cz/html/download_premium.php?ID=%s" % self.fileID) def handleOverriden(self): if not self.premium: @@ -73,12 +71,6 @@ class MultishareCz(SimpleHoster): self.logDebug(url, params) self.download(url, get = params) - def getFileID(self): - found = re.search(self.FILE_ID_PATTERN, self.pyfile.url) - if not found: self.fail("Parse error (ID)") - - return found.group('ID') - def checkCredit(self): self.acc_info = self.account.getAccountInfo(self.user, True) self.logInfo("User %s has %i MB left" % (self.user, self.acc_info["trafficleft"]/1024)) -- cgit v1.2.3