mirror of
https://github.com/soimort/you-get.git
synced 2025-02-11 20:52:31 +03:00
Merge branch 'develop' into fix-qq-download-bug
This commit is contained in:
commit
3eda8b4652
@ -15,7 +15,7 @@ SITES = {
|
||||
'dilidili' : 'dilidili',
|
||||
'dongting' : 'dongting',
|
||||
'douban' : 'douban',
|
||||
'douyutv' : 'douyutv',
|
||||
'douyu' : 'douyutv',
|
||||
'ehow' : 'ehow',
|
||||
'facebook' : 'facebook',
|
||||
'fc2' : 'fc2video',
|
||||
|
@ -127,7 +127,8 @@ def bilibili_download(url, output_dir='.', merge=True, info_only=False, **kwargs
|
||||
if re.match(r'https?://live\.bilibili\.com/', url):
|
||||
title = r1(r'<title>([^<>]+)</title>', html)
|
||||
bilibili_live_download_by_cid(cid, title, output_dir=output_dir, merge=merge, info_only=info_only)
|
||||
elif 'playlist' in kwargs and kwargs['playlist']:
|
||||
|
||||
else:
|
||||
# multi-P
|
||||
cids = []
|
||||
pages = re.findall('<option value=\'([^\']*)\'', html)
|
||||
@ -140,15 +141,18 @@ def bilibili_download(url, output_dir='.', merge=True, info_only=False, **kwargs
|
||||
if flashvars:
|
||||
t, cid = flashvars.split('=', 1)
|
||||
cids.append(cid.split('&')[0])
|
||||
|
||||
# no multi-P
|
||||
if not pages:
|
||||
cids = [cid]
|
||||
titles = [r1(r'<option value=.* selected>(.+)</option>', html) or title]
|
||||
|
||||
for i in range(len(cids)):
|
||||
bilibili_download_by_cid(cids[i],
|
||||
titles[i],
|
||||
output_dir=output_dir,
|
||||
merge=merge,
|
||||
info_only=info_only)
|
||||
else:
|
||||
title = r1(r'<option value=.* selected>(.+)</option>', html) or title
|
||||
bilibili_download_by_cid(cid, title, output_dir=output_dir, merge=merge, info_only=info_only)
|
||||
|
||||
elif t == 'vid':
|
||||
sina_download_by_vid(cid, title=title, output_dir=output_dir, merge=merge, info_only=info_only)
|
||||
@ -169,14 +173,6 @@ def bilibili_download(url, output_dir='.', merge=True, info_only=False, **kwargs
|
||||
with open(os.path.join(output_dir, title + '.cmt.xml'), 'w', encoding='utf-8') as x:
|
||||
x.write(xml)
|
||||
|
||||
def bilibili_download_playlist(url, output_dir='.', merge=True, info_only=False, **kwargs):
|
||||
bilibili_download(url,
|
||||
output_dir=output_dir,
|
||||
merge=merge,
|
||||
info_only=info_only,
|
||||
playlist=True,
|
||||
**kwargs)
|
||||
|
||||
site_info = "bilibili.com"
|
||||
download = bilibili_download
|
||||
download_playlist = bilibili_download_playlist
|
||||
download_playlist = bilibili_download
|
||||
|
@ -12,7 +12,7 @@ def douyutv_download(url, output_dir = '.', merge = True, info_only = False, **k
|
||||
#Thanks to @yan12125 for providing decoding method!!
|
||||
suffix = 'room/%s?aid=android&client_sys=android&time=%d' % (room_id, int(time.time()))
|
||||
sign = hashlib.md5((suffix + '1231').encode('ascii')).hexdigest()
|
||||
json_request_url = "http://www.douyutv.com/api/v1/%s&auth=%s" % (suffix, sign)
|
||||
json_request_url = "http://www.douyu.com/api/v1/%s&auth=%s" % (suffix, sign)
|
||||
content = get_html(json_request_url)
|
||||
data = json.loads(content)['data']
|
||||
server_status = data.get('error',0)
|
||||
@ -28,6 +28,6 @@ def douyutv_download(url, output_dir = '.', merge = True, info_only = False, **k
|
||||
if not info_only:
|
||||
download_urls([real_url], title, 'flv', None, output_dir, merge = merge)
|
||||
|
||||
site_info = "douyutv.com"
|
||||
site_info = "douyu.com"
|
||||
download = douyutv_download
|
||||
download_playlist = playlist_not_supported('douyutv')
|
||||
download_playlist = playlist_not_supported('douyu')
|
||||
|
@ -4,6 +4,7 @@ from ..common import *
|
||||
|
||||
from .iqiyi import iqiyi_download_by_vid
|
||||
from .le import letvcloud_download_by_vu
|
||||
from .netease import netease_download
|
||||
from .qq import qq_download_by_vid
|
||||
from .sina import sina_download_by_vid
|
||||
from .tudou import tudou_download_by_id
|
||||
@ -36,10 +37,13 @@ yinyuetai_embed_patterns = [ 'player\.yinyuetai\.com/video/swf/(\d+)' ]
|
||||
|
||||
iqiyi_embed_patterns = [ 'player\.video\.qiyi\.com/([^/]+)/[^/]+/[^/]+/[^/]+\.swf[^"]+tvId=(\d+)' ]
|
||||
|
||||
netease_embed_patterns = [ '(http://\w+\.163\.com/movie/[^\'"]+)' ]
|
||||
|
||||
def embed_download(url, output_dir = '.', merge = True, info_only = False ,**kwargs):
|
||||
content = get_content(url)
|
||||
content = get_content(url, headers=fake_headers)
|
||||
found = False
|
||||
title = match1(content, '<title>([^<>]+)</title>')
|
||||
|
||||
vids = matchall(content, youku_embed_patterns)
|
||||
for vid in set(vids):
|
||||
found = True
|
||||
@ -60,6 +64,11 @@ def embed_download(url, output_dir = '.', merge = True, info_only = False ,**kwa
|
||||
found = True
|
||||
iqiyi_download_by_vid((vid[1], vid[0]), title=title, output_dir=output_dir, merge=merge, info_only=info_only)
|
||||
|
||||
urls = matchall(content, netease_embed_patterns)
|
||||
for url in urls:
|
||||
found = True
|
||||
netease_download(url, title=title, output_dir=output_dir, merge=merge, info_only=info_only)
|
||||
|
||||
if not found:
|
||||
raise NotImplementedError(url)
|
||||
|
||||
|
@ -58,7 +58,7 @@ def ffmpeg_concat_mp4_to_mpg(files, output='output.mpg'):
|
||||
concat_list.close()
|
||||
|
||||
params = [FFMPEG] + LOGLEVEL
|
||||
params.extend(['-f', 'concat', '-y', '-i'])
|
||||
params.extend(['-f', 'concat', '-safe', '-1', '-y', '-i'])
|
||||
params.append(output + '.txt')
|
||||
params += ['-c', 'copy', output]
|
||||
|
||||
@ -122,7 +122,7 @@ def ffmpeg_concat_flv_to_mp4(files, output='output.mp4'):
|
||||
concat_list.write("file %s\n" % parameterize(file))
|
||||
concat_list.close()
|
||||
|
||||
params = [FFMPEG] + LOGLEVEL + ['-f', 'concat', '-y', '-i']
|
||||
params = [FFMPEG] + LOGLEVEL + ['-f', 'concat', '-safe', '-1', '-y', '-i']
|
||||
params.append(output + '.txt')
|
||||
params += ['-c', 'copy', output]
|
||||
|
||||
@ -167,7 +167,7 @@ def ffmpeg_concat_mp4_to_mp4(files, output='output.mp4'):
|
||||
concat_list.write("file %s\n" % parameterize(file))
|
||||
concat_list.close()
|
||||
|
||||
params = [FFMPEG] + LOGLEVEL + ['-f', 'concat', '-y', '-i']
|
||||
params = [FFMPEG] + LOGLEVEL + ['-f', 'concat', '-safe', '-1', '-y', '-i']
|
||||
params.append(output + '.txt')
|
||||
params += ['-c', 'copy', output]
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user