From 389e5bd208feb97f4faca9cfd4bc0f037efc32d9 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 5 Jul 2014 16:31:44 +0200 Subject: [VeohCom] Auto quality detection --- module/plugins/hoster/VeohCom.py | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) (limited to 'module/plugins/hoster/VeohCom.py') diff --git a/module/plugins/hoster/VeohCom.py b/module/plugins/hoster/VeohCom.py index c1ebffb81..15d7a98b0 100644 --- a/module/plugins/hoster/VeohCom.py +++ b/module/plugins/hoster/VeohCom.py @@ -23,8 +23,8 @@ class VeohCom(SimpleHoster): __name__ = "VeohCom" __type__ = "hoster" __pattern__ = r'http://(?:www\.)?veoh\.com/(tv/)?(watch|videos)/(?Pv\w+)' - __version__ = "0.1" - __config__ = [("quality", "Low;High", "Quality", "High")] + __version__ = "0.2" + __config__ = [("quality", "Low;High;Auto", "Quality", "Auto")] __description__ = """Veoh.com hoster plugin""" __author_name__ = "Walter Purcaro" __author_mail__ = "vuolter@gmail.com" @@ -41,16 +41,22 @@ class VeohCom(SimpleHoster): self.chunkLimit = -1 def handleFree(self): - q = self.getConfig("quality") - pattern = r'"fullPreviewHash%sPath":"(.+?)"' % q - found = re.search(pattern, self.html) - if found: - self.pyfile.name += ".mp4" - link = found.group(1).replace("\\", "") - self.logDebug("Download link: " + link) - self.download(link) + quality = self.getConfig("quality") + if quality == "Auto": + quality = ("High", "Low") + for q in quality: + pattern = r'"fullPreviewHash%sPath":"(.+?)"' % q + found = re.search(pattern, self.html) + if found: + self.pyfile.name += ".mp4" + link = found.group(1).replace("\\", "") + self.logDebug("Download link: " + link) + self.download(link) + return + else: + self.logInfo("No %s quality video found" % q.upper()) else: - self.fail("No %s quality video found" % q.lower()) + self.fail("No video found!") getInfo = create_getInfo(VeohCom) -- cgit v1.2.3 From 93592862b520a862c01f80c019e5c4bc43746c19 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 5 Jul 2014 16:54:20 +0200 Subject: [SimpleHoster] Better inline docs + changed "FILE_OFFLINE_PATTERN" to "OFFLINE_PATTERN" --- module/plugins/hoster/VeohCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/VeohCom.py') diff --git a/module/plugins/hoster/VeohCom.py b/module/plugins/hoster/VeohCom.py index 15d7a98b0..472d40f01 100644 --- a/module/plugins/hoster/VeohCom.py +++ b/module/plugins/hoster/VeohCom.py @@ -30,7 +30,7 @@ class VeohCom(SimpleHoster): __author_mail__ = "vuolter@gmail.com" FILE_NAME_PATTERN = r'Sorry, we couldn\'t find the video you were looking for' + OFFLINE_PATTERN = r'>Sorry, we couldn\'t find the video you were looking for' FILE_URL_REPLACEMENTS = [(__pattern__, r'http://www.veoh.com/watch/\g')] -- cgit v1.2.3 From 9395182da7afed55a29bde1c7cbefe4204e783f0 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 20 Jul 2014 03:02:09 +0200 Subject: Store all re.search/match object as "m" instead "found" --- module/plugins/hoster/VeohCom.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/hoster/VeohCom.py') diff --git a/module/plugins/hoster/VeohCom.py b/module/plugins/hoster/VeohCom.py index 472d40f01..9dbc9b8ad 100644 --- a/module/plugins/hoster/VeohCom.py +++ b/module/plugins/hoster/VeohCom.py @@ -46,10 +46,10 @@ class VeohCom(SimpleHoster): quality = ("High", "Low") for q in quality: pattern = r'"fullPreviewHash%sPath":"(.+?)"' % q - found = re.search(pattern, self.html) - if found: + m = re.search(pattern, self.html) + if m: self.pyfile.name += ".mp4" - link = found.group(1).replace("\\", "") + link = m.group(1).replace("\\", "") self.logDebug("Download link: " + link) self.download(link) return -- cgit v1.2.3 From ba916633f2bedb04c7358000b91aed69f52e8e43 Mon Sep 17 00:00:00 2001 From: Walter Purcaro 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/VeohCom.py | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) (limited to 'module/plugins/hoster/VeohCom.py') diff --git a/module/plugins/hoster/VeohCom.py b/module/plugins/hoster/VeohCom.py index 9dbc9b8ad..fcd5e90a4 100644 --- a/module/plugins/hoster/VeohCom.py +++ b/module/plugins/hoster/VeohCom.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 . -############################################################################ import re @@ -22,9 +8,11 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class VeohCom(SimpleHoster): __name__ = "VeohCom" __type__ = "hoster" - __pattern__ = r'http://(?:www\.)?veoh\.com/(tv/)?(watch|videos)/(?Pv\w+)' __version__ = "0.2" + + __pattern__ = r'http://(?:www\.)?veoh\.com/(tv/)?(watch|videos)/(?Pv\w+)' __config__ = [("quality", "Low;High;Auto", "Quality", "Auto")] + __description__ = """Veoh.com hoster plugin""" __author_name__ = "Walter Purcaro" __author_mail__ = "vuolter@gmail.com" @@ -36,6 +24,7 @@ class VeohCom(SimpleHoster): SH_COOKIES = [(".veoh.com", "lassieLocale", "en")] + def setup(self): self.resumeDownload = self.multiDL = True self.chunkLimit = -1 -- cgit v1.2.3 From 4709a41c176dd2947709b7f35ccc84213d574624 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 26 Sep 2014 16:59:26 +0200 Subject: Rename SH flags --- module/plugins/hoster/VeohCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/VeohCom.py') diff --git a/module/plugins/hoster/VeohCom.py b/module/plugins/hoster/VeohCom.py index fcd5e90a4..a965e5e77 100644 --- a/module/plugins/hoster/VeohCom.py +++ b/module/plugins/hoster/VeohCom.py @@ -22,7 +22,7 @@ class VeohCom(SimpleHoster): FILE_URL_REPLACEMENTS = [(__pattern__, r'http://www.veoh.com/watch/\g')] - SH_COOKIES = [(".veoh.com", "lassieLocale", "en")] + COOKIES = [(".veoh.com", "lassieLocale", "en")] def setup(self): -- cgit v1.2.3 From b0868ae6446078bacf1635dde5e4ab316b4a94cb Mon Sep 17 00:00:00 2001 From: Walter Purcaro 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/VeohCom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/VeohCom.py') diff --git a/module/plugins/hoster/VeohCom.py b/module/plugins/hoster/VeohCom.py index a965e5e77..923679305 100644 --- a/module/plugins/hoster/VeohCom.py +++ b/module/plugins/hoster/VeohCom.py @@ -14,8 +14,8 @@ class VeohCom(SimpleHoster): __config__ = [("quality", "Low;High;Auto", "Quality", "Auto")] __description__ = """Veoh.com hoster plugin""" - __author_name__ = "Walter Purcaro" - __author_mail__ = "vuolter@gmail.com" + __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] + FILE_NAME_PATTERN = r'Sorry, we couldn\'t find the video you were looking for' -- cgit v1.2.3 From ae7a7e66981456e5bbe2b54006d79b6f907be7a4 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 8 Oct 2014 20:18:13 +0200 Subject: Add __license__ key attribute to plugins --- module/plugins/hoster/VeohCom.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/hoster/VeohCom.py') diff --git a/module/plugins/hoster/VeohCom.py b/module/plugins/hoster/VeohCom.py index 923679305..a4b94f40f 100644 --- a/module/plugins/hoster/VeohCom.py +++ b/module/plugins/hoster/VeohCom.py @@ -14,6 +14,7 @@ class VeohCom(SimpleHoster): __config__ = [("quality", "Low;High;Auto", "Quality", "Auto")] __description__ = """Veoh.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 Date: Wed, 22 Oct 2014 19:44:59 +0200 Subject: Two space before function declaration --- module/plugins/hoster/VeohCom.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/hoster/VeohCom.py') diff --git a/module/plugins/hoster/VeohCom.py b/module/plugins/hoster/VeohCom.py index a4b94f40f..f35ed2510 100644 --- a/module/plugins/hoster/VeohCom.py +++ b/module/plugins/hoster/VeohCom.py @@ -30,6 +30,7 @@ class VeohCom(SimpleHoster): self.resumeDownload = self.multiDL = True self.chunkLimit = -1 + def handleFree(self): quality = self.getConfig("quality") if quality == "Auto": -- cgit v1.2.3 From 4da90891eb2544ac15a7d512aba8cb357f68ee5f Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 25 Oct 2014 01:11:29 +0200 Subject: Spare code cosmetics --- module/plugins/hoster/VeohCom.py | 1 - 1 file changed, 1 deletion(-) (limited to 'module/plugins/hoster/VeohCom.py') diff --git a/module/plugins/hoster/VeohCom.py b/module/plugins/hoster/VeohCom.py index f35ed2510..8863750e0 100644 --- a/module/plugins/hoster/VeohCom.py +++ b/module/plugins/hoster/VeohCom.py @@ -41,7 +41,6 @@ class VeohCom(SimpleHoster): if m: self.pyfile.name += ".mp4" link = m.group(1).replace("\\", "") - self.logDebug("Download link: " + link) self.download(link) return else: -- cgit v1.2.3 From 9f2ebe486a3e155fb6a60e07cccb77ab6a772eb2 Mon Sep 17 00:00:00 2001 From: Walter Purcaro 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/VeohCom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/VeohCom.py') diff --git a/module/plugins/hoster/VeohCom.py b/module/plugins/hoster/VeohCom.py index 8863750e0..4533c4f80 100644 --- a/module/plugins/hoster/VeohCom.py +++ b/module/plugins/hoster/VeohCom.py @@ -44,9 +44,9 @@ class VeohCom(SimpleHoster): self.download(link) 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(VeohCom) -- cgit v1.2.3 From 34984dae733c3f3d47b41a0acfba3724d53c65a1 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 28 Oct 2014 16:52:10 +0100 Subject: Code cosmetics: plugin class attributes --- module/plugins/hoster/VeohCom.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins/hoster/VeohCom.py') diff --git a/module/plugins/hoster/VeohCom.py b/module/plugins/hoster/VeohCom.py index 4533c4f80..5057e593a 100644 --- a/module/plugins/hoster/VeohCom.py +++ b/module/plugins/hoster/VeohCom.py @@ -6,16 +6,16 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class VeohCom(SimpleHoster): - __name__ = "VeohCom" - __type__ = "hoster" + __name__ = "VeohCom" + __type__ = "hoster" __version__ = "0.2" __pattern__ = r'http://(?:www\.)?veoh\.com/(tv/)?(watch|videos)/(?Pv\w+)' __config__ = [("quality", "Low;High;Auto", "Quality", "Auto")] __description__ = """Veoh.com hoster plugin""" - __license__ = "GPLv3" - __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] + __license__ = "GPLv3" + __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] FILE_NAME_PATTERN = r' Date: Sun, 2 Nov 2014 22:47:07 +0100 Subject: Update all other plugins --- module/plugins/hoster/VeohCom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/VeohCom.py') diff --git a/module/plugins/hoster/VeohCom.py b/module/plugins/hoster/VeohCom.py index 5057e593a..4e91f62bd 100644 --- a/module/plugins/hoster/VeohCom.py +++ b/module/plugins/hoster/VeohCom.py @@ -18,10 +18,10 @@ class VeohCom(SimpleHoster): __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] - FILE_NAME_PATTERN = r'Sorry, we couldn\'t find the video you were looking for' - FILE_URL_REPLACEMENTS = [(__pattern__, r'http://www.veoh.com/watch/\g')] + URL_REPLACEMENTS = [(__pattern__, r'http://www.veoh.com/watch/\g')] COOKIES = [(".veoh.com", "lassieLocale", "en")] -- cgit v1.2.3 From e8246525f3106c152d6d1436c6a3111e0334520f Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 15 Nov 2014 18:04:47 +0100 Subject: Fix cookie domain --- module/plugins/hoster/VeohCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/VeohCom.py') diff --git a/module/plugins/hoster/VeohCom.py b/module/plugins/hoster/VeohCom.py index 4e91f62bd..9a8fd830f 100644 --- a/module/plugins/hoster/VeohCom.py +++ b/module/plugins/hoster/VeohCom.py @@ -23,7 +23,7 @@ class VeohCom(SimpleHoster): URL_REPLACEMENTS = [(__pattern__, r'http://www.veoh.com/watch/\g')] - COOKIES = [(".veoh.com", "lassieLocale", "en")] + COOKIES = [("veoh.com", "lassieLocale", "en")] def setup(self): -- cgit v1.2.3 From 2ca8cc959a587992dc389d6baf71dd3e4f66df1c Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 23 Nov 2014 04:41:17 +0100 Subject: Fix some URL_REPLACEMENTS --- module/plugins/hoster/VeohCom.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/hoster/VeohCom.py') diff --git a/module/plugins/hoster/VeohCom.py b/module/plugins/hoster/VeohCom.py index 9a8fd830f..8f434203d 100644 --- a/module/plugins/hoster/VeohCom.py +++ b/module/plugins/hoster/VeohCom.py @@ -8,7 +8,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class VeohCom(SimpleHoster): __name__ = "VeohCom" __type__ = "hoster" - __version__ = "0.2" + __version__ = "0.21" __pattern__ = r'http://(?:www\.)?veoh\.com/(tv/)?(watch|videos)/(?Pv\w+)' __config__ = [("quality", "Low;High;Auto", "Quality", "Auto")] @@ -18,10 +18,10 @@ class VeohCom(SimpleHoster): __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] - NAME_PATTERN = r'Sorry, we couldn\'t find the video you were looking for' - URL_REPLACEMENTS = [(__pattern__, r'http://www.veoh.com/watch/\g')] + URL_REPLACEMENTS = [(__pattern__ + ".*", r'http://www.veoh.com/watch/\g')] COOKIES = [("veoh.com", "lassieLocale", "en")] -- cgit v1.2.3 From 67587fbe0335cacfde28a86ba729b9d567ce1da7 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 7 Dec 2014 00:27:18 +0100 Subject: Plugin code cosmetics (3) --- module/plugins/hoster/VeohCom.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/VeohCom.py') diff --git a/module/plugins/hoster/VeohCom.py b/module/plugins/hoster/VeohCom.py index 8f434203d..6dbac397b 100644 --- a/module/plugins/hoster/VeohCom.py +++ b/module/plugins/hoster/VeohCom.py @@ -27,8 +27,9 @@ class VeohCom(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