tubesync icon indicating copy to clipboard operation
tubesync copied to clipboard

Requested format is not available for some media (not all)

Open garbled1 opened this issue 3 months ago • 9 comments

While trying to download media.. this seems to randomly happen to some media, but not all.

2025-09-23 10:16:16,052 [tubesync/INFO] Downloading media: qOp_nyKqmic (UUID: e6e4f076-190b-4b35-8162-a78e750f7761) to: "/downloads/video/Julie_Nolke [youtube2-UCy0Pr5u-MwGXXzp_GDd4m_g]/20250724 - the-invention-of-coffee [qOp_nyKqmic].mkv"
WARNING: [youtube] Falling back to generic n function search
         player = https://www.youtube.com/s/player/2b83d2e0/player_ias.vflset/en_US/base.js
WARNING: [youtube] qOp_nyKqmic: nsig extraction failed: Some formats may be missing
         n = q3PrRoFDZ1y-BtQcb ; player = https://www.youtube.com/s/player/2b83d2e0/player_ias.vflset/en_US/base.js
         Please report this issue on  https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template. Confirm you are on the latest version using  yt-dlp -U
WARNING: [youtube] qOp_nyKqmic: nsig extraction failed: Some formats may be missing
         n = 3QcG6NmdyuV1iltUM ; player = https://www.youtube.com/s/player/2b83d2e0/player_ias.vflset/en_US/base.js
         Please report this issue on  https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template. Confirm you are on the latest version using  yt-dlp -U
WARNING: [youtube] qOp_nyKqmic: nsig extraction failed: Some formats may be missing
         n = zuftTxMHJVgLjOxBq ; player = https://www.youtube.com/s/player/2b83d2e0/player_ias.vflset/en_US/base.js
         Please report this issue on  https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template. Confirm you are on the latest version using  yt-dlp -U
WARNING: [youtube] qOp_nyKqmic: nsig extraction failed: Some formats may be missing
         n = KZCeqwrAOKIh2nFfr ; player = https://www.youtube.com/s/player/2b83d2e0/player_ias.vflset/en_US/base.js
         Please report this issue on  https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template. Confirm you are on the latest version using  yt-dlp -U
WARNING: [youtube] qOp_nyKqmic: nsig extraction failed: Some formats may be missing
         n = -i763Y0bDPY8fXqZu ; player = https://www.youtube.com/s/player/2b83d2e0/player_ias.vflset/en_US/base.js
         Please report this issue on  https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template. Confirm you are on the latest version using  yt-dlp -U
WARNING: [youtube] qOp_nyKqmic: Some web client https formats have been skipped as they are missing a url. YouTube is forcing SABR streaming for this client. See  https://github.com/yt-dlp/yt-dlp/issues/12482  for more details
WARNING: Only images are available for download. use --list-formats to see them
2025-09-23 10:16:32,630 [tubesync/INFO] [SponsorBlock] started for: qOp_nyKqmic: The Invention of coffee
2025-09-23 10:16:32,638 [tubesync/INFO] [SponsorBlock] started for: qOp_nyKqmic: The Invention of coffee
2025-09-23 10:16:33,455 [tubesync/INFO] [SponsorBlock] finished for: qOp_nyKqmic: The Invention of coffee
2025-09-23 10:16:33,460 [tubesync/INFO] [SponsorBlock] finished for: qOp_nyKqmic: The Invention of coffee
ERROR: [youtube] qOp_nyKqmic: Requested format is not available. Use --list-formats for a list of available formats
[2025-09-23 10:16:33,465] ERROR:huey:185:Unhandled exception in task 6767d5e6-3fe7-49a7-a95f-37fba0303ff2.
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/dist-packages/yt_dlp/YoutubeDL.py", line 1668, in wrapper
    return func(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/yt_dlp/YoutubeDL.py", line 1824, in __extract_info
    return self.process_ie_result(ie_result, download, extra_info)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/yt_dlp/YoutubeDL.py", line 1883, in process_ie_result
    ie_result = self.process_video_result(ie_result, download=download)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/yt_dlp/YoutubeDL.py", line 3027, in process_video_result
    raise ExtractorError(
yt_dlp.utils.ExtractorError: [youtube] qOp_nyKqmic: Requested format is not available. Use --list-formats for a list of available formats
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/app/sync/youtube.py", line 458, in download_media
    return y.download([url])
           ^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/yt_dlp/YoutubeDL.py", line 3660, in download
    self.__download_wrapper(self.extract_info)(
  File "/usr/local/lib/python3.11/dist-packages/yt_dlp/YoutubeDL.py", line 3633, in wrapper
    res = func(*args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/yt_dlp/YoutubeDL.py", line 1657, in extract_info
    return self.__extract_info(url, self.get_info_extractor(key), download, extra_info, process)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/yt_dlp/YoutubeDL.py", line 1686, in wrapper
    self.report_error(str(e), e.format_traceback())
  File "/usr/local/lib/python3.11/dist-packages/yt_dlp/YoutubeDL.py", line 1126, in report_error
    self.trouble(f'{self._format_err("ERROR:", self.Styles.ERROR)} {message}', *args, **kwargs)
  File "/usr/local/lib/python3.11/dist-packages/yt_dlp/YoutubeDL.py", line 1065, in trouble
    raise DownloadError(message, exc_info)
yt_dlp.utils.DownloadError: ERROR: [youtube] qOp_nyKqmic: Requested format is not available. Use --list-formats for a list of available formats
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/dist-packages/huey/api.py", line 394, in _execute
    task_value = task.execute()
                 ^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/huey/api.py", line 834, in execute
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/django_huey/__init__.py", line 23, in inner
    return fn(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^
  File "/app/sync/tasks.py", line 1014, in download_media_file
    format_str, container = media.download_media()
                            ^^^^^^^^^^^^^^^^^^^^^^
  File "/app/sync/models/media.py", line 1026, in download_media
    download_youtube_media(self.url, format_str, self.source.extension,
  File "/app/sync/youtube.py", line 466, in download_media
    raise YouTubeError(f'Failed to download for "{url}": {e}') from e
sync.youtube.YouTubeError: Failed to download for "https://www.youtube.com/watch?v=qOp_nyKqmic": ERROR: [youtube] qOp_nyKqmic: Requested format is not available. Use --list-formats for a list of available formats
2025-09-23 10:16:34,043 [tubesync/INFO] waiting for errors: 429 (00:00:00): dyE7krGPP2A
2025-09-23 10:16:34,104 [tubesync/INFO] Downloading media: dyE7krGPP2A (UUID: 4001ce4a-351c-4f85-bdde-80f215e3cb01) to: "/downloads/video/Project_Farm [UC2rzsm1Qi6N1X-wuOg_p0Ng]/20250713 - best-car-battery-charger-i-torture-tested-them-all [dyE7krGPP2A].mkv"
2025-09-23 10:19:09,256 [tubesync/INFO] Scheduling task to download metadata for: https://www.youtube.com/watch?v=kzuOezZ_quI
2025-09-23 10:19:27,882 [tubesync/INFO] Scheduling task to download metadata for: https://www.youtube.com/watch?v=4UTzerFjycg
2025-09-23 10:19:34,316 [tubesync/INFO] Scheduling task to download metadata for: https://www.youtube.com/watch?v=sCJoAe9tJw4

garbled1 avatar Sep 23 '25 17:09 garbled1

TubeSync version 0.15.9 with yt-dlp version 2025.09.05 and FFmpeg version N-121120-gc74181a04b-20250918.

garbled1 avatar Sep 23 '25 17:09 garbled1

https://github.com/meeb/tubesync/blob/e539d466d41819bf72be3144212b53f51f5b01a3/tubesync/tubesync/settings.py#L196

Try using the YOUTUBE_DL_SKIP_UNAVAILABLE_FORMAT = True setting. Or, you should be able to simply wait for the formats to be updated.

tcely avatar Sep 23 '25 22:09 tcely

So is this just a matter of ytdl not supporting certain formats right now, and I'm waiting for those to get updated? If I leave the settings/files alone, when that happens, will it just retry them?

garbled1 avatar Sep 24 '25 13:09 garbled1

It's YouTube making certain formats more difficult to download.

The "no formats" error triggers a refresh of the available formats. This takes a bit of time usually.

The setting removes the format that failed, so the next download can't try that format again.

tcely avatar Sep 24 '25 13:09 tcely

Same problem, and I solved it by forcibly updating the yt-dlp in the container to the 2025.09.23 version with docker entrypoint.

kman0001 avatar Sep 25 '25 02:09 kman0001

yt-dlp should already be updated in the :latest releases.

meeb avatar Sep 25 '25 12:09 meeb

I believe this manifested for me specifically because the formats are chosen and stored in the database. I get a difference list of available formats if I use the latest version of yt-dlp versus an older one.

Anusien avatar Sep 26 '25 03:09 Anusien

I consistently got the ERROR: ... Requested format is not available on a fresh install. It seems the current Docker image is based on Debian Bookworm, which has two issues:

  1. The bundled yt-dlp is outdated.
  2. The system Python is "externally managed" (PEP 668), which prevents pip install from working without an override.

I solved it by creating a custom entrypoint script that installs pip and then forces the yt-dlp update.

That was a lot of wasted effort. The latest image included the most current version of yt-dlp available when it was built.

Currently: + yt-dlp==2025.9.23

Also, we have had a script for a while.

https://github.com/meeb/tubesync/blob/5361838cde7b82845f5b4d462013c8f023d7e0cc/tubesync/upgrade_yt-dlp.sh#L37

tcely avatar Sep 26 '25 03:09 tcely

I believe this manifested for me specifically because the formats are chosen and stored in the database. I get a difference list of available formats if I use the latest version of yt-dlp versus an older one.

Sure. Formats are stored and tested as a separate task before downloading.

Because of this approach we have tasks to retrieve the new list of formats. This simply doesn't happen quickly. The YOUTUBE_DL_SKIP_UNAVAILABLE_FORMAT = True setting, that I mentioned above, causes the next download attempt to select another format after one failed to download.

There is also a task for trying to download a higher quality format later. https://github.com/meeb/tubesync/blob/5361838cde7b82845f5b4d462013c8f023d7e0cc/tubesync/tubesync/settings.py#L183 https://github.com/meeb/tubesync/blob/5361838cde7b82845f5b4d462013c8f023d7e0cc/tubesync/sync/tasks.py#L1051-L1059

tcely avatar Sep 26 '25 03:09 tcely