Skip to content

Commit

Permalink
优化抖音直播流编码选择
Browse files Browse the repository at this point in the history
  • Loading branch information
auqhjjqdo committed Jul 11, 2023
1 parent bbb2a7b commit 67923ea
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,12 +257,12 @@ async def run(self):
)).text
result = re.search('<script id="RENDER_DATA".*?>(.*?)</script>', response).group(1)
data = json.loads(urllib.parse.unquote(result))
room_info = data['app']['initialState']['roomStore']['roomInfo']
if web_stream_url := room_info['web_stream_url']:
title = room_info['room']['title']
initial_state = data['app']['initialState']
if stream := initial_state['streamStore']['streamData']['H264_streamData']['stream']:
title = initial_state['roomStore']['roomInfo']['room']['title']
stream = HTTPStream(
self.get_streamlink(),
web_stream_url['flv_pull_url']['FULL_HD1']
stream['origin']['main']['flv']
) # HTTPStream[flv]
await asyncio.to_thread(self.run_record, stream, url, title, 'flv')

Expand Down

0 comments on commit 67923ea

Please sign in to comment.