mirror of
https://github.com/wbt5/real-url.git
synced 2025-07-27 11:00:32 +08:00
✨ Add BIGOLIVE (#245)
This commit is contained in:
parent
7b40185347
commit
5d4dfb3a10
35
bigo.py
Normal file
35
bigo.py
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# @Time: 2021/8/15 16:00
|
||||||
|
# @Project: my-spiders
|
||||||
|
# @Author: wbt5
|
||||||
|
# @Blog: https://wbt5.com
|
||||||
|
|
||||||
|
import requests
|
||||||
|
|
||||||
|
|
||||||
|
class bigo:
|
||||||
|
|
||||||
|
def __init__(self, rid):
|
||||||
|
self.rid = rid
|
||||||
|
|
||||||
|
def get_real_url(self):
|
||||||
|
with requests.Session() as s:
|
||||||
|
url = f'https://ta.bigo.tv/official_website/studio/getInternalStudioInfo'
|
||||||
|
res = s.post(url, data={'siteId': self.rid}).json()
|
||||||
|
hls_src = res['data']['hls_src']
|
||||||
|
play_url = hls_src if hls_src else '不存在或未开播'
|
||||||
|
return play_url
|
||||||
|
|
||||||
|
|
||||||
|
def get_real_url(rid):
|
||||||
|
try:
|
||||||
|
url = bigo(rid)
|
||||||
|
return url.get_real_url()
|
||||||
|
except Exception as e:
|
||||||
|
print('Exception:', e)
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
r = input('输入bigo直播房间号:\n')
|
||||||
|
print(get_real_url(r))
|
Loading…
x
Reference in New Issue
Block a user