From a6684ce241093935d3812b16da0094aab915d85d Mon Sep 17 00:00:00 2001 From: Samir Boulema Date: Wed, 25 Jun 2014 16:28:24 +0200 Subject: [Filefactory] Improved free links detect Merges #638 --- module/plugins/hoster/FilefactoryCom.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/hoster/FilefactoryCom.py') diff --git a/module/plugins/hoster/FilefactoryCom.py b/module/plugins/hoster/FilefactoryCom.py index 273a717b5..21b803649 100644 --- a/module/plugins/hoster/FilefactoryCom.py +++ b/module/plugins/hoster/FilefactoryCom.py @@ -23,7 +23,7 @@ class FilefactoryCom(SimpleHoster): __name__ = "FilefactoryCom" __type__ = "hoster" __pattern__ = r'https?://(?:www\.)?filefactory\.com/file/(?P[a-zA-Z0-9]+)' - __version__ = "0.47" + __version__ = "0.48" __description__ = """Filefactory.com hoster plugin""" __author_name__ = "stickell" __author_mail__ = "l.stickell@yahoo.it" @@ -40,7 +40,7 @@ class FilefactoryCom(SimpleHoster): elif "All free download slots on this server are currently in use" in self.html: self.retry(50, 15 * 60, "All free slots are busy") - m = re.search(r'data-href-direct="(http://[^"]+)"', self.html) + m = re.search(r'data-href(?:-direct)?="(http://[^"]+)"', self.html) if m: t = re.search(r'
', self.html) if t: @@ -65,7 +65,7 @@ class FilefactoryCom(SimpleHoster): self.wait(int(waittime.group(1))) # Parse the direct link and download it - direct = re.search(r'data-href-direct="(.*)" class="button', self.html) + direct = re.search(r'data-href(?:-direct)?="(.*)" class="button', self.html) if not direct: self.parseError('Unable to detect free direct link') direct = direct.group(1) -- cgit v1.2.3 From 47d3ef52a10e1a0db8b73fde81c9d3a7eaed00c3 Mon Sep 17 00:00:00 2001 From: Stefano Date: Wed, 2 Jul 2014 14:56:10 +0200 Subject: [Filefactory] getInfo handle direct links Partially fixes #648 --- module/plugins/hoster/FilefactoryCom.py | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'module/plugins/hoster/FilefactoryCom.py') diff --git a/module/plugins/hoster/FilefactoryCom.py b/module/plugins/hoster/FilefactoryCom.py index 21b803649..05edf6b99 100644 --- a/module/plugins/hoster/FilefactoryCom.py +++ b/module/plugins/hoster/FilefactoryCom.py @@ -16,14 +16,26 @@ import re -from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo +from module.plugins.internal.SimpleHoster import SimpleHoster, parseFileInfo +from module.network.RequestFactory import getURL + + +def getInfo(urls): + for url in urls: + h = getURL(url, just_header=True) + m = re.search(r'Location: (.+)\r\n', h) + if m and not re.match(m.group(1), FilefactoryCom.__pattern__): # It's a direct link! Skipping + yield (url, 0, 3, url) + else: # It's a standard html page + file_info = parseFileInfo(FilefactoryCom, url, getURL(url)) + yield file_info class FilefactoryCom(SimpleHoster): __name__ = "FilefactoryCom" __type__ = "hoster" __pattern__ = r'https?://(?:www\.)?filefactory\.com/file/(?P[a-zA-Z0-9]+)' - __version__ = "0.48" + __version__ = "0.49" __description__ = """Filefactory.com hoster plugin""" __author_name__ = "stickell" __author_mail__ = "l.stickell@yahoo.it" @@ -101,6 +113,3 @@ class FilefactoryCom(SimpleHoster): self.logDebug('DIRECT PREMIUM LINK: ' + url) self.download(url, disposition=True) - - -getInfo = create_getInfo(FilefactoryCom) -- cgit v1.2.3 From 521a8122e24cbcf27578e88d75fea356b4ea4a5f Mon Sep 17 00:00:00 2001 From: Stefano Date: Wed, 2 Jul 2014 15:17:50 +0200 Subject: [Filefactory] Improved offline pattern Forced english locale --- module/plugins/hoster/FilefactoryCom.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/FilefactoryCom.py') diff --git a/module/plugins/hoster/FilefactoryCom.py b/module/plugins/hoster/FilefactoryCom.py index 05edf6b99..ab0d3232f 100644 --- a/module/plugins/hoster/FilefactoryCom.py +++ b/module/plugins/hoster/FilefactoryCom.py @@ -35,15 +35,16 @@ class FilefactoryCom(SimpleHoster): __name__ = "FilefactoryCom" __type__ = "hoster" __pattern__ = r'https?://(?:www\.)?filefactory\.com/file/(?P[a-zA-Z0-9]+)' - __version__ = "0.49" + __version__ = "0.50" __description__ = """Filefactory.com hoster plugin""" __author_name__ = "stickell" __author_mail__ = "l.stickell@yahoo.it" FILE_INFO_PATTERN = r'
]*>\s*

(?P[^<]+)

\s*
\s*(?P[\d.]+) (?P\w+) uploaded' DIRECT_LINK_PATTERN = r']*>]*> Download with FileFactory Premium' - FILE_OFFLINE_PATTERN = r'

File Removed

' + FILE_OFFLINE_PATTERN = r'

File Removed

|This file is no longer available' PREMIUM_ONLY_PATTERN = r'>Premium Account Required<' + SH_COOKIES = [('.filefactory.com', 'locale', 'en_US.utf8')] def handleFree(self): self.html = self.load(self.pyfile.url, decode=True) -- 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/FilefactoryCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/FilefactoryCom.py') diff --git a/module/plugins/hoster/FilefactoryCom.py b/module/plugins/hoster/FilefactoryCom.py index ab0d3232f..d6a15b0ea 100644 --- a/module/plugins/hoster/FilefactoryCom.py +++ b/module/plugins/hoster/FilefactoryCom.py @@ -42,7 +42,7 @@ class FilefactoryCom(SimpleHoster): FILE_INFO_PATTERN = r'
]*>\s*

(?P[^<]+)

\s*
\s*(?P[\d.]+) (?P\w+) uploaded' DIRECT_LINK_PATTERN = r']*>]*> Download with FileFactory Premium' - FILE_OFFLINE_PATTERN = r'

File Removed

|This file is no longer available' + OFFLINE_PATTERN = r'

File Removed

|This file is no longer available' PREMIUM_ONLY_PATTERN = r'>Premium Account Required<' SH_COOKIES = [('.filefactory.com', 'locale', 'en_US.utf8')] -- 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/FilefactoryCom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/FilefactoryCom.py') diff --git a/module/plugins/hoster/FilefactoryCom.py b/module/plugins/hoster/FilefactoryCom.py index d6a15b0ea..bcef5a5db 100644 --- a/module/plugins/hoster/FilefactoryCom.py +++ b/module/plugins/hoster/FilefactoryCom.py @@ -41,7 +41,7 @@ class FilefactoryCom(SimpleHoster): __author_mail__ = "l.stickell@yahoo.it" FILE_INFO_PATTERN = r'
]*>\s*

(?P[^<]+)

\s*
\s*(?P[\d.]+) (?P\w+) uploaded' - DIRECT_LINK_PATTERN = r']*>]*> Download with FileFactory Premium' + LINK_PATTERN = r']*>]*> Download with FileFactory Premium' OFFLINE_PATTERN = r'

File Removed

|This file is no longer available' PREMIUM_ONLY_PATTERN = r'>Premium Account Required<' SH_COOKIES = [('.filefactory.com', 'locale', 'en_US.utf8')] @@ -106,7 +106,7 @@ class FilefactoryCom(SimpleHoster): else: self.logInfo('You could enable "Direct Downloads" on http://filefactory.com/account/') html = self.load(self.pyfile.url) - found = re.search(self.DIRECT_LINK_PATTERN, html) + found = re.search(self.LINK_PATTERN, html) if found: url = found.group(1) else: -- 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/FilefactoryCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/FilefactoryCom.py') diff --git a/module/plugins/hoster/FilefactoryCom.py b/module/plugins/hoster/FilefactoryCom.py index bcef5a5db..0874e1410 100644 --- a/module/plugins/hoster/FilefactoryCom.py +++ b/module/plugins/hoster/FilefactoryCom.py @@ -66,7 +66,7 @@ class FilefactoryCom(SimpleHoster): else: # This section could be completely useless now # Load the page that contains the direct link url = re.search(r"document\.location\.host \+\s*'(.+)';", self.html) - if not url: + if url is None: self.parseError('Unable to detect free link') url = 'http://www.filefactory.com' + url.group(1) self.html = self.load(url, decode=True) -- cgit v1.2.3 From a9f81c043c62abcb3ce38971237693736833fdbe Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 20 Jul 2014 03:28:23 +0200 Subject: Fix hosters SH_COOKIES syntax --- module/plugins/hoster/FilefactoryCom.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'module/plugins/hoster/FilefactoryCom.py') diff --git a/module/plugins/hoster/FilefactoryCom.py b/module/plugins/hoster/FilefactoryCom.py index 0874e1410..013448b09 100644 --- a/module/plugins/hoster/FilefactoryCom.py +++ b/module/plugins/hoster/FilefactoryCom.py @@ -44,7 +44,9 @@ class FilefactoryCom(SimpleHoster): LINK_PATTERN = r']*>]*> Download with FileFactory Premium' OFFLINE_PATTERN = r'

File Removed

|This file is no longer available' PREMIUM_ONLY_PATTERN = r'>Premium Account Required<' - SH_COOKIES = [('.filefactory.com', 'locale', 'en_US.utf8')] + + SH_COOKIES = [(".filefactory.com", "locale", "en_US.utf8")] + def handleFree(self): self.html = self.load(self.pyfile.url, decode=True) -- 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/FilefactoryCom.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/hoster/FilefactoryCom.py') diff --git a/module/plugins/hoster/FilefactoryCom.py b/module/plugins/hoster/FilefactoryCom.py index 013448b09..98a97121c 100644 --- a/module/plugins/hoster/FilefactoryCom.py +++ b/module/plugins/hoster/FilefactoryCom.py @@ -108,9 +108,9 @@ class FilefactoryCom(SimpleHoster): else: self.logInfo('You could enable "Direct Downloads" on http://filefactory.com/account/') html = self.load(self.pyfile.url) - found = re.search(self.LINK_PATTERN, html) - if found: - url = found.group(1) + m = re.search(self.LINK_PATTERN, html) + if m: + url = m.group(1) else: self.parseError('Unable to detect premium direct link') -- 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/FilefactoryCom.py | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) (limited to 'module/plugins/hoster/FilefactoryCom.py') diff --git a/module/plugins/hoster/FilefactoryCom.py b/module/plugins/hoster/FilefactoryCom.py index 98a97121c..1ac7550fc 100644 --- a/module/plugins/hoster/FilefactoryCom.py +++ b/module/plugins/hoster/FilefactoryCom.py @@ -1,23 +1,9 @@ # -*- 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, parseFileInfo from module.network.RequestFactory import getURL +from module.plugins.internal.SimpleHoster import SimpleHoster, parseFileInfo def getInfo(urls): @@ -34,8 +20,10 @@ def getInfo(urls): class FilefactoryCom(SimpleHoster): __name__ = "FilefactoryCom" __type__ = "hoster" - __pattern__ = r'https?://(?:www\.)?filefactory\.com/file/(?P[a-zA-Z0-9]+)' __version__ = "0.50" + + __pattern__ = r'https?://(?:www\.)?filefactory\.com/file/(?P[a-zA-Z0-9]+)' + __description__ = """Filefactory.com hoster plugin""" __author_name__ = "stickell" __author_mail__ = "l.stickell@yahoo.it" -- 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/FilefactoryCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/FilefactoryCom.py') diff --git a/module/plugins/hoster/FilefactoryCom.py b/module/plugins/hoster/FilefactoryCom.py index 1ac7550fc..627e4dee9 100644 --- a/module/plugins/hoster/FilefactoryCom.py +++ b/module/plugins/hoster/FilefactoryCom.py @@ -33,7 +33,7 @@ class FilefactoryCom(SimpleHoster): OFFLINE_PATTERN = r'

File Removed

|This file is no longer available' PREMIUM_ONLY_PATTERN = r'>Premium Account Required<' - SH_COOKIES = [(".filefactory.com", "locale", "en_US.utf8")] + COOKIES = [(".filefactory.com", "locale", "en_US.utf8")] def handleFree(self): -- cgit v1.2.3 From 0d220d634e512d89bda540f91c643b361c82ea8a Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 27 Sep 2014 01:38:32 +0200 Subject: Logging string cosmetics --- module/plugins/hoster/FilefactoryCom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/FilefactoryCom.py') diff --git a/module/plugins/hoster/FilefactoryCom.py b/module/plugins/hoster/FilefactoryCom.py index 627e4dee9..eb0c497a5 100644 --- a/module/plugins/hoster/FilefactoryCom.py +++ b/module/plugins/hoster/FilefactoryCom.py @@ -73,7 +73,7 @@ class FilefactoryCom(SimpleHoster): self.parseError('Unable to detect free direct link') direct = direct.group(1) - self.logDebug('DIRECT LINK: ' + direct) + self.logDebug("DIRECT LINK: " + direct) self.download(direct, disposition=True) check = self.checkDownload({"multiple": "You are currently downloading too many files at once.", @@ -102,5 +102,5 @@ class FilefactoryCom(SimpleHoster): else: self.parseError('Unable to detect premium direct link') - self.logDebug('DIRECT PREMIUM LINK: ' + url) + self.logDebug("DIRECT PREMIUM LINK: " + url) self.download(url, disposition=True) -- 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/FilefactoryCom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/FilefactoryCom.py') diff --git a/module/plugins/hoster/FilefactoryCom.py b/module/plugins/hoster/FilefactoryCom.py index eb0c497a5..9cddd4eef 100644 --- a/module/plugins/hoster/FilefactoryCom.py +++ b/module/plugins/hoster/FilefactoryCom.py @@ -25,8 +25,8 @@ class FilefactoryCom(SimpleHoster): __pattern__ = r'https?://(?:www\.)?filefactory\.com/file/(?P[a-zA-Z0-9]+)' __description__ = """Filefactory.com hoster plugin""" - __author_name__ = "stickell" - __author_mail__ = "l.stickell@yahoo.it" + __authors__ = [("stickell", "l.stickell@yahoo.it")] + FILE_INFO_PATTERN = r'
]*>\s*

(?P[^<]+)

\s*
\s*(?P[\d.]+) (?P\w+) uploaded' LINK_PATTERN = r']*>]*> Download with FileFactory Premium' -- 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/FilefactoryCom.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/hoster/FilefactoryCom.py') diff --git a/module/plugins/hoster/FilefactoryCom.py b/module/plugins/hoster/FilefactoryCom.py index 9cddd4eef..a9fbdaff1 100644 --- a/module/plugins/hoster/FilefactoryCom.py +++ b/module/plugins/hoster/FilefactoryCom.py @@ -25,6 +25,7 @@ class FilefactoryCom(SimpleHoster): __pattern__ = r'https?://(?:www\.)?filefactory\.com/file/(?P[a-zA-Z0-9]+)' __description__ = """Filefactory.com hoster plugin""" + __license__ = "GPLv3" __authors__ = [("stickell", "l.stickell@yahoo.it")] -- cgit v1.2.3 From f76e5c2336718dca9da8033ba22cd83c72c7b3b3 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 11 Oct 2014 15:14:28 +0200 Subject: Pattern update 1 --- module/plugins/hoster/FilefactoryCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/FilefactoryCom.py') diff --git a/module/plugins/hoster/FilefactoryCom.py b/module/plugins/hoster/FilefactoryCom.py index a9fbdaff1..878d18d0a 100644 --- a/module/plugins/hoster/FilefactoryCom.py +++ b/module/plugins/hoster/FilefactoryCom.py @@ -22,7 +22,7 @@ class FilefactoryCom(SimpleHoster): __type__ = "hoster" __version__ = "0.50" - __pattern__ = r'https?://(?:www\.)?filefactory\.com/file/(?P[a-zA-Z0-9]+)' + __pattern__ = r'https?://(?:www\.)?filefactory\.com/file/(?P\w+)' __description__ = """Filefactory.com hoster plugin""" __license__ = "GPLv3" -- cgit v1.2.3 From c5d1a4fd8943877c6d2eb3843e0de725dba5191e Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 11 Oct 2014 15:09:53 +0200 Subject: Pattern update 2 --- module/plugins/hoster/FilefactoryCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/FilefactoryCom.py') diff --git a/module/plugins/hoster/FilefactoryCom.py b/module/plugins/hoster/FilefactoryCom.py index 878d18d0a..15f44ad61 100644 --- a/module/plugins/hoster/FilefactoryCom.py +++ b/module/plugins/hoster/FilefactoryCom.py @@ -29,7 +29,7 @@ class FilefactoryCom(SimpleHoster): __authors__ = [("stickell", "l.stickell@yahoo.it")] - FILE_INFO_PATTERN = r'
]*>\s*

(?P[^<]+)

\s*
\s*(?P[\d.]+) (?P\w+) uploaded' + FILE_INFO_PATTERN = r'
]*>\s*

(?P[^<]+)

\s*
\s*(?P[\d.,]+) (?P\w+) uploaded' LINK_PATTERN = r']*>]*> Download with FileFactory Premium' OFFLINE_PATTERN = r'

File Removed

|This file is no longer available' PREMIUM_ONLY_PATTERN = r'>Premium Account Required<' -- cgit v1.2.3 From 388a2f6478d42e423f1f8442d8539983f3762f22 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 14 Oct 2014 13:38:49 +0200 Subject: Improve unit detection in size pattern --- module/plugins/hoster/FilefactoryCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/FilefactoryCom.py') diff --git a/module/plugins/hoster/FilefactoryCom.py b/module/plugins/hoster/FilefactoryCom.py index 15f44ad61..8d231e350 100644 --- a/module/plugins/hoster/FilefactoryCom.py +++ b/module/plugins/hoster/FilefactoryCom.py @@ -29,7 +29,7 @@ class FilefactoryCom(SimpleHoster): __authors__ = [("stickell", "l.stickell@yahoo.it")] - FILE_INFO_PATTERN = r'
]*>\s*

(?P[^<]+)

\s*
\s*(?P[\d.,]+) (?P\w+) uploaded' + FILE_INFO_PATTERN = r'
]*>\s*

(?P[^<]+)

\s*
\s*(?P[\d.,]+) (?P[\w^_]+) uploaded' LINK_PATTERN = r']*>]*> Download with FileFactory Premium' OFFLINE_PATTERN = r'

File Removed

|This file is no longer available' PREMIUM_ONLY_PATTERN = r'>Premium Account Required<' -- cgit v1.2.3 From 2ae91b81a2f12a1c9b1f78524df78a2b3f1ef494 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 19 Oct 2014 14:52:42 +0200 Subject: Update hosters to self.error --- module/plugins/hoster/FilefactoryCom.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'module/plugins/hoster/FilefactoryCom.py') diff --git a/module/plugins/hoster/FilefactoryCom.py b/module/plugins/hoster/FilefactoryCom.py index 8d231e350..0e422f108 100644 --- a/module/plugins/hoster/FilefactoryCom.py +++ b/module/plugins/hoster/FilefactoryCom.py @@ -20,7 +20,7 @@ def getInfo(urls): class FilefactoryCom(SimpleHoster): __name__ = "FilefactoryCom" __type__ = "hoster" - __version__ = "0.50" + __version__ = "0.51" __pattern__ = r'https?://(?:www\.)?filefactory\.com/file/(?P\w+)' @@ -58,20 +58,20 @@ class FilefactoryCom(SimpleHoster): # Load the page that contains the direct link url = re.search(r"document\.location\.host \+\s*'(.+)';", self.html) if url is None: - self.parseError('Unable to detect free link') + self.error('Unable to detect free link') url = 'http://www.filefactory.com' + url.group(1) self.html = self.load(url, decode=True) # Free downloads wait time waittime = re.search(r'id="startWait" value="(\d+)"', self.html) if not waittime: - self.parseError('Unable to detect wait time') + self.error('Unable to detect wait time') self.wait(int(waittime.group(1))) # Parse the direct link and download it direct = re.search(r'data-href(?:-direct)?="(.*)" class="button', self.html) if not direct: - self.parseError('Unable to detect free direct link') + self.error('Unable to detect free direct link') direct = direct.group(1) self.logDebug("DIRECT LINK: " + direct) @@ -101,7 +101,7 @@ class FilefactoryCom(SimpleHoster): if m: url = m.group(1) else: - self.parseError('Unable to detect premium direct link') + self.error('Unable to detect premium direct link') self.logDebug("DIRECT PREMIUM LINK: " + url) self.download(url, disposition=True) -- cgit v1.2.3 From 1b096b2eb2634e8dea80b06ab9ecde206b198b35 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 22 Oct 2014 19:47:00 +0200 Subject: Spare code cosmetics --- module/plugins/hoster/FilefactoryCom.py | 1 - 1 file changed, 1 deletion(-) (limited to 'module/plugins/hoster/FilefactoryCom.py') diff --git a/module/plugins/hoster/FilefactoryCom.py b/module/plugins/hoster/FilefactoryCom.py index 0e422f108..a5942e261 100644 --- a/module/plugins/hoster/FilefactoryCom.py +++ b/module/plugins/hoster/FilefactoryCom.py @@ -38,7 +38,6 @@ class FilefactoryCom(SimpleHoster): def handleFree(self): - self.html = self.load(self.pyfile.url, decode=True) if "Currently only Premium Members can download files larger than" in self.html: self.fail("File too large for free download") elif "All free download slots on this server are currently in use" in self.html: -- 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/FilefactoryCom.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/hoster/FilefactoryCom.py') diff --git a/module/plugins/hoster/FilefactoryCom.py b/module/plugins/hoster/FilefactoryCom.py index a5942e261..0801ca9a1 100644 --- a/module/plugins/hoster/FilefactoryCom.py +++ b/module/plugins/hoster/FilefactoryCom.py @@ -85,6 +85,7 @@ class FilefactoryCom(SimpleHoster): elif check == "error": self.fail("Unknown error") + def handlePremium(self): header = self.load(self.pyfile.url, just_header=True) if 'location' in header: -- cgit v1.2.3 From 0a353e2f754370e70276bc0f3bad66deb2015607 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Thu, 23 Oct 2014 15:47:27 +0200 Subject: [FilefactoryCom] Fix handleFree --- module/plugins/hoster/FilefactoryCom.py | 75 +++++++++++++-------------------- 1 file changed, 30 insertions(+), 45 deletions(-) (limited to 'module/plugins/hoster/FilefactoryCom.py') diff --git a/module/plugins/hoster/FilefactoryCom.py b/module/plugins/hoster/FilefactoryCom.py index 0801ca9a1..dcb2fd8f0 100644 --- a/module/plugins/hoster/FilefactoryCom.py +++ b/module/plugins/hoster/FilefactoryCom.py @@ -2,6 +2,8 @@ import re +from urlparse import urljoin + from module.network.RequestFactory import getURL from module.plugins.internal.SimpleHoster import SimpleHoster, parseFileInfo @@ -10,9 +12,9 @@ def getInfo(urls): for url in urls: h = getURL(url, just_header=True) m = re.search(r'Location: (.+)\r\n', h) - if m and not re.match(m.group(1), FilefactoryCom.__pattern__): # It's a direct link! Skipping + if m and not re.match(m.group(1), FilefactoryCom.__pattern__): #: It's a direct link! Skipping yield (url, 0, 3, url) - else: # It's a standard html page + else: #: It's a standard html page file_info = parseFileInfo(FilefactoryCom, url, getURL(url)) yield file_info @@ -20,19 +22,23 @@ def getInfo(urls): class FilefactoryCom(SimpleHoster): __name__ = "FilefactoryCom" __type__ = "hoster" - __version__ = "0.51" + __version__ = "0.52" - __pattern__ = r'https?://(?:www\.)?filefactory\.com/file/(?P\w+)' + __pattern__ = r'https?://(?:www\.)?filefactory\.com/(file|trafficshare/\w+)/\w+' __description__ = """Filefactory.com hoster plugin""" __license__ = "GPLv3" - __authors__ = [("stickell", "l.stickell@yahoo.it")] + __authors__ = [("stickell", "l.stickell@yahoo.it"), + ("Walter Purcaro", "vuolter@gmail.com")] FILE_INFO_PATTERN = r'
]*>\s*

(?P[^<]+)

\s*
\s*(?P[\d.,]+) (?P[\w^_]+) uploaded' - LINK_PATTERN = r']*>]*> Download with FileFactory Premium' OFFLINE_PATTERN = r'

File Removed

|This file is no longer available' - PREMIUM_ONLY_PATTERN = r'>Premium Account Required<' + + LINK_PATTERN = r'"([^"]+filefactory\.com/get.+?)"' + + WAIT_PATTERN = r'
' + PREMIUM_ONLY_PATTERN = r'>Premium Account Required' COOKIES = [(".filefactory.com", "locale", "en_US.utf8")] @@ -43,55 +49,35 @@ class FilefactoryCom(SimpleHoster): elif "All free download slots on this server are currently in use" in self.html: self.retry(50, 15 * 60, "All free slots are busy") - m = re.search(r'data-href(?:-direct)?="(http://[^"]+)"', self.html) + m = re.search(self.LINK_PATTERN, self.html) + if m is None: + self.error("Free download link not found") + + dl_link = m.group(1) + + m = re.search(self.WAIT_PATTERN, self.html) if m: - t = re.search(r'
', self.html) - if t: - t = t.group(1) - else: - self.logDebug("Unable to detect countdown duration. Guessing 60 seconds") - t = 60 - self.wait(t) - direct = m.group(1) - else: # This section could be completely useless now - # Load the page that contains the direct link - url = re.search(r"document\.location\.host \+\s*'(.+)';", self.html) - if url is None: - self.error('Unable to detect free link') - url = 'http://www.filefactory.com' + url.group(1) - self.html = self.load(url, decode=True) - - # Free downloads wait time - waittime = re.search(r'id="startWait" value="(\d+)"', self.html) - if not waittime: - self.error('Unable to detect wait time') - self.wait(int(waittime.group(1))) - - # Parse the direct link and download it - direct = re.search(r'data-href(?:-direct)?="(.*)" class="button', self.html) - if not direct: - self.error('Unable to detect free direct link') - direct = direct.group(1) - - self.logDebug("DIRECT LINK: " + direct) - self.download(direct, disposition=True) - - check = self.checkDownload({"multiple": "You are currently downloading too many files at once.", - "error": '
'}) + self.wait(m.group(1)) + + self.download(dl_link, disposition=True) + + check = self.checkDownload({'multiple': "You are currently downloading too many files at once.", + 'error': '
'}) if check == "multiple": self.logDebug("Parallel downloads detected; waiting 15 minutes") self.retry(wait_time=15 * 60, reason="Parallel downloads") elif check == "error": - self.fail("Unknown error") + self.error("Unknown error") def handlePremium(self): header = self.load(self.pyfile.url, just_header=True) + if 'location' in header: url = header['location'].strip() if not url.startswith("http://"): - url = "http://www.filefactory.com" + url + url = urljoin("http://www.filefactory.com", url) elif 'content-disposition' in header: url = self.pyfile.url else: @@ -101,7 +87,6 @@ class FilefactoryCom(SimpleHoster): if m: url = m.group(1) else: - self.error('Unable to detect premium direct link') + self.error("Premium download link not found") - self.logDebug("DIRECT PREMIUM LINK: " + url) self.download(url, disposition=True) -- 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/FilefactoryCom.py | 1 - 1 file changed, 1 deletion(-) (limited to 'module/plugins/hoster/FilefactoryCom.py') diff --git a/module/plugins/hoster/FilefactoryCom.py b/module/plugins/hoster/FilefactoryCom.py index dcb2fd8f0..f4729cf2f 100644 --- a/module/plugins/hoster/FilefactoryCom.py +++ b/module/plugins/hoster/FilefactoryCom.py @@ -81,7 +81,6 @@ class FilefactoryCom(SimpleHoster): elif 'content-disposition' in header: url = self.pyfile.url else: - self.logInfo('You could enable "Direct Downloads" on http://filefactory.com/account/') html = self.load(self.pyfile.url) m = re.search(self.LINK_PATTERN, html) if m: -- 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/FilefactoryCom.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins/hoster/FilefactoryCom.py') diff --git a/module/plugins/hoster/FilefactoryCom.py b/module/plugins/hoster/FilefactoryCom.py index f4729cf2f..068724488 100644 --- a/module/plugins/hoster/FilefactoryCom.py +++ b/module/plugins/hoster/FilefactoryCom.py @@ -45,13 +45,13 @@ class FilefactoryCom(SimpleHoster): def handleFree(self): if "Currently only Premium Members can download files larger than" in self.html: - self.fail("File too large for free download") + self.fail(_("File too large for free download")) elif "All free download slots on this server are currently in use" in self.html: self.retry(50, 15 * 60, "All free slots are busy") m = re.search(self.LINK_PATTERN, self.html) if m is None: - self.error("Free download link not found") + self.error(_("Free download link not found")) dl_link = m.group(1) @@ -68,7 +68,7 @@ class FilefactoryCom(SimpleHoster): self.logDebug("Parallel downloads detected; waiting 15 minutes") self.retry(wait_time=15 * 60, reason="Parallel downloads") elif check == "error": - self.error("Unknown error") + self.error(_("Unknown error")) def handlePremium(self): @@ -86,6 +86,6 @@ class FilefactoryCom(SimpleHoster): if m: url = m.group(1) else: - self.error("Premium download link not found") + self.error(_("Premium download link not found")) self.download(url, disposition=True) -- cgit v1.2.3 From 146fe1e309c33ab149bfaf58ad86c0dd4fb9b156 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 27 Oct 2014 01:18:45 +0100 Subject: Spare code cosmetics --- module/plugins/hoster/FilefactoryCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/FilefactoryCom.py') diff --git a/module/plugins/hoster/FilefactoryCom.py b/module/plugins/hoster/FilefactoryCom.py index 068724488..c2d18160a 100644 --- a/module/plugins/hoster/FilefactoryCom.py +++ b/module/plugins/hoster/FilefactoryCom.py @@ -66,7 +66,7 @@ class FilefactoryCom(SimpleHoster): if check == "multiple": self.logDebug("Parallel downloads detected; waiting 15 minutes") - self.retry(wait_time=15 * 60, reason="Parallel downloads") + self.retry(wait_time=15 * 60, reason=_("Parallel downloads")) elif check == "error": self.error(_("Unknown error")) -- cgit v1.2.3 From 8b3589dd394d81177bf4680dddb5bdb9506b89ea Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 28 Oct 2014 16:04:10 +0100 Subject: Update plugins to last changes --- module/plugins/hoster/FilefactoryCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/FilefactoryCom.py') diff --git a/module/plugins/hoster/FilefactoryCom.py b/module/plugins/hoster/FilefactoryCom.py index c2d18160a..f35108cff 100644 --- a/module/plugins/hoster/FilefactoryCom.py +++ b/module/plugins/hoster/FilefactoryCom.py @@ -47,7 +47,7 @@ class FilefactoryCom(SimpleHoster): if "Currently only Premium Members can download files larger than" in self.html: self.fail(_("File too large for free download")) elif "All free download slots on this server are currently in use" in self.html: - self.retry(50, 15 * 60, "All free slots are busy") + self.retry(50, 15 * 60, _("All free slots are busy")) m = re.search(self.LINK_PATTERN, self.html) if m is None: -- 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/FilefactoryCom.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'module/plugins/hoster/FilefactoryCom.py') diff --git a/module/plugins/hoster/FilefactoryCom.py b/module/plugins/hoster/FilefactoryCom.py index f35108cff..cca78061c 100644 --- a/module/plugins/hoster/FilefactoryCom.py +++ b/module/plugins/hoster/FilefactoryCom.py @@ -20,16 +20,16 @@ def getInfo(urls): class FilefactoryCom(SimpleHoster): - __name__ = "FilefactoryCom" - __type__ = "hoster" + __name__ = "FilefactoryCom" + __type__ = "hoster" __version__ = "0.52" __pattern__ = r'https?://(?:www\.)?filefactory\.com/(file|trafficshare/\w+)/\w+' __description__ = """Filefactory.com hoster plugin""" - __license__ = "GPLv3" - __authors__ = [("stickell", "l.stickell@yahoo.it"), - ("Walter Purcaro", "vuolter@gmail.com")] + __license__ = "GPLv3" + __authors__ = [("stickell", "l.stickell@yahoo.it"), + ("Walter Purcaro", "vuolter@gmail.com")] FILE_INFO_PATTERN = r'
]*>\s*

(?P[^<]+)

\s*
\s*(?P[\d.,]+) (?P[\w^_]+) uploaded' -- cgit v1.2.3 From 772e47ef806d18fd209e910be0535bce7c07dc7b Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 2 Nov 2014 22:47:07 +0100 Subject: Update all other plugins --- module/plugins/hoster/FilefactoryCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/FilefactoryCom.py') diff --git a/module/plugins/hoster/FilefactoryCom.py b/module/plugins/hoster/FilefactoryCom.py index cca78061c..b31500b0e 100644 --- a/module/plugins/hoster/FilefactoryCom.py +++ b/module/plugins/hoster/FilefactoryCom.py @@ -32,7 +32,7 @@ class FilefactoryCom(SimpleHoster): ("Walter Purcaro", "vuolter@gmail.com")] - FILE_INFO_PATTERN = r'
]*>\s*

(?P[^<]+)

\s*
\s*(?P[\d.,]+) (?P[\w^_]+) uploaded' + INFO_PATTERN = r'
]*>\s*

(?P[^<]+)

\s*
\s*(?P[\d.,]+) (?P[\w^_]+) uploaded' OFFLINE_PATTERN = r'

File Removed

|This file is no longer available' LINK_PATTERN = r'"([^"]+filefactory\.com/get.+?)"' -- cgit v1.2.3 From 03f3b86f500c495932fd118b54569d92f700847c Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 3 Nov 2014 16:57:55 +0100 Subject: Code cosmetics about file_info and other stuff --- module/plugins/hoster/FilefactoryCom.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'module/plugins/hoster/FilefactoryCom.py') diff --git a/module/plugins/hoster/FilefactoryCom.py b/module/plugins/hoster/FilefactoryCom.py index b31500b0e..7691a1d00 100644 --- a/module/plugins/hoster/FilefactoryCom.py +++ b/module/plugins/hoster/FilefactoryCom.py @@ -15,8 +15,7 @@ def getInfo(urls): if m and not re.match(m.group(1), FilefactoryCom.__pattern__): #: It's a direct link! Skipping yield (url, 0, 3, url) else: #: It's a standard html page - file_info = parseFileInfo(FilefactoryCom, url, getURL(url)) - yield file_info + yield parseFileInfo(FilefactoryCom, url, getURL(url)) class FilefactoryCom(SimpleHoster): -- 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/FilefactoryCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/FilefactoryCom.py') diff --git a/module/plugins/hoster/FilefactoryCom.py b/module/plugins/hoster/FilefactoryCom.py index 7691a1d00..349875f75 100644 --- a/module/plugins/hoster/FilefactoryCom.py +++ b/module/plugins/hoster/FilefactoryCom.py @@ -39,7 +39,7 @@ class FilefactoryCom(SimpleHoster): WAIT_PATTERN = r'
' PREMIUM_ONLY_PATTERN = r'>Premium Account Required' - COOKIES = [(".filefactory.com", "locale", "en_US.utf8")] + COOKIES = [("filefactory.com", "locale", "en_US.utf8")] def handleFree(self): -- cgit v1.2.3 From be05dce2da77bca4613efbdfb0f6357a983e6e1c Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 3 Dec 2014 14:38:22 +0100 Subject: Fix https://github.com/pyload/pyload/issues/943 --- module/plugins/hoster/FilefactoryCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/FilefactoryCom.py') diff --git a/module/plugins/hoster/FilefactoryCom.py b/module/plugins/hoster/FilefactoryCom.py index 349875f75..ada498a51 100644 --- a/module/plugins/hoster/FilefactoryCom.py +++ b/module/plugins/hoster/FilefactoryCom.py @@ -56,7 +56,7 @@ class FilefactoryCom(SimpleHoster): m = re.search(self.WAIT_PATTERN, self.html) if m: - self.wait(m.group(1)) + self.wait(int(m.group(1))) self.download(dl_link, disposition=True) -- cgit v1.2.3