Skip to content

fix(FixYoutubeEmbed): Fix Error 15 in Youtube Embeds#3736

Open
emabrey wants to merge 1 commit into
Vendicated:mainfrom
emabrey:youtube-plugin-fixes
Open

fix(FixYoutubeEmbed): Fix Error 15 in Youtube Embeds#3736
emabrey wants to merge 1 commit into
Vendicated:mainfrom
emabrey:youtube-plugin-fixes

Conversation

@emabrey
Copy link
Copy Markdown

@emabrey emabrey commented Oct 24, 2025

TLDR:
This should fix the "Error 15" in youtube embeds related to youtube identity verification. This also adds detection and workaround for the Youtube "you look like a bot" blocks and attempts to reload the embed in that case. Also modifes the adblock plugin to be aware of the non-standard (but google official) youtube-nocookie domain used to bypass the identity error.

More in depth:
When attempting to play a blocked video with the FixYoutubeEmbed plugin, I kept getting error despite the plugin technically "working" (as in, the UMG block was bypassed but the video still would not play).
Image showing error 15

Upon investigation, this was related to Youtube's identity verification policies as shown in the debug message for the javascript player:

"debug_error": "{\"errorCode\":\"embedder.identity.denied\",\"errorDetail\":\"0\",\"errorMessage\":\"This video is unavailable\",\"hF\":\"Error code: 15\",\"ZV\":\"0;a6s.0\",\"BE\":2,\"cpn\":\"\"}"

Internet research revealed that Youtube is looking for a cookie to be set in order to validate age, and it defaults to failing you if the hueristics that generate the cookie have not run and provided you an identity cookie. After switching to the youtube-nocookie.com domain, which is Youtube's official GDPR compliant replacement for youtube.com, I was able to solve this problem because in that environment no cookie can be expected, which side steps the issue entirely. However, I also needed to add it to the CSP for Vencord to prevent frame-src mismatch related CSP errors. After fixing that problem, I ran into a new issue - Youtube was repeatedly detecting me as a bot and refusing to play the video without login (which is impossible, or at minimum extremely difficult in the embedded context). I added additional code to handle the bot blocking in addition to the original block workaround for the UMG style blocks. Finally, I noticed that the ad blocking wasn't always working because of the new domain, so I modified the youtubeAdblock plugin to be aware of the possibility of the youtube-nocookie.com domain.

@emabrey emabrey force-pushed the youtube-plugin-fixes branch from 140a27f to 7c577f9 Compare October 26, 2025 13:41
@emabrey
Copy link
Copy Markdown
Author

emabrey commented Oct 26, 2025

Made a small modification to the PR so it won't generate a plugin error message in the event the plugin is disabled and we run into a null value we cant handle.

@emabrey emabrey force-pushed the youtube-plugin-fixes branch 2 times, most recently from 7c577f9 to 70e4d10 Compare October 28, 2025 22:09
@emabrey
Copy link
Copy Markdown
Author

emabrey commented Oct 28, 2025

Sorry for force-push spam. I didn't realize that the github ui merge would be non fast forward and I had to undo what github did to the repo lol. sigh >.>

@emabrey emabrey force-pushed the youtube-plugin-fixes branch 3 times, most recently from fc60448 to 80de315 Compare November 4, 2025 01:59
@emabrey emabrey changed the title Fix Youtube plugins fix(FixYoutubeEmbed): Fix Error 15 in Youtube Embeds Nov 4, 2025
@emabrey emabrey force-pushed the youtube-plugin-fixes branch 3 times, most recently from d49f5ed to 809871f Compare November 10, 2025 03:54
@emabrey
Copy link
Copy Markdown
Author

emabrey commented Nov 10, 2025

I made some changes to remove the logging statements that weren't previously part of the plugins, and to move the CSP editing from the main CSP file into the plugin itself so that users who aren't opted-in to using the plugin don't have any modifications to their CSP. I also added additional checks to ensure the plugin doesnt have null dereferences or array out of bounds accesses done within the frame javascript context.

@emabrey emabrey force-pushed the youtube-plugin-fixes branch 2 times, most recently from f23285d to a0ba51f Compare November 13, 2025 04:45
@emabrey emabrey force-pushed the youtube-plugin-fixes branch from a0ba51f to 754dcbd Compare December 22, 2025 09:11
@emabrey
Copy link
Copy Markdown
Author

emabrey commented Dec 22, 2025

Just updated the branch to match main. If there is anything that needs to be done to make this mergeable please let me know.

@emabrey emabrey force-pushed the youtube-plugin-fixes branch 3 times, most recently from 7267eab to 04b5c89 Compare January 15, 2026 01:04
@emabrey emabrey force-pushed the youtube-plugin-fixes branch 2 times, most recently from 89cadf8 to 1d9daaa Compare January 30, 2026 15:59
@emabrey emabrey force-pushed the youtube-plugin-fixes branch from 1d9daaa to b97a473 Compare February 10, 2026 11:07
@emabrey emabrey force-pushed the youtube-plugin-fixes branch from b97a473 to 9aa46c7 Compare March 18, 2026 11:35
Fix "Error 15" generated by YouTube within FixYoutubeEmbed plugin
Add youtube-nocookie.com domain to CSP (when FixYoutubeEmbed is enabled)
Add support for youtube-nocookie.com domain to youtubeAdblock.desktop

Signed-off-by: Emily Mabrey <emilymabrey93@gmail.com>
@emabrey emabrey force-pushed the youtube-plugin-fixes branch from 9aa46c7 to 74b7224 Compare May 23, 2026 10:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant