1
0
mirror of https://github.com/wbt5/real-url.git synced 2025-06-17 00:09:58 +08:00

修复虎牙、哔哩哔哩、快手、爱奇艺

This commit is contained in:
wbt5 2020-04-24 21:52:16 +08:00
parent 924a445d4b
commit 8bb3edfe39
4 changed files with 7 additions and 5 deletions

View File

@ -2,7 +2,9 @@
目前有21个直播平台斗鱼直播、虎牙直播、哔哩哔哩直播、战旗直播、网易CC直播、火猫直播、企鹅电竞、YY直播、一直播、快手直播、花椒直播、映客直播、西瓜直播、触手直播、NOW直播、抖音直播爱奇艺直播、酷狗直播、龙珠直播、PPS奇秀直播、六间房。
> 2020.02.26: 更新一直播。
> 2020.04.24:修复虎牙、哔哩哔哩、快手、爱奇艺。
> 2020.02.26:更新一直播。
> 2020.01.18:更新抖音直播。

View File

@ -1,5 +1,5 @@
# 获取哔哩哔哩直播的真实流媒体地址。
# quality=4默认画质为原画
# 现在B站直播默认画质改为高清了更高画质需登陆才可获取。
import requests

View File

@ -11,7 +11,7 @@ import urllib.parse
def get_real_url(rid):
try:
response = requests.get('https://m-live.iqiyi.com/w/' + rid).text
response = requests.get('https://m-gamelive.iqiyi.com/w/' + rid).text
# 获取直播间的qipuId
qipuId = re.findall(r'"qipuId":(\d*?),"roomId', response)[0]
callback = 'jsonp_' + str(int((time.time() * 1000))) + '_0000'

View File

@ -11,8 +11,8 @@ def get_real_url(rid):
headers = {
'user-agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1'}
response = requests.get(url=room_url, headers=headers).text
m3u8_url = re.findall(r'type="video/mp4" src="([\s\S]*?)_sd1000tp.m3u8', response)[0]
real_url = [m3u8_url + i for i in ['.flv', '.m3u8']]
m3u8_url = re.findall(r'type="application/x-mpegURL" src="([\s\S]*?)_sd1000(tp)?(/index)?.m3u8', response)[0]
real_url = [m3u8_url[0] + i for i in ['.flv', '.m3u8']]
except:
real_url = '该直播间不存在或未开播'
return real_url