Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

YouTube videos redirect during linkcheck #4203

Closed
stevepiercy opened this issue Dec 30, 2022 · 19 comments · Fixed by #6494
Closed

YouTube videos redirect during linkcheck #4203

stevepiercy opened this issue Dec 30, 2022 · 19 comments · Fixed by #6494

Comments

@stevepiercy
Copy link
Collaborator

And there are still warnings for youtube links:

Looks like a GDPR issue. I don't see redirects in the US.

We could add youtube to the list of ignored links, or just be aware of it. There is no open issue in Sphinx about GDPR compliance for linkcheck.

Alternatively we could embed the YouTube videos with https://github.com/sphinx-contrib/youtube, as suggested by executablebooks/sphinx-book-theme#354 (comment), which would remove the links.

Originally posted by @stevepiercy in #4181 (comment)

@SaiRev0
Copy link
Contributor

SaiRev0 commented Jan 13, 2023

I would like to work on this issue

@stevepiercy
Copy link
Collaborator Author

@SaiRev0 the @plone/documentation-team first needs to discuss and decide how to proceed. Once that decision is made, then you are welcome to work on it. @ksuess @polyester opinions?

Meanwhile, have you signed the Plone Contributor Agreement and been able to build the docs locally? See https://6.docs.plone.org/contributing/index.html for details. Thank you!

@SaiRev0
Copy link
Contributor

SaiRev0 commented Jan 14, 2023

@stevepiercy I have filled and mailed the Agreement yesterday, but no response for it yet, and i have not setup it locally, so doing it now

@SaiRev0
Copy link
Contributor

SaiRev0 commented Jan 21, 2023

@stevepiercy Can you please explain the issue and What I have to do, Its a bit unclear

@stevepiercy
Copy link
Collaborator Author

I'm awaiting opinions of how to deal with this issue from the @plone/documentation-team. @polyester @ksuess I don't have enough experience with GDPR to have an informed opinion.

@polyester
Copy link
Member

looks like sphinxcontrib-youtube has an easy way of setting the 'privacy mode which is a nice thing to do.
.. youtube:: dQw4w9WgXcQ
:privacy_mode:

@stevepiercy
Copy link
Collaborator Author

Nice. I also found the PR and noted that there is a Do Not Track mode for Vimeo, in case we need it.

sphinx-contrib/youtube#30

```{eval-rst}
 .. vimeo:: 73214621
        :url_parameters: ?dnt=1
```

@SaiRev0 let's replace the links to the videos accordingly, and add this extension to Sphinx's conf.py and requirements-docs.txt. Then we can ask folks who are affected by the GDPR to check it.

This will also need to be applied to the main documentation repository.

@stevepiercy
Copy link
Collaborator Author

@MohdAnas07 @ShubhamKhati see my earlier comment.

Meanwhile, have you signed the Plone Contributor Agreement and been able to build the docs locally? See https://6.docs.plone.org/contributing/index.html for details. Thank you!

See also: plone/documentation#1452 which will be incorporated into documentation soon by me.

@plone plone deleted a comment from MohdAnas07 Oct 5, 2023
@plone plone deleted a comment from ShubhamKhati Oct 5, 2023
@stevepiercy
Copy link
Collaborator Author

stevepiercy commented Nov 19, 2024

@polyester would you please test this, now that #6486 was merged?

Visit: https://volto--6486.org.readthedocs.build/tutorials/index.html

Compare to: https://6.docs.plone.org/volto/tutorials/index.html

@stevepiercy
Copy link
Collaborator Author

@ksuess @polyester I think this is now fixed. Can you run make linkcheckbroken to verify? Sorry, I don't have a VPN in the EU to test this out. Thank you!

@polyester
Copy link
Member

@stevepiercy currently not in the EU as well

@ksuess
Copy link
Member

ksuess commented Nov 19, 2024

Running make docs-linkcheckbroken from Zurich,
on a freshly checked out https://github.com/plone/volto/ branch main,
I get the following:

% make docs-linkcheckbroken
Symlink to Volto news created or updated.
/Users/katjasuss/Volto/volto/lib/python3.12/site-packages/sphinx/builders/linkcheck.py:86: RemovedInSphinx80Warning: The default value for 'linkcheck_report_timeouts_as_broken' will change to False in Sphinx 8, meaning that request timeouts will be reported with a new 'timeout' status, instead of as 'broken'. This is intended to provide more detail as to the failure mode. See https://github.com/sphinx-doc/sphinx/issues/11868 for details.
  warnings.warn(deprecation_msg, RemovedInSphinx80Warning, stacklevel=1)
/Users/katjasuss/Volto/volto/docs/source/news/6482.documentation: WARNING: document isn't included in any toctree
/Users/katjasuss/Volto/volto/docs/source/news/6485.bugfix: WARNING: document isn't included in any toctree
/Users/katjasuss/Volto/volto/docs/source/news/6486.documentation: WARNING: document isn't included in any toctree
/Users/katjasuss/Volto/volto/docs/source/news/6487.bugfix: WARNING: document isn't included in any toctree
( tutorials/index: line   80) redirect  https://www.youtube.com/playlist?list=PLGN9BI-OAQkQmEqf6O8jeyoFY1b2hD1uL - with Found to https://consent.youtube.com/m?continue=https%3A%2F%2Fwww.youtube.com%2Fplaylist%3Flist%3DPLGN9BI-OAQkQmEqf6O8jeyoFY1b2hD1uL%26cbrd%3D1&gl=CH&m=0&pc=yt&cm=2&hl=de&src=1
( tutorials/index: line   74) redirect  https://www.youtube.com/playlist?list=PLGN9BI-OAQkQDLQinBwdEXpebDTQCwdGi - with Found to https://consent.youtube.com/m?continue=https%3A%2F%2Fwww.youtube.com%2Fplaylist%3Flist%3DPLGN9BI-OAQkQDLQinBwdEXpebDTQCwdGi%26cbrd%3D1&gl=CH&m=0&pc=yt&cm=2&hl=de&src=1
( tutorials/index: line   57) redirect  https://www.youtube.com/playlist?list=PLGN9BI-OAQkQxqQcCZeJefMC8XlA_qv3Z - with Found to https://consent.youtube.com/m?continue=https%3A%2F%2Fwww.youtube.com%2Fplaylist%3Flist%3DPLGN9BI-OAQkQxqQcCZeJefMC8XlA_qv3Z%26cbrd%3D1&gl=CH&m=0&pc=yt&cm=2&hl=de&src=1
( tutorials/index: line   75) redirect  https://www.youtube.com/playlist?list=PLGN9BI-OAQkTJPayNdKIZ8lLDm5RVOLV3 - with Found to https://consent.youtube.com/m?continue=https%3A%2F%2Fwww.youtube.com%2Fplaylist%3Flist%3DPLGN9BI-OAQkTJPayNdKIZ8lLDm5RVOLV3%26cbrd%3D1&gl=CH&m=0&pc=yt&cm=2&hl=de&src=1
make: *** [Makefile:119: docs-linkcheckbroken] Error 1

@ksuess
Copy link
Member

ksuess commented Nov 19, 2024

Can I test something else?

@kmahesh18
Copy link

❯ make docs-linkcheckbroken
Symlink to Volto news created or updated.
/home/mahesh/volto/lib64/python3.10/site-packages/sphinx/builders/linkcheck.py:86: RemovedInSphinx80Warning: The default value for 'linkcheck_report_timeouts_as_broken' will change to False in Sphinx 8, meaning that request timeouts will be reported with a new 'timeout' status, instead of as 'broken'. This is intended to provide more detail as to the failure mode. See sphinx-doc/sphinx#11868 for details.
warnings.warn(deprecation_msg, RemovedInSphinx80Warning, stacklevel=1)
/home/mahesh/volto/docs/source/news/6482.documentation: WARNING: document isn't included in any toctree

got this Running make docs-linkcheckbroken from Hyderabad

@stevepiercy
Copy link
Collaborator Author

Can I test something else?

Oh, duh. My mistake, of course linkcheck won't check this directive, as there is no link for it to check.

```{youtube} kHec4MXH8vo
:privacy_mode:
:width: 100%
```

@ksuess, since you're in the EU, there are two things to check.

  1. Check whether the result of viewing this rendered page results in a GDPR warning (or whatever cookie stuff gets thrown at EU residents). I just pushed this page to production so it has the new rendered directive.

    https://6.docs.plone.org/volto/tutorials/index.html

    Its iframe has this: src="https://www.youtube-nocookie.com/embed/kHec4MXH8vo".

    The following earlier PR preview has the previous <iframe> version, for comparison:

    https://plone6--1757.org.readthedocs.build/volto/tutorials/index.html

  2. For this line:

    ( tutorials/index: line   80) redirect  https://www.youtube.com/playlist?list=PLGN9BI-OAQkQmEqf6O8jeyoFY1b2hD1uL - with Found to https://consent.youtube.com/m?continue=https%3A%2F%2Fwww.youtube.com%2Fplaylist%3Flist%3DPLGN9BI-OAQkQmEqf6O8jeyoFY1b2hD1uL%26cbrd%3D1&gl=CH&m=0&pc=yt&cm=2&hl=de&src=1

    Can you edit the URL to:

    https://www.youtube-nocookie.com/embed/playlist?list=PLGN9BI-OAQkQmEqf6O8jeyoFY1b2hD1uL
    

    ...and run linkcheck to see if that one still redirects? If this test works, then we can do a global find and replace. Otherwise we'll need to leave this ticket open. I'd prefer to find a different video host that does not profit from our personal information.

Thank you!

@stevepiercy
Copy link
Collaborator Author

@ksuess
Copy link
Member

ksuess commented Nov 20, 2024

I am not in the EU, but Switzerland. As I see the EU cookie consent popup when visiting youtube, it makes sense that I do the tests.
grafik

  1. The embedded video is shown properly without any cookie dialog.
    grafik
    It's good to use the https://www.youtube-nocookie.com/embed/kHec4MXH8vo
    Even better for privacy would be to use the https://www.youtube-nocookie.com/embed/VIDEO_ID?privacy_mode=1
    Add the privacy_mode=1 parameter to the embed URL. This parameter further enhances privacy by ensuring YouTube doesn't store user information or track their activity while watching the embedded video.
    See https://usercode.de/blog/how-to-embed-youtube-videos-with-maximum-privacy-gdpr-compliant#2-enable-privacy-mode
    So this is the code to achieve it:
```{youtube} kHec4MXH8vo
:privacy_mode:
:url_parameters: ?privacy_mode=1
:width: 100%
```

@ksuess
Copy link
Member

ksuess commented Nov 20, 2024

  1. Link check warnings are eliminated by using https://www.youtube-nocookie.com
    tutorials/index: line line 80:
    https://www.youtube-nocookie.com/embed/playlist?list=PLGN9BI-OAQkQmEqf6O8jeyoFY1b2hD1uL&privacy_mode=1
 [make docs-linkcheckbroken] ~/Volto/volto                                                                                         24-11-20  9:03AM
katjasuss@purpur volto % make docs-linkcheckbroken
Symlink to Volto news created or updated.
/Users/katjasuss/Volto/volto/lib/python3.12/site-packages/sphinx/builders/linkcheck.py:86: RemovedInSphinx80Warning: The default value for 'linkcheck_report_timeouts_as_broken' will change to False in Sphinx 8, meaning that request timeouts will be reported with a new 'timeout' status, instead of as 'broken'. This is intended to provide more detail as to the failure mode. See https://github.com/sphinx-doc/sphinx/issues/11868 for details.
  warnings.warn(deprecation_msg, RemovedInSphinx80Warning, stacklevel=1)
/Users/katjasuss/Volto/volto/docs/source/news/6482.documentation: WARNING: document isn't included in any toctree
/Users/katjasuss/Volto/volto/docs/source/news/6485.bugfix: WARNING: document isn't included in any toctree
/Users/katjasuss/Volto/volto/docs/source/news/6486.documentation: WARNING: document isn't included in any toctree
/Users/katjasuss/Volto/volto/docs/source/news/6487.bugfix: WARNING: document isn't included in any toctree

@stevepiercy
Copy link
Collaborator Author

@ksuess thanks for the thorough testing and PR!

@github-project-automation github-project-automation bot moved this from Todo to Done in Release Plone 6 docs Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
5 participants