From f5224f7a581eb5750a6ab9de2302ed749fb77540 Mon Sep 17 00:00:00 2001 From: zoidberg10 Date: Thu, 1 Dec 2011 21:45:11 +0100 Subject: megaupload decode file info, megaupload/depositfiles folders --- module/plugins/hoster/MegauploadCom.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/MegauploadCom.py b/module/plugins/hoster/MegauploadCom.py index 4854dcef7..87ac3f7f9 100644 --- a/module/plugins/hoster/MegauploadCom.py +++ b/module/plugins/hoster/MegauploadCom.py @@ -25,7 +25,7 @@ def getInfo(urls): fileIds.append(match.group("id")) for i, fileId in enumerate(fileIds): post["id%i" % i] = fileId - response = getURL(MegauploadCom.API_URL, post=post) + response = getURL(MegauploadCom.API_URL, post=post, decode = True) # Process API response parts = [re.split(r"&(?!amp;|#\d+;)", x) for x in re.split(r"&?(?=id[\d]+=)", response)] @@ -53,7 +53,7 @@ def _translateAPIFileInfo(apiFileId, apiFileDataMap, apiHosterMap): fileInfo = {} try: fileInfo['status'] = MegauploadCom.API_STATUS_MAPPING[apiFileDataMap[apiFileId]] - fileInfo['name'] = apiFileDataMap['n'] + fileInfo['name'] = html_unescape(apiFileDataMap['n']) fileInfo['size'] = int(apiFileDataMap['s']) fileInfo['hoster'] = apiHosterMap[apiFileDataMap['d']] except: @@ -65,7 +65,7 @@ class MegauploadCom(Hoster): __name__ = "MegauploadCom" __type__ = "hoster" __pattern__ = r"http://[\w\.]*?(megaupload)\.com/.*?(\?|&)d=(?P[0-9A-Za-z]+)" - __version__ = "0.26" + __version__ = "0.27" __description__ = """Megaupload.com Download Hoster""" __author_name__ = ("spoob") __author_mail__ = ("spoob@pyload.org") @@ -211,7 +211,7 @@ class MegauploadCom(Hoster): fileId = self.pyfile.url.split("=")[-1] # Get file id from url apiFileId = "id0" post = {apiFileId: fileId} - response = getURL(self.API_URL, post=post) + response = getURL(self.API_URL, post=post, decode = True) self.log.debug("%s: API response [%s]" % (self.__name__, response)) # Translate API response @@ -271,4 +271,4 @@ class MegauploadCom(Hoster): if re.search("The password you have entered is not correct", self.html[1]): self.fail(_("Wrong password for download link.")) - return True + return True \ No newline at end of file -- cgit v1.2.3