From fc36aa1a426fb8c75897debdc6cb4104dbff8200 Mon Sep 17 00:00:00 2001 From: GammaC0de Date: Sat, 2 May 2015 22:36:02 +0300 Subject: [AntiVirus] report missing send2trash --- module/plugins/hooks/AntiVirus.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/module/plugins/hooks/AntiVirus.py b/module/plugins/hooks/AntiVirus.py index ac9373a37..69dffbe73 100644 --- a/module/plugins/hooks/AntiVirus.py +++ b/module/plugins/hooks/AntiVirus.py @@ -16,7 +16,7 @@ from module.utils import fs_encode, save_join class AntiVirus(Hook): __name__ = "AntiVirus" __type__ = "hook" - __version__ = "0.08" + __version__ = "0.09" #@TODO: add trash option (use Send2Trash lib) __config__ = [("action" , "Antivirus default;Delete;Quarantine", "Manage infected files" , "Antivirus default"), @@ -80,8 +80,13 @@ class AntiVirus(Hook): try: send2trash.send2trash(file) - except Exception: - self.logWarning(_("Unable to move file to trash, move to quarantine instead")) + except NameError: + self.logWarning(_("Send2Trash lib not found, moving to quarantine instead")) + pyfile.setCustomStatus(_("file moving")) + shutil.move(file, self.getConfig('quardir')) + + except Exception: + self.logWarning(_("Unable to move file to trash, moving to quarantine instead")) pyfile.setCustomStatus(_("file moving")) shutil.move(file, self.getConfig('quardir')) -- cgit v1.2.3 From dec360bee84f046bf40612173ec4e74aebd60599 Mon Sep 17 00:00:00 2001 From: GammaC0de Date: Sat, 2 May 2015 22:40:55 +0300 Subject: [ExtractArchive] report missing send2trash --- module/plugins/hooks/ExtractArchive.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py index 05a1e368a..609d0ad62 100644 --- a/module/plugins/hooks/ExtractArchive.py +++ b/module/plugins/hooks/ExtractArchive.py @@ -110,7 +110,7 @@ class ArchiveQueue(object): class ExtractArchive(Hook): __name__ = "ExtractArchive" __type__ = "hook" - __version__ = "1.42" + __version__ = "1.43" __config__ = [("activated" , "bool" , "Activated" , True ), ("fullpath" , "bool" , "Extract with full paths" , True ), @@ -472,6 +472,9 @@ class ExtractArchive(Hook): try: send2trash.send2trash(file) + except NameError: + self.logWarning(_("Unable to move %s to trash: Send2Trash lib not found") % os.path.basename(f)) + except Exception: self.logWarning(_("Unable to move %s to trash") % os.path.basename(f)) -- cgit v1.2.3 From 11b355093b8a1f73718d36fd043042abbfdcc0d3 Mon Sep 17 00:00:00 2001 From: GammaC0de Date: Sun, 3 May 2015 16:13:28 +0300 Subject: new hoster SizedriveCom --- module/plugins/hoster/SizedriveCom.py | 42 +++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 module/plugins/hoster/SizedriveCom.py diff --git a/module/plugins/hoster/SizedriveCom.py b/module/plugins/hoster/SizedriveCom.py new file mode 100644 index 000000000..13a29eb99 --- /dev/null +++ b/module/plugins/hoster/SizedriveCom.py @@ -0,0 +1,42 @@ +# -*- coding: utf-8 -*- + +import re + +from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo + + +class SizedriveCom(SimpleHoster): + __name__ = "SizedriveCom" + __type__ = "hoster" + __version__ = "0.01" + + __pattern__ = r'http://(?:www\.)?sizedrive\.com/[rd]/(?P\w+)' + + __description__ = """Sizedrive.com hoster plugin""" + __license__ = "GPLv3" + __authors__ = [("GammaC0de", None)] + + + OFFLINE_PATTERN = r'ARQUIVO DELATADO POR' + NAME_PATTERN = r'Nome: (?P.+)<' + SIZE_PATTERN = r'Tamanho:(?P[\d.,]+) (?P[\w^_]+)' + + def setup(self): + self.resumeDownload = False + self.multiDL = False + self.chunkLimit = 1 + + + def handleFree(self, pyfile): + self.wait(5) + self.html = self.load("http://www.sizedrive.com/getdownload.php", + post={'id': self.info['pattern']['ID']}) + + m = re.search(r' Date: Mon, 4 May 2015 01:33:47 +0300 Subject: more verbose --- module/plugins/hooks/ExtractArchive.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py index 609d0ad62..d0a84364a 100644 --- a/module/plugins/hooks/ExtractArchive.py +++ b/module/plugins/hooks/ExtractArchive.py @@ -475,8 +475,8 @@ class ExtractArchive(Hook): except NameError: self.logWarning(_("Unable to move %s to trash: Send2Trash lib not found") % os.path.basename(f)) - except Exception: - self.logWarning(_("Unable to move %s to trash") % os.path.basename(f)) + except Exception, e: + self.logWarning(_("Unable to move %s to trash: %s") % (os.path.basename(f), e.message)) self.logInfo(name, _("Extracting finished")) extracted_files = archive.files or archive.list() -- cgit v1.2.3 From dc7c81b6ab0813745ee03116c27f870138b3fc7f Mon Sep 17 00:00:00 2001 From: GammaC0de Date: Mon, 4 May 2015 01:36:23 +0300 Subject: more verbose --- module/plugins/hooks/AntiVirus.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/plugins/hooks/AntiVirus.py b/module/plugins/hooks/AntiVirus.py index 69dffbe73..6823729af 100644 --- a/module/plugins/hooks/AntiVirus.py +++ b/module/plugins/hooks/AntiVirus.py @@ -85,8 +85,8 @@ class AntiVirus(Hook): pyfile.setCustomStatus(_("file moving")) shutil.move(file, self.getConfig('quardir')) - except Exception: - self.logWarning(_("Unable to move file to trash, moving to quarantine instead")) + except Exception, e: + self.logWarning(_("Unable to move file to trash: %s, moving to quarantine instead") % e.message) pyfile.setCustomStatus(_("file moving")) shutil.move(file, self.getConfig('quardir')) -- cgit v1.2.3 From e26ba64714e84745db1f6dfc73ccc8c68ad4abcc Mon Sep 17 00:00:00 2001 From: GammaC0de Date: Mon, 4 May 2015 02:22:06 +0300 Subject: even more --- module/plugins/hooks/ExtractArchive.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py index d0a84364a..5b90b28fc 100644 --- a/module/plugins/hooks/ExtractArchive.py +++ b/module/plugins/hooks/ExtractArchive.py @@ -478,6 +478,9 @@ class ExtractArchive(Hook): except Exception, e: self.logWarning(_("Unable to move %s to trash: %s") % (os.path.basename(f), e.message)) + else: + self.logDebug(_("Successfully moved %s to trash") % os.path.basename(f)) + self.logInfo(name, _("Extracting finished")) extracted_files = archive.files or archive.list() -- cgit v1.2.3 From ee360021434803991226d1cc36e7221fb9cbc418 Mon Sep 17 00:00:00 2001 From: GammaC0de Date: Mon, 4 May 2015 02:24:23 +0300 Subject: even more --- module/plugins/hooks/AntiVirus.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/module/plugins/hooks/AntiVirus.py b/module/plugins/hooks/AntiVirus.py index 6823729af..c620f556d 100644 --- a/module/plugins/hooks/AntiVirus.py +++ b/module/plugins/hooks/AntiVirus.py @@ -85,11 +85,14 @@ class AntiVirus(Hook): pyfile.setCustomStatus(_("file moving")) shutil.move(file, self.getConfig('quardir')) - except Exception, e: + except Exception, e: self.logWarning(_("Unable to move file to trash: %s, moving to quarantine instead") % e.message) pyfile.setCustomStatus(_("file moving")) shutil.move(file, self.getConfig('quardir')) + else: + self.logDebug(_("Successfully moved file to trash")) + elif action == "Quarantine": pyfile.setCustomStatus(_("file moving")) shutil.move(file, self.getConfig('quardir')) -- cgit v1.2.3 From 55717d96c0ef590f9c224741415447b8adb12f95 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 4 May 2015 21:30:39 +0200 Subject: [SizedriveCom] Cleanup --- module/plugins/hoster/SizedriveCom.py | 7 +++---- module/plugins/hoster/ZippyshareCom.py | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/module/plugins/hoster/SizedriveCom.py b/module/plugins/hoster/SizedriveCom.py index 13a29eb99..3b9748fb6 100644 --- a/module/plugins/hoster/SizedriveCom.py +++ b/module/plugins/hoster/SizedriveCom.py @@ -17,9 +17,10 @@ class SizedriveCom(SimpleHoster): __authors__ = [("GammaC0de", None)] + NAME_PATTERN = r'>Nome: (?P.+?)<' + SIZE_PATTERN = r'>Tamanho:(?P[\d.,]+) (?P[\w^_]+)' OFFLINE_PATTERN = r'ARQUIVO DELATADO POR' - NAME_PATTERN = r'Nome: (?P.+)<' - SIZE_PATTERN = r'Tamanho:(?P[\d.,]+) (?P[\w^_]+)' + def setup(self): self.resumeDownload = False @@ -35,8 +36,6 @@ class SizedriveCom(SimpleHoster): m = re.search(r' Date: Mon, 4 May 2015 21:31:34 +0200 Subject: [GoogledriveCom][OneFichierCom][UlozTo] Reset DISPOSITION to False --- module/plugins/hoster/GoogledriveCom.py | 4 +++- module/plugins/hoster/OneFichierCom.py | 10 +++++----- module/plugins/hoster/UlozTo.py | 3 ++- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/module/plugins/hoster/GoogledriveCom.py b/module/plugins/hoster/GoogledriveCom.py index 66f36e6c0..09c54a8da 100644 --- a/module/plugins/hoster/GoogledriveCom.py +++ b/module/plugins/hoster/GoogledriveCom.py @@ -12,7 +12,7 @@ from module.utils import html_unescape class GoogledriveCom(SimpleHoster): __name__ = "GoogledriveCom" __type__ = "hoster" - __version__ = "0.07" + __version__ = "0.08" __pattern__ = r'https?://(?:www\.)?drive\.google\.com/file/.+' __config__ = [("use_premium", "bool", "Use premium account if available", True)] @@ -22,6 +22,8 @@ class GoogledriveCom(SimpleHoster): __authors__ = [("zapp-brannigan", "fuerst.reinje@web.de")] + DISPOSITION = False #: Remove in 0.4.10 + NAME_PATTERN = r'"og:title" content="(?P.*?)">' OFFLINE_PATTERN = r'align="center">

\w+)\.)?(?P1fichier\.com|alterupload\.com|cjoint\.net|d(es)?fichiers\.com|dl4free\.com|megadl\.fr|mesfichiers\.org|piecejointe\.net|pjointe\.com|tenvoi\.com)(?:/\?(?P\w+))?' __config__ = [("use_premium", "bool", "Use premium account if available", True)] @@ -25,13 +25,13 @@ class OneFichierCom(SimpleHoster): ("Ludovic Lehmann", "ludo.lehmann@gmail.com")] - NAME_PATTERN = r'>FileName :\s*(?P.+?)<' - SIZE_PATTERN = r'>Size :\s*(?P[\d.,]+) (?P[\w^_]+)' + COOKIES = [("1fichier.com", "LG", "en")] + DISPOSITION = False #: Remove in 0.4.10 + NAME_PATTERN = r'>FileName :\s*(?P.+?)<' + SIZE_PATTERN = r'>Size :\s*(?P[\d.,]+) (?P[\w^_]+)' OFFLINE_PATTERN = r'File not found !\s*<' - COOKIES = [("1fichier.com", "LG", "en")] - WAIT_PATTERN = r'>You must wait \d+ minutes' diff --git a/module/plugins/hoster/UlozTo.py b/module/plugins/hoster/UlozTo.py index c48873387..b43ff8d92 100644 --- a/module/plugins/hoster/UlozTo.py +++ b/module/plugins/hoster/UlozTo.py @@ -15,7 +15,7 @@ def convertDecimalPrefix(m): class UlozTo(SimpleHoster): __name__ = "UlozTo" __type__ = "hoster" - __version__ = "1.08" + __version__ = "1.09" __pattern__ = r'http://(?:www\.)?(uloz\.to|ulozto\.(cz|sk|net)|bagruj\.cz|zachowajto\.pl)/(?:live/)?(?P\w+/[^/?]*)' __config__ = [("use_premium", "bool", "Use premium account if available", True)] @@ -34,6 +34,7 @@ class UlozTo(SimpleHoster): SIZE_REPLACEMENTS = [(r'([\d.]+)\s([kMG])B', convertDecimalPrefix)] CHECK_TRAFFIC = True + DISPOSITION = False #: Remove in 0.4.10 ADULT_PATTERN = r'

' PASSWD_PATTERN = r'
' -- cgit v1.2.3 From 8483aacbcd7f3f4c6ad92ef2255b449b88d64a35 Mon Sep 17 00:00:00 2001 From: GammaC0de Date: Tue, 5 May 2015 01:23:31 +0300 Subject: fix bug causing `extractQueued` called twice --- module/plugins/hooks/ExtractArchive.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py index 05a1e368a..62eb36714 100644 --- a/module/plugins/hooks/ExtractArchive.py +++ b/module/plugins/hooks/ExtractArchive.py @@ -187,6 +187,11 @@ class ExtractArchive(Hook): @threaded def extractQueued(self, thread): + if self.extracting: #@NOTE: doing the check here for safty (called by coreReady) + return + + self.extracting = True + packages = self.queue.get() while packages: if self.lastPackage: #: called from allDownloadsProcessed @@ -200,6 +205,8 @@ class ExtractArchive(Hook): packages = self.queue.get() #: check for packages added during extraction + self.extracting = False + @Expose def extractPackage(self, *ids): @@ -222,7 +229,7 @@ class ExtractArchive(Hook): def allDownloadsProcessed(self): self.lastPackage = True - if not self.extracting: + if self.getConfig('waitall') and not self.extracting: self.extractQueued() @@ -231,8 +238,6 @@ class ExtractArchive(Hook): if not ids: return False - self.extracting = True - processed = [] extracted = [] failed = [] @@ -374,7 +379,6 @@ class ExtractArchive(Hook): self.queue.remove(pid) - self.extracting = False return True if not failed else False -- cgit v1.2.3 From e3d3ad079d8af1806a475020aeb7e9fdc5a26600 Mon Sep 17 00:00:00 2001 From: GammaC0de Date: Tue, 5 May 2015 01:33:17 +0300 Subject: Update ExtractArchive.py --- module/plugins/hooks/ExtractArchive.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py index 62eb36714..bd8153a73 100644 --- a/module/plugins/hooks/ExtractArchive.py +++ b/module/plugins/hooks/ExtractArchive.py @@ -110,7 +110,7 @@ class ArchiveQueue(object): class ExtractArchive(Hook): __name__ = "ExtractArchive" __type__ = "hook" - __version__ = "1.42" + __version__ = "1.43" __config__ = [("activated" , "bool" , "Activated" , True ), ("fullpath" , "bool" , "Extract with full paths" , True ), -- cgit v1.2.3 From 4160919db621472e85460d0f4ec0052e3536ec93 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 5 May 2015 01:43:10 +0200 Subject: [SimpleHoster] Why Premium download fails? --- module/plugins/internal/SimpleHoster.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/plugins/internal/SimpleHoster.py b/module/plugins/internal/SimpleHoster.py index df3d66ea2..f77a31ae2 100644 --- a/module/plugins/internal/SimpleHoster.py +++ b/module/plugins/internal/SimpleHoster.py @@ -244,7 +244,7 @@ def secondsToMidnight(gmt=0): class SimpleHoster(Hoster): __name__ = "SimpleHoster" __type__ = "hoster" - __version__ = "1.40" + __version__ = "1.41" __pattern__ = r'^unmatchable$' __config__ = [("use_premium", "bool", "Use premium account if available", True)] @@ -489,7 +489,7 @@ class SimpleHoster(Hoster): except Fail, e: #@TODO: Move to PluginThread in 0.4.10 if self.premium: - self.logWarning(_("Premium download failed")) + self.logWarning(_("Premium download failed"), e) self.retryFree() else: raise Fail(e) -- cgit v1.2.3 From 430630fc3158e5dc5412824095f058a0be295edb Mon Sep 17 00:00:00 2001 From: GammaC0de Date: Tue, 5 May 2015 20:50:50 +0300 Subject: Update ExtractArchive.py --- module/plugins/hooks/ExtractArchive.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py index 07a2ba228..5b9e3f30b 100644 --- a/module/plugins/hooks/ExtractArchive.py +++ b/module/plugins/hooks/ExtractArchive.py @@ -110,7 +110,7 @@ class ArchiveQueue(object): class ExtractArchive(Hook): __name__ = "ExtractArchive" __type__ = "hook" - __version__ = "1.43" + __version__ = "1.44" __config__ = [("activated" , "bool" , "Activated" , True ), ("fullpath" , "bool" , "Extract with full paths" , True ), -- cgit v1.2.3 From 44c994bbd576182c4a499c8c9292e2ef18d9a6b6 Mon Sep 17 00:00:00 2001 From: GammaC0de Date: Tue, 5 May 2015 21:10:14 +0300 Subject: Update YadiSk.py --- module/plugins/hoster/YadiSk.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/plugins/hoster/YadiSk.py b/module/plugins/hoster/YadiSk.py index ad63ffb32..54050fb9b 100644 --- a/module/plugins/hoster/YadiSk.py +++ b/module/plugins/hoster/YadiSk.py @@ -10,9 +10,9 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class YadiSk(SimpleHoster): __name__ = "YadiSk" __type__ = "hoster" - __version__ = "0.04" + __version__ = "0.05" - __pattern__ = r'https?://yadi\.sk/d/\w+' + __pattern__ = r'https?://yadi\.sk/d/.+' __description__ = """Yadi.sk hoster plugin""" __license__ = "GPLv3" -- cgit v1.2.3 From 3f84c0b2defeb5298e8cc63381e274d8bad66e80 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 5 May 2015 23:34:08 +0200 Subject: [XFSCrypter] Improve LINK_PATTERN (2) --- module/plugins/internal/XFSCrypter.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/module/plugins/internal/XFSCrypter.py b/module/plugins/internal/XFSCrypter.py index 0612be876..c4809ec46 100644 --- a/module/plugins/internal/XFSCrypter.py +++ b/module/plugins/internal/XFSCrypter.py @@ -6,7 +6,7 @@ from module.plugins.internal.SimpleCrypter import SimpleCrypter, create_getInfo class XFSCrypter(SimpleCrypter): __name__ = "XFSCrypter" __type__ = "crypter" - __version__ = "0.07" + __version__ = "0.08" __pattern__ = r'^unmatchable$' @@ -19,8 +19,8 @@ class XFSCrypter(SimpleCrypter): URL_REPLACEMENTS = [(r'&?per_page=\d+', ""), (r'[?/&]+$', ""), (r'(.+/[^?]+)$', r'\1?'), (r'$', r'&per_page=10000')] - LINK_PATTERN = r'.+?(?:)?\s*' - NAME_PATTERN = r'<[tT]itle>.*?\: (?P.+) folder' + LINK_PATTERN = r'.+?(?:)?\s*(<.+>\s*)?' + NAME_PATTERN = r'<[Tt]itle>.*?\: (?P.+) folder' OFFLINE_PATTERN = r'>\s*\w+ (Not Found|file (was|has been) removed)' TEMP_OFFLINE_PATTERN = r'>\s*\w+ server (is in )?(maintenance|maintainance)' -- cgit v1.2.3 From 93c4b9c09745f7cf583341991eb475ee84d2361b Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 6 May 2015 00:12:00 +0200 Subject: [XFSHoster] Fix WAIT_PATTERN --- module/plugins/internal/XFSHoster.py | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/module/plugins/internal/XFSHoster.py b/module/plugins/internal/XFSHoster.py index 33dc6d16b..8dab0bb4f 100644 --- a/module/plugins/internal/XFSHoster.py +++ b/module/plugins/internal/XFSHoster.py @@ -13,7 +13,7 @@ from module.utils import html_unescape class XFSHoster(SimpleHoster): __name__ = "XFSHoster" __type__ = "hoster" - __version__ = "0.46" + __version__ = "0.47" __pattern__ = r'^unmatchable$' @@ -36,7 +36,7 @@ class XFSHoster(SimpleHoster): OFFLINE_PATTERN = r'>\s*\w+ (Not Found|file (was|has been) removed)' TEMP_OFFLINE_PATTERN = r'>\s*\w+ server (is in )?(maintenance|maintainance)' - WAIT_PATTERN = r'.*?>(\d+)|id="countdown" value=".*?(\d+).*?"' + WAIT_PATTERN = r'(\d+)|id="countdown" value=".*?(\d+).*?"' PREMIUM_ONLY_PATTERN = r'>This file is available for Premium Users only' ERROR_PATTERN = r'(?:class=["\']err["\'].*?>|<[Cc]enter>|>Error|>\(ERROR:)(?:\s*<.+?>\s*)*(.+?)(?:["\']|<|\))' @@ -148,10 +148,7 @@ class XFSHoster(SimpleHoster): action, inputs = self.parseHtmlForm('F1') if not inputs: - if self.errmsg: - self.retry(reason=self.errmsg) - else: - self.error(_("TEXTAREA F1 not found")) + self.retry(reason=self.errmsg or _("TEXTAREA F1 not found")) self.logDebug(inputs) @@ -204,7 +201,7 @@ class XFSHoster(SimpleHoster): self.fail(_("File can be downloaded by premium users only")) elif 'limit' in self.errmsg: - if 'days' in self.errmsg: + if 'day' in self.errmsg: delay = secondsToMidnight(gmt=2) retries = 3 else: @@ -242,10 +239,7 @@ class XFSHoster(SimpleHoster): if not inputs: action, inputs = self.parseHtmlForm('F1') if not inputs: - if self.errmsg: - self.retry(reason=self.errmsg) - else: - self.error(_("TEXTAREA F1 not found")) + self.retry(reason=self.errmsg or _("TEXTAREA F1 not found")) self.logDebug(inputs) -- cgit v1.2.3 From 5c153e02a6eaebb721c85202b54401fa2c1f08fc Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 6 May 2015 00:14:25 +0200 Subject: [SimpleHoster] Fallback option --- module/plugins/hoster/YadiSk.py | 2 +- module/plugins/internal/SimpleHoster.py | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/module/plugins/hoster/YadiSk.py b/module/plugins/hoster/YadiSk.py index 54050fb9b..3b4c9d985 100644 --- a/module/plugins/hoster/YadiSk.py +++ b/module/plugins/hoster/YadiSk.py @@ -12,7 +12,7 @@ class YadiSk(SimpleHoster): __type__ = "hoster" __version__ = "0.05" - __pattern__ = r'https?://yadi\.sk/d/.+' + __pattern__ = r'https?://yadi\.sk/d/[\w-]+' __description__ = """Yadi.sk hoster plugin""" __license__ = "GPLv3" diff --git a/module/plugins/internal/SimpleHoster.py b/module/plugins/internal/SimpleHoster.py index f77a31ae2..0039d3f8e 100644 --- a/module/plugins/internal/SimpleHoster.py +++ b/module/plugins/internal/SimpleHoster.py @@ -244,10 +244,11 @@ def secondsToMidnight(gmt=0): class SimpleHoster(Hoster): __name__ = "SimpleHoster" __type__ = "hoster" - __version__ = "1.41" + __version__ = "1.42" __pattern__ = r'^unmatchable$' - __config__ = [("use_premium", "bool", "Use premium account if available", True)] + __config__ = [("use_premium", "bool", "Use premium account if available" , True), + ("fallback" , "bool", "Fallback to free download if premium fails", True)] __description__ = """Simple hoster plugin""" __license__ = "GPLv3" @@ -488,7 +489,7 @@ class SimpleHoster(Hoster): self.checkFile() except Fail, e: #@TODO: Move to PluginThread in 0.4.10 - if self.premium: + if self.getConfig('fallback', True) and self.premium: self.logWarning(_("Premium download failed"), e) self.retryFree() else: @@ -748,7 +749,7 @@ class SimpleHoster(Hoster): self.premium = False self.account = None self.req = self.core.requestFactory.getRequest(self.__name__) - self.retries = 0 + self.retries = -1 raise Retry(_("Fallback to free download")) -- cgit v1.2.3