summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
authorA Farzat <a@farzat.xyz>2025-10-08 10:44:07 +0300
committerA Farzat <a@farzat.xyz>2025-10-08 10:48:47 +0300
commitc641e6f1948f683bf7b1fff08bce125cb64563df (patch)
tree9d1f7ee667da951265a466d12798d296e2c36a5d /components
parenta79fe26ade3a46ddf5649b2318e33ea95e15e0fa (diff)
downloadcsca5028-c641e6f1948f683bf7b1fff08bce125cb64563df.tar.gz
csca5028-c641e6f1948f683bf7b1fff08bce125cb64563df.zip
Add unit tests for obtain_vid_info
Diffstat (limited to 'components')
-rw-r--r--components/extractor/check_url.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/components/extractor/check_url.py b/components/extractor/check_url.py
index b574b22..13d7259 100644
--- a/components/extractor/check_url.py
+++ b/components/extractor/check_url.py
@@ -11,7 +11,10 @@ def is_video(url: str) -> bool:
if not is_youtube(url):
return False
parsed_url = urlparse(url)
- if parsed_url.path in ('/watch', '/shorts/', '/embed/'):
+ for path in ('/shorts/', '/embed/'):
+ if parsed_url.path.startswith(path):
+ return True
+ if parsed_url.path == '/watch' and 'v' in parse_qs(parsed_url.query):
return True
return parsed_url.netloc == 'youtu.be'