# About the youtube procedure in scribble-embedding package

**URL:** <https://racket.discourse.group/t/about-the-youtube-procedure-in-scribble-embedding-package/4162>\
**Category:** Questions & Answers\
**Tags:** question\
**Created:** [March 20, 2026, 7:19am UTC](https://racket.discourse.group/t/about-the-youtube-procedure-in-scribble-embedding-package/4162 "2026-03-20T07:19:39Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![encomer](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/encomer/32/280_2.png) [@encomer](https://racket.discourse.group/u/encomer)\
**Post date:** [March 20, 2026, 7:19am UTC](https://racket.discourse.group/t/about-the-youtube-procedure-in-scribble-embedding-package/4162/1 "2026-03-20T07:19:39Z")

</div>

Hello _Racket friends_:  
Please, if possible: _ **could you verify** _\*\* if the `youtube` procedure in the very useful `scribble-embedding` package is working fine for you?\*\*

In my installation (`Racket v9.1`, under _Windows 10_ and the current version of `scribble-embedding` package), the following code:

```scheme
#lang scribble/manual
@require[scribble-embedding]
@title[#:style 'toc-hidden]{Testing @tt{scribble-embedding's} @tt{youtube} procedure}
@(youtube "https://www.youtube.com/embed/y1rOWZkALto")

```

Generates the following message:

 ![image](https://global.discourse-cdn.com/free1/uploads/racket/original/2X/c/c7381ede333352c691275b83ebb0a44f1b0ad374.png)

**Thank you very much in advance for your support on this issue**.  
_Kind regards_,  
E. Comer

P. S.  
(a) The `google-form` procedure, is working fine.  
(b) As a reference, the `youtube` procedure (in `scribble-embedding` package) worked fine when I use it, the years 2022-2025.

---

<div class="post-metadata">

**Author:** ![soegaard](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/soegaard/32/19_2.png) [@soegaard](https://racket.discourse.group/u/soegaard)\
**Post date:** [March 20, 2026, 1:18pm UTC](https://racket.discourse.group/t/about-the-youtube-procedure-in-scribble-embedding-package/4162/2 "2026-03-20T13:18:59Z")

</div>

Hi,

The problem is the video itself:

https://www.youtube.com/embed/y1rOWZkALto?feature=oembed&wmode=opaque

 ![image](https://global.discourse-cdn.com/free1/uploads/racket/original/2X/a/a69a6007a1565cc2022e8958fa9d712cae6a1d7a.png)

/Jens Axel

---

<div class="post-metadata">

**Author:** ![soegaard](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/soegaard/32/19_2.png) [@soegaard](https://racket.discourse.group/u/soegaard)\
**Post date:** [March 20, 2026, 1:20pm UTC](https://racket.discourse.group/t/about-the-youtube-procedure-in-scribble-embedding-package/4162/3 "2026-03-20T13:20:19Z")

</div>

Interesting!

I pasted the link

```scheme
https://www.youtube.com/embed/y1rOWZkALto

```

into youtube and got the error.

But I now see that it works on Discourse.

Does this link work for you?

```scheme
https://youtu.be/y1rOWZkALto

```

---

<div class="post-metadata">

**Author:** ![encomer](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/encomer/32/280_2.png) [@encomer](https://racket.discourse.group/u/encomer)\
**Post date:** [March 23, 2026, 2:49am UTC](https://racket.discourse.group/t/about-the-youtube-procedure-in-scribble-embedding-package/4162/4 "2026-03-23T02:49:13Z")

</div>

Thank you @soegaard , for your reply.

The link that you shared: "[https://youtu.be/y1rOWZkALto](https://youtu.be/y1rOWZkALto)" works fine, directly in my web browser.

I'm using as a reference the documentation for the `scribble-embedding` package, for example as in the file with link: [scribble-embedding/scribblings/doc.scrbl at master · shriram/scribble-embedding · GitHub](https://github.com/shriram/scribble-embedding/blob/master/scribblings/doc.scrbl) . Please see line 90 of the code, that corresponds in my local documentation to:

```scheme
@(youtube " https://www.youtube.com/embed/43XaZEn2aLc ")

```

The problem is that (in my current installation,) the code above (line 90) generates the **Error 153** , at the **HTML output** _of the associated **scribble file** _.

_Does the above line of code, works fine in your installation_, using the` scribble-embedding` package?

_Thank you very much for your support to solve this issue_.  
EC

---

<div class="post-metadata">

**Author:** ![soegaard](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/soegaard/32/19_2.png) [@soegaard](https://racket.discourse.group/u/soegaard)\
**Post date:** [March 23, 2026, 9:17am UTC](https://racket.discourse.group/t/about-the-youtube-procedure-in-scribble-embedding-package/4162/5 "2026-03-23T09:17:26Z")

</div>

> The link that you shared: "[https://youtu.be/y1rOWZkALto](https://youtu.be/y1rOWZkALto)" works fine, directly in my web browser.

Does it work in Scribble too?

If not, do you have a minimal, full Scribble we can use to debug?

---

<div class="post-metadata">

**Author:** ![encomer](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/encomer/32/280_2.png) [@encomer](https://racket.discourse.group/u/encomer)\
**Post date:** [March 24, 2026, 1:26am UTC](https://racket.discourse.group/t/about-the-youtube-procedure-in-scribble-embedding-package/4162/6 "2026-03-24T01:26:35Z")

</div>

Thank you @soegaard . The link "[https://youtu.be/y1rOWZkALto](https://youtu.be/y1rOWZkALto)" doesn't work under Scribble file:

A minimal Scribble file to produce the Error 153 is:

```scheme
#lang scribble/manual
@require[scribble-embedding]
@(youtube "https://www.youtube.com/embed/43XaZEn2aLc")

```

_Exploring_ this issue, I searched for the **API changes** for embedding a Youtube video, and found that the **Error 153 was introduced in July 9, 2025**. See the section with link: [https://developers.google.com/youtube/iframe\_api\_reference#Revision\_History](https://developers.google.com/youtube/iframe_api_reference#Revision_History)

It seems that a **HTTP Referer** is now needed to be able to embed the YouTube Video: see for example the section with link: [https://developers.google.com/youtube/terms/required-minimum-functionality#set-the-referer](https://developers.google.com/youtube/terms/required-minimum-functionality#set-the-referer)

Thank you again for your support to solve this problem.  
_Kind regards._  
EC

---

<div class="post-metadata">

**Author:** ![soegaard](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/soegaard/32/19_2.png) [@soegaard](https://racket.discourse.group/u/soegaard)\
**Post date:** [March 24, 2026, 10:49am UTC](https://racket.discourse.group/t/about-the-youtube-procedure-in-scribble-embedding-package/4162/7 "2026-03-24T10:49:21Z")

</div>

You found the cause:

 ![image](https://global.discourse-cdn.com/free1/uploads/racket/original/2X/0/0c2a58914ee63221071ebdb42e6e5d87cfd759fa.png)

This means Shriram needs to add an header.

> **[GitHub - shriram/scribble-embedding: Tools to embed 3rd party content into Scribble...](https://github.com/shriram/scribble-embedding)**
>
> Tools to embed 3rd party content into Scribble documents

Make an issue.

---

<div class="post-metadata">

**Author:** ![encomer](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/encomer/32/280_2.png) [@encomer](https://racket.discourse.group/u/encomer)\
**Post date:** [April 13, 2026, 12:08am UTC](https://racket.discourse.group/t/about-the-youtube-procedure-in-scribble-embedding-package/4162/8 "2026-04-13T00:08:42Z")

</div>

Thank you very much @soegaard for the suggestion.

In link: [https://github.com/shriram/scribble-embedding/issues/1](https://github.com/shriram/scribble-embedding/issues/1), _you can see the issue created._

_Thank you in advance to professor_ **Shriram** , for the corresponding update _**in order to fix this [first] issue**_. And also for having created in the first place, the very practical and useful `scribble-embedding` package.

_Kind regards_.  
EC

---

<div class="post-metadata">

**Author:** ![mwblakley](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/mwblakley/32/2578_2.png) [@mwblakley](https://racket.discourse.group/u/mwblakley)\
**Post date:** [April 13, 2026, 10:01pm UTC](https://racket.discourse.group/t/about-the-youtube-procedure-in-scribble-embedding-package/4162/9 "2026-04-13T22:01:11Z")

</div>

Unfortunately, this is going to depend on how the scribble doc is served as HTML (i.e. file://, http://, https://) and how the browser handles referrerPolicy. Scribble is not setting a `<meta name="referrer" .../>` tag so the referrer policy for the generated html will be whatever the browser determines it should be. Actually setting a referrer policy that will work for all schemes is particularly difficult for file:// schemes. Safari seems like it won't ever send a referrer for file:// scheme even when using "unsafe-url". If you are serving this from an http server, then "unsafe-url" works fine and many of the other non-strict referrerPolicy option should also work. From https should also allow for some of the strict options.

There are a couple of ways to set the referrer policy in HTML. First is to add a meta tag to the HTML and second is to add it directly to the iframe. There might be a way to do the first option via scribble, but I'm not sure without more research how to do that. The second option is probably more appropriate for a scribble-embedding fix and would be something along the lines of

```diff
diff --git a/main.rkt b/main.rkt
index 4da1b44..133cb3b 100644
--- a/main.rkt
+++ b/main.rkt
@@ -46,6 +46,7 @@
      `(iframe [@ (src ,url)
                 (width ,(number->string width))
                 (height ,(number->string height))
+ (referrerpolicy "unsafe-url")
                 ,@(if frame-border
                       `((frameborder ,(number->string frame-border)))
                       `())

```

Actual fix likely won't want to use "unsafe-url", see [\<iframe\>: The Inline Frame element - HTML | MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/iframe#referrerpolicy) for options.

---

<div class="post-metadata">

**Author:** ![LiberalArtist](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/liberalartist/32/151_2.png) [@LiberalArtist](https://racket.discourse.group/u/LiberalArtist)\
**Post date:** [April 14, 2026, 2:16am UTC](https://racket.discourse.group/t/about-the-youtube-procedure-in-scribble-embedding-package/4162/10 "2026-04-14T02:16:01Z")

</div>

> [@mwblakley](#):
>
> Actually setting a referrer policy that will work for all schemes is particularly difficult for `file://` schemes. Safari seems like it won't ever send a referrer for `file://` scheme even when using "unsafe-url".

I haven't investigated in detail, but I expect this will indeed be a challenge. Per [RFC 9110 § 10.1.3](https://www.rfc-editor.org/rfc/rfc9110#section-10.1.3-9):

> The Referer header field has the potential to reveal information about the request context or browsing history of the user, which is a privacy concern … Most general-purpose user agents do not send the Referer header field when the referring resource is a local "file" or "data" URI.

The `scribble-embedding` package can certainly add a `referrerpolicy` attribute (maybe `origin`?) to help when documents are served over HTTP.

Scribble documents are designed to work from `file://` URLs, but it is not clear to me if Google wants to support this usecase for YouTube anymore. I found Google documentation on an [`origin` player parameter](https://developers.google.com/youtube/player_parameters#origin) (which it says to use for `SFSafariViewController` embedding, which does not set `Referer`) and a [“YouTube Player API Reference for iframe Embeds”](https://developers.google.com/youtube/iframe_api_reference) (which seems more likely to be relevant than the docs on mobile app embedding), but, in some (non-exhaustive) experiments, I have not found a way to hand-write a HTML file embedding a YouTube video that works when opened through `file://`.

If you have the rights to this video, you might consider just hosting it yourself. Here is a rough sketch (save [https://developer.mozilla.org/shared-assets/videos/flower.webm](https://developer.mozilla.org/shared-assets/videos/flower.webm) next to your `.scrbl` file):

```scheme
#lang scribble/manual
@; SPDX-License-Identifier: CC0-1.0

@(require scribble/core
          scribble/html-properties
          (only-in xml comment))

@(define (local-video relative-webm)
   (paragraph
    (style #f (list (install-resource relative-webm)
                    (alt-tag "video")
                    (attributes `([controls . "controls"]
                                  [width . "250"]))))
    @elem[
 #:style (style #f (list (alt-tag "p")
                         (xexpr-property
                          `(source ([src ,relative-webm]
                                    [type "video/webm"]))
                          (comment "nothing to inject after fallback"))))]{
 Your browser does not support this embedded video:
 you can @hyperlink[relative-webm]{download it} instead.
 }))

@local-video["flower.webm"]

```

---

<div class="post-metadata">

**Author:** ![soegaard](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/soegaard/32/19_2.png) [@soegaard](https://racket.discourse.group/u/soegaard)\
**Post date:** [April 14, 2026, 2:47pm UTC](https://racket.discourse.group/t/about-the-youtube-procedure-in-scribble-embedding-package/4162/11 "2026-04-14T14:47:24Z")

</div>

Advice and patch suggestion from ChatGPT:

> **[ChatGPT - YouTube Embed Issue](https://chatgpt.com/share/69de531a-adb4-8392-a92c-71edb73b80c3)**
>
> Shared via ChatGPT

---

<div class="post-metadata">

**Author:** ![encomer](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/encomer/32/280_2.png) [@encomer](https://racket.discourse.group/u/encomer)\
**Post date:** [April 26, 2026, 4:33pm UTC](https://racket.discourse.group/t/about-the-youtube-procedure-in-scribble-embedding-package/4162/12 "2026-04-26T16:33:32Z")

</div>

_Thank you very much_ @LiberalArtist _for this suggestion_.  
**It would be great** if in an _updated version_ of `scribble-embedding` (hopefully soon, for the benefit of all users), your `local-video` procedure _could be included_.

_Kind regards_.

P. S. We hope someone technically proficient on the complexities of this issue (as indicated by @mwblakley and @soegaard), will be able to advance in solving it —_may be by working first_ in the case when the Scribble doc is served as **https** , or **http**. _Thanks again for your support_.

---

<div class="post-metadata">

**Author:** ![LiberalArtist](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/liberalartist/32/151_2.png) [@LiberalArtist](https://racket.discourse.group/u/LiberalArtist)\
**Post date:** [May 8, 2026, 3:36am UTC](https://racket.discourse.group/t/about-the-youtube-procedure-in-scribble-embedding-package/4162/13 "2026-05-08T03:36:31Z")

</div>

> [@soegaard](#):
>
> Advice and patch suggestion from ChatGPT

For the record, when I wrote above that “it is not clear to me if Google wants to support this usecase [i.e. `file://` urls] for YouTube anymore,” it is not clearly unsupported, either. I did not find any explicit discussion in Google's docs about `file://` urls at all.

I have extremely low confidence in the accuracy of LLM output in general, but I wonder if it might have simply regurgitated my tentative conclusion. I didn't get the `origin` player parameter with the iframe embedding API to work, but I also didn't encounter anything that clearly _wouldn't_ work, and the LLM output didn't discuss that API at all.

(That said, I am not convinced that YouTube's newfound desire for a `Referer` header is legitimate from a privacy perspective.)

---

<div class="post-metadata">

**Author:** ![soegaard](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/soegaard/32/19_2.png) [@soegaard](https://racket.discourse.group/u/soegaard)\
**Post date:** [May 8, 2026, 8:33am UTC](https://racket.discourse.group/t/about-the-youtube-procedure-in-scribble-embedding-package/4162/14 "2026-05-08T08:33:24Z")

</div>

I got ChatGPT to find me the relevant parts of the YouTube documentation.

From [Embed videos & playlists - YouTube Help](https://support.google.com/youtube/answer/171780)

 ![image](https://global.discourse-cdn.com/free1/uploads/racket/original/2X/c/c354c7d3e768ec6722a18f5c15f45c4278cc9bd0.png)

Clicking the "developer documentation" leads to:

> **[API Client Identity and Credentials - YouTube API Services - Required Minimum...](https://developers.google.com/youtube/terms/required-minimum-functionality#embedded-player-api-client-identity)**
>
> This document outlines the minimum functional requirements for API clients accessing YouTube API services, ensuring a consistent user experience for users, content owners, and advertisers.

My clear impression is that plain `file://` without a local file server is not supposed to work.

That the requirement is in the Terms of Service means this is not by accident.

---

<div class="post-metadata">

**Author:** ![LiberalArtist](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/liberalartist/32/151_2.png) [@LiberalArtist](https://racket.discourse.group/u/LiberalArtist)\
**Post date:** [May 8, 2026, 10:06pm UTC](https://racket.discourse.group/t/about-the-youtube-procedure-in-scribble-embedding-package/4162/15 "2026-05-08T22:06:14Z")

</div>

> [@soegaard](#):
>
> Clicking the "developer documentation" leads to:
> 
> [YouTube API Services - Required Minimum Functionality &nbsp;|&nbsp; Google for Developers](https://developers.google.com/youtube/terms/required-minimum-functionality#embedded-player-api-client-identity)
> 
> My clear impression is that plain `file://` without a local file server is not supposed to work.

I will not be surprised if the ultimate conclusion is that `file://` URLs are no longer supported by YouTube, I just don't think that has been definitively established yet.

The documentation page you linked to says:

> [@Youtube API Services - Required Minimum Functionality](#):
>
> In environments where `HTTP Referer` is empty by default and not automatically set by the browser, API Clients must take action to provide their identity through alternative means. In WebView integrations such as a mobile app or desktop app, `HTTP Referer` is empty by default and the `Referer` is typically set using one of these techniques:
> 
> - …
> - Mobile app with player inside a native browser tab
> - …
> - iOS `SFSafariViewController`  
> `SFSafariViewController` does not support setting the `Referer`. In this case, set the [`origin`](https://developers.google.com/youtube/player_parameters#origin) player parameter instead.

The link to discussion of the `origin` player parameter is what led me to the [YouTube Player API Reference for iframe Embeds &nbsp;|&nbsp; YouTube IFrame Player API &nbsp;|&nbsp; Google for Developers](https://developers.google.com/youtube/iframe_api_reference) documentation, which seems more applicable anyway to Scribble-generated HTML pages, which hardly constitute an “app.”

I did not, in fact, successfully get anything based on the `iframe` API documentation working from a `file://` url, but I emphasize that I did not try very hard, and I didn't run into any clear dead end with that approach. It's a different situation than with [RFC 9110 § 10.1.3,](https://www.rfc-editor.org/rfc/rfc9110#section-10.1.3-9) which is fairly conclusive that no `Referer` policy will be effective for `file://` URLs.

That said, all of the focus in the documentation on “app”s and “API client”s does give me the sinking feeling that people at YouTube are not thinking about `iframe`s as fancy links, among the permissionless connections between hypermedia of which the open Web is woven. I just don't want my general feeling of apprehension to be mistaken for definitive knowledge.
