From d016326ea5611c5dd9c0d5fcf2145fc202a45a9a Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 5 Jul 2014 16:33:12 +0200 Subject: New hoster: VimeoCom --- module/plugins/hoster/VimeoCom.py | 82 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 module/plugins/hoster/VimeoCom.py (limited to 'module/plugins/hoster/VimeoCom.py') diff --git a/module/plugins/hoster/VimeoCom.py b/module/plugins/hoster/VimeoCom.py new file mode 100644 index 000000000..3d93d3d03 --- /dev/null +++ b/module/plugins/hoster/VimeoCom.py @@ -0,0 +1,82 @@ +# -*- coding: utf-8 -*- +############################################################################ +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +############################################################################ + +import re + +from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo + + +class VimeoCom(SimpleHoster): + __name__ = "VimeoCom" + __type__ = "hoster" + __pattern__ = r'https?://(?:www\.)?(player\.)?vimeo\.com/(video/)?(?P\d+)' + __version__ = "0.01" + __config__ = [("quality", "Lowest;Mobile;SD;HD;Highest", "Quality", "Highest"), + ("original", "bool", "Try to download the original file first", True)] + __description__ = """Vimeo.com hoster plugin""" + __author_name__ = "Walter Purcaro" + __author_mail__ = "vuolter@gmail.com" + + FILE_NAME_PATTERN = r'(?P<N>.+) on Vimeo<' + FILE_OFFLINE_PATTERN = r'class="exception_header"' + TEMP_OFFLINE_PATTERN = r'Please try again in a few minutes.<' + + FILE_URL_REPLACEMENTS = [(__pattern__, r'https://www.vimeo.com/\g<ID>')] + + SH_COOKIES = [(".vimeo.com", "language", "en")] + + + def setup(self): + self.resumeDownload = self.multiDL = True + self.chunkLimit = -1 + + def handleFree(self): + if self.js and 'class="btn iconify_down_b"' in self.html: + html = self.js.eval(self.load(self.pyfile.url, get={'action': "download"}, decode=True)) + pattern = r'href="(?P<URL>http://vimeo\.com.+?)".*?\>(?P<QL>.+?) ' + else: + id = re.match(self.__pattern__, self.pyfile.url).group("ID") + html = self.load("https://player.vimeo.com/video/" + id) + pattern = r'"(?P<QL>\w+)":{"profile".*?"(?P<URL>http://pdl\.vimeocdn\.com.+?)"' + + link = dict([(l.group('QL').lower(), l.group('URL')) for l in re.finditer(pattern, html)]) + + if self.getConfig("original"): + if "original" in link: + self.download(link[q]) + return + else: + self.logInfo("Original file not downloadable") + + quality = self.getConfig("quality") + if quality == "Highest": + qlevel = ("hd", "sd", "mobile") + elif quality == "Lowest": + qlevel = ("mobile", "sd", "hd") + else: + qlevel = quality.lower() + + for q in qlevel: + if q in link: + self.download(link[q]) + return + else: + self.logInfo("No %s quality video found" % q.upper()) + else: + self.fail("No video found!") + + +getInfo = create_getInfo(VimeoCom) -- cgit v1.2.3 From 93592862b520a862c01f80c019e5c4bc43746c19 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Sat, 5 Jul 2014 16:54:20 +0200 Subject: [SimpleHoster] Better inline docs + changed "FILE_OFFLINE_PATTERN" to "OFFLINE_PATTERN" --- module/plugins/hoster/VimeoCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/VimeoCom.py') diff --git a/module/plugins/hoster/VimeoCom.py b/module/plugins/hoster/VimeoCom.py index 3d93d3d03..2c7f4b9c3 100644 --- a/module/plugins/hoster/VimeoCom.py +++ b/module/plugins/hoster/VimeoCom.py @@ -31,7 +31,7 @@ class VimeoCom(SimpleHoster): __author_mail__ = "vuolter@gmail.com" FILE_NAME_PATTERN = r'<title>(?P<N>.+) on Vimeo<' - FILE_OFFLINE_PATTERN = r'class="exception_header"' + OFFLINE_PATTERN = r'class="exception_header"' TEMP_OFFLINE_PATTERN = r'Please try again in a few minutes.<' FILE_URL_REPLACEMENTS = [(__pattern__, r'https://www.vimeo.com/\g<ID>')] -- cgit v1.2.3 From ba916633f2bedb04c7358000b91aed69f52e8e43 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Fri, 1 Aug 2014 19:35:59 +0200 Subject: Remove trailing whitespaces + remove license headers + import urllib methods directly + sort and fix key attributes + use save_join instead join + sort some import declarations + other minor code cosmetics --- module/plugins/hoster/VimeoCom.py | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) (limited to 'module/plugins/hoster/VimeoCom.py') diff --git a/module/plugins/hoster/VimeoCom.py b/module/plugins/hoster/VimeoCom.py index 2c7f4b9c3..7fa675715 100644 --- a/module/plugins/hoster/VimeoCom.py +++ b/module/plugins/hoster/VimeoCom.py @@ -1,18 +1,4 @@ # -*- coding: utf-8 -*- -############################################################################ -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. -############################################################################ import re @@ -22,10 +8,12 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class VimeoCom(SimpleHoster): __name__ = "VimeoCom" __type__ = "hoster" - __pattern__ = r'https?://(?:www\.)?(player\.)?vimeo\.com/(video/)?(?P<ID>\d+)' __version__ = "0.01" + + __pattern__ = r'https?://(?:www\.)?(player\.)?vimeo\.com/(video/)?(?P<ID>\d+)' __config__ = [("quality", "Lowest;Mobile;SD;HD;Highest", "Quality", "Highest"), ("original", "bool", "Try to download the original file first", True)] + __description__ = """Vimeo.com hoster plugin""" __author_name__ = "Walter Purcaro" __author_mail__ = "vuolter@gmail.com" -- cgit v1.2.3 From 291f946c45da87a6223ad41902f82e5226b9cf37 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Sat, 30 Aug 2014 21:19:48 +0200 Subject: [VimeoCom] Private video support --- module/plugins/hoster/VimeoCom.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'module/plugins/hoster/VimeoCom.py') diff --git a/module/plugins/hoster/VimeoCom.py b/module/plugins/hoster/VimeoCom.py index 7fa675715..145d9053f 100644 --- a/module/plugins/hoster/VimeoCom.py +++ b/module/plugins/hoster/VimeoCom.py @@ -8,7 +8,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class VimeoCom(SimpleHoster): __name__ = "VimeoCom" __type__ = "hoster" - __version__ = "0.01" + __version__ = "0.02" __pattern__ = r'https?://(?:www\.)?(player\.)?vimeo\.com/(video/)?(?P<ID>\d+)' __config__ = [("quality", "Lowest;Mobile;SD;HD;Highest", "Quality", "Highest"), @@ -32,12 +32,14 @@ class VimeoCom(SimpleHoster): self.chunkLimit = -1 def handleFree(self): + password = self.getPassword() + if self.js and 'class="btn iconify_down_b"' in self.html: - html = self.js.eval(self.load(self.pyfile.url, get={'action': "download"}, decode=True)) + html = self.js.eval(self.load(self.pyfile.url, get={'action': "download", 'password': password}, decode=True)) pattern = r'href="(?P<URL>http://vimeo\.com.+?)".*?\>(?P<QL>.+?) ' else: id = re.match(self.__pattern__, self.pyfile.url).group("ID") - html = self.load("https://player.vimeo.com/video/" + id) + html = self.load("https://player.vimeo.com/video/" + id, get={'password': password}) pattern = r'"(?P<QL>\w+)":{"profile".*?"(?P<URL>http://pdl\.vimeocdn\.com.+?)"' link = dict([(l.group('QL').lower(), l.group('URL')) for l in re.finditer(pattern, html)]) -- cgit v1.2.3 From 4709a41c176dd2947709b7f35ccc84213d574624 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Fri, 26 Sep 2014 16:59:26 +0200 Subject: Rename SH flags --- module/plugins/hoster/VimeoCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/VimeoCom.py') diff --git a/module/plugins/hoster/VimeoCom.py b/module/plugins/hoster/VimeoCom.py index 145d9053f..923be59f7 100644 --- a/module/plugins/hoster/VimeoCom.py +++ b/module/plugins/hoster/VimeoCom.py @@ -24,7 +24,7 @@ class VimeoCom(SimpleHoster): FILE_URL_REPLACEMENTS = [(__pattern__, r'https://www.vimeo.com/\g<ID>')] - SH_COOKIES = [(".vimeo.com", "language", "en")] + COOKIES = [(".vimeo.com", "language", "en")] def setup(self): -- cgit v1.2.3 From b0868ae6446078bacf1635dde5e4ab316b4a94cb Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Tue, 7 Oct 2014 18:57:59 +0200 Subject: New __authors__ key replaces __author_name__ and __author_mail__ + Whitespaces and EOF fixup --- module/plugins/hoster/VimeoCom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/VimeoCom.py') diff --git a/module/plugins/hoster/VimeoCom.py b/module/plugins/hoster/VimeoCom.py index 923be59f7..48c20d2de 100644 --- a/module/plugins/hoster/VimeoCom.py +++ b/module/plugins/hoster/VimeoCom.py @@ -15,8 +15,8 @@ class VimeoCom(SimpleHoster): ("original", "bool", "Try to download the original file first", True)] __description__ = """Vimeo.com hoster plugin""" - __author_name__ = "Walter Purcaro" - __author_mail__ = "vuolter@gmail.com" + __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] + FILE_NAME_PATTERN = r'<title>(?P<N>.+) on Vimeo<' OFFLINE_PATTERN = r'class="exception_header"' -- cgit v1.2.3 From ae7a7e66981456e5bbe2b54006d79b6f907be7a4 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Wed, 8 Oct 2014 20:18:13 +0200 Subject: Add __license__ key attribute to plugins --- module/plugins/hoster/VimeoCom.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/hoster/VimeoCom.py') diff --git a/module/plugins/hoster/VimeoCom.py b/module/plugins/hoster/VimeoCom.py index 48c20d2de..2f554ee1b 100644 --- a/module/plugins/hoster/VimeoCom.py +++ b/module/plugins/hoster/VimeoCom.py @@ -15,6 +15,7 @@ class VimeoCom(SimpleHoster): ("original", "bool", "Try to download the original file first", True)] __description__ = """Vimeo.com hoster plugin""" + __license__ = "GPLv3" __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] -- cgit v1.2.3 From 0eb6e7ec4a1144dcca824d8add049787d3da1762 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Wed, 22 Oct 2014 19:44:59 +0200 Subject: Two space before function declaration --- module/plugins/hoster/VimeoCom.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/hoster/VimeoCom.py') diff --git a/module/plugins/hoster/VimeoCom.py b/module/plugins/hoster/VimeoCom.py index 2f554ee1b..8de7fad88 100644 --- a/module/plugins/hoster/VimeoCom.py +++ b/module/plugins/hoster/VimeoCom.py @@ -32,6 +32,7 @@ class VimeoCom(SimpleHoster): self.resumeDownload = self.multiDL = True self.chunkLimit = -1 + def handleFree(self): password = self.getPassword() -- cgit v1.2.3 From 9f2ebe486a3e155fb6a60e07cccb77ab6a772eb2 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Sun, 26 Oct 2014 02:31:54 +0200 Subject: Extend translation support in plugins + a lot of code cosmetics and typo fixes --- module/plugins/hoster/VimeoCom.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/hoster/VimeoCom.py') diff --git a/module/plugins/hoster/VimeoCom.py b/module/plugins/hoster/VimeoCom.py index 8de7fad88..08377b98f 100644 --- a/module/plugins/hoster/VimeoCom.py +++ b/module/plugins/hoster/VimeoCom.py @@ -51,7 +51,7 @@ class VimeoCom(SimpleHoster): self.download(link[q]) return else: - self.logInfo("Original file not downloadable") + self.logInfo(_("Original file not downloadable")) quality = self.getConfig("quality") if quality == "Highest": @@ -66,9 +66,9 @@ class VimeoCom(SimpleHoster): self.download(link[q]) return else: - self.logInfo("No %s quality video found" % q.upper()) + self.logInfo(_("No %s quality video found") % q.upper()) else: - self.fail("No video found!") + self.fail(_("No video found!")) getInfo = create_getInfo(VimeoCom) -- cgit v1.2.3 From 34984dae733c3f3d47b41a0acfba3724d53c65a1 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Tue, 28 Oct 2014 16:52:10 +0100 Subject: Code cosmetics: plugin class attributes --- module/plugins/hoster/VimeoCom.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins/hoster/VimeoCom.py') diff --git a/module/plugins/hoster/VimeoCom.py b/module/plugins/hoster/VimeoCom.py index 08377b98f..14e0c7a26 100644 --- a/module/plugins/hoster/VimeoCom.py +++ b/module/plugins/hoster/VimeoCom.py @@ -6,8 +6,8 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class VimeoCom(SimpleHoster): - __name__ = "VimeoCom" - __type__ = "hoster" + __name__ = "VimeoCom" + __type__ = "hoster" __version__ = "0.02" __pattern__ = r'https?://(?:www\.)?(player\.)?vimeo\.com/(video/)?(?P<ID>\d+)' @@ -15,8 +15,8 @@ class VimeoCom(SimpleHoster): ("original", "bool", "Try to download the original file first", True)] __description__ = """Vimeo.com hoster plugin""" - __license__ = "GPLv3" - __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] + __license__ = "GPLv3" + __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] FILE_NAME_PATTERN = r'<title>(?P<N>.+) on Vimeo<' -- cgit v1.2.3 From 772e47ef806d18fd209e910be0535bce7c07dc7b Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Sun, 2 Nov 2014 22:47:07 +0100 Subject: Update all other plugins --- module/plugins/hoster/VimeoCom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/VimeoCom.py') diff --git a/module/plugins/hoster/VimeoCom.py b/module/plugins/hoster/VimeoCom.py index 14e0c7a26..1d016961f 100644 --- a/module/plugins/hoster/VimeoCom.py +++ b/module/plugins/hoster/VimeoCom.py @@ -19,11 +19,11 @@ class VimeoCom(SimpleHoster): __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] - FILE_NAME_PATTERN = r'<title>(?P<N>.+) on Vimeo<' + NAME_PATTERN = r'<title>(?P<N>.+) on Vimeo<' OFFLINE_PATTERN = r'class="exception_header"' TEMP_OFFLINE_PATTERN = r'Please try again in a few minutes.<' - FILE_URL_REPLACEMENTS = [(__pattern__, r'https://www.vimeo.com/\g<ID>')] + URL_REPLACEMENTS = [(__pattern__, r'https://www.vimeo.com/\g<ID>')] COOKIES = [(".vimeo.com", "language", "en")] -- cgit v1.2.3 From e8246525f3106c152d6d1436c6a3111e0334520f Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Sat, 15 Nov 2014 18:04:47 +0100 Subject: Fix cookie domain --- module/plugins/hoster/VimeoCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/VimeoCom.py') diff --git a/module/plugins/hoster/VimeoCom.py b/module/plugins/hoster/VimeoCom.py index 1d016961f..3242185f6 100644 --- a/module/plugins/hoster/VimeoCom.py +++ b/module/plugins/hoster/VimeoCom.py @@ -25,7 +25,7 @@ class VimeoCom(SimpleHoster): URL_REPLACEMENTS = [(__pattern__, r'https://www.vimeo.com/\g<ID>')] - COOKIES = [(".vimeo.com", "language", "en")] + COOKIES = [("vimeo.com", "language", "en")] def setup(self): -- cgit v1.2.3 From 2ca8cc959a587992dc389d6baf71dd3e4f66df1c Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Sun, 23 Nov 2014 04:41:17 +0100 Subject: Fix some URL_REPLACEMENTS --- module/plugins/hoster/VimeoCom.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins/hoster/VimeoCom.py') diff --git a/module/plugins/hoster/VimeoCom.py b/module/plugins/hoster/VimeoCom.py index 3242185f6..025abf15e 100644 --- a/module/plugins/hoster/VimeoCom.py +++ b/module/plugins/hoster/VimeoCom.py @@ -8,7 +8,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class VimeoCom(SimpleHoster): __name__ = "VimeoCom" __type__ = "hoster" - __version__ = "0.02" + __version__ = "0.03" __pattern__ = r'https?://(?:www\.)?(player\.)?vimeo\.com/(video/)?(?P<ID>\d+)' __config__ = [("quality", "Lowest;Mobile;SD;HD;Highest", "Quality", "Highest"), @@ -19,11 +19,11 @@ class VimeoCom(SimpleHoster): __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] - NAME_PATTERN = r'<title>(?P<N>.+) on Vimeo<' - OFFLINE_PATTERN = r'class="exception_header"' + NAME_PATTERN = r'<title>(?P<N>.+) on Vimeo<' + OFFLINE_PATTERN = r'class="exception_header"' TEMP_OFFLINE_PATTERN = r'Please try again in a few minutes.<' - URL_REPLACEMENTS = [(__pattern__, r'https://www.vimeo.com/\g<ID>')] + URL_REPLACEMENTS = [(__pattern__ + ".*", r'https://www.vimeo.com/\g<ID>')] COOKIES = [("vimeo.com", "language", "en")] -- cgit v1.2.3 From 67587fbe0335cacfde28a86ba729b9d567ce1da7 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Sun, 7 Dec 2014 00:27:18 +0100 Subject: Plugin code cosmetics (3) --- module/plugins/hoster/VimeoCom.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/VimeoCom.py') diff --git a/module/plugins/hoster/VimeoCom.py b/module/plugins/hoster/VimeoCom.py index 025abf15e..9e4abf702 100644 --- a/module/plugins/hoster/VimeoCom.py +++ b/module/plugins/hoster/VimeoCom.py @@ -29,8 +29,9 @@ class VimeoCom(SimpleHoster): def setup(self): - self.resumeDownload = self.multiDL = True - self.chunkLimit = -1 + self.resumeDownload = True + self.multiDL = True + self.chunkLimit = -1 def handleFree(self): -- cgit v1.2.3 From 854efeb463bd98cb8e22f1f78f5ce97e6c0ab49f Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@gmail.com> Date: Mon, 22 Dec 2014 16:45:04 +0100 Subject: Spare code cosmetics --- module/plugins/hoster/VimeoCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/VimeoCom.py') diff --git a/module/plugins/hoster/VimeoCom.py b/module/plugins/hoster/VimeoCom.py index 9e4abf702..0e42c1674 100644 --- a/module/plugins/hoster/VimeoCom.py +++ b/module/plugins/hoster/VimeoCom.py @@ -41,7 +41,7 @@ class VimeoCom(SimpleHoster): html = self.js.eval(self.load(self.pyfile.url, get={'action': "download", 'password': password}, decode=True)) pattern = r'href="(?P<URL>http://vimeo\.com.+?)".*?\>(?P<QL>.+?) ' else: - id = re.match(self.__pattern__, self.pyfile.url).group("ID") + id = re.match(self.__pattern__, self.pyfile.url).group('ID') html = self.load("https://player.vimeo.com/video/" + id, get={'password': password}) pattern = r'"(?P<QL>\w+)":{"profile".*?"(?P<URL>http://pdl\.vimeocdn\.com.+?)"' -- cgit v1.2.3