youtube-dl: YouTube 403 forbidden error on audio urls

Checklist

  • I’m asking a question
  • I’ve looked through the README and FAQ for similar questions
  • I’ve searched the bugtracker for similar questions including closed ones

Question

Did something change in the YouTube audio formats, or are they returned differently than before? After merging https://github.com/ytdl-org/youtube-dl/commit/e1b3fa242cb94eb9dc949ab3f2cace91c46f11bf into my codebase, I am getting (somewhat) random failures, but still very repeatable. I wasn’t getting these errors with the previous version of ytdl, but there was a new error (https://github.com/ytdl-org/youtube-dl/issues/32842#issuecomment-2247729123) so had to update.

Plex is giving me 406 (unacceptable) errors when I try to upload the audio.

2024-07-26 20:31:01,164 (1e38) :  ERROR (logkit:22) - 7: Error uploading media: (406) not_acceptable; http://127.0.0.1:32400/library/metadata/7/themes?url=https%3A%2F%2Frr2---sn-vgqsknll.googlevideo.com%2Fvideoplayback%3Fsparams%3Dexpire%252Cei%252Cip%252Cid%252Citag%252Csource%252Crequiressl%252Cxpc%252Cbui%252Cspc%252Cvprv%252Csvpuc%252Cmime%252Cns%252Crqh%252Cgir%252Cclen%252Cdur%252Clmt%26ei%3DdwekZoOfFMiL2_gPr9aZ8QY%26ip%3D<ip_address>%26clen%3D2952380%26spc%3DNO7bAUSfQKp7wA51RtQGKsRLBRf5mthsur--MRW5fbsriZPkNA1qre4UysJp%26id%3Do-AAoY5UDjTl1nbz2ILx_0-6f07PC6a8wTiWVAlOzqqb7U%26keepalive%3Dyes%26svpuc%3D1%26gir%3Dyes%26xpc%3DEgVo2aDSNQ%253D%253D%26requiressl%3Dyes%26source%3Dyoutube%26mv%3Du%26sig%3DAJfQdSswRQIhAMf8bjXRaGzgiRSBkOqQ_D39zP9NvzqawnrrT5DUi7FiAiB5sA67GgEuGddyT9dBkO93JerPVjcdWgiGzv499zHq4A%253D%253D%26dur%3D185.852%26ns%3DsfVMzFqD1xnov-0SyNvSksYQ%26vprv%3D1%26lsig%3DAGtxev0wRQIhALDSyv0QtzedMTElYBf8wrYFLVu9AVKMUkS73YdG0JmCAiB1MAf-1V11K54VOSB7cgbzRiqKJlpJmgEwfMoqD0sIog%253D%253D%26lsparams%3Dmh%252Cmm%252Cmn%252Cms%252Cmv%252Cmvi%252Cpl%26lmt%3D1381172018924357%26c%3DWEB%26sefc%3D1%26expire%3D1722047447%26mime%3Daudio%252Fmp4%26fvip%3D1%26rqh%3D1%26itag%3D140%26mm%3D31%252C29%26mn%3Dsn-vgqsknll%252Csn-vgqsrnsr%26mh%3DRH%26n%3DByy7QEICFdfW5A%26mt%3D1722025513%26bui%3DAXc671J3DF8IaVyrVeX7P2gjoWIta83r8-VJE-frLLoYb-Qu34nQWYMq_tCvsDUUawSv_qeOTvQLUkSo%26pl%3D23%26ms%3Dau%252Crdu%26mvi%3D2 <html><head><title>Not Acceptable</title></head><body><h1>406 Not Acceptable</h1></body></html>

Here is my code for getting the audio url: https://github.com/LizardByte/Themerr-plex/blob/c948caa73991e05cebe8b24b88bce5ccb6bede4c/Contents/Code/youtube_dl_helper.py#L133-L161

I tested locally, and I’m still getting audio urls, but could be in formats that aren’t supported by Plex. Last update for Plex was July 9th, so nothing on their end changed in the last few days.

Any ideas?

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 1
  • Comments: 20 (17 by maintainers)

Most upvoted comments

@dirkf I’ll be happy to test when it’s ready. My CI tests about 30 videos, so it’s pretty easy to hit this error.

if someone could point me to the best place to get updates going forward.

https://github.com/ytdl-org/ytdl-nightly/releases

Probably this PR is the best source.

Ah yeah, I’ve just seen the behaviour. It failed with 403 then after about 10 minutes it worked. Weird that they’re sending a 403 when it’s likely a rate limit. I’m not sure how to solve this as having the process wait for 10 minutes on a 403 isn’t really a good solution.