Failed to extract cipher manifest
Version
6.5.4
Platform
.NET 8 / Windows 11
Steps to reproduce
var client = new YoutubeClient();
VideoId id = new("https://www.youtube.com/watch?v=UFdO3wodIJk");
try { await client.Videos.GetAsync(id); }
catch (Exception ex) { Console.WriteLine(ex); } // VideoUnavailableException
try { var cc = await client.Videos.ClosedCaptions.GetManifestAsync(id); }
catch (Exception ex) { Console.WriteLine(ex); } // VideoUnavailableException
try { var streams = await client.Videos.Streams.GetManifestAsync(id); }
catch (Exception ex) { Console.WriteLine(ex); } // YouTubeExplodeException "Failed to extract the cipher manifest."
Details
Thanks for building and maintaining this great library!
While the library works great for most videos I try it with, this particular one fails reliably for me even though on the front-end I don't see anything special about it.
Checklist
- [x] I have looked through existing issues to make sure that this bug has not been reported before
- [x] I have provided a descriptive title for this issue
- [x] I have made sure that this bug is reproducible on the latest version of the package
- [x] I have provided all the information needed to reproduce this bug as efficiently as possible
- [ ] I have sponsored this project
- [ ] I have not read any of the above and just checked all the boxes to submit the issue
same error, any fix?
Worked fine for me until all of a sudden throws this exception, same code same everything, did you find any solution?
Could this be related to https://github.com/yt-dlp/yt-dlp/issues/14404 ?
Could this be related to yt-dlp/yt-dlp#14404 ?
Possibly, but at least for me, installing Deno solved nothing.
@Sumanuil installing deno wouldn't help since that solution is specific to yt-dlp. I was more wondering whether YoutubeExplode was running into any of the same problems that were motivating yt-dlp to install deno.
YouTube changed their player source code format in a very significant way, basically making the current parsing logic that YTE employs obsolete. I spent some time analyzing the new format, and it seems that it would be quite difficult to adapt.
Note that the cipher route is only used as a fallback when the main route fails. Currently, the main route does not work because of #853 -- and the fallback route does not work because of the above-mentioned updates. If/when #853 is fixed, this issue will become much less impactful, as the fallback won't be needed for 99% of videos.
Could this be related to yt-dlp/yt-dlp#14404 ?
It is related, yes. YTE doesn't use an interpreter though, but the underlying issue is the same.
@Tyrrrz sooo any idea how to fix this? :) Where should we look for a possible places to make changes? PlayerResponse class?
I just remove these apps and changed to https://github.com/yt-dlp/yt-dlp, replace the ps script with my modification
YT_downloader_by_PowerShell.zip
and generate "www.youtube.com_cookies.txt" file using MS/Chrome Plugin
- install https://chromewebstore.google.com/detail/get-cookiestxt-locally/cclelndahbckbenkjhflpdbgdldlbecc
- open a youtube video and login your youtube account.
- In MS Edge ?Chrome Plugin Bar, open the Get coodkies Plugin
This Solution is very reliable and never let me disappointed,
The full folder zip
@Tyrrrz sooo any idea how to fix this? :) Where should we look for a possible places to make changes?
PlayerResponseclass?
It's PlayerSource: https://github.com/Tyrrrz/YoutubeExplode/blob/master/YoutubeExplode/Bridge/PlayerSource.cs
Basically, all the assumptions made about the player source code are now obsolete. You can debug through the CipherManifest property to find that the regular expressions no longer work. And if you look at the full source code, you'll see that its format has changed significantly.
I have tried to do some simple analyze about new js content. It seems Youtube has encode basic methods like .split and .join into elements in an array. For a specific video, it holds an array named R, and here's the relationship:
R[0] = "fromCharCode" R[7] = "length" R[8] = "call" R[15] = "match" R[19] = "forEach" R[21] = "slice" R[22] = "splice" R[25] = "push" R[26] = "split" R[29] = "indexOf" R[31] = "reverse" R[33] = "unshift" R[38] = "assign" R[41] = "startsWith" R[59] = "toString" R[69] = "join" R[77] = "replace" R[81] = "pop"
I haven't done deeper search, but I think this is why the old regex failed. Hoping someone can use this to better the software's robustness.
I have added some better handling of errors around the cipher manifest fallback code.
The reason is that I believe that some of these errors aren't cipher errors and more to do with Point Origin Tokens, which is working against us. The cipher issue does exist, but so does the POT issue.
I've done experiments with "other" clients as well and it's the same. investigating more now
Still having this issue, seems to be related to videos marked as "kids" or "family" content, in my case. The "Oculus Quest 3" user agent is not working with this kind of videos and yt-dlp has the same problem, I tried a bunch of other user agents but no one is working. EDIT: yt-dlp can actually solve the issue if you have Deno installed
I'm having this issue too, for example with video https://www.youtube.com/watch?v=nQuzyJ-C1Fc Any news? Thank you!
Issue fixed in this PR https://github.com/Tyrrrz/YoutubeExplode/pull/965
Still seeing Failed to extract the cipher manifest on a build that already includes #965, so I'm adding a concrete case in case it helps.
Build: prime up to c703892 (#978), which includes ea791ab (#965). Plus one local commit that only adds a flag to skip per-stream probing. .NET 10, Linux. Seen 2026-11-23, three attempts over ~10 minutes, all failing the same way.
Repro: my service calls StreamClient.GetManifestAsync for the video. On a livestream that had ended about 8.5 hours earlier it throws YoutubeExplodeException: Failed to extract the cipher manifest. within about 0.5 s. Other videos work with the same build, including a livestream from the same channel that ended a week earlier.
Difference between the two livestreams (watch page):
- The failing one has
playabilityStatus.reason: "This live event has ended.",playableInEmbed: false, noapproxDurationMson its formats, and 13 format entries. - The working one has no "has ended" reason, has
approxDurationMs, and 8 format entries. It ended a week earlier.
So the processing state of the stream seems to decide whether the cipher fallback is needed.
Cause of the exception: PlayerSource.CipherManifest returns null. I ran its regexes against the player script in use (/s/player/6b3d0364/player_ias.vflset/en_US/base.js):
(?:signatureTimestamp|sts):(\d{5})matches (20774).- The cipher callsite regex
[$_\w]+=function\([$_\w]+\){([$_\w]+)=\1\.split\(['"]{2}\);.*?return \1\.join\(['"]{2}\)}matches nothing. The script has no function of that shape: all 14.split("")calls are generic helpers and the 3.reverse()calls are unrelated.
This looks like what Tyrrrz described in Oct 2025, that all assumptions about the player source are obsolete. #965 fixed the common path, but the cipher fallback is still broken for streams that need it.
- The failing one has
playabilityStatus.reason: "This live event has ended.",playableInEmbed: false, noapproxDurationMson its formats, and 13 format entries.
I wonder if, besides having playabilityStatus.reason, it was also marked as unplayable? And whether those format entries are still related to the livestream.
What is happening, I believe, is that a finished livestream video needs some time before YouTube converts its progressive streams into regular video streams. During that time, you can still watch the video on YouTube as a livestream (albeit finished), but YoutubeExplode does not support it.