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(-) (limited to 'module/plugins') 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(-) (limited to 'module/plugins') 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 (limited to 'module/plugins') 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(-) (limited to 'module/plugins') 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(-) (limited to 'module/plugins') 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(+) (limited to 'module/plugins') 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(-) (limited to 'module/plugins') 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(-) (limited to 'module/plugins') 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(-) (limited to 'module/plugins') 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(-) (limited to 'module/plugins') 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(-) (limited to 'module/plugins') 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(-) (limited to 'module/plugins') 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