Skip to content

Commit

Permalink
修复Pixivsketch无可用直播源
Browse files Browse the repository at this point in the history
  • Loading branch information
auqhjjqdo committed Jan 11, 2024
1 parent 5e7d02b commit c07d5d1
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions live_recorder.py
Original file line number Diff line number Diff line change
Expand Up @@ -472,8 +472,13 @@ async def run(self):
next_data = json.loads(re.search(r'<script id="__NEXT_DATA__".*?>(.*?)</script>', response)[1])
initial_state = json.loads(next_data['props']['pageProps']['initialState'])
if lives := initial_state['live']['lives']:
title = list(lives.values())[0]['name']
stream = self.get_streamlink().streams(url).get('best') # HLSStream[mpegts]
live = list(lives.values())[0]
title = live['name']
streams = HLSStream.parse_variant_playlist(
session=self.get_streamlink(),
url=live['owner']['hls_movie']
)
stream = list(streams.values())[0] # HLSStream[mpegts]
await asyncio.to_thread(self.run_record, stream, url, title, 'ts')


Expand Down

0 comments on commit c07d5d1

Please sign in to comment.