Skip to content

Commit

Permalink
fix: use correct url when using privacy mode (#58)
Browse files Browse the repository at this point in the history
* fix: use correct url when using privacy mode

* check against None
  • Loading branch information
12rambau authored Sep 12, 2023
1 parent 4ffb539 commit 77783fc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions sphinxcontrib/youtube/youtube.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@ class YouTube(utils.Video):
_thumbnail_url = "https://i3.ytimg.com/vi/{}/maxresdefault.jpg"
_platform = "youtube"
_platform_url = "https://youtu.be/"
_platform_url_privacy = "https://www.youtube-nocookie.com/embed/"


def visit_youtube_node(self, node):
"""Custom html visit node."""
node["platform_url"] = "https://www.youtube.com/embed/"
privacy = "https://www.youtube-nocookie.com/embed/"
embed = "https://www.youtube.com/embed/"
node["platform_url"] = embed if node["privacy_mode"] is None else privacy
return utils.visit_video_node_html(self, node)


Expand Down

0 comments on commit 77783fc

Please # to comment.