Skip to content

Commit

Permalink
add support for cb (auqhjjqdo#109)
Browse files Browse the repository at this point in the history
  • Loading branch information
iayee authored Jul 6, 2024
1 parent d660868 commit 1d855f8
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
5 changes: 5 additions & 0 deletions config.sample.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@
"id": "@blue_gk",
"name": "@blue_gk",
"cookies": "_sketch_session=xxxxx"
},
{
"platform": "Chaturbate",
"id": "abc123",
"name": "abc123"
}
]
}
24 changes: 24 additions & 0 deletions live_recorder.py
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,30 @@ 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}'
if url not in recording:
response = (await self.request(
method='POST',
url='https://chaturbate.com/get_edge_hls_url_ajax/',
headers={
'X-Requested-With': 'XMLHttpRequest'
},
data={
'room_slug': self.id
}
)).json()
if response['room_status'] == 'public':
title = self.id
streams = HLSStream.parse_variant_playlist(
session=self.get_streamlink(),
url=response['url']
)
stream = list(streams.values())[2]
await asyncio.to_thread(self.run_record, stream, url, title, 'ts')


async def run():
Expand Down

0 comments on commit 1d855f8

Please sign in to comment.