refactor(sponsorblock): use params and include sponsor category as well

This commit is contained in:
Ryan 2025-01-22 14:53:21 -05:00
parent 8ef4c85bd8
commit 03a8014d2f
Signed by: ErrorNoInternet
GPG Key ID: 2486BFB7B1E6A4A3

View File

@ -12,7 +12,8 @@ async def get_segments(videoId: str):
hashPrefix = hashlib.sha256(videoId.encode()).hexdigest()[:4]
session = aiohttp.ClientSession()
response = await session.get(
f'https://sponsor.ajay.app/api/skipSegments/{hashPrefix}?categories=["music_offtopic"]'
f"https://sponsor.ajay.app/api/skipSegments/{hashPrefix}",
params={"categories": '["sponsor", "music_offtopic"]'},
)
if response.status == 200 and (
results := list(