直播添加ua

This commit is contained in:
qist
2026-05-12 09:02:43 +08:00
parent b2807dd4f4
commit ba32661f7e
3 changed files with 7 additions and 6 deletions
+5 -4
View File
@@ -219,16 +219,17 @@ class Spider(Spider):
return result
def playerContent(self, flag, id, vipFlags):
h = {'User-Agent': self.header['User-Agent']}
# 直播: 直接用m3u8地址
if id.startswith('live@'):
m3u8 = id.replace('live@', '')
if m3u8.startswith('http'):
return {'parse': 0, 'url': m3u8, 'header': {}, 'playUrl': ''}
return {'parse': 0, 'url': m3u8, 'header': h, 'playUrl': ''}
stream = self._get_live_stream(m3u8)
return {'parse': 0, 'url': stream, 'header': {}, 'playUrl': ''}
# m3u8直链(从detailContent传过来的)
return {'parse': 0, 'url': stream, 'header': h, 'playUrl': ''}
# m3u8直链
if id.startswith('http'):
return {'parse': 0, 'url': id, 'header': {}, 'playUrl': ''}
return {'parse': 0, 'url': id, 'header': h, 'playUrl': ''}
# 点播
parts = id.split('@')
route = parts[0] if len(parts) > 1 else 'play'