From 7a22af4db66cf9778b2cf15e2567d792c5a5134e Mon Sep 17 00:00:00 2001 From: James Taylor Date: Tue, 24 Jul 2018 03:26:34 -0700 Subject: fix double html escape of titles in local playlist --- youtube/common.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'youtube') diff --git a/youtube/common.py b/youtube/common.py index 46dfc8d..5af33a0 100644 --- a/youtube/common.py +++ b/youtube/common.py @@ -502,18 +502,20 @@ def get_stats(html_ready): return ' | '.join(stats) def video_item_html(item, template, html_exclude=set()): - html_ready = get_html_ready(item) + video_info = {} for key in ('id', 'title', 'author'): try: - video_info[key] = html_ready[key] + video_info[key] = item[key] except KeyError: video_info[key] = '' try: - video_info['duration'] = html_ready['duration'] + video_info['duration'] = item['duration'] except KeyError: video_info['duration'] = 'Live' # livestreams don't have a duration + html_ready = get_html_ready(item) + html_ready['video_info'] = html.escape(json.dumps(video_info) ) html_ready['url'] = URL_ORIGIN + "/watch?v=" + html_ready['id'] html_ready['datetime'] = '' #TODO -- cgit v1.2.3