mirror of
https://github.com/soimort/you-get.git
synced 2025-02-11 20:52:31 +03:00
add UA fix some time statuscode=403
This commit is contained in:
parent
ac6b97618f
commit
5db51c9478
@ -40,7 +40,10 @@ def douyutv_download(url, output_dir = '.', merge = True, info_only = False, **k
|
||||
douyutv_video_download(url, output_dir=output_dir, merge=merge, info_only=info_only, **kwargs)
|
||||
return
|
||||
|
||||
html = get_content(url)
|
||||
headers = {
|
||||
'user-agent': 'Mozilla/5.0 (iPad; CPU OS 8_1_3 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Version/8.0 Mobile/12B466 Safari/600.1.4'
|
||||
}
|
||||
html = get_content(url, headers)
|
||||
room_id_patt = r'"room_id"\s*:\s*(\d+),'
|
||||
room_id = match1(html, room_id_patt)
|
||||
if room_id == "0":
|
||||
|
Loading…
Reference in New Issue
Block a user