mirror of
https://github.com/soimort/you-get.git
synced 2025-02-10 12:12:26 +03:00
commit
3d77312ad0
@ -23,7 +23,7 @@ from .youku import youku_download_by_vid
|
||||
class Bilibili(VideoExtractor):
|
||||
name = 'Bilibili'
|
||||
live_api = 'http://live.bilibili.com/api/playurl?cid={}&otype=json'
|
||||
api_url = 'http://interface.bilibili.com/playurl?'
|
||||
api_url = 'http://interface.bilibili.com/v2/playurl?'
|
||||
bangumi_api_url = 'http://bangumi.bilibili.com/player/web_api/playurl?'
|
||||
live_room_init_api_url = 'https://api.live.bilibili.com/room/v1/Room/room_init?id={}'
|
||||
live_room_info_api_url = 'https://api.live.bilibili.com/room/v1/Room/get_info?room_id={}'
|
||||
|
@ -47,6 +47,9 @@ def qq_download_by_vid(vid, title, output_dir='.', merge=True, info_only=False):
|
||||
else:
|
||||
log.w(key_json['msg'])
|
||||
break
|
||||
if key_json.get('filename') is None:
|
||||
log.w(key_json['msg'])
|
||||
break
|
||||
|
||||
part_urls.append(url)
|
||||
_, ext, size = url_info(url)
|
||||
@ -121,18 +124,6 @@ def qq_download(url, output_dir='.', merge=True, info_only=False, **kwargs):
|
||||
qq_download_by_vid(vid, vid, output_dir, merge, info_only)
|
||||
return
|
||||
|
||||
#do redirect
|
||||
if 'v.qq.com/page' in url:
|
||||
# for URLs like this:
|
||||
# http://v.qq.com/page/k/9/7/k0194pwgw97.html
|
||||
new_url = url_locations([url])[0]
|
||||
if url == new_url:
|
||||
#redirect in js?
|
||||
content = get_content(url)
|
||||
url = match1(content,r'window\.location\.href="(.*?)"')
|
||||
else:
|
||||
url = new_url
|
||||
|
||||
if 'kuaibao.qq.com' in url or re.match(r'http://daxue.qq.com/content/content/id/\d+', url):
|
||||
content = get_content(url)
|
||||
vid = match1(content, r'vid\s*=\s*"\s*([^"]+)"')
|
||||
|
@ -78,7 +78,7 @@ class Youku(VideoExtractor):
|
||||
self.api_error_code = None
|
||||
self.api_error_msg = None
|
||||
|
||||
self.ccode = '0507'
|
||||
self.ccode = '0590'
|
||||
self.utid = None
|
||||
|
||||
def youku_ups(self):
|
||||
|
@ -366,14 +366,22 @@ class YouTube(VideoExtractor):
|
||||
dash_url += '&signature={}'.format(sig)
|
||||
dash_size = stream['clen']
|
||||
itag = stream['itag']
|
||||
audio_url = None
|
||||
audio_size = None
|
||||
try:
|
||||
audio_url = dash_webm_a_url
|
||||
audio_size = int(dash_webm_a_size)
|
||||
except UnboundLocalError as e:
|
||||
audio_url = dash_mp4_a_url
|
||||
audio_size = int(dash_mp4_a_size)
|
||||
self.dash_streams[itag] = {
|
||||
'quality': stream['size'],
|
||||
'itag': itag,
|
||||
'type': mimeType,
|
||||
'mime': mimeType,
|
||||
'container': 'webm',
|
||||
'src': [dash_url, dash_webm_a_url],
|
||||
'size': int(dash_size) + int(dash_webm_a_size)
|
||||
'src': [dash_url, audio_url],
|
||||
'size': int(dash_size) + int(audio_size)
|
||||
}
|
||||
|
||||
def extract(self, **kwargs):
|
||||
|
Loading…
Reference in New Issue
Block a user