mirror of
https://github.com/wbt5/real-url.git
synced 2025-07-23 17:06:40 +08:00
⚡ Improve 我秀直播
-优化代码
This commit is contained in:
parent
5a175ec283
commit
3ff9c78da2
8
woxiu.py
8
woxiu.py
@ -10,15 +10,15 @@ class WoXiu:
|
|||||||
|
|
||||||
def get_real_url(self):
|
def get_real_url(self):
|
||||||
headers = {
|
headers = {
|
||||||
'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) '
|
'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, '
|
||||||
'Version/11.0 Mobile/15A372 Safari/604.1'
|
'like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1 '
|
||||||
}
|
}
|
||||||
url = 'https://m.woxiu.com/index.php?action=M/Live&do=LiveInfo&room_id={}'.format(self.rid)
|
url = f'https://m.woxiu.com/index.php?action=M/Live&do=LiveInfo&room_id={self.rid}'
|
||||||
with requests.Session() as s:
|
with requests.Session() as s:
|
||||||
res = s.get(url, headers=headers)
|
res = s.get(url, headers=headers)
|
||||||
try:
|
try:
|
||||||
res = res.json()
|
res = res.json()
|
||||||
except:
|
except Exception:
|
||||||
raise Exception('直播间不存在')
|
raise Exception('直播间不存在')
|
||||||
status = res['online']
|
status = res['online']
|
||||||
if status:
|
if status:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user