mirror of
https://github.com/soimort/you-get.git
synced 2025-02-03 08:43:58 +03:00
fix douyutv support.
This commit is contained in:
parent
eafe0d86ec
commit
c3b16cfbda
@ -246,7 +246,7 @@ def url_info(url, faker = False):
|
||||
ext = None
|
||||
|
||||
if headers['transfer-encoding'] != 'chunked':
|
||||
size = int(headers['content-length'])
|
||||
size = int(headers['content-length'] or '-1')
|
||||
else:
|
||||
size = None
|
||||
|
||||
|
@ -7,7 +7,7 @@ import re
|
||||
import json
|
||||
|
||||
def douyutv_download(url, output_dir = '.', merge = True, info_only = False):
|
||||
html = get_html(p_url)
|
||||
html = get_html(url)
|
||||
room_id_patt = '"room_id":(\d{1,99}),'
|
||||
title_patt = '<title>([^<]{0,1000})</title>'
|
||||
|
||||
@ -17,8 +17,8 @@ def douyutv_download(url, output_dir = '.', merge = True, info_only = False):
|
||||
conf = get_html("http://www.douyutv.com/api/client/room/"+roomid)
|
||||
metadata = json.loads(conf)
|
||||
|
||||
rtmp_live= jcfg.get('data').get('rtmp_live')
|
||||
rtmp_url= jcfg.get('data').get('rtmp_url')
|
||||
rtmp_live= metadata.get('data').get('rtmp_live')
|
||||
rtmp_url= metadata.get('data').get('rtmp_url')
|
||||
real_url = rtmp_url+'/'+rtmp_live
|
||||
|
||||
type, ext, size = url_info(real_url)
|
||||
|
Loading…
Reference in New Issue
Block a user