Ensure a valid channel/playlist id present when validating url in youtube task handler.

This commit is contained in:
arabcoders 2025-09-23 22:00:26 +03:00
parent 03cd3312cc
commit d09761bd1c

View file

@ -129,10 +129,10 @@ class YoutubeHandler(BaseHandler):
None if the URL is neither.
"""
if m := YoutubeHandler.CHANNEL_REGEX.match(url):
if (m := YoutubeHandler.CHANNEL_REGEX.match(url)) and m.group("id"):
return {"type": "channel_id", "id": m.group("id")}
if m := YoutubeHandler.PLAYLIST_REGEX.match(url):
if (m := YoutubeHandler.PLAYLIST_REGEX.match(url)) and m.group("id"):
return {"type": "playlist_id", "id": m.group("id")}
return None