Unescape podcast description

main
Bob Mottram 2022-01-12 19:40:12 +00:00
parent c7e030d0c6
commit 3d175fc5d1
2 changed files with 35 additions and 35 deletions

View File

@ -538,7 +538,7 @@ def _create_news_mirror(base_dir: str, domain: str,
return True return True
def _convert_rs_sto_activity_pub(base_dir: str, http_prefix: str, def _convert_rss_to_activitypub(base_dir: str, http_prefix: str,
domain: str, port: int, domain: str, port: int,
newswire: {}, newswire: {},
translate: {}, translate: {},
@ -755,7 +755,7 @@ def _convert_rs_sto_activity_pub(base_dir: str, http_prefix: str,
try: try:
os.remove(filename + '.arrived') os.remove(filename + '.arrived')
except OSError: except OSError:
print('EX: _convert_rs_sto_activity_pub ' + print('EX: _convert_rss_to_activitypub ' +
'unable to delete ' + filename + '.arrived') 'unable to delete ' + filename + '.arrived')
# setting the url here links to the activitypub object # setting the url here links to the activitypub object
@ -833,7 +833,7 @@ def run_newswire_daemon(base_dir: str, httpd,
print('No new newswire') print('No new newswire')
print('Converting newswire to activitypub format') print('Converting newswire to activitypub format')
_convert_rs_sto_activity_pub(base_dir, _convert_rss_to_activitypub(base_dir,
http_prefix, domain, port, http_prefix, domain, port,
new_newswire, translate, new_newswire, translate,
httpd.recent_posts_cache, httpd.recent_posts_cache,

View File

@ -8,7 +8,7 @@ __status__ = "Production"
__module_group__ = "Web Interface Columns" __module_group__ = "Web Interface Columns"
import os import os
import urllib.parse import html
from shutil import copyfile from shutil import copyfile
from utils import get_config_param from utils import get_config_param
from utils import remove_html from utils import remove_html
@ -184,14 +184,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'
podcast_title = remove_html(urllib.parse.unquote_plus(newswire_item[0])) podcast_title = remove_html(html.unescape(newswire_item[0]))
if podcast_title: if podcast_title:
podcast_str += \ podcast_str += \
'<p><label class="podcast-title">"' + podcast_title + \ '<p><label class="podcast-title">"' + podcast_title + \
'</label></p>\n' '</label></p>\n'
if newswire_item[4]: if newswire_item[4]:
podcast_description = \ podcast_description = \
remove_html(urllib.parse.unquote_plus(newswire_item[4])) remove_html(html.unescape(newswire_item[4]))
if podcast_description: if podcast_description:
podcast_str += '<p>' + podcast_description + '</p>\n' podcast_str += '<p>' + podcast_description + '</p>\n'