wbt5 / real-url

获取斗鱼&虎牙&哔哩哔哩&抖音&快手等 58 个直播平台的真实流媒体地址(直播源)和弹幕,直播源可在 PotPlayer、flv.js 等播放器中播放。
GNU General Public License v2.0
7.43k stars 1.54k forks source link

有最新的虎牙拉流地址方法么 #468

Open Yuphee opened 8 months ago

Yigehaoren8848 commented 8 months ago

说一下,断流太严重了

iceynano commented 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)
Yigehaoren8848 commented 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)

https://mp.huya.com/cache.php?m=Live&do=profileRoom&roomid={rid}这个地址是在app端抓取到的吗?还是哪里

Yigehaoren8848 commented 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)

https://mp.huya.com/cache.php?m=Live&do=profileRoom&roomid={rid}这个地址是在app端抓取到的吗?还是哪里

还有就是打印出来的flv_url是没办法直接用的,应该还要一个关键参数seqid

iceynano commented 8 months ago

还有就是打印出来的flv_url是没办法直接用的,应该还要一个关键参数seqid

我用vlc直接播放没发现任何问题

Yigehaoren8848 commented 8 months ago

还有就是打印出来的flv_url是没办法直接用的,应该还要一个关键参数seqid

我用vlc直接播放没发现任何问题

请问你这个https://mp.huya.com/cache.php?m=Live&do=profileRoom&roomid={rid}在哪里抓到的?app还是pc网页还是移动端网页呢?

iceynano commented 8 months ago

还有就是打印出来的flv_url是没办法直接用的,应该还要一个关键参数seqid

我用vlc直接播放没发现任何问题

请问你这个[https://mp.huya.com/cache.php?m=Live&do=profileRoom&roomid={rid}]()在哪里抓到的?app还是pc网页还是移动端网页呢

https://www.52pojie.cn/forum.php?mod=viewthread&tid=1700120

djniche commented 7 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)

感谢 好用..一点不卡缓冲

Yuphee commented 7 months ago

邮件已收到,谢谢!

Yuphee commented 6 months ago

邮件已收到,谢谢!

DreamL commented 5 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)

很好用, 感谢, 另外请问这个默认是什么清晰度, 如何切换清晰度?

Yuphee commented 5 months ago

邮件已收到,谢谢!

wxhbts commented 3 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)

现在会出现只能看3秒

Yuphee commented 3 months ago

邮件已收到,谢谢!

iceynano commented 3 months ago

现在会出现只能看3秒

我这边VLC正常播放

wxhbts commented 3 months ago

现在会出现只能看3秒

我这边VLC正常播放

只是在部分主播出现3秒播放

thep0y commented 3 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)

这样直接获取的源不一定能播放。 不过受此提示,更新了一下,虎牙暂时可用了,但我不怎么看虎牙,所以还需各位看LOL的粉丝们测试。

https://github.com/thep0y/lsar