mirror of
https://github.com/wbt5/real-url.git
synced 2025-06-16 15:59:57 +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):
|
||||
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'
|
||||
'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, '
|
||||
'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:
|
||||
res = s.get(url, headers=headers)
|
||||
try:
|
||||
res = res.json()
|
||||
except:
|
||||
except Exception:
|
||||
raise Exception('直播间不存在')
|
||||
status = res['online']
|
||||
if status:
|
||||
|
Loading…
x
Reference in New Issue
Block a user