summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-05-28 00:05:49 +0200
committerGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-05-28 00:05:49 +0200
commit46781a7b3b2ec464e48e2629ab7f23412f9aa5b6 (patch)
treee6955044b497122bc20f45d39ccfb6d2588872b5 /module/plugins/hoster
parentSpare code cosmetics (diff)
downloadpyload-46781a7b3b2ec464e48e2629ab7f23412f9aa5b6.tar.xz
[GoogledriveCom][MediafireCom] Cleanup
Diffstat (limited to 'module/plugins/hoster')
-rw-r--r--module/plugins/hoster/GoogledriveCom.py10
-rw-r--r--module/plugins/hoster/MediafireCom.py5
2 files changed, 5 insertions, 10 deletions
diff --git a/module/plugins/hoster/GoogledriveCom.py b/module/plugins/hoster/GoogledriveCom.py
index 871ce0f2b..1c33a1e4e 100644
--- a/module/plugins/hoster/GoogledriveCom.py
+++ b/module/plugins/hoster/GoogledriveCom.py
@@ -13,9 +13,9 @@ from module.utils import html_unescape
class GoogledriveCom(SimpleHoster):
__name__ = "GoogledriveCom"
__type__ = "hoster"
- __version__ = "0.11"
+ __version__ = "0.12"
- __pattern__ = r'https?://(?:www\.)?(drive|docs)\.google\.com/(file/d/\w+|uc.+?)'
+ __pattern__ = r'https?://(?:www\.)?(drive|docs)\.google\.com/(file/d/\w+|uc\?.*id=)'
__config__ = [("use_premium", "bool", "Use premium account if available", True)]
__description__ = """Drive.google.com hoster plugin"""
@@ -25,7 +25,7 @@ class GoogledriveCom(SimpleHoster):
DISPOSITION = False #: Remove in 0.4.10
- NAME_PATTERN = r'"og:title" content="(?P<N>.*?)">'
+ NAME_PATTERN = r'(?:<title>|class="uc-name-size".*>)(?P<N>.+?)(?: - Google Drive</title>|</a> \()'
OFFLINE_PATTERN = r'align="center"><p class="errorMessage"'
LINK_FREE_PATTERN = r'"([^"]+uc\?.*?)"'
@@ -38,10 +38,6 @@ class GoogledriveCom(SimpleHoster):
def handleFree(self, pyfile):
- if "export=download" in self.pyfile.url:
- dl_id = self.pyfile.url.split("id=")[1]
- self.html = self.load("https://docs.google.com/file/d/%s/edit" %dl_id)
- self.pyfile.name = re.search(self.NAME_PATTERN,self.html).group(1)
for _i in xrange(2):
m = re.search(self.LINK_FREE_PATTERN, self.html)
diff --git a/module/plugins/hoster/MediafireCom.py b/module/plugins/hoster/MediafireCom.py
index d7ab8eb3f..1ba38fdf7 100644
--- a/module/plugins/hoster/MediafireCom.py
+++ b/module/plugins/hoster/MediafireCom.py
@@ -9,7 +9,7 @@ class MediafireCom(SimpleHoster):
__type__ = "hoster"
__version__ = "0.88"
- __pattern__ = r'https?://(?:www\.)?mediafire\.com/(file/|view/\??|download(\.php\?|/)|\?)\w{15}'
+ __pattern__ = r'https?://(?:www\.)?mediafire\.com/(file/|view/\??|download(\.php\?|/)|\?)(?P<ID>\w{15})'
__config__ = [("use_premium", "bool", "Use premium account if available", True)]
__description__ = """Mediafire.com hoster plugin"""
@@ -40,8 +40,7 @@ class MediafireCom(SimpleHoster):
if captcha_key:
response, challenge = solvemedia.challenge(captcha_key)
- dl_id = self.pyfile.url.split("/")[4]
- self.html = self.load("http://www.mediafire.com/?%s" %dl_id,
+ self.html = self.load("http://www.mediafire.com/?" + self.info['pattern']['ID'],
post={'adcopy_challenge': challenge,
'adcopy_response' : response},
decode=True)