Skip to content

Commit

Permalink
新增一直播
Browse files Browse the repository at this point in the history
  • Loading branch information
wbt5 committed Nov 17, 2019
1 parent 557864b commit b1851ee
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 2 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
获取斗鱼&虎牙&哔哩哔哩&战旗直播&网易CC&火猫直播&企鹅电竞&YY直播 直播间的真实流媒体地址(直播源),可在PotPlayer、flv.js等播放器中播放。
获取斗鱼&虎牙&哔哩哔哩&战旗直播&网易CC&火猫直播&企鹅电竞&YY直播&一直播 直播间的真实流媒体地址(直播源),可在PotPlayer、flv.js等播放器中播放。

2019年11月17日:新增火猫直播;新增企鹅电竞;新增YY直播
2019年11月18日:新增一直播。

2019年11月17日:新增火猫直播;新增企鹅电竞;新增YY直播。

2019年11月16日:新增战旗tv直播源;新增网易CC直播。

Expand Down
41 changes: 41 additions & 0 deletions yizhibo.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# 获取一直播的真实流媒体地址。


import requests
import re


def get_real_url(room_url):
try:
scid = re.findall(r'/l/(\w*).html', room_url)[0]
flvurl = 'http://alcdn.f01.xiaoka.tv/live/{}.flv'.format(scid)
m3u8url = 'http://al01.alcdn.hls.xiaoka.tv/live/{}.m3u8'.format(scid)
rtmpurl = 'rtmp://alcdn.r01.xiaoka.tv/live/live/{}'.format(scid)
real_url = {
'flvurl': flvurl,
'm3u8url': m3u8url,
'rtmpurl': rtmpurl
}
except:
real_url = '链接错误'
return real_url


def get_status(room_url):
try:
scid = re.findall(r'/l/(\w*).html', room_url)[0]
response = requests.get(
url='https://m.yizhibo.com/www/live/get_live_video?scid=' + str(scid)).json()
status_code = response.get('data').get('info').get('status')
status = '直播中' if status_code == 10 else '未开播'
except:
status = '链接错误'
return status


rid = input('请输入一直播房间地址:\n')
status = get_status(rid)
print('当前直播状态', status)
real_url = get_real_url(rid)
print('该直播间源地址为:')
print(real_url)

0 comments on commit b1851ee

Please sign in to comment.