本文整理汇总了Python中module.plugins.internal.SimpleHoster.create_getInfo函数的典型用法代码示例。如果您正苦于以下问题:Python create_getInfo函数的具体用法?Python create_getInfo怎么用?Python create_getInfo使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了create_getInfo函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: setup
("chk_filesize", "bool", "Check file size" , True),
("max_wait" , "int" , "Reconnect if waiting time is greater than minutes", 10 )]
__description__ = """Filepup.net hoster plugin"""
__license__ = "GPLv3"
__authors__ = [("zapp-brannigan", "[email protected]"),
("Walter Purcaro", "[email protected]")]
NAME_PATTERN = r'>(?P<N>.+?)</h1>'
SIZE_PATTERN = r'class="fa fa-archive"></i> \((?P<S>[\d.,]+) (?P<U>[\w^_]+)'
OFFLINE_PATTERN = r'>This file has been deleted'
LINK_FREE_PATTERN = r'(http://www\.filepup\.net/get/.+?)\''
def setup(self):
self.multiDL = False
self.chunk_limit = 1
def handle_free(self, pyfile):
m = re.search(self.LINK_FREE_PATTERN, self.data)
if m is not None:
dl_link = m.group(1)
self.download(dl_link, post={'task': "download"})
getInfo = create_getInfo(FilepupNet)
开发者ID:johny149,项目名称:openmediavault-pyload,代码行数:30,代码来源:FilepupNet.py
示例2: decrypt
return "http://turbobit.net%s" % out.strip()
except Exception, e:
self.logError(e)
else:
if self.retries >= 2:
# retry with updated js
self.delStorage("rtUpdate")
self.retry()
def decrypt(self, data):
cipher = ARC4.new(hexlify('E\x15\xa1\x9e\xa3M\xa0\xc6\xa0\x84\xb6H\x83\xa8o\xa0'))
return unhexlify(cipher.encrypt(unhexlify(data)))
def getLocalTimeString(self):
lt = time.localtime()
tz = time.altzone if lt.tm_isdst else time.timezone
return "%s GMT%+03d%02d" % (time.strftime("%a %b %d %Y %H:%M:%S", lt), -tz // 3600, tz % 3600)
def handlePremium(self):
self.logDebug("Premium download as user %s" % self.user)
self.downloadFile()
def downloadFile(self):
found = re.search(self.DOWNLOAD_URL_PATTERN, self.html)
if not found: self.parseError("download link")
self.url = "http://turbobit.net" + found.group('url')
self.logDebug(self.url)
self.download(self.url)
getInfo = create_getInfo(TurbobitNet)
开发者ID:4Christopher,项目名称:pyload,代码行数:30,代码来源:TurbobitNet.py
示例3: setup
SH_COOKIES = [("http://www.wrzuc.to", "language", "en")]
FILE_SIZE_PATTERN = r'class="info">\s*<tr>\s*<td>(?P<S>.*?)</td>'
FILE_NAME_PATTERN = r'id="file_info">\s*<strong>(?P<N>.*?)</strong>'
def setup(self):
self.multiDL = True
def handleFree(self):
data = dict(re.findall(r'(md5|file): "(.*?)"', self.html))
if len(data) != 2:
self.parseError('File ID')
self.req.http.c.setopt(HTTPHEADER, ["X-Requested-With: XMLHttpRequest"])
self.req.http.lastURL = self.pyfile.url
self.load("http://www.wrzuc.to/ajax/server/prepair", post={"md5": data['md5']})
self.req.http.lastURL = self.pyfile.url
self.html = self.load("http://www.wrzuc.to/ajax/server/download_link", post={"file": data['file']})
data.update(re.findall(r'"(download_link|server_id)":"(.*?)"', self.html))
if len(data) != 4:
self.parseError('Download URL')
download_url = "http://%s.wrzuc.to/pobierz/%s" % (data['server_id'], data['download_link'])
self.logDebug("Download URL: %s" % download_url)
self.download(download_url)
getInfo = create_getInfo(WrzucTo)
开发者ID:BlackSmith,项目名称:pyload,代码行数:29,代码来源:WrzucTo.py
示例4: getLastHeaders
self.fail("Cookie error")
location = headers.get("location")
self.req.setCookieJar(cj)
self.download(location, disposition=True)
else:
self.fail("Invalid response")
def getLastHeaders(self):
#parse header
header = {"code": self.req.code}
for line in self.req.http.header.splitlines():
line = line.strip()
if not line or ":" not in line:
continue
key, none, value = line.partition(":")
key = key.lower().strip()
value = value.strip()
if key in header:
if type(header[key]) == list:
header[key].append(value)
else:
header[key] = [header[key], value]
else:
header[key] = value
return header
getInfo = create_getInfo(DlFreeFr)
开发者ID:DasLampe,项目名称:pyload,代码行数:30,代码来源:DlFreeFr.py
示例5: handlePremium
self.retry(max_tries=5, reason="Wrong captcha")
def handlePremium(self):
header = self.load(self.pyfile.url, just_header=True)
if "location" in header:
url = header["location"]
else:
self.html = self.load(self.pyfile.url)
self.getFileInfo() #
if self.CREDIT_PATTERN in self.html:
self.logWarning("Not enough traffic left")
self.resetAccount()
else:
found = re.search(self.PREMIUM_URL_PATTERN, self.html)
if found:
url = found.group(1)
else:
self.parseError("Premium URL")
self.logDebug("PREMIUM URL: " + url)
self.download(url, disposition=True)
check = self.checkDownload({"credit": re.compile(self.CREDIT_PATTERN)})
if check == "credit":
self.resetAccount()
getInfo = create_getInfo(FastshareCz)
开发者ID:3DMeny,项目名称:pyload,代码行数:30,代码来源:FastshareCz.py
示例6: do_recaptcha
return swfdump
def do_recaptcha(self):
self.logDebug('Trying to solve captcha')
captcha_key = re.search(self.CAPTCHA_KEY_PATTERN, self.html).group(1)
shortencode = re.search(self.CAPTCHA_SHORTENCODE_PATTERN, self.html).group(1)
url = re.search(self.CAPTCHA_DOWNLOAD_PATTERN, self.html).group(1)
recaptcha = ReCaptcha(self)
for i in range(5):
challenge, code = recaptcha.challenge(captcha_key)
response = json_loads(self.load(self.file_info['HOST'] + '/rest/captcha/test',
post={'challenge': challenge,
'response': code,
'shortencode': shortencode}))
self.logDebug("reCaptcha response : %s" % response)
if response == True:
self.correctCaptcha()
break
else:
self.invalidCaptcha()
else:
self.fail("Invalid captcha")
return url
getInfo = create_getInfo(ZippyshareCom)
开发者ID:DasLampe,项目名称:pyload,代码行数:30,代码来源:ZippyshareCom.py
示例7: check_file
self.wait()
def check_file(self):
#: Check download
check = self.check_download({
"temp offline" : re.compile(r"^Soubor je do.*asn.* nedostupn.*$"),
'credit' : re.compile(r"^Nem.*te dostate.*n.* kredit.$"),
"multi-dl" : re.compile(self.MULTIDL_PATTERN),
'captcha' : "<li>Zadaný ověřovací kód nesouhlasí!</li>"
})
if check == "temp offline":
self.fail(_("File not available - try later"))
elif check == "credit":
self.restart(nopremium=True)
elif check == "multi-dl":
self.wait(5 * 60, 12, _("Download limit reached"))
elif check == "captcha":
self.captcha.invalid()
self.retry()
return super(CzshareCom, self).check_file()
getInfo = create_getInfo(CzshareCom)
开发者ID:earthGavinLee,项目名称:pyload,代码行数:29,代码来源:CzshareCom.py
示例8: handlePremium
if 'location' in self.req.http.header:
location = re.search(r'location: (\S+)', self.req.http.header).group(1)
downloadURL = 'http://filer.net' + location
self.correctCaptcha()
break
else:
self.logInfo('Wrong captcha')
self.invalidCaptcha()
if not downloadURL:
self.fail("No Download url retrieved/all captcha attempts failed")
self.download(downloadURL, disposition=True)
def handlePremium(self):
header = self.load(self.pyfile.url, just_header=True)
if 'location' in header: # Direct Download ON
dl = self.pyfile.url
else: # Direct Download OFF
html = self.load(self.pyfile.url)
m = re.search(self.DIRECT_LINK_PATTERN, html)
if not m:
self.parseError("Unable to detect direct link, try to enable 'Direct download' in your user settings")
dl = 'http://filer.net' + m.group(1)
self.logDebug('Direct link: ' + dl)
self.download(dl, disposition=True)
getInfo = create_getInfo(FilerNet)
开发者ID:jmcabgam,项目名称:pyload,代码行数:30,代码来源:FilerNet.py
示例9: handle_free
'wst' : ""})
if not re.search(r'<status>OK', api):
info['status'] = 1
else:
info['status'] = 2
info['name'] = re.search(r'<name>(.+?)<', api).group(1)
info['size'] = re.search(r'<size>(.+?)<', api).group(1)
return info
def handle_free(self, pyfile):
wst = self.account.get_data('wst') if self.account else None
api_data = get_url("https://webshare.cz/api/file_link/",
post={'ident': self.info['pattern']['ID'], 'wst': wst})
self.log_debug("API data: " + api_data)
m = re.search('<link>(.+)</link>', api_data)
if m is not None:
self.link = m.group(1)
def handle_premium(self, pyfile):
return self.handle_free(pyfile)
getInfo = create_getInfo(WebshareCz)
开发者ID:johny149,项目名称:openmediavault-pyload,代码行数:30,代码来源:WebshareCz.py
示例10: DataHu
class DataHu(SimpleHoster):
__name__ = "DataHu"
__type__ = "hoster"
__version__ = "0.06"
__status__ = "testing"
__pattern__ = r'http://(?:www\.)?data\.hu/get/\w+'
__config__ = [("activated" , "bool", "Activated" , True),
("use_premium" , "bool", "Use premium account if available" , True),
("fallback" , "bool", "Fallback to free download if premium fails" , True),
("chk_filesize", "bool", "Check file size" , True),
("max_wait" , "int" , "Reconnect if waiting time is greater than minutes", 10 )]
__description__ = """Data.hu hoster plugin"""
__license__ = "GPLv3"
__authors__ = [("crash", None),
("stickell", "[email protected]")]
INFO_PATTERN = ur'<title>(?P<N>.*) \((?P<S>[^)]+)\) let\xf6lt\xe9se</title>'
OFFLINE_PATTERN = ur'Az adott f\xe1jl nem l\xe9tezik'
LINK_FREE_PATTERN = r'<div class="download_box_button"><a href="(.+?)">'
def setup(self):
self.resume_download = True
self.multiDL = self.premium
getInfo = create_getInfo(DataHu)
开发者ID:johny149,项目名称:openmediavault-pyload,代码行数:30,代码来源:DataHu.py
示例11: create_getInfo
found = re.search(self.DOWNLOAD_URL_PATTERN, self.html)
if found:
if 'captcha_hash' in params:
self.correctCaptcha()
download_url = found.group(1)
break
found = re.search(self.CAPTCHA_PATTERN, self.html)
if found:
if 'captcha_hash' in params:
self.invalidCaptcha()
captcha_url1 = "http://www.sendspace.com/" + found.group(1)
found = re.search(self.USER_CAPTCHA_PATTERN, self.html)
captcha_url2 = "http://www.sendspace.com/" + found.group(1)
params = {'captcha_hash': found.group(2),
'captcha_submit': 'Verify',
'captcha_answer': self.decryptCaptcha(captcha_url1) + " " + self.decryptCaptcha(captcha_url2)}
else:
params = {'download': "Regular Download"}
self.logDebug(params)
self.html = self.load(self.pyfile.url, post=params)
else:
self.fail("Download link not found")
self.logDebug("Download URL: %s" % download_url)
self.download(download_url)
create_getInfo(SendspaceCom)
开发者ID:BlackSmith,项目名称:pyload,代码行数:30,代码来源:SendspaceCom.py
示例12: setup
INFO_PATTERN = r'<title>(?P<N>.+) \((?P<S>[\d.,]+) (?P<U>[\w^_]+)\)<'
OFFLINE_PATTERN = r'<div class="alert alert-error"'
IP_BLOCKED_PATTERN = ur'>Nasz serwis wykrył że Twój adres IP nie pochodzi z Polski.<'
WAIT_PATTERN = r'var\scount\s=\s(\d+);'
LINK_FREE_PATTERN = r'<form action="(.+?)" method="GET">'
LINK_PREMIUM_PATTERN = r'<form action="(.+?)" method="GET">'
def setup(self):
self.multiDL = self.premium
self.resume_download = True
def handle_free(self, pyfile):
recaptcha = ReCaptcha(self)
response, challenge = recaptcha.challenge()
self.data = self.load(pyfile.url,
post={'recaptcha_challenge_field': challenge,
'recaptcha_response_field' : response})
m = re.search(self.LINK_FREE_PATTERN, self.data)
if m is not None:
self.link = m.group(1)
getInfo = create_getInfo(CatShareNet)
开发者ID:johny149,项目名称:openmediavault-pyload,代码行数:29,代码来源:CatShareNet.py
示例13: create_getInfo
if m is None:
self.error(_("LINK_FREE_PATTERN not found"))
url = m.group(1)
self.log_debug(('FREEUSER' if m.group(2) == "download" else 'GUEST') + ' URL', url)
res = json.loads(self.load(urlparse.urljoin("http://115.com/", url), decode=False))
if "urls" in res:
mirrors = res['urls']
elif "data" in res:
mirrors = res['data']
else:
mirrors = None
for mr in mirrors:
try:
self.link = mr['url'].replace("\\", "")
self.log_debug("Trying URL: " + self.link)
break
except Exception:
pass
else:
self.fail(_("No working link found"))
getInfo = create_getInfo(YibaishiwuCom)
开发者ID:johny149,项目名称:openmediavault-pyload,代码行数:30,代码来源:YibaishiwuCom.py
示例14: handle_captcha
def handle_captcha(self):
post_data = {'free' : 1,
'freeDownloadRequest': 1,
'uniqueId' : self.fid,
'yt0' : ''}
m = re.search(r'id="(captcha\-form)"', self.html)
self.log_debug("captcha-form found %s" % m)
m = re.search(self.CAPTCHA_PATTERN, self.html)
self.log_debug("CAPTCHA_PATTERN found %s" % m)
if m:
captcha_url = urlparse.urljoin("http://keep2s.cc/", m.group(1))
post_data['CaptchaForm[code]'] = self.captcha.decrypt(captcha_url)
else:
recaptcha = ReCaptcha(self)
response, challenge = recaptcha.challenge()
post_data.update({'recaptcha_challenge_field': challenge,
'recaptcha_response_field' : response})
self.html = self.load(self.pyfile.url, post=post_data)
if 'verification code is incorrect' not in self.html:
self.captcha.correct()
else:
self.captcha.invalid()
getInfo = create_getInfo(Keep2ShareCc)
开发者ID:earthGavinLee,项目名称:pyload,代码行数:29,代码来源:Keep2ShareCc.py
示例15: checkWait
download_url = found.group(1)
self.logDebug(download_url)
self.download(download_url)
def checkWait(self):
found = re.search(r"(?:Delay between downloads must be not less than|Try again in)\s*(\d+)\s*(hour|min)",
self.html)
if found:
wait_time = int(found.group(1)) * {"hour": 60, "min": 1}[found.group(2)]
else:
found = re.search(r"You have reached your (daily|hourly) downloads limit", self.html)
if found:
wait_time = 60
else:
return
self.logDebug("Waiting %d minutes" % wait_time)
self.setWait(wait_time * 60, True)
self.wait()
self.retry(max_tries=24)
def getJsonResponse(self, url):
response = self.load(url, decode=True)
if not response.startswith('{'):
self.retry()
self.logDebug(url, response)
return json_loads(response)
getInfo = create_getInfo(RapidgatorNet)
开发者ID:DasLampe,项目名称:pyload,代码行数:30,代码来源:RapidgatorNet.py
示例16: handle_errors
self.handle_errors(res, '#')
url = res.split("#")[-1]
return url
def handle_errors(self, res, separator):
self.log_debug("Checking response [%s]" % res)
if "ERROR:Session timed out" in res:
self.retry()
elif "ERROR" in res:
msg = res.split(separator)[-1]
self.fail(msg)
def handle_captcha_errors(self, res):
self.log_debug("Result of captcha resolving [%s]" % res)
if "SUCCESS" in res:
self.captcha.correct()
elif "ERROR:SESSION ERROR" in res:
self.retry()
else:
self.retry_captcha()
getInfo = create_getInfo(BitshareCom)
开发者ID:johny149,项目名称:openmediavault-pyload,代码行数:30,代码来源:BitshareCom.py
示例17: or
self.account.relogin()
self.retry(msg=_("User not logged in"))
self.link = pyfile.url.rstrip('/') + "/download/"
check = self.check_file({
'login': re.compile(self.ERROR_PATTERN),
'json' : re.compile(r'\{"status":"error".*?"message":"(.*?)"')
})
if check == "login" or (check == "json" and self.last_check.group(1) == "Access token expired"):
self.account.relogin()
self.retry(msg=_("Access token expired"))
elif check == "json":
self.fail(self.last_check.group(1))
def handle_free(self, pyfile):
if re.search(self.DL_LIMIT_PATTERN, self.data):
self.wait(5 * 60, 12, _("Download limit reached"))
m = re.search(self.LINK_FREE_PATTERN, self.data)
if m is None:
self.error(_("LINK_FREE_PATTERN not found"))
self.link = m.group(1)
getInfo = create_getInfo(EuroshareEu)
开发者ID:johny149,项目名称:openmediavault-pyload,代码行数:30,代码来源:EuroshareEu.py
示例18: setup
__author_name__ = ("zoidberg")
FILE_NAME_PATTERN = r'<h1 id="filename"[^>]*>(?P<N>[^<]+)</h1>'
FILE_SIZE_PATTERN = r'<strong id="FileSize_master">(?P<S>[0-9.]*) (?P<U>[kKMG])i?B</strong>'
FILE_OFFLINE_PATTERN = r'<h1>File not found.</h1>'
SHOW_WINDOW_PATTERN = r'<a href="([^?]+/(\d+)/\?do=(fileDownloadButton|relatedFileDownloadButton-\2)-showDownloadWindow)"'
def setup(self):
self.resumeDownload = self.multiDL = True if self.account else False
self.chunkLimit = 1
def process(self, pyfile):
if not self.account:
self.fail("User not logged in")
pyfile.url = re.search(self.__pattern__, pyfile.url).group(1)
self.html = self.load(pyfile.url, decode=True)
self.getFileInfo()
if not self.checkTrafficLeft():
self.fail("Not enough traffic left for user %s." % self.user)
found = re.search(self.SHOW_WINDOW_PATTERN, self.html)
if not found:
self.parseError('SHOW WINDOW')
self.url = "http://www.hellshare.com" + found.group(1)
self.logDebug("DOWNLOAD URL: " + self.url)
self.download(self.url)
getInfo = create_getInfo(HellshareCz)
开发者ID:BlackSmith,项目名称:pyload,代码行数:30,代码来源:HellshareCz.py
示例19: _
'error' : e.message}
else:
info = {'status' : 8,
'error' : _("Too many redirects")}
return info
def handle_free(self, pyfile):
self.check_errors()
url, inputs = self.parse_html_form('action="https://1fichier.com/\?[\w^_]+')
if not url:
return
if "pass" in inputs:
inputs['pass'] = self.get_password()
inputs['submit'] = "Download"
self.download(url, post=inputs)
def handle_premium(self, pyfile):
self.download(pyfile.url, post={'did': 0, 'dl_no_ssl': "on"})
getInfo = create_getInfo(OneFichierCom)
开发者ID:johny149,项目名称:openmediavault-pyload,代码行数:30,代码来源:OneFichierCom.py
示例20: setup
__name__ = "TwoSharedCom"
__type__ = "hoster"
__version__ = "0.17"
__status__ = "testing"
__pattern__ = r'http://(?:www\.)?2shared\.com/(account/)?(download|get|file|document|photo|video|audio)/.+'
__config__ = [("activated" , "bool", "Activated" , True),
("use_premium" , "bool", "Use premium account if available" , True),
("fallback" , "bool", "Fallback to free download if premium fails" , True),
("chk_filesize", "bool", "Check file size" , True),
("max_wait" , "int" , "Reconnect if waiting time is greater than minutes", 10 )]
__description__ = """2Shared.com hoster plugin"""
__license__ = "GPLv3"
__authors__ = [("zoidberg", "[email protected]")]
NAME_PATTERN = r'<h1>(?P<N>.*)</h1>'
SIZE_PATTERN = r'<span class="dtitle">File size:</span>\s*(?P<S>[\d.,]+) (?P<U>[\w^_]+)'
OFFLINE_PATTERN = r'The file link that you requested is not valid\.|This file was deleted\.'
LINK_FREE_PATTERN = r'window.location =\'(.+?)\';'
def setup(self):
self.resume_download = True
self.multiDL = True
getInfo = create_getInfo(TwoSharedCom)
开发者ID:johny149,项目名称:openmediavault-pyload,代码行数:30,代码来源:TwoSharedCom.py
注:本文中的module.plugins.internal.SimpleHoster.create_getInfo函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论