From b150e9d731213410345628f06c1182a662e63ec5 Mon Sep 17 00:00:00 2001 From: zapp-brannigan Date: Wed, 27 May 2015 14:58:22 +0200 Subject: [GoogledriveCom] Make it more flexible Support links like ` https://drive.google.com/uc?export=download&id= ` See forum: http://forum.pyload.org/viewtopic.php?f=13&t=4203 --- module/plugins/hoster/GoogledriveCom.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/hoster/GoogledriveCom.py b/module/plugins/hoster/GoogledriveCom.py index 5a8862e6b..871ce0f2b 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.10" + __version__ = "0.11" - __pattern__ = r'https?://(?:www\.)?(drive|docs)\.google\.com/file/d/\w+' + __pattern__ = r'https?://(?:www\.)?(drive|docs)\.google\.com/(file/d/\w+|uc.+?)' __config__ = [("use_premium", "bool", "Use premium account if available", True)] __description__ = """Drive.google.com hoster plugin""" @@ -38,6 +38,10 @@ 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) -- cgit v1.2.3