diff --git a/app/routes.py b/app/routes.py index 0fa025c..56358f7 100644 --- a/app/routes.py +++ b/app/routes.py @@ -242,7 +242,7 @@ def ytsearch(): 'thumbnail':'https:{}'.format(c['thumbnails'][0]), 'subCount':c['suscriberCountText'].split(" ")[0] }) - return render_template('ytsearch.html', form=form, btform=button_form, channels=channels, videos=videos) + return render_template('ytsearch.html', form=form, btform=button_form, channels=channels, videos=videos, restricted=config['restrictPublicUsage']) else: return render_template('ytsearch.html', form=form) @@ -301,7 +301,7 @@ def channel(id): data = feedparser.parse(data.content) channelData = YoutubeSearch.channelInfo(id) - return render_template('channel.html', form=form, btform=button_form, channel=channelData[0], videos=channelData[1]) + return render_template('channel.html', form=form, btform=button_form, channel=channelData[0], videos=channelData[1], restricted=config['restrictPublicUsage']) @app.route('/watch', methods=['GET']) @login_required diff --git a/app/templates/channel.html b/app/templates/channel.html index a4f3c5b..85f4bee 100644 --- a/app/templates/channel.html +++ b/app/templates/channel.html @@ -18,6 +18,7 @@ + {% if restricted or current_user.is_authenticated %}
{% if not current_user.is_following_yt(channel.id) %}

@@ -35,6 +36,7 @@

{% endif %}
+ {% endif %} diff --git a/app/templates/ytsearch.html b/app/templates/ytsearch.html index a7f7e23..9b20fd7 100644 --- a/app/templates/ytsearch.html +++ b/app/templates/ytsearch.html @@ -20,6 +20,7 @@ {% for res in channels %}
+ {% if restricted or current_user.is_authenticated %}
{% if not current_user.is_following_yt(res.channelId) %}

@@ -37,6 +38,7 @@

{% endif %}
+ {% endif %} Avatar
{{res.username}} diff --git a/yotter-config.json b/yotter-config.json index e0ef1e3..d24b805 100644 --- a/yotter-config.json +++ b/yotter-config.json @@ -2,5 +2,6 @@ "serverName": "Yotter.xyz", "nitterInstance": "https://nitter.net/", "maxInstanceUsers": 10, - "serverLocation": "Germany" + "serverLocation": "Germany", + "restrictPublicUsage":false }