forked from Fijxu/invidious
Tokens: Option to disable user tokens.
This commit is contained in:
parent
20ebfedca5
commit
7a1d294543
4 changed files with 13 additions and 4 deletions
|
@ -189,6 +189,8 @@ class Config
|
|||
|
||||
property pubsub_domain : String = ""
|
||||
|
||||
property ignore_user_tokens : Bool = false
|
||||
|
||||
# Materialious redirects
|
||||
property materialious_domain : String?
|
||||
|
||||
|
|
|
@ -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}")
|
||||
|
|
|
@ -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"]?
|
||||
|
||||
|
|
|
@ -126,6 +126,7 @@
|
|||
<input name="save_player_pos" id="save_player_pos" type="checkbox" <% if preferences.save_player_pos %>checked<% end %>>
|
||||
</div>
|
||||
|
||||
<% if !CONFIG.ignore_user_tokens %>
|
||||
<div class="pure-control-group">
|
||||
<label for="po_token"><%= translate(locale, "preferences_po_token") %></label>
|
||||
<input name="po_token" id="po_token" type="text" value="<%= preferences.po_token %>">
|
||||
|
@ -140,6 +141,7 @@
|
|||
<div class="pure-control-group">
|
||||
<a href="/generate_tokens?referer=<%= URI.encode_www_form(referer) %>"><%= translate(locale, "Generate po_token and visitor_data for your account") %></a>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<legend><%= translate(locale, "preferences_category_visual") %></legend>
|
||||
|
|
Loading…
Reference in a new issue