mirror of
https://github.com/soimort/you-get.git
synced 2025-03-13 03:17:44 +03:00
parent
7c2ea4f641
commit
62a9e35ed0
@ -9,6 +9,7 @@ SITES = {
|
||||
'bandcamp' : 'bandcamp',
|
||||
'baomihua' : 'baomihua',
|
||||
'bilibili' : 'bilibili',
|
||||
'cctv' : 'cntv',
|
||||
'cntv' : 'cntv',
|
||||
'cbs' : 'cbs',
|
||||
'dailymotion' : 'dailymotion',
|
||||
|
@ -7,6 +7,7 @@ from ..common import *
|
||||
import json
|
||||
import re
|
||||
|
||||
|
||||
def cntv_download_by_id(id, title = None, output_dir = '.', merge = True, info_only = False):
|
||||
assert id
|
||||
info = json.loads(get_html('http://vdn.apps.cntv.cn/api/getHttpVideoInfo.do?pid=' + id))
|
||||
@ -31,7 +32,12 @@ def cntv_download_by_id(id, title = None, output_dir = '.', merge = True, info_o
|
||||
def cntv_download(url, output_dir = '.', merge = True, info_only = False, **kwargs):
|
||||
if re.match(r'http://tv\.cntv\.cn/video/(\w+)/(\w+)', url):
|
||||
id = match1(url, r'http://tv\.cntv\.cn/video/\w+/(\w+)')
|
||||
elif re.match(r'http://\w+\.cntv\.cn/(\w+/\w+/(classpage/video/)?)?\d+/\d+\.shtml', url) or re.match(r'http://\w+.cntv.cn/(\w+/)*VIDE\d+.shtml', url):
|
||||
elif re.match(r'http://\w+.cctv.com/\d+/\d+/\d+/\w+.shtml', url) or re.match(r'http://\w+.cntv.cn/\d+/\d+/\d+/\w+.shtml', url):
|
||||
html = get_content(url)
|
||||
id = match1(html, r'guid = \"(.+)\"')
|
||||
elif re.match(r'http://\w+\.cntv\.cn/(\w+/\w+/(classpage/video/)?)?\d+/\d+\.shtml', url) or \
|
||||
re.match(r'http://\w+.cntv.cn/(\w+/)*VIDE\d+.shtml', url) or \
|
||||
re.match(r'http://(\w+).cntv.cn/(\w+)/classpage/video/(\d+)/(\d+).shtml', url):
|
||||
id = r1(r'videoCenterId","(\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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user