From 641724f79fdbc3d8ee9d38ac33125d0026a71a6e Mon Sep 17 00:00:00 2001 From: pluja Date: Sat, 26 Sep 2020 20:37:44 +0200 Subject: [PATCH] Fixes #81 on ytsearch --- app/routes.py | 6 ++++++ app/templates/ytsearch.html | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/app/routes.py b/app/routes.py index 4d787da..0326912 100644 --- a/app/routes.py +++ b/app/routes.py @@ -234,6 +234,12 @@ def ytsearch(): sort = 0 filters = {"time":0, "type":0, "duration":0} results = yts.search_by_terms(searchTerms, page, autocorrect, sort, filters) + for channel in results['channels']: + if config['nginxVideoStream']: + channel['thumbnail'] = channel['thumbnail'].replace("~", "/") + hostName = urllib.parse.urlparse(channel['thumbnail']).netloc + channel['thumbnail'] = channel['thumbnail'].replace("https://{}".format(hostName), "")+"&host="+hostName + print(channel['thumbnail']) return render_template('ytsearch.html', form=form, btform=button_form, results=results, restricted=config['restrictPublicUsage'], config=config) else: diff --git a/app/templates/ytsearch.html b/app/templates/ytsearch.html index b551081..e4d05c2 100644 --- a/app/templates/ytsearch.html +++ b/app/templates/ytsearch.html @@ -21,7 +21,11 @@ {% for res in results.channels %}
- + {% if config.nginxVideoStream %} + Avatar + {% else %} + Avatar + {% endif %}