Skip to content

Commit

Permalink
新增Bigotv直播
Browse files Browse the repository at this point in the history
  • Loading branch information
auqhjjqdo committed Nov 2, 2023
1 parent 028403e commit b3aaadb
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
- [x] TwitCasting
- [x] Afreeca
- [x] Pandalive
- [x] Bigotv
- [ ] 更多平台欢迎PR

## 已知bug
Expand Down
5 changes: 5 additions & 0 deletions config.sample.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@
"platform": "Pandalive",
"id": "seeenv",
"name": "seeenv"
},
{
"platform": "Bigotv",
"id": "660801666",
"name": "660801666"
}
]
}
18 changes: 18 additions & 0 deletions live_recorder.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,24 @@ async def run(self):
await asyncio.to_thread(self.run_record, stream, url, title, 'ts')


class Bigotv(LiveRecoder):
async def run(self):
url = f'https://www.bigo.tv/cn/{self.id}'
if url not in recording:
response = (await self.request(
method='POST',
url='https://ta.bigo.tv/official_website/studio/getInternalStudioInfo',
params={'siteId': self.id}
)).json()
if response['data']['alive']:
title = response['data']['roomTopic']
stream = HLSStream(
session=self.get_streamlink(),
url=response['data']['hls_src']
) # HLSStream[mpegts]
await asyncio.to_thread(self.run_record, stream, url, title, 'ts')


async def run():
with open('config.json', 'r', encoding='utf-8') as f:
config = json.load(f)
Expand Down

0 comments on commit b3aaadb

Please sign in to comment.