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/FreevideoCz.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/hoster/FreevideoCz.py') diff --git a/module/plugins/hoster/FreevideoCz.py b/module/plugins/hoster/FreevideoCz.py index eebb43b48..21948a83d 100644 --- a/module/plugins/hoster/FreevideoCz.py +++ b/module/plugins/hoster/FreevideoCz.py @@ -28,7 +28,7 @@ def getInfo(urls): for url in urls: html = getURL(url) - if re.search(FreevideoCz.FILE_OFFLINE_PATTERN, html): + if re.search(FreevideoCz.OFFLINE_PATTERN, html): # File offline result.append((url, 0, 1, url)) else: @@ -46,7 +46,7 @@ class FreevideoCz(Hoster): __author_mail__ = "zoidberg@mujmail.cz" URL_PATTERN = r'clip: {\s*url: "([^"]+)"' - FILE_OFFLINE_PATTERN = r'

Str.nka nebyla nalezena

' + OFFLINE_PATTERN = r'

Str.nka nebyla nalezena

' def setup(self): self.multiDL = self.resumeDownload = True @@ -55,7 +55,7 @@ class FreevideoCz(Hoster): self.html = self.load(pyfile.url, decode=True) - if re.search(self.FILE_OFFLINE_PATTERN, self.html): + if re.search(self.OFFLINE_PATTERN, self.html): self.offline() found = re.search(self.URL_PATTERN, self.html) -- cgit v1.2.3 From 04038a2cf0c4c2d9cc9a0c8e8bf9beb6426afae8 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Thu, 10 Jul 2014 03:02:26 +0200 Subject: Use parseError instead PluginParseError + unified all download pattern attributes as LINK_PATTERN + removed some old patterns (not used anymore) + other code cosmetics --- module/plugins/hoster/FreevideoCz.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/FreevideoCz.py') diff --git a/module/plugins/hoster/FreevideoCz.py b/module/plugins/hoster/FreevideoCz.py index 21948a83d..175d317be 100644 --- a/module/plugins/hoster/FreevideoCz.py +++ b/module/plugins/hoster/FreevideoCz.py @@ -45,9 +45,11 @@ class FreevideoCz(Hoster): __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" - URL_PATTERN = r'clip: {\s*url: "([^"]+)"' OFFLINE_PATTERN = r'

Str.nka nebyla nalezena

' + LINK_PATTERN = r'clip: {\s*url: "([^"]+)"' + + def setup(self): self.multiDL = self.resumeDownload = True @@ -58,7 +60,7 @@ class FreevideoCz(Hoster): if re.search(self.OFFLINE_PATTERN, self.html): self.offline() - found = re.search(self.URL_PATTERN, self.html) + found = re.search(self.LINK_PATTERN, self.html) if found is None: self.fail("Parse error (URL)") download_url = found.group(1) -- cgit v1.2.3 From 48c0c42fd6faffc56432d5f037cd575979f180cc Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 14 Jul 2014 02:23:37 +0200 Subject: Removed all @author flags + key attributes cleanup for internal & hooks plugins --- module/plugins/hoster/FreevideoCz.py | 2 -- 1 file changed, 2 deletions(-) (limited to 'module/plugins/hoster/FreevideoCz.py') diff --git a/module/plugins/hoster/FreevideoCz.py b/module/plugins/hoster/FreevideoCz.py index 175d317be..ffad94418 100644 --- a/module/plugins/hoster/FreevideoCz.py +++ b/module/plugins/hoster/FreevideoCz.py @@ -13,8 +13,6 @@ You should have received a copy of the GNU General Public License along with this program; if not, see . - - @author: zoidberg """ import re -- cgit v1.2.3 From 5060e4c6374a5116d0d8b02528f910f8c5f8bcf9 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 15 Jul 2014 16:25:41 +0200 Subject: Fix code indentation, some bad whitespaces and missing authors + use 'not' instead 'is None' + replace __pattern__'s r" with r' + other minor cosmetics --- module/plugins/hoster/FreevideoCz.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/FreevideoCz.py') diff --git a/module/plugins/hoster/FreevideoCz.py b/module/plugins/hoster/FreevideoCz.py index ffad94418..94c17760b 100644 --- a/module/plugins/hoster/FreevideoCz.py +++ b/module/plugins/hoster/FreevideoCz.py @@ -59,7 +59,7 @@ class FreevideoCz(Hoster): self.offline() found = re.search(self.LINK_PATTERN, self.html) - if found is None: + if not found: self.fail("Parse error (URL)") download_url = found.group(1) -- cgit v1.2.3 From 05d258d98dd8c2faf0b769840fa1e3c4acccdce8 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 20 Jul 2014 03:25:14 +0200 Subject: Fix and improve 5060e4c6374a5116d0d8b02528f910f8c5f8bcf9 --- module/plugins/hoster/FreevideoCz.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/FreevideoCz.py') diff --git a/module/plugins/hoster/FreevideoCz.py b/module/plugins/hoster/FreevideoCz.py index 94c17760b..ffad94418 100644 --- a/module/plugins/hoster/FreevideoCz.py +++ b/module/plugins/hoster/FreevideoCz.py @@ -59,7 +59,7 @@ class FreevideoCz(Hoster): self.offline() found = re.search(self.LINK_PATTERN, self.html) - if not found: + if found is None: self.fail("Parse error (URL)") download_url = found.group(1) -- cgit v1.2.3 From 9b9d6db9d99bec69e61070a743d0b2194c35e375 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 19 Jul 2014 14:47:10 +0200 Subject: [FreevideoCz] Mark as dead --- module/plugins/hoster/FreevideoCz.py | 64 ++++-------------------------------- 1 file changed, 7 insertions(+), 57 deletions(-) (limited to 'module/plugins/hoster/FreevideoCz.py') diff --git a/module/plugins/hoster/FreevideoCz.py b/module/plugins/hoster/FreevideoCz.py index ffad94418..0945f173a 100644 --- a/module/plugins/hoster/FreevideoCz.py +++ b/module/plugins/hoster/FreevideoCz.py @@ -1,68 +1,18 @@ # -*- coding: utf-8 -*- -""" - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, - or (at your option) any later version. +from module.plugins.internal.DeadHoster import DeadHoster, create_getInfo - 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 General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program; if not, see . -""" - -import re -from module.plugins.Hoster import Hoster -from module.network.RequestFactory import getURL - - -def getInfo(urls): - result = [] - - for url in urls: - - html = getURL(url) - if re.search(FreevideoCz.OFFLINE_PATTERN, html): - # File offline - result.append((url, 0, 1, url)) - else: - result.append((url, 0, 2, url)) - yield result - - -class FreevideoCz(Hoster): +class FreevideoCz(DeadHoster): __name__ = "FreevideoCz" + __version__ = "0.3" __type__ = "hoster" - __pattern__ = r'http://(?:www\.)?freevideo.cz/vase-videa/(.*)\.html' - __version__ = "0.2" + + __pattern__ = r'http://(?:www\.)?freevideo\.cz/vase-videa/.+' + __description__ = """Freevideo.cz hoster plugin""" __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" - OFFLINE_PATTERN = r'

Str.nka nebyla nalezena

' - - LINK_PATTERN = r'clip: {\s*url: "([^"]+)"' - - - def setup(self): - self.multiDL = self.resumeDownload = True - - def process(self, pyfile): - - self.html = self.load(pyfile.url, decode=True) - - if re.search(self.OFFLINE_PATTERN, self.html): - self.offline() - - found = re.search(self.LINK_PATTERN, self.html) - if found is None: - self.fail("Parse error (URL)") - download_url = found.group(1) - - pyfile.name = re.match(self.__pattern__, pyfile.url).group(1) + ".mp4" - self.download(download_url) +getInfo = create_getInfo(FreevideoCz) \ No newline at end of file -- 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/FreevideoCz.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/FreevideoCz.py') diff --git a/module/plugins/hoster/FreevideoCz.py b/module/plugins/hoster/FreevideoCz.py index 0945f173a..d6549a8df 100644 --- a/module/plugins/hoster/FreevideoCz.py +++ b/module/plugins/hoster/FreevideoCz.py @@ -5,8 +5,8 @@ from module.plugins.internal.DeadHoster import DeadHoster, create_getInfo class FreevideoCz(DeadHoster): __name__ = "FreevideoCz" - __version__ = "0.3" __type__ = "hoster" + __version__ = "0.3" __pattern__ = r'http://(?:www\.)?freevideo\.cz/vase-videa/.+' -- cgit v1.2.3