fix: YouTube 403 on download — removed aria2c for YouTube, fixed title fetch
This commit is contained in:
@@ -155,7 +155,14 @@ async def get_video_title(url: str) -> str:
|
|||||||
[
|
[
|
||||||
YT_DL_PYTHON, "-c",
|
YT_DL_PYTHON, "-c",
|
||||||
f"import yt_dlp, sys; "
|
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"info = ydl.extract_info(sys.argv[1], download=False); "
|
||||||
f"print(info.get('title', '') if info else '')",
|
f"print(info.get('title', '') if info else '')",
|
||||||
url,
|
url,
|
||||||
|
|||||||
Reference in New Issue
Block a user