From 7b6e274da2d63417f89d48152251f5b6290008b5 Mon Sep 17 00:00:00 2001 From: girst Date: Sun, 21 Jan 2024 16:27:43 +0000 Subject: [PATCH] add link to youtube playlist from /watch e.g. on /watch?v=6GWQBpvdC0c&list=PLJtitKU0CAehsdcybehbPFHObmWsKtQcY&index=1 --- app/youtube/__init__.py | 3 ++- app/youtube/templates/watch.html.j2 | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/youtube/__init__.py b/app/youtube/__init__.py index 0f8aa27..306d74f 100644 --- a/app/youtube/__init__.py +++ b/app/youtube/__init__.py @@ -84,6 +84,7 @@ def watch(): } video_id = request.args.get('v') + playlist = request.args.get('list') show = request.args.get("show") itag = request.args.get("itag") video_url, stream_map, metadata, error, errdetails = get_video_info(video_id, metaOnly=(show == 'meta')) @@ -189,7 +190,7 @@ def watch(): return render_template('watch.html.j2', video_id=video_id, video_url=video_url, stream_map=stream_map, video_error=error, errdetails=errdetails, invidious_url=invidious_url, - is_pinned=is_pinned, is_subscribed=is_subscribed, + playlist=playlist, is_pinned=is_pinned, is_subscribed=is_subscribed, **meta) @frontend.route('/embed/videoseries') diff --git a/app/youtube/templates/watch.html.j2 b/app/youtube/templates/watch.html.j2 index 2bcf667..9aaecd6 100644 --- a/app/youtube/templates/watch.html.j2 +++ b/app/youtube/templates/watch.html.j2 @@ -77,7 +77,12 @@ var sha256=function a(b){function c(a,b){return a>>>b|a<<32-b}for(var d,e,f=Math {% endif %}

{{ title | e }}
-{{ author | e }}

+ +{{ author | e }} +{% if playlist %} + | view playlist +{% endif %} +
Description

{{ description | e }}

-- 2.39.3