From 1d0d039c85af4aa62696ae4e368f688c25a7aa38 Mon Sep 17 00:00:00 2001 From: A Farzat Date: Tue, 14 Oct 2025 08:43:50 +0300 Subject: Clean the remains of yt-dlp --- components/ytdlp/__init__.py | 19 ------------------- requirements.txt | 1 - 2 files changed, 20 deletions(-) delete mode 100644 components/ytdlp/__init__.py diff --git a/components/ytdlp/__init__.py b/components/ytdlp/__init__.py deleted file mode 100644 index 83fc1c8..0000000 --- a/components/ytdlp/__init__.py +++ /dev/null @@ -1,19 +0,0 @@ -from json import dumps -from random import randrange -from sys import stderr -from typing import Any, Dict - -from yt_dlp import YoutubeDL # type: ignore - -def obtain_vid_info(url: str) -> Dict[str, Any]: - ydl_opts = { "check_formats": False, } # We only want the durations. - try: - with YoutubeDL(ydl_opts) as ydl: - info = ydl.extract_info(url, download=False) - return { "duration_string": info["duration_string"] } - 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 obviously random - # string instead. - return { "duration_string": "-1:%02d" % randrange(60) } diff --git a/requirements.txt b/requirements.txt index d37bcfb..9f8efb8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -32,4 +32,3 @@ types-requests==2.32.4.20250913 typing_extensions==4.14.1 urllib3==2.5.0 Werkzeug==3.1.3 -yt-dlp==2025.9.26 -- cgit v1.2.3-70-g09d2