mirror of https://gitlab.com/bashrc2/epicyon
Mime type for youtube videos
parent
c05b569ce6
commit
e3a702efe6
|
@ -1029,7 +1029,7 @@ def _atom_feed_yt_to_dict(base_dir: str, domain: str, xml_str: str,
|
||||||
description = description.split('</summary>')[0]
|
description = description.split('</summary>')[0]
|
||||||
description = remove_html(description)
|
description = remove_html(description)
|
||||||
|
|
||||||
link, link_mime_type = get_link_from_rss_item(atom_item)
|
link, _ = get_link_from_rss_item(atom_item)
|
||||||
if not link:
|
if not link:
|
||||||
link = atom_item.split('<yt:videoId>')[1]
|
link = atom_item.split('<yt:videoId>')[1]
|
||||||
link = link.split('</yt:videoId>')[0]
|
link = link.split('</yt:videoId>')[0]
|
||||||
|
@ -1047,7 +1047,7 @@ def _atom_feed_yt_to_dict(base_dir: str, domain: str, xml_str: str,
|
||||||
votes_status = []
|
votes_status = []
|
||||||
podcast_properties = xml_podcast_to_dict(atom_item, xml_str)
|
podcast_properties = xml_podcast_to_dict(atom_item, xml_str)
|
||||||
if podcast_properties:
|
if podcast_properties:
|
||||||
podcast_properties['linkMimeType'] = link_mime_type
|
podcast_properties['linkMimeType'] = 'video/youtube'
|
||||||
_add_newswire_dict_entry(base_dir, domain,
|
_add_newswire_dict_entry(base_dir, domain,
|
||||||
result, pub_date_str,
|
result, pub_date_str,
|
||||||
title, link,
|
title, link,
|
||||||
|
|
|
@ -39,8 +39,8 @@ def _add_embedded_video_from_sites(translate: {}, content: str,
|
||||||
url = content.split('>vimeo.com/')[1]
|
url = content.split('>vimeo.com/')[1]
|
||||||
if '<' in url:
|
if '<' in url:
|
||||||
url = url.split('<')[0]
|
url = url.split('<')[0]
|
||||||
content = \
|
content += \
|
||||||
content + "<center>\n<iframe loading=\"lazy\" " + \
|
"<center>\n<iframe loading=\"lazy\" " + \
|
||||||
"src=\"https://player.vimeo.com/video/" + \
|
"src=\"https://player.vimeo.com/video/" + \
|
||||||
url + "\" width=\"" + str(width) + \
|
url + "\" width=\"" + str(width) + \
|
||||||
"\" height=\"" + str(height) + \
|
"\" height=\"" + str(height) + \
|
||||||
|
@ -57,8 +57,8 @@ def _add_embedded_video_from_sites(translate: {}, content: str,
|
||||||
url = url.split('&')[0]
|
url = url.split('&')[0]
|
||||||
if '?utm_' in url:
|
if '?utm_' in url:
|
||||||
url = url.split('?utm_')[0]
|
url = url.split('?utm_')[0]
|
||||||
content = \
|
content += \
|
||||||
content + "<center>\n<iframe loading=\"lazy\" src=\"" + \
|
"<center>\n<iframe loading=\"lazy\" src=\"" + \
|
||||||
video_site + url + "\" width=\"" + str(width) + \
|
video_site + url + "\" width=\"" + str(width) + \
|
||||||
"\" height=\"" + str(height) + \
|
"\" height=\"" + str(height) + \
|
||||||
"\" frameborder=\"0\" allow=\"autoplay; fullscreen\" " + \
|
"\" frameborder=\"0\" allow=\"autoplay; fullscreen\" " + \
|
||||||
|
@ -88,8 +88,8 @@ def _add_embedded_video_from_sites(translate: {}, content: str,
|
||||||
url = url.split('&')[0]
|
url = url.split('&')[0]
|
||||||
if '?utm_' in url:
|
if '?utm_' in url:
|
||||||
url = url.split('?utm_')[0]
|
url = url.split('?utm_')[0]
|
||||||
content = \
|
content += \
|
||||||
content + "<center>\n<iframe loading=\"lazy\" src=\"" + \
|
"<center>\n<iframe loading=\"lazy\" src=\"" + \
|
||||||
video_site + url + "\" width=\"" + \
|
video_site + url + "\" width=\"" + \
|
||||||
str(width) + "\" height=\"" + str(height) + \
|
str(width) + "\" height=\"" + str(height) + \
|
||||||
"\" frameborder=\"0\" allow=\"autoplay; fullscreen\" " + \
|
"\" frameborder=\"0\" allow=\"autoplay; fullscreen\" " + \
|
||||||
|
@ -103,8 +103,8 @@ def _add_embedded_video_from_sites(translate: {}, content: str,
|
||||||
url = url.split('"')[0]
|
url = url.split('"')[0]
|
||||||
if not url.endswith('/oembed'):
|
if not url.endswith('/oembed'):
|
||||||
url = url + '/oembed'
|
url = url + '/oembed'
|
||||||
content = \
|
content += \
|
||||||
content + "<center>\n<iframe loading=\"lazy\" src=\"" + \
|
"<center>\n<iframe loading=\"lazy\" src=\"" + \
|
||||||
video_site + url + "\" width=\"" + \
|
video_site + url + "\" width=\"" + \
|
||||||
str(width) + "\" height=\"" + str(height) + \
|
str(width) + "\" height=\"" + str(height) + \
|
||||||
"\" frameborder=\"0\" allow=\"fullscreen\" " + \
|
"\" frameborder=\"0\" allow=\"fullscreen\" " + \
|
||||||
|
@ -153,8 +153,8 @@ def _add_embedded_video_from_sites(translate: {}, content: str,
|
||||||
if '"' not in url:
|
if '"' not in url:
|
||||||
continue
|
continue
|
||||||
url = url.split('"')[0].replace('/watch/', '/embed/')
|
url = url.split('"')[0].replace('/watch/', '/embed/')
|
||||||
content = \
|
content += \
|
||||||
content + "<center>\n<iframe loading=\"lazy\" " + \
|
"<center>\n<iframe loading=\"lazy\" " + \
|
||||||
"sandbox=\"allow-same-origin " + \
|
"sandbox=\"allow-same-origin " + \
|
||||||
"allow-scripts\" src=\"https://" + \
|
"allow-scripts\" src=\"https://" + \
|
||||||
site + url + "\" width=\"" + str(width) + \
|
site + url + "\" width=\"" + str(width) + \
|
||||||
|
|
|
@ -190,7 +190,14 @@ def html_podcast_episode(css_cache: {}, translate: {},
|
||||||
translate['Your browser does not support the audio element.'] + \
|
translate['Your browser does not support the audio element.'] + \
|
||||||
'\n </audio>\n'
|
'\n </audio>\n'
|
||||||
elif podcast_properties.get('linkMimeType'):
|
elif podcast_properties.get('linkMimeType'):
|
||||||
if 'video' in podcast_properties['linkMimeType']:
|
if '/youtube' in podcast_properties['linkMimeType'] or \
|
||||||
|
'/vimeo' in podcast_properties['linkMimeType']:
|
||||||
|
podcast_str += \
|
||||||
|
" <iframe loading=\"lazy\" src=\"" + \
|
||||||
|
link_url + "\" width=\"90%\" " + \
|
||||||
|
"frameborder=\"0\" allow=\"autoplay; fullscreen\" " + \
|
||||||
|
"allowfullscreen>\n </iframe>\n"
|
||||||
|
elif 'video' in podcast_properties['linkMimeType']:
|
||||||
video_mime_type = podcast_properties['linkMimeType']
|
video_mime_type = podcast_properties['linkMimeType']
|
||||||
video_msg = 'Your browser does not support the video element.'
|
video_msg = 'Your browser does not support the video element.'
|
||||||
podcast_str += \
|
podcast_str += \
|
||||||
|
|
Loading…
Reference in New Issue