@Mars36

Как скачать с ютуба видео с возрастным ограничением через youtube-dl?

Использую такие опции для youtube-dl
YDL_OPTIONS = { 'format': 'worstaudio/best', 'noplaylist': 'True', 'simulate': 'True', 'preferredquality': '192', 
                'preferredcodec': 'mp3', 'key': 'FFmpegExtractAudio', 'username': 'myEmail@gmail.com', 'password': 'myPassword'}

При попытке загрузить видео вылетает такая
ошибка

[youtube] Downloading login page
[youtube] Looking up account info
WARNING: Unable to look up account info: HTTP Error 400: Bad Request
[youtube] StZcUAPRRac: Downloading webpage
[youtube] StZcUAPRRac: Refetching age-gated info webpage
WARNING: unable to download video info webpage: HTTP Error 410: Gone
[youtube] Downloading just video StZcUAPRRac because of --no-playlist
ERROR: Sign in to confirm your age
This video may be inappropriate for some users.
Ignoring exception in command yt:
Traceback (most recent call last):
File "C:\Python\Python39\lib\site-packages\youtube_dl\YoutubeDL.py", line 815, in wrapper
return func(self, *args, **kwargs)
File "C:\Python\Python39\lib\site-packages\youtube_dl\YoutubeDL.py", line 836, in __extract_info
ie_result = ie.extract(url)
File "C:\Python\Python39\lib\site-packages\youtube_dl\extractor\common.py", line 534, in extract
ie_result = self._real_extract(url)
File "C:\Python\Python39\lib\site-packages\youtube_dl\extractor\youtube.py", line 1713, in _real_extract
raise ExtractorError(reason, expected=True)
youtube_dl.utils.ExtractorError: Sign in to confirm your age
This video may be inappropriate for some users.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Python\Python39\lib\site-packages\discord\ext\commands\core.py", line 85, in wrapped
ret = await coro(*args, **kwargs)
File "D:\code\python\dbot\bot.py", line 172, in yt
info = ydl.extract_info(url, download=False)
File "C:\Python\Python39\lib\site-packages\youtube_dl\YoutubeDL.py", line 808, in extract_info
return self.__extract_info(url, ie, download, extra_info, process)
File "C:\Python\Python39\lib\site-packages\youtube_dl\YoutubeDL.py", line 824, in wrapper
self.report_error(compat_str(e), e.format_traceback())
File "C:\Python\Python39\lib\site-packages\youtube_dl\YoutubeDL.py", line 628, in report_error
self.trouble(error_message, tb)
File "C:\Python\Python39\lib\site-packages\youtube_dl\YoutubeDL.py", line 598, in trouble
raise DownloadError(message, exc_info)
youtube_dl.utils.DownloadError: ERROR: Sign in to confirm your age
This video may be inappropriate for some users.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "C:\Python\Python39\lib\site-packages\discord\ext\commands\bot.py", line 939, in invoke
await ctx.command.invoke(ctx)
File "C:\Python\Python39\lib\site-packages\discord\ext\commands\core.py", line 863, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "C:\Python\Python39\lib\site-packages\discord\ext\commands\core.py", line 94, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: DownloadError: ERROR: Sign in to confirm your age
This video may be inappropriate for some users.

Данные аккаунта перепроверил, должны быть временными, в настройках аккаунта возраст указан. Но ошибка не меняется, даже если исключить из опций поля с именем и паролем.
  • Вопрос задан
  • 1924 просмотра
Пригласить эксперта
Ответы на вопрос 1
@DoubleSystems
Используйте форк yt-dlp
Ответ написан
Комментировать
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Похожие вопросы
30 нояб. 2024, в 22:41
500 руб./за проект
30 нояб. 2024, в 20:49
2000 руб./за проект
30 нояб. 2024, в 20:18
5000 руб./за проект