diff --git a/src/invidious.cr b/src/invidious.cr index 8d1ccd8e..b66d5edb 100644 --- a/src/invidious.cr +++ b/src/invidious.cr @@ -71,6 +71,7 @@ ARCHIVE_URL = URI.parse("https://archive.org") PUBSUB_URL = URI.parse("https://pubsubhubbub.appspot.com") REDDIT_URL = URI.parse("https://www.reddit.com") YT_URL = URI.parse("https://www.youtube.com") +PUBSUB_HOST_URL = CONFIG.pubsub_domain HOST_URL = make_host_url(Kemal.config) EXT_VIDEOP_LIST = gen_videoplayback_proxy_list() diff --git a/src/invidious/config.cr b/src/invidious/config.cr index ff63f869..8f283355 100644 --- a/src/invidious/config.cr +++ b/src/invidious/config.cr @@ -187,6 +187,8 @@ class Config # Job to refresh tokens from a Redis compatible DB property refresh_tokens : Bool = true + property pubsub_domain : String = "" + # Materialious redirects property materialious_domain : String? diff --git a/src/invidious/helpers/utils.cr b/src/invidious/helpers/utils.cr index d98c933b..072bd7ef 100644 --- a/src/invidious/helpers/utils.cr +++ b/src/invidious/helpers/utils.cr @@ -294,7 +294,7 @@ def subscribe_pubsub(topic, key) signature = "#{time}:#{nonce}" body = { - "hub.callback" => "#{HOST_URL}/feed/webhook/v1:#{time}:#{nonce}:#{OpenSSL::HMAC.hexdigest(:sha1, key, signature)}", + "hub.callback" => "#{PUBSUB_HOST_URL}/feed/webhook/v1:#{time}:#{nonce}:#{OpenSSL::HMAC.hexdigest(:sha1, key, signature)}", "hub.topic" => "https://www.youtube.com/xml/feeds/videos.xml?#{topic}", "hub.verify" => "async", "hub.mode" => "subscribe", diff --git a/src/invidious/jobs/subscribe_to_feeds_job.cr b/src/invidious/jobs/subscribe_to_feeds_job.cr index 8584fb9c..b7e7197c 100644 --- a/src/invidious/jobs/subscribe_to_feeds_job.cr +++ b/src/invidious/jobs/subscribe_to_feeds_job.cr @@ -30,6 +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}") if response.status_code >= 400 LOGGER.error("SubscribeToFeedsJob: #{ucid} : #{response.body}")