mirror of
https://github.com/wbt5/real-url.git
synced 2025-07-27 11:00:32 +08:00
新增艾米直播
This commit is contained in:
parent
c5c0a25a30
commit
f8d31de046
23
imifun.py
Normal file
23
imifun.py
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
# 艾米直播:https://www.imifun.com/
|
||||||
|
import requests
|
||||||
|
import re
|
||||||
|
|
||||||
|
|
||||||
|
def imifun(rid):
|
||||||
|
with requests.Session() as s:
|
||||||
|
res = s.get('https://www.imifun.com/' + str(rid)).text
|
||||||
|
roomid = re.search(r"roomId:\s'([\w-]+)'", res)
|
||||||
|
if roomid:
|
||||||
|
status = re.search(r"isLive:(\d),", res).group(1)
|
||||||
|
if status == '1':
|
||||||
|
real_url = 'https://wsmd.happyia.com/ivp/{}.flv'.format(roomid.group(1))
|
||||||
|
return real_url
|
||||||
|
else:
|
||||||
|
raise Exception('未开播')
|
||||||
|
else:
|
||||||
|
raise Exception('直播间不存在')
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
r = input('输入艾米直播房间号:\n')
|
||||||
|
print(imifun(r))
|
Loading…
x
Reference in New Issue
Block a user