Fix YouTube Error 153 in Obsidian
Resolve YouTube embedding issues when videos show Error 153 instead of playing
When embedding YouTube videos in Obsidian notes, you might encounter "Error 153" displayed instead of the video thumbnail or player. This error is tied to Google tightening access for anonymous embeds lately.
Solution
Upgrade to Obsidian 1.10.3
News from obsidian team: Obsidian 1.10.3 public release should fix the 153 error for YouTube embeds.
YouTube in Canvas and iOS devices should be fixed in upcoming Obsidian 1.10.4 release, see forum post for details:
Request header rewrite + MITM
This method is for advanced users who are familiar with network proxy tools with http rewrite and MITM capabilities. If you are not familiar with these tools, you should probably wait for the patch in the upcoming Obsidian insider versions.
- Make sure you have network proxy tools with http rewrite and MITM capabilities (e.g. Surge, Loon, Shadowrocket, etc).
- Properly configure CA certificate per tool's documentation. For example, in Surge, follow the instructions here
- Enable HTTP rewrite and MITM in your proxy tools.
- Include domains "www.youtube-nocookie.com" and "www.youtube.com" in the MITM list.
- Add the request header rewrite rule
- target:
https://www.youtube-nocookie.com/embed/*orhttps://www.youtube.com/embed/*, or in Regular Expression:
https:\/\/www\.youtube(-nocookie)?\.com\/embed\/- action: add request header "Referer" with value "app://obsidian.md". (not "Referrer", the misspelled "r" is intentional)
- target:
For example, in Surge, the rule should look like this:
[MITM]
hostname = www.youtube-nocookie.com,www.youtube.com
[Header Rewrite]
http-request https:\/\/www\.youtube(-nocookie)?\.com\/embed\/ header-add Referer app://obsidian.mdI've built modules for the following proxy tools:
- Surge (macOS/iOS): surge.sgmodule
- Stash (macOS/iOS): stash.stoverride
- Loon (iOS): loon.plugin
- Shadowrocket (iOS): shadowrocket.module
You can copy URL to modules and import it to get this fix following corresponding tool's documentation.
Clear YouTube Cookies
Available in Media Extended v4.1.2
- Open the Command Palette with Ctrl / ⌘ + P
- Search for and select "Clear YouTube cookies"
- Wait for the confirmation notice
This command clears cookies from both youtube.com and youtube-nocookie.com domains. It should fix the issue after re-opening the note.
Manual fix
If you prefer to fix it manually, you can do the following:
- Open Developer Tools
- On Windows, you can open it with Ctrl + Shift + I
- On macOS, you can open it with ⌘ + ⌥ + I
- From the obsidian menu:
View>Toggle Developer Tools
- Open the
Applicationtab - expand
Cookies - right-click any YouTube cookies (
https://www.youtube.comorhttps://www.youtube-nocookie.com) - select
Clear.
Replace iframe Host with No-Cookie Variant
This is enabled by default in Obsidian 1.10.2 or later, or if Media Embeds is enabled with Media Extended installed.
If you're using iframe HTML embeds in your notes, you can manually change the host from youtube.com to youtube-nocookie.com to avoid Error 153:
Before:
<iframe src="https://www.youtube.com/embed/VIDEO_ID"></iframe>After:
<iframe src="https://www.youtube-nocookie.com/embed/VIDEO_ID"></iframe>This privacy-enhanced domain doesn't use third-party cookies, reducing the likelihood of Error 153.