diff --git a/you_get/downloader/cntv.py b/you_get/downloader/cntv.py index d807ec27..35945ffb 100644 --- a/you_get/downloader/cntv.py +++ b/you_get/downloader/cntv.py @@ -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'(\w+)', 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)