#!/usr/bin/env python # -*- coding: utf-8 -*- import re from urllib import unquote from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo from module.network.RequestFactory import getURL from module.plugins.ReCaptcha import ReCaptcha class DepositfilesCom(SimpleHoster): __name__ = "DepositfilesCom" __type__ = "hoster" __pattern__ = r"http://[\w\.]*?depositfiles\.com(/\w{1,3})?/files/[\w]+" __version__ = "0.41" __description__ = """Depositfiles.com Download Hoster""" __author_name__ = ("spoob", "zoidberg") __author_mail__ = ("spoob@pyload.org", "zoidberg@mujmail.cz") FILE_NAME_PATTERN = r'File name: (?P[0-9.]+) (?P[kKMG])i?B' FILE_OFFLINE_PATTERN = r'' FILE_URL_REPLACEMENTS = [(r"\.com(/.*?)?/files", ".com/en/files"), (r"\.html$", "")] RECAPTCHA_PATTERN = r"Recaptcha.create\('([^']+)'" DOWNLOAD_LINK_PATTERN = r'
(\d+)', self.html) if wait: wait_time = int(wait.group(1)) self.log.info( "%s: Traffic used up. Waiting %d seconds." % (self.__name__, wait_time) ) self.setWait(wait_time) self.wantReconnect = True self.wait() self.retry() wait = re.search(r'>Try in (\d+) minutes or use GOLD account', self.html) if wait: wait_time = int(wait.group(1)) self.log.info( "%s: All free slots occupied. Waiting %d minutes." % (self.__name__, 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))) found = re.search(r"var fid = '(\w+)';", self.html) if not found: self.retry(wait_time=5) params = {'fid' : found.group(1)} self.logDebug ("FID: %s" % params['fid']) captcha_key = '6LdRTL8SAAAAAE9UOdWZ4d0Ky-aeA7XfSqyWDM2m' found = re.search(self.RECAPTCHA_PATTERN, self.html) if found: captcha_key = found.group(1) self.logDebug ("CAPTCHA_KEY: %s" % captcha_key) self.wait() recaptcha = ReCaptcha(self) for i in range(5): self.html = self.load("http://depositfiles.com/get_file.php", get = params) if '' in self.html: self.logWarning("Download limit reached") self.retry(25, 3600, "Download limit reached") elif 'onClick="show_gold_offer' in self.html: self.account.relogin(self.user) self.retry() link = unquote(re.search('
\s*