Open Yuphee opened 8 months ago
贴一个我自己拼凑的,会打印四个线路
import json
import requests
rid = input('输入虎牙直播房间号:\n')
url = f"https://mp.huya.com/cache.php?m=Live&do=profileRoom&roomid={rid}"
headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36'
}
response = requests.get(url=url,headers=headers)
json_data = response.text
data = json.loads(json_data)
for lines in range(0,4):
flv_url = data['data']['stream']['flv']['multiLine'][lines]['url']
print(flv_url)
贴一个我自己拼凑的,会打印四个线路
import json import requests rid = input('输入虎牙直播房间号:\n') url = f"https://mp.huya.com/cache.php?m=Live&do=profileRoom&roomid={rid}" headers = { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36' } response = requests.get(url=url,headers=headers) json_data = response.text data = json.loads(json_data) for lines in range(0,4): flv_url = data['data']['stream']['flv']['multiLine'][lines]['url'] print(flv_url)
https://mp.huya.com/cache.php?m=Live&do=profileRoom&roomid={rid}这个地址是在app端抓取到的吗?还是哪里?
贴一个我自己拼凑的,会打印四个线路
import json import requests rid = input('输入虎牙直播房间号:\n') url = f"https://mp.huya.com/cache.php?m=Live&do=profileRoom&roomid={rid}" headers = { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36' } response = requests.get(url=url,headers=headers) json_data = response.text data = json.loads(json_data) for lines in range(0,4): flv_url = data['data']['stream']['flv']['multiLine'][lines]['url'] print(flv_url)
https://mp.huya.com/cache.php?m=Live&do=profileRoom&roomid={rid}这个地址是在app端抓取到的吗?还是哪里?
还有就是打印出来的flv_url是没办法直接用的,应该还要一个关键参数seqid
还有就是打印出来的flv_url是没办法直接用的,应该还要一个关键参数seqid
我用vlc直接播放没发现任何问题
还有就是打印出来的flv_url是没办法直接用的,应该还要一个关键参数seqid
我用vlc直接播放没发现任何问题
请问你这个https://mp.huya.com/cache.php?m=Live&do=profileRoom&roomid={rid}在哪里抓到的?app还是pc网页还是移动端网页呢?
还有就是打印出来的flv_url是没办法直接用的,应该还要一个关键参数seqid
我用vlc直接播放没发现任何问题
请问你这个[https://mp.huya.com/cache.php?m=Live&do=profileRoom&roomid={rid}]()在哪里抓到的?app还是pc网页还是移动端网页呢?
贴一个我自己拼凑的,会打印四个线路
import json import requests rid = input('输入虎牙直播房间号:\n') url = f"https://mp.huya.com/cache.php?m=Live&do=profileRoom&roomid={rid}" headers = { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36' } response = requests.get(url=url,headers=headers) json_data = response.text data = json.loads(json_data) for lines in range(0,4): flv_url = data['data']['stream']['flv']['multiLine'][lines]['url'] print(flv_url)
感谢 好用..一点不卡缓冲
邮件已收到,谢谢!
邮件已收到,谢谢!
贴一个我自己拼凑的,会打印四个线路
import json import requests rid = input('输入虎牙直播房间号:\n') url = f"https://mp.huya.com/cache.php?m=Live&do=profileRoom&roomid={rid}" headers = { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36' } response = requests.get(url=url,headers=headers) json_data = response.text data = json.loads(json_data) for lines in range(0,4): flv_url = data['data']['stream']['flv']['multiLine'][lines]['url'] print(flv_url)
很好用, 感谢, 另外请问这个默认是什么清晰度, 如何切换清晰度?
邮件已收到,谢谢!
贴一个我自己拼凑的,会打印四个线路
import json import requests rid = input('输入虎牙直播房间号:\n') url = f"https://mp.huya.com/cache.php?m=Live&do=profileRoom&roomid={rid}" headers = { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36' } response = requests.get(url=url,headers=headers) json_data = response.text data = json.loads(json_data) for lines in range(0,4): flv_url = data['data']['stream']['flv']['multiLine'][lines]['url'] print(flv_url)
现在会出现只能看3秒
邮件已收到,谢谢!
现在会出现只能看3秒
我这边VLC正常播放
现在会出现只能看3秒
我这边VLC正常播放
只是在部分主播出现3秒播放
贴一个我自己拼凑的,会打印四个线路
import json import requests rid = input('输入虎牙直播房间号:\n') url = f"https://mp.huya.com/cache.php?m=Live&do=profileRoom&roomid={rid}" headers = { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36' } response = requests.get(url=url,headers=headers) json_data = response.text data = json.loads(json_data) for lines in range(0,4): flv_url = data['data']['stream']['flv']['multiLine'][lines]['url'] print(flv_url)
这样直接获取的源不一定能播放。 不过受此提示,更新了一下,虎牙暂时可用了,但我不怎么看虎牙,所以还需各位看LOL的粉丝们测试。
说一下,断流太严重了