youtube-dl : "ERROR: No video formats found" when listing a youtube playlist

Viewed 2705

I'm trying to create a Github Actions to save a list with the names of all the youtube videos of a playlist. It is running on the latest ubuntu version and I'm installing the latest youtube-dl version.

sudo curl -L https://yt-dl.org/downloads/latest/youtube-dl -o /usr/local/bin/youtube-dl
sudo chmod a+rx /usr/local/bin/youtube-dl
sudo youtube-dl --update

The script is working perfectly on some playlist but on others I get this error message :

ERROR: No video formats found

This is the youtube-dl command I'm using. It's working perfectly on my computer (windows) on any playlist.

youtube-dl --skip-download --get-title --get-id --no-warnings --verbose --no-mark-watched --ignore-errors --no-warnings --geo-bypass --no-progress https://www.youtube.com/playlist?list=${{ secrets.PLAYLIST_ID }} > playlist.txt

I tried with the verbose parameter, here is the result

[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['--skip-download', '--get-title', '--get-id', '--no-warnings', '--verbose', '--no-mark-watched', '--ignore-errors', '--no-warnings', '--geo-bypass', '--no-progress', 'https://www.youtube.com/playlist?list=***']
[debug] Encodings: locale UTF-8, fs utf-8, out utf-8, pref UTF-8
[debug] youtube-dl version 2021.04.17
[debug] Python version 3.8.5 (CPython) - Linux-5.4.0-1043-azure-x86_64-with-glibc2.29
[debug] exe versions: phantomjs 2.1.1
[debug] Proxy map: {}
[debug] Default format spec: bestvideo+bestaudio/best
[debug] Default format spec: bestvideo+bestaudio/best
[debug] Default format spec: bestvideo+bestaudio/best
[debug] Default format spec: bestvideo+bestaudio/best
...
[debug] Default format spec: bestvideo+bestaudio/best
ERROR: No video formats found; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
Traceback (most recent call last):
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 806, in wrapper
    return func(self, *args, **kwargs)
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 827, in __extract_info
    ie_result = ie.extract(url)
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 534, in extract
    ie_result = self._real_extract(url)
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/youtube.py", line 1716, in _real_extract
    self._sort_formats(formats)
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 1374, in _sort_formats
    raise ExtractorError('No video formats found')
youtube_dl.utils.ExtractorError: No video formats found; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
...
Error: Process completed with exit code 1.

UPDATE :
Changing the youtube-dl version doesn't solve the issue. I also tried to change the ubuntu version to 18.04 and it worked once... but sill got the erreur when rerunning the action a seconde time. I also tried to change to a windows machine but still got the problem.

UPDATE 2 :
I found a better working solution by changing the youtube-dl command. With the --flat-playlist, each video page is not loaded so I don't have the error.

youtube-dl --dump-json --flat-playlist --no-warnings --ignore-errors --geo-bypass https://www.youtube.com/playlist?list=${{ secrets.PLAYLIST_ID }} | jq --raw-output '"\(.id) | \(.uploader) | \(.title)"' > playlist.txt
0 Answers
Related