This commit is contained in:
Mort Yao 2014-04-13 13:31:21 +02:00
parent ecb7e84e6b
commit 358df6bfff

View File

@ -12,15 +12,15 @@ from .youku import youku_download_by_id
import json, re
def get_srt_json(id):
url = 'http://comment.acfun.tv/%s.json' % id
url = 'http://comment.acfun.com/%s.json' % id
return get_html(url)
def get_srt_lock_json(id):
url = 'http://comment.acfun.tv/%s_lock.json' % id
url = 'http://comment.acfun.com/%s_lock.json' % id
return get_html(url)
def acfun_download_by_vid(vid, title=None, output_dir='.', merge=True, info_only=False):
info = json.loads(get_html('http://www.acfun.tv/video/getVideo.aspx?id=' + vid))
info = json.loads(get_html('http://www.acfun.com/video/getVideo.aspx?id=' + vid))
sourceType = info['sourceType']
sourceId = info['sourceId']
danmakuId = info['danmakuId']
@ -49,10 +49,10 @@ def acfun_download_by_vid(vid, title=None, output_dir='.', merge=True, info_only
pass
def acfun_download(url, output_dir = '.', merge = True, info_only = False):
assert re.match(r'http://[^\.]+.acfun.tv/v/ac(\d+)', url)
assert re.match(r'http://[^\.]+.acfun.[^\.]+/v/ac(\d+)', url)
html = get_html(url)
title = r1(r'<h1 id="title-article" class="title"[^<>]*>([^<>]+)<', html)
title = r1(r'<h1 id="txt-title-view">([^<>]+)<', html)
title = unescape_html(title)
title = escape_file_path(title)
assert title
@ -68,6 +68,6 @@ def acfun_download(url, output_dir = '.', merge = True, info_only = False):
id = r1(r"src=\"/newflvplayer/player.*id=(\d+)", html)
sina_download_by_vid(id, title, output_dir=output_dir, merge=merge, info_only=info_only)
site_info = "AcFun.tv"
site_info = "AcFun.com"
download = acfun_download
download_playlist = playlist_not_supported('acfun')