mirror of
https://github.com/soimort/you-get.git
synced 2025-02-02 16:24:00 +03:00
fix CNTV
This commit is contained in:
parent
f739bfa314
commit
b89618d61d
@ -13,7 +13,7 @@ def cntv_download_by_id(id, title = None, output_dir = '.', merge = True, info_o
|
||||
title = title or info['title']
|
||||
video = info['video']
|
||||
alternatives = [x for x in video.keys() if x.startswith('chapters')]
|
||||
assert alternatives in (['chapters'], ['chapters', 'chapters2']), alternatives
|
||||
#assert alternatives in (['chapters'], ['chapters', 'chapters2']), alternatives
|
||||
chapters = video['chapters2'] if 'chapters2' in video else video['chapters']
|
||||
urls = [x['url'] for x in chapters]
|
||||
ext = r1(r'\.([^.]+)$', urls[0])
|
||||
@ -28,7 +28,7 @@ def cntv_download_by_id(id, title = None, output_dir = '.', merge = True, info_o
|
||||
download_urls(urls, title, ext, size, output_dir = output_dir, merge = merge)
|
||||
|
||||
def cntv_download(url, output_dir = '.', merge = True, info_only = False):
|
||||
if re.match(r'http://\w+\.cntv\.cn/(\w+/\w+/classpage/video/)?\d+/\d+\.shtml', url):
|
||||
if re.match(r'http://\w+\.cntv\.cn/(\w+/\w+/(classpage/video/)?)?\d+/\d+\.shtml', url):
|
||||
id = r1(r'<!--repaste.video.code.begin-->(\w+)<!--repaste.video.code.end-->', get_html(url))
|
||||
elif re.match(r'http://xiyou.cntv.cn/v-[\w-]+\.html', url):
|
||||
id = r1(r'http://xiyou.cntv.cn/v-([\w-]+)\.html', url)
|
||||
|
Loading…
Reference in New Issue
Block a user