From 5c5e00433a3e8d197462d104155204e9dfcca1c6 Mon Sep 17 00:00:00 2001 From: Renato Date: Tue, 7 Jul 2026 15:43:18 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20YouTube=20403=20on=20download=20?= =?UTF-8?q?=E2=80=94=20removed=20aria2c=20for=20YouTube,=20fixed=20title?= =?UTF-8?q?=20fetch?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- openshorts/telegram_bot.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/openshorts/telegram_bot.py b/openshorts/telegram_bot.py index 26f1416..ecde6c2 100644 --- a/openshorts/telegram_bot.py +++ b/openshorts/telegram_bot.py @@ -155,7 +155,14 @@ async def get_video_title(url: str) -> str: [ YT_DL_PYTHON, "-c", f"import yt_dlp, sys; " - f"ydl = yt_dlp.YoutubeDL({{'quiet': True, 'no_warnings': True, 'cookiesfrombrowser': ('chrome',)}}); " + f"opts = {{" + f" 'quiet': True, 'no_warnings': True," + f" 'cookiesfrombrowser': ('chrome',)," + f" 'js_runtimes': {{'node': {{}}}}," + f" 'extractor_args': {{'youtube': {{'player_client': ['tv', 'web']}}}}," + f" 'format': 'worst[height<=360]+worstaudio/worst[height<=360]'," + f"}}; " + f"ydl = yt_dlp.YoutubeDL(opts); " f"info = ydl.extract_info(sys.argv[1], download=False); " f"print(info.get('title', '') if info else '')", url,