aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Taylor <user234683@users.noreply.github.com>2018-07-24 03:26:34 -0700
committerJames Taylor <user234683@users.noreply.github.com>2018-07-24 03:26:34 -0700
commit7a22af4db66cf9778b2cf15e2567d792c5a5134e (patch)
tree0f22c68114b7c6109fd86aedaeef15eb4271b4ad
parent5e9f74d9407a6a88172faa631a497eee2b7b10ac (diff)
downloadyt-local-7a22af4db66cf9778b2cf15e2567d792c5a5134e.tar.lz
yt-local-7a22af4db66cf9778b2cf15e2567d792c5a5134e.tar.xz
yt-local-7a22af4db66cf9778b2cf15e2567d792c5a5134e.zip
fix double html escape of titles in local playlist
-rw-r--r--youtube/common.py8
1 files changed, 5 insertions, 3 deletions
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