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,