From 8b61cb7f0374c804373937b9c041e3f11c95d366 Mon Sep 17 00:00:00 2001 From: A Farzat Date: Sun, 5 Oct 2025 08:47:47 +0300 Subject: Make ytdlp's replacement string obviously random --- components/ytdlp/__init__.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'components') diff --git a/components/ytdlp/__init__.py b/components/ytdlp/__init__.py index e63858c..83fc1c8 100644 --- a/components/ytdlp/__init__.py +++ b/components/ytdlp/__init__.py @@ -1,4 +1,5 @@ from json import dumps +from random import randrange from sys import stderr from typing import Any, Dict @@ -13,6 +14,6 @@ def obtain_vid_info(url: str) -> Dict[str, Any]: except Exception as e: print("Ran into an exception while fetching", url + ":", e, file=stderr) # This is a dummy project. If yt-dlp fails, repeatedly parsing YouTube - # would only get us possibly blocked. Better return an empty string - # instead. - return { "duration_string": "" } + # would only get us possibly blocked. Better return an obviously random + # string instead. + return { "duration_string": "-1:%02d" % randrange(60) } -- cgit v1.2.3-70-g09d2