diff --git a/src/invidious/config.cr b/src/invidious/config.cr index 8f283355..accfad2f 100644 --- a/src/invidious/config.cr +++ b/src/invidious/config.cr @@ -189,6 +189,8 @@ class Config property pubsub_domain : String = "" + property ignore_user_tokens : Bool = false + # Materialious redirects property materialious_domain : String? diff --git a/src/invidious/jobs/subscribe_to_feeds_job.cr b/src/invidious/jobs/subscribe_to_feeds_job.cr index b7e7197c..3f2b7aad 100644 --- a/src/invidious/jobs/subscribe_to_feeds_job.cr +++ b/src/invidious/jobs/subscribe_to_feeds_job.cr @@ -30,8 +30,8 @@ class Invidious::Jobs::SubscribeToFeedsJob < Invidious::Jobs::BaseJob spawn do begin response = subscribe_pubsub(ucid, hmac_key) - LOGGER.debug("SubscribeToFeedsJob: Subscribed to #{ucid}.") - LOGGER.trace("SubscribeToFeedsJob: response.body: #{response.body}") + LOGGER.debug("SubscribeToFeedsJob: Subscribed to #{ucid}.") + LOGGER.trace("SubscribeToFeedsJob: response.body: #{response.body}") if response.status_code >= 400 LOGGER.error("SubscribeToFeedsJob: #{ucid} : #{response.body}") diff --git a/src/invidious/routes/watch.cr b/src/invidious/routes/watch.cr index 73478da1..3a90d822 100644 --- a/src/invidious/routes/watch.cr +++ b/src/invidious/routes/watch.cr @@ -3,8 +3,13 @@ module Invidious::Routes::Watch def self.handle(env) locale = env.get("preferences").as(Preferences).locale - user_po_token = env.get("preferences").as(Preferences).po_token - user_visitor_data = env.get("preferences").as(Preferences).visitor_data + if !CONFIG.ignore_user_tokens + user_po_token = env.get("preferences").as(Preferences).po_token + user_visitor_data = env.get("preferences").as(Preferences).visitor_data + else + user_po_token = "" + user_visitor_data = "" + end region = env.params.query["region"]? diff --git a/src/invidious/views/user/preferences.ecr b/src/invidious/views/user/preferences.ecr index 81fc1f96..c04805bb 100644 --- a/src/invidious/views/user/preferences.ecr +++ b/src/invidious/views/user/preferences.ecr @@ -126,6 +126,7 @@ checked<% end %>> + <% if !CONFIG.ignore_user_tokens %>