fix to handle new domain of douyu.com (was douyutv.com)

This commit is contained in:
Botu Sun 2016-03-25 16:44:32 +09:00
parent 0cabb980b6
commit 39ceacd8d6
2 changed files with 4 additions and 4 deletions

View File

@ -15,7 +15,7 @@ SITES = {
'dilidili' : 'dilidili', 'dilidili' : 'dilidili',
'dongting' : 'dongting', 'dongting' : 'dongting',
'douban' : 'douban', 'douban' : 'douban',
'douyutv' : 'douyutv', 'douyu' : 'douyutv',
'ehow' : 'ehow', 'ehow' : 'ehow',
'facebook' : 'facebook', 'facebook' : 'facebook',
'fc2' : 'fc2video', 'fc2' : 'fc2video',

View File

@ -12,7 +12,7 @@ def douyutv_download(url, output_dir = '.', merge = True, info_only = False, **k
#Thanks to @yan12125 for providing decoding method!! #Thanks to @yan12125 for providing decoding method!!
suffix = 'room/%s?aid=android&client_sys=android&time=%d' % (room_id, int(time.time())) suffix = 'room/%s?aid=android&client_sys=android&time=%d' % (room_id, int(time.time()))
sign = hashlib.md5((suffix + '1231').encode('ascii')).hexdigest() 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) content = get_html(json_request_url)
data = json.loads(content)['data'] data = json.loads(content)['data']
server_status = data.get('error',0) 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: if not info_only:
download_urls([real_url], title, 'flv', None, output_dir, merge = merge) download_urls([real_url], title, 'flv', None, output_dir, merge = merge)
site_info = "douyutv.com" site_info = "douyu.com"
download = douyutv_download download = douyutv_download
download_playlist = playlist_not_supported('douyutv') download_playlist = playlist_not_supported('douyu')