diff --git a/backend/common/src/urlparser.py b/backend/common/src/urlparser.py index 6c058a0a..ae314791 100644 --- a/backend/common/src/urlparser.py +++ b/backend/common/src/urlparser.py @@ -67,6 +67,9 @@ class Parser: if all_paths[0] == "channel": return self._validate_expected(all_paths[1], "channel") + if all_paths[0] == "live": + return self._validate_expected(all_paths[1], "video") + # detect channel channel_id = self._extract_channel_name(parsed.geturl()) return {"type": "channel", "url": channel_id} diff --git a/backend/common/tests/test_src/test_urlparser.py b/backend/common/tests/test_src/test_urlparser.py index f25f3ca9..2f54544e 100644 --- a/backend/common/tests/test_src/test_urlparser.py +++ b/backend/common/tests/test_src/test_urlparser.py @@ -10,6 +10,7 @@ VIDEO_URL_IN = [ "https://www.youtube.com/watch?v=7DKv5H5Frt0&t=113&feature=shared", "https://www.youtube.com/watch?v=7DKv5H5Frt0&list=PL96C35uN7xGJu6skU4TBYrIWxggkZBrF5&index=1&pp=iAQB" # noqa: E501 "https://youtu.be/7DKv5H5Frt0", + "https://www.youtube.com/live/7DKv5H5Frt0", ] VIDEO_OUT = [{"type": "video", "url": "7DKv5H5Frt0", "vid_type": "unknown"}] VIDEO_TEST_CASES = [(i, VIDEO_OUT) for i in VIDEO_URL_IN]