Skip to content

Commit

Permalink
修复抖音录制画质问题
Browse files Browse the repository at this point in the history
  • Loading branch information
auqhjjqdo committed Jul 6, 2024
1 parent 56df49f commit 2bd472c
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions live_recorder.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,9 +276,15 @@ async def run(self):
data = data[0]
if data['status'] == 2:
title = data['title']
live_url = ''
stream_data = json.loads(data['stream_url']['live_core_sdk_data']['pull_data']['stream_data'])
for quality_code in ('origin', 'uhd', 'hd', 'sd', 'md', 'ld'):
if quality_data := stream_data['data'].get(quality_code):
live_url = quality_data['main']['flv']
break
stream = HTTPStream(
self.get_streamlink(),
data['stream_url']['flv_pull_url']['FULL_HD1']
live_url
) # HTTPStream[flv]
await asyncio.to_thread(self.run_record, stream, url, title, 'flv')

Expand Down Expand Up @@ -455,11 +461,11 @@ async def run(self):
)
stream = list(streams.values())[0] # HLSStream[mpegts]
await asyncio.to_thread(self.run_record, stream, url, title, 'ts')


class Chaturbate(LiveRecoder):
async def run(self):
url = f'https://chaturbate.com/{self.id}'
url = f'https://chaturbate.com/{self.id}'
if url not in recording:
response = (await self.request(
method='POST',
Expand All @@ -477,7 +483,7 @@ async def run(self):
session=self.get_streamlink(),
url=response['url']
)
stream = list(streams.values())[2]
stream = list(streams.values())[2]
await asyncio.to_thread(self.run_record, stream, url, title, 'ts')


Expand Down

0 comments on commit 2bd472c

Please sign in to comment.