in plugins/consensual_youtube.py [0:0]
def generate_youtube(content):
if isinstance(content, contents.Static):
return
soup = BeautifulSoup(content._content, 'html.parser') # pylint: disable=protected-access
tags = soup.find_all('youtube')
if not tags:
return
style = soup.new_tag('style')
style.append(CSS_STYLE)
soup.append(style)
script = soup.new_tag('script')
script.append(JS_SCRIPT)
soup.append(script)
for tag in tags:
replace_tag(content.settings['PATH'], content.settings['OUTPUT_PATH'], soup, tag)
content._content = soup.decode(formatter='html') # pylint: disable=protected-access