mirror of
https://git.nadeko.net/Fijxu/invidious.git
synced 2025-12-27 18:11:25 +00:00
PubSub: Use external domain for pubsub feeds
This commit is contained in:
@@ -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?
|
||||
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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}")
|
||||
|
||||
Reference in New Issue
Block a user