summaryrefslogtreecommitdiff
path: root/tests/utils/vid_url_to_html.py
diff options
context:
space:
mode:
authorA Farzat <a@farzat.xyz>2025-10-08 12:48:20 +0300
committerA Farzat <a@farzat.xyz>2025-10-08 12:48:20 +0300
commit6d02de42105e1fa390984c665fd73b8e6f6116f5 (patch)
treee1041072b2e622e1121ce3b72bc73bbe23eb58b9 /tests/utils/vid_url_to_html.py
parent4372982119140dba5b132e09200b94c1b422a1dd (diff)
downloadcsca5028-6d02de42105e1fa390984c665fd73b8e6f6116f5.tar.gz
csca5028-6d02de42105e1fa390984c665fd73b8e6f6116f5.zip
Modify analyser tests to reflect the use of extractor
Diffstat (limited to 'tests/utils/vid_url_to_html.py')
-rw-r--r--tests/utils/vid_url_to_html.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/utils/vid_url_to_html.py b/tests/utils/vid_url_to_html.py
index 355e830..60f6ccc 100644
--- a/tests/utils/vid_url_to_html.py
+++ b/tests/utils/vid_url_to_html.py
@@ -1,6 +1,7 @@
from urllib.parse import urlparse, parse_qs
from components.extractor.check_url import is_video
+from .get_random_vid_info import get_random_vid_duration
def extract_vid_id(url: str) -> str:
if not is_video(url):
@@ -16,3 +17,6 @@ def extract_vid_id(url: str) -> str:
def get_vid_html_from_url(url: str) -> str:
with open(f'tests/data/video@{extract_vid_id(url)}.html', 'r') as file:
return file.read()
+
+def obtain_vid_duration(url:str, html: str = '') -> int:
+ return get_random_vid_duration(url)