summaryrefslogtreecommitdiffstats
path: root/pyload/plugin/hoster/DepositfilesCom.py
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-03-26 17:04:38 +0100
committerGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-03-26 17:04:38 +0100
commitccb6aaee9d987b56faf19fb48dd06a04ff8ca721 (patch)
tree6a385417ff77f3ed17329e2d606f80b673bdb3c0 /pyload/plugin/hoster/DepositfilesCom.py
parentPrepare to merging (diff)
parentTiny code cosmetics (diff)
downloadpyload-ccb6aaee9d987b56faf19fb48dd06a04ff8ca721.tar.xz
Merge branch 'stable' into 0.4.10
Conflicts: module/plugins/accounts/Keep2ShareCc.py module/plugins/captcha/OCR.py module/plugins/captcha/captcha.py module/plugins/crypter/DailymotionBatch.py module/plugins/crypter/DailymotionComFolder.py module/plugins/crypter/YoutubeBatch.py module/plugins/crypter/YoutubeComFolder.py module/plugins/internal/CaptchaService.py pyload/plugin/Extractor.py pyload/plugin/OCR.py pyload/plugin/account/DebridItaliaCom.py pyload/plugin/account/MegaRapidCz.py pyload/plugin/account/NoPremiumPl.py pyload/plugin/account/RapideoPl.py pyload/plugin/addon/AndroidPhoneNotify.py pyload/plugin/addon/Checksum.py pyload/plugin/addon/ClickAndLoad.py pyload/plugin/addon/DeleteFinished.py pyload/plugin/addon/DownloadScheduler.py pyload/plugin/addon/ExternalScripts.py pyload/plugin/addon/ExtractArchive.py pyload/plugin/addon/HotFolder.py pyload/plugin/addon/IRCInterface.py pyload/plugin/addon/JustPremium.py pyload/plugin/addon/MergeFiles.py pyload/plugin/addon/MultiHome.py pyload/plugin/addon/RestartFailed.py pyload/plugin/addon/RestartSlow.py pyload/plugin/addon/SkipRev.py pyload/plugin/addon/UnSkipOnFail.py pyload/plugin/addon/UpdateManager.py pyload/plugin/addon/WindowsPhoneNotify.py pyload/plugin/crypter/DDLMusicOrg.py pyload/plugin/crypter/DailymotionBatch.py pyload/plugin/crypter/DevhostSt.py pyload/plugin/crypter/EmbeduploadCom.py pyload/plugin/crypter/MultiloadCz.py pyload/plugin/crypter/YoutubeBatch.py pyload/plugin/extractor/SevenZip.py pyload/plugin/extractor/UnRar.py pyload/plugin/extractor/UnZip.py pyload/plugin/hook/BypassCaptcha.py pyload/plugin/hook/Captcha9Kw.py pyload/plugin/hook/CaptchaBrotherhood.py pyload/plugin/hook/DeathByCaptcha.py pyload/plugin/hook/ExpertDecoders.py pyload/plugin/hook/ImageTyperz.py pyload/plugin/hook/XFileSharingPro.py pyload/plugin/hoster/AlldebridCom.py pyload/plugin/hoster/CzshareCom.py pyload/plugin/hoster/EuroshareEu.py pyload/plugin/hoster/FastixRu.py pyload/plugin/hoster/FastshareCz.py pyload/plugin/hoster/GooIm.py pyload/plugin/hoster/MediafireCom.py pyload/plugin/hoster/MegaDebridEu.py pyload/plugin/hoster/NitroflareCom.py pyload/plugin/hoster/OverLoadMe.py pyload/plugin/hoster/PremiumTo.py pyload/plugin/hoster/PremiumizeMe.py pyload/plugin/hoster/RapidgatorNet.py pyload/plugin/hoster/RealdebridCom.py pyload/plugin/hoster/SimplyPremiumCom.py pyload/plugin/hoster/SimplydebridCom.py pyload/plugin/hoster/SmoozedCom.py pyload/plugin/hoster/SoundcloudCom.py pyload/plugin/hoster/UlozTo.py pyload/plugin/hoster/UploadableCh.py pyload/plugin/hoster/UploadedTo.py pyload/plugin/hoster/UploadheroCom.py pyload/plugin/hoster/VeehdCom.py pyload/plugin/hoster/VimeoCom.py pyload/plugin/hoster/ZeveraCom.py pyload/plugin/hoster/ZippyshareCom.py pyload/plugin/internal/BasePlugin.py pyload/plugin/internal/MultiHoster.py pyload/plugin/internal/SimpleDereferer.py pyload/plugin/internal/SimpleHoster.py pyload/plugin/internal/XFSHoster.py pyload/plugin/ocr/GigasizeCom.py pyload/plugin/ocr/LinksaveIn.py pyload/plugin/ocr/NetloadIn.py pyload/plugin/ocr/ShareonlineBiz.py
Diffstat (limited to 'pyload/plugin/hoster/DepositfilesCom.py')
-rw-r--r--pyload/plugin/hoster/DepositfilesCom.py60
1 files changed, 20 insertions, 40 deletions
diff --git a/pyload/plugin/hoster/DepositfilesCom.py b/pyload/plugin/hoster/DepositfilesCom.py
index 67cfe4bdc..1832fd35b 100644
--- a/pyload/plugin/hoster/DepositfilesCom.py
+++ b/pyload/plugin/hoster/DepositfilesCom.py
@@ -11,9 +11,10 @@ from pyload.plugin.internal.SimpleHoster import SimpleHoster
class DepositfilesCom(SimpleHoster):
__name__ = "DepositfilesCom"
__type__ = "hoster"
- __version__ = "0.53"
+ __version__ = "0.54"
__pattern__ = r'https?://(?:www\.)?(depositfiles\.com|dfiles\.(eu|ru))(/\w{1,3})?/files/(?P<ID>\w+)'
+ __config__ = [("use_premium", "bool", "Use premium account if available", True)]
__description__ = """Depositfiles.com hoster plugin"""
__license__ = "GPLv3"
@@ -32,32 +33,18 @@ class DepositfilesCom(SimpleHoster):
COOKIES = [("dfiles.eu", "lang_current", "en")]
+ WAIT_PATTERN = r'(?:download_waiter_remain">|html_download_api-limit_interval">|>Please wait|>Try in).+'
+ ERROR_PATTER = r'File is checked, please try again in a minute'
+
LINK_FREE_PATTERN = r'<form id="downloader_file_form" action="(http://.+?\.(dfiles\.eu|depositfiles\.com)/.+?)" method="post"'
LINK_PREMIUM_PATTERN = r'class="repeat"><a href="(.+?)"'
LINK_MIRROR_PATTERN = r'class="repeat_mirror"><a href="(.+?)"'
def handleFree(self, pyfile):
- if re.search(r'File is checked, please try again in a minute.', self.html) is not None:
- self.logInfo(_("The file is being checked. Waiting 1 minute"))
- self.retry(wait_time=60)
-
- wait = re.search(r'html_download_api-limit_interval\">(\d+)</span>', self.html)
- if wait:
- wait_time = int(wait.group(1))
- self.logInfo(_("Traffic used up. Waiting %d seconds") % wait_time)
- self.wait(wait_time, True)
- self.retry()
+ self.html = self.load(pyfile.url, post={'gateway_result': "1"})
- wait = re.search(r'>Try in (\d+) minutes or use GOLD account', self.html)
- if wait:
- wait_time = int(wait.group(1))
- self.logInfo(_("All free slots occupied. Waiting %d minutes") % wait_time)
- self.setWait(wait_time * 60, False)
-
- wait = re.search(r'Please wait (\d+) sec', self.html)
- if wait:
- self.setWait(int(wait.group(1)))
+ self.checkErrors()
m = re.search(r"var fid = '(\w+)';", self.html)
if m is None:
@@ -69,38 +56,31 @@ class DepositfilesCom(SimpleHoster):
recaptcha = ReCaptcha(self)
captcha_key = recaptcha.detect_key()
if captcha_key is None:
- self.error(_("ReCaptcha key not found"))
+ return
+
+ self.html = self.load("https://dfiles.eu/get_file.php", get=params)
- for _i in xrange(5):
+ if '<input type=button value="Continue" onclick="check_recaptcha' in self.html:
+ params['response'], params['challenge'] = recaptcha.challenge(captcha_key)
self.html = self.load("https://dfiles.eu/get_file.php", get=params)
- if '<input type=button value="Continue" onclick="check_recaptcha' in self.html:
- if 'response' in params:
- self.invalidCaptcha()
- params['response'], params['challenge'] = recaptcha.challenge(captcha_key)
- self.logDebug(params)
- continue
-
- m = re.search(self.LINK_FREE_PATTERN, self.html)
- if m:
- if 'response' in params:
- self.correctCaptcha()
-
- self.link = unquote(m.group(1))
- break
- else:
- self.error(_("Download link"))
- else:
- self.fail(_("No valid captcha response received"))
+ m = re.search(self.LINK_FREE_PATTERN, self.html)
+ if m:
+ if 'response' in params:
+ self.correctCaptcha()
+
+ self.link = unquote(m.group(1))
def handlePremium(self, pyfile):
if '<span class="html_download_api-gold_traffic_limit">' in self.html:
self.logWarning(_("Download limit reached"))
self.retry(25, 60 * 60, "Download limit reached")
+
elif 'onClick="show_gold_offer' in self.html:
self.account.relogin(self.user)
self.retry()
+
else:
link = re.search(self.LINK_PREMIUM_PATTERN, self.html)
mirror = re.search(self.LINK_MIRROR_PATTERN, self.html)