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/SockshareCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/SockshareCom.py') diff --git a/module/plugins/hoster/SockshareCom.py b/module/plugins/hoster/SockshareCom.py index 017c8a839..60fd6a4cd 100644 --- a/module/plugins/hoster/SockshareCom.py +++ b/module/plugins/hoster/SockshareCom.py @@ -32,7 +32,7 @@ class SockshareCom(SimpleHoster): __author_mail__ = ("jeix@hasnomail.de", "l.stickell@yahoo.it", "vuolter@gmail.com") FILE_INFO_PATTERN = r'site-content">\s*

(?P.+)\( (?P[^)]+) \)

' - FILE_OFFLINE_PATTERN = r'>This file doesn\'t exist, or has been removed.<' + OFFLINE_PATTERN = r'>This file doesn\'t exist, or has been removed.<' FILE_URL_REPLACEMENTS = [(__pattern__, r'http://www.sockshare.com/file/\g')] -- cgit v1.2.3 From 0072668fd976f9ce4dbaac7e807791f21cbe07ed Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 6 Jul 2014 18:57:55 +0200 Subject: Compute wait time using secondsToMidnight --- module/plugins/hoster/SockshareCom.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'module/plugins/hoster/SockshareCom.py') diff --git a/module/plugins/hoster/SockshareCom.py b/module/plugins/hoster/SockshareCom.py index 60fd6a4cd..241089ee7 100644 --- a/module/plugins/hoster/SockshareCom.py +++ b/module/plugins/hoster/SockshareCom.py @@ -19,6 +19,7 @@ import re from os import rename +from module.plugins.hoster.UnrestrictLi import secondsToMidnight from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo @@ -26,7 +27,7 @@ class SockshareCom(SimpleHoster): __name__ = "SockshareCom" __type__ = "hoster" __pattern__ = r'http://(?:www\.)?sockshare\.com/(mobile/)?(file|embed)/(?P\w+)' - __version__ = "0.02" + __version__ = "0.03" __description__ = """Sockshare.com hoster plugin""" __author_name__ = ("jeix", "stickell", "Walter Purcaro") __author_mail__ = ("jeix@hasnomail.de", "l.stickell@yahoo.it", "vuolter@gmail.com") @@ -54,9 +55,11 @@ class SockshareCom(SimpleHoster): post_data = {"hash": hash_data.group(1), "confirm": "Continue+as+Free+User"} self.html = self.load(self.pyfile.url, post=post_data) - if (">You have exceeded the daily stream limit for your country\\. You can wait until tomorrow" in self.html or - "(>This content server has been temporarily disabled for upgrades|Try again soon\\. You can still download it below\\.<)" in self.html): - self.retry(wait_time=60 * 60 * 2, reason="Download limit exceeded or server disabled") # 2 hours wait + if ">You have exceeded the daily stream limit for your country\\. You can wait until tomorrow" in self.html: + self.logWarning("You have exceeded your daily stream limit for today") + self.wait(secondsToMidnight(gmt=2), True) + elif "(>This content server has been temporarily disabled for upgrades|Try again soon\\. You can still download it below\\.<)" in self.html): + self.retry(wait_time=2 * 60 * 60, reason="Server temporarily offline") # 2 hours wait patterns = (r'(/get_file\.php\?id=[A-Z0-9]+&key=[a-zA-Z0-9=]+&original=1)', r'(/get_file\.php\?download=[A-Z0-9]+&key=[a-z0-9]+)', -- 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/SockshareCom.py | 2 -- 1 file changed, 2 deletions(-) (limited to 'module/plugins/hoster/SockshareCom.py') diff --git a/module/plugins/hoster/SockshareCom.py b/module/plugins/hoster/SockshareCom.py index 241089ee7..bc3d5a7b4 100644 --- a/module/plugins/hoster/SockshareCom.py +++ b/module/plugins/hoster/SockshareCom.py @@ -12,8 +12,6 @@ # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . -# -# @author: Walter Purcaro ############################################################################### import re -- 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/SockshareCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/SockshareCom.py') diff --git a/module/plugins/hoster/SockshareCom.py b/module/plugins/hoster/SockshareCom.py index bc3d5a7b4..9818875c8 100644 --- a/module/plugins/hoster/SockshareCom.py +++ b/module/plugins/hoster/SockshareCom.py @@ -72,7 +72,7 @@ class SockshareCom(SimpleHoster): if link: self.html = self.load("http://www.sockshare.com" + link.group(1)) link = re.search(r'media:content url="(http://.*?)"', self.html) - if not link: + if link is None: link = re.search(r'\"(http://media\\-b\\d+\\.sockshare\\.com/download/\\d+/.*?)\"', self.html) else: self.parseError('Unable to detect a download link') -- cgit v1.2.3 From 239475cfe71c6be77e4aca26a3cb54abc8660b64 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 19 Jul 2014 13:47:54 +0200 Subject: [SockshareCom] Fix https://github.com/pyload/pyload/issues/696 --- module/plugins/hoster/SockshareCom.py | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) (limited to 'module/plugins/hoster/SockshareCom.py') diff --git a/module/plugins/hoster/SockshareCom.py b/module/plugins/hoster/SockshareCom.py index 9818875c8..61df428db 100644 --- a/module/plugins/hoster/SockshareCom.py +++ b/module/plugins/hoster/SockshareCom.py @@ -1,20 +1,7 @@ # -*- 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 os import rename from module.plugins.hoster.UnrestrictLi import secondsToMidnight @@ -23,18 +10,22 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class SockshareCom(SimpleHoster): __name__ = "SockshareCom" + __version__ = "0.04" __type__ = "hoster" + __pattern__ = r'http://(?:www\.)?sockshare\.com/(mobile/)?(file|embed)/(?P\w+)' - __version__ = "0.03" + __description__ = """Sockshare.com hoster plugin""" __author_name__ = ("jeix", "stickell", "Walter Purcaro") __author_mail__ = ("jeix@hasnomail.de", "l.stickell@yahoo.it", "vuolter@gmail.com") FILE_INFO_PATTERN = r'site-content">\s*

(?P.+)\( (?P[^)]+) \)

' OFFLINE_PATTERN = r'>This file doesn\'t exist, or has been removed.<' + TEMP_OFFLINE_PATTERN = r'(>This content server has been temporarily disabled for upgrades|Try again soon\\. You can still download it below\\.<)' FILE_URL_REPLACEMENTS = [(__pattern__, r'http://www.sockshare.com/file/\g')] + def setup(self): self.multiDL = self.resumeDownload = True self.chunkLimit = -1 @@ -56,7 +47,7 @@ class SockshareCom(SimpleHoster): if ">You have exceeded the daily stream limit for your country\\. You can wait until tomorrow" in self.html: self.logWarning("You have exceeded your daily stream limit for today") self.wait(secondsToMidnight(gmt=2), True) - elif "(>This content server has been temporarily disabled for upgrades|Try again soon\\. You can still download it below\\.<)" in self.html): + elif re.search(self.TEMP_OFFLINE_PATTERN, self.html): self.retry(wait_time=2 * 60 * 60, reason="Server temporarily offline") # 2 hours wait patterns = (r'(/get_file\.php\?id=[A-Z0-9]+&key=[a-zA-Z0-9=]+&original=1)', -- 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/SockshareCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/SockshareCom.py') diff --git a/module/plugins/hoster/SockshareCom.py b/module/plugins/hoster/SockshareCom.py index 61df428db..90f092473 100644 --- a/module/plugins/hoster/SockshareCom.py +++ b/module/plugins/hoster/SockshareCom.py @@ -10,8 +10,8 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class SockshareCom(SimpleHoster): __name__ = "SockshareCom" - __version__ = "0.04" __type__ = "hoster" + __version__ = "0.04" __pattern__ = r'http://(?:www\.)?sockshare\.com/(mobile/)?(file|embed)/(?P\w+)' -- cgit v1.2.3