Skip to content
Permalink
Browse files
Use youtube-nocookie.com for better privacy in YouTube player
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed May 10, 2018
1 parent f2e0ad8 commit c79597dc2b5407b828b3681240cda095fa12208f
Showing with 9 additions and 6 deletions.
  1. +4 −3 nikola/plugins/compile/rest/youtube.py
  2. +5 −3 tests/test_rst_compiler.py
@@ -48,7 +48,8 @@ def set_site(self, site):
CODE = """\
<div class="youtube-video{align}">
<iframe width="{width}" height="{height}"
src="https://www.youtube.com/embed/{yid}?rel=0&amp;hd=1&amp;wmode=transparent"
src="https://www.youtube-nocookie.com/embed/{yid}?rel=0&wmode=transparent"
frameborder="0" allow="encrypted-media" allowfullscreen
></iframe>
</div>"""

@@ -76,8 +77,8 @@ def run(self):
self.check_content()
options = {
'yid': self.arguments[0],
'width': 425,
'height': 344,
'width': 560,
'height': 315,
}
options.update(self.options)
if self.options.get('align') in _align_options_base:
@@ -170,10 +170,12 @@ def test_youtube(self):
""" Test Youtube iframe tag generation """
self.basic_test()
self.assertHTMLContains("iframe",
attributes={"src": ("https://www.youtube.com/"
"embed/YID?rel=0&hd=1&"
attributes={"src": ("https://www.youtube-nocookie.com/"
"embed/YID?rel=0&"
"wmode=transparent"),
"height": "400", "width": "600"})
"height": "400", "width": "600",
"frameborder": "0", "allowfullscreen": "",
"allow": "encrypted-media"})


class ListingTestCase(ReSTExtensionTestCase):

0 comments on commit c79597d

Please sign in to comment.