mirror of https://gitlab.com/bashrc2/epicyon
Include parent domain within twitch embed
parent
00765d4b26
commit
5eb3bf9ea0
2
blog.py
2
blog.py
|
@ -282,7 +282,7 @@ def _html_blog_post_content(debug: bool, session, authorized: bool,
|
|||
blog_str += '<br><center>' + attachment_str + '</center>'
|
||||
if json_content:
|
||||
content_str = add_embedded_elements(translate, json_content,
|
||||
peertube_instances)
|
||||
peertube_instances, domain_full)
|
||||
if post_json_object['object'].get('tag'):
|
||||
post_json_object_tags = post_json_object['object']['tag']
|
||||
content_str = replace_emoji_from_tags(session, base_dir,
|
||||
|
|
|
@ -33,7 +33,8 @@ def load_peertube_instances(base_dir: str, peertube_instances: []) -> None:
|
|||
|
||||
def _add_embedded_video_from_sites(translate: {}, content: str,
|
||||
peertube_instances: [],
|
||||
width: int, height: int) -> str:
|
||||
width: int, height: int,
|
||||
domain: str) -> str:
|
||||
"""Adds embedded videos
|
||||
"""
|
||||
if '<iframe' in content:
|
||||
|
@ -51,7 +52,7 @@ def _add_embedded_video_from_sites(translate: {}, content: str,
|
|||
content += \
|
||||
'<center>\n<span itemprop="video">\n' + \
|
||||
'<iframe src="https://player.twitch.tv/?channel=' + \
|
||||
channel + '&parent=www.example.com" ' + \
|
||||
channel + '&parent=' + domain + '" ' + \
|
||||
'frameborder="0" allowfullscreen="true" ' + \
|
||||
'scrolling="no" height="378" width="620"></iframe>' + \
|
||||
'</span>\n</center>\n'
|
||||
|
@ -366,10 +367,11 @@ def _add_embedded_video(translate: {}, content: str) -> str:
|
|||
|
||||
|
||||
def add_embedded_elements(translate: {}, content: str,
|
||||
peertube_instances: []) -> str:
|
||||
peertube_instances: [], domain: str) -> str:
|
||||
"""Adds embedded elements for various media types
|
||||
"""
|
||||
content = _add_embedded_video_from_sites(translate, content,
|
||||
peertube_instances, 400, 300)
|
||||
peertube_instances,
|
||||
400, 300, domain)
|
||||
content = _add_embedded_audio(translate, content)
|
||||
return _add_embedded_video(translate, content)
|
||||
|
|
|
@ -2236,7 +2236,7 @@ def individual_post_as_html(signing_priv_key_pem: str,
|
|||
if not post_is_sensitive:
|
||||
content_str = object_content + attachment_str
|
||||
content_str = add_embedded_elements(translate, content_str,
|
||||
peertube_instances)
|
||||
peertube_instances, domain)
|
||||
content_str = insert_question(base_dir, translate,
|
||||
nickname, domain,
|
||||
content_str, post_json_object,
|
||||
|
@ -2258,7 +2258,8 @@ def individual_post_as_html(signing_priv_key_pem: str,
|
|||
cw_content_str = object_content + attachment_str
|
||||
if not is_patch:
|
||||
cw_content_str = add_embedded_elements(translate, cw_content_str,
|
||||
peertube_instances)
|
||||
peertube_instances,
|
||||
domain_full)
|
||||
cw_content_str = \
|
||||
insert_question(base_dir, translate, nickname, domain,
|
||||
cw_content_str, post_json_object, page_number)
|
||||
|
|
Loading…
Reference in New Issue