From e6cf876628bbdfacf5f6c60f3b7027d0ba0cb274 Mon Sep 17 00:00:00 2001 From: Nitzo Date: Fri, 22 Jul 2016 23:01:17 +0300 Subject: [GoogledriveCom] Use API --- module/plugins/hoster/GoogledriveCom.py | 63 ++++++++++++++++++++++----------- 1 file changed, 43 insertions(+), 20 deletions(-) (limited to 'module') diff --git a/module/plugins/hoster/GoogledriveCom.py b/module/plugins/hoster/GoogledriveCom.py index afe7f1fb8..d6ead2d65 100644 --- a/module/plugins/hoster/GoogledriveCom.py +++ b/module/plugins/hoster/GoogledriveCom.py @@ -4,19 +4,19 @@ # https://drive.google.com/file/d/0B6RNTe4ygItBQm15RnJiTmMyckU/view?pli=1 import re -import urlparse -from module.plugins.internal.SimpleHoster import SimpleHoster -from module.plugins.internal.misc import html_unescape +from module.network.HTTPRequest import BadHeader +from module.plugins.internal.Hoster import Hoster +from module.plugins.internal.misc import json -class GoogledriveCom(SimpleHoster): +class GoogledriveCom(Hoster): __name__ = "GoogledriveCom" __type__ = "hoster" - __version__ = "0.21" + __version__ = "0.22" __status__ = "testing" - __pattern__ = r'https?://(?:www\.)?(drive|docs)\.google\.com/(file/d/\w+|uc\?.*id=)' + __pattern__ = r'https?://(?:www\.)?(?:drive|docs)\.google\.com/(?:file/d/|(?:uc|open)\?.*id=)(?P[-\w]+)' __config__ = [("activated" , "bool", "Activated" , True), ("use_premium" , "bool", "Use premium account if available" , True), ("fallback" , "bool", "Fallback to free download if premium fails" , True), @@ -25,11 +25,11 @@ class GoogledriveCom(SimpleHoster): __description__ = """Drive.google.com hoster plugin""" __license__ = "GPLv3" - __authors__ = [("zapp-brannigan", "fuerst.reinje@web.de")] + __authors__ = [("zapp-brannigan", "fuerst.reinje@web.de" ), + ("GammaC0de" , "nitzo2001[AT]yahoo[DOT]com")] - - NAME_PATTERN = r'(?:|class="uc-name-size".*>)(?P<N>.+?)(?: - Google Drive| \()' - OFFLINE_PATTERN = r'align="center">