mirror of
https://github.com/soimort/you-get.git
synced 2025-02-02 16:24:00 +03:00
Merge branch 'pastebt-develop' into develop
This commit is contained in:
commit
66053b0788
@ -19,7 +19,8 @@ client = {
|
||||
'Accept-Charset': 'UTF-8,*;q=0.5',
|
||||
'Accept-Encoding': 'gzip,deflate,sdch',
|
||||
'Accept-Language': 'en-US,en;q=0.8',
|
||||
'User-Agent': 'Biligrab /0.8 (cnbeining@gmail.com)'
|
||||
#'User-Agent': 'Biligrab /0.8 (cnbeining@gmail.com)'
|
||||
'User-Agent': "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.94 Safari/537.36"
|
||||
}
|
||||
|
||||
def get_srt_xml(id):
|
||||
|
@ -11,7 +11,7 @@ def real_url(host, prot, file, new):
|
||||
start, _, host, key = get_html(url).split('|')[:4]
|
||||
return '%s%s?key=%s' % (start[:-1], new, key)
|
||||
|
||||
def sohu_download(url, output_dir = '.', merge = True, info_only = False):
|
||||
def sohu_download(url, output_dir = '.', merge = True, info_only = False, extractor_proxy=None):
|
||||
if re.match(r'http://share.vrs.sohu.com', url):
|
||||
vid = r1('id=(\d+)', url)
|
||||
else:
|
||||
@ -20,12 +20,16 @@ def sohu_download(url, output_dir = '.', merge = True, info_only = False):
|
||||
assert vid
|
||||
|
||||
if re.match(r'http://tv.sohu.com/', url):
|
||||
if extractor_proxy:
|
||||
set_proxy(tuple(extractor_proxy.split(":")))
|
||||
data = json.loads(get_decoded_html('http://hot.vrs.sohu.com/vrs_flash.action?vid=%s' % vid))
|
||||
for qtyp in ["oriVid","superVid","highVid" ,"norVid","relativeId"]:
|
||||
hqvid = data['data'][qtyp]
|
||||
if hqvid != 0 and hqvid != vid :
|
||||
data = json.loads(get_decoded_html('http://hot.vrs.sohu.com/vrs_flash.action?vid=%s' % hqvid))
|
||||
break
|
||||
if extractor_proxy:
|
||||
unset_proxy()
|
||||
host = data['allot']
|
||||
prot = data['prot']
|
||||
urls = []
|
||||
|
Loading…
Reference in New Issue
Block a user