diff --git a/app/routes.py b/app/routes.py index 726fa2c..b9791ad 100644 --- a/app/routes.py +++ b/app/routes.py @@ -297,6 +297,20 @@ def channel(id): data = feedparser.parse(data.content) channelData = YoutubeSearch.channelInfo(id) + + for video in channelData[1]: + print(video) + if config['nginxVideoStream']: + hostName = urllib.parse.urlparse(video['videoThumb']).netloc + video['videoThumb'] = video['videoThumb'].replace("https://{}".format(hostName), "").replace("hqdefault", "mqdefault")+"?host="+hostName + else: + video['videoThumb'] = video['videoThumb'].replace('/', '~') + if config['nginxVideoStream']: + hostName = urllib.parse.urlparse(channelData[0]['avatar']).netloc + channelData[0]['avatar'] = channelData[0]['avatar'].replace("https://{}".format(hostName), "")+"?host="+hostName + else: + channelData[0]['avatar'] = channelData[0]['avatar'].replace('/', '~') + return render_template('channel.html', form=form, btform=button_form, channel=channelData[0], videos=channelData[1], restricted=config['restrictPublicUsage'], config=config) @app.route('/watch', methods=['GET']) diff --git a/app/templates/channel.html b/app/templates/channel.html index 85f4bee..a9c3272 100644 --- a/app/templates/channel.html +++ b/app/templates/channel.html @@ -4,7 +4,11 @@
- Avatar + {%if config.nginxVideoStream%} + Thumbnail + {%else%} + Thumbnail + {%endif%}