|
|
@ -4,7 +4,7 @@ class InvidiousChannel
|
|
|
|
author: String,
|
|
|
|
author: String,
|
|
|
|
updated: Time,
|
|
|
|
updated: Time,
|
|
|
|
deleted: Bool,
|
|
|
|
deleted: Bool,
|
|
|
|
subscribed: {type: Bool, default: false},
|
|
|
|
subscribed: Time?,
|
|
|
|
})
|
|
|
|
})
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
@ -186,7 +186,7 @@ def fetch_channel(ucid, db, pull_all_videos = true, locale = nil)
|
|
|
|
db.exec("DELETE FROM channel_videos * WHERE NOT id = ANY ('{#{ids.map { |id| %("#{id}") }.join(",")}}') AND ucid = $1", ucid)
|
|
|
|
db.exec("DELETE FROM channel_videos * WHERE NOT id = ANY ('{#{ids.map { |id| %("#{id}") }.join(",")}}') AND ucid = $1", ucid)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
channel = InvidiousChannel.new(ucid, author, Time.now, false, false)
|
|
|
|
channel = InvidiousChannel.new(ucid, author, Time.now, false, nil)
|
|
|
|
|
|
|
|
|
|
|
|
return channel
|
|
|
|
return channel
|
|
|
|
end
|
|
|
|
end
|
|
|
@ -198,11 +198,11 @@ def subscribe_pubsub(ucid, key, config)
|
|
|
|
host_url = make_host_url(Kemal.config.ssl || config.https_only, config.domain)
|
|
|
|
host_url = make_host_url(Kemal.config.ssl || config.https_only, config.domain)
|
|
|
|
|
|
|
|
|
|
|
|
body = {
|
|
|
|
body = {
|
|
|
|
"hub.callback" => "#{host_url}/feed/webhook",
|
|
|
|
"hub.callback" => "#{host_url}/feed/webhook/#{time}:#{OpenSSL::HMAC.hexdigest(:sha1, key, time)}",
|
|
|
|
"hub.topic" => "https://www.youtube.com/feeds/videos.xml?channel_id=#{ucid}",
|
|
|
|
"hub.topic" => "https://www.youtube.com/feeds/videos.xml?channel_id=#{ucid}",
|
|
|
|
"hub.verify" => "async",
|
|
|
|
"hub.verify" => "async",
|
|
|
|
"hub.mode" => "subscribe",
|
|
|
|
"hub.mode" => "subscribe",
|
|
|
|
"hub.verify_token" => "#{time}:#{OpenSSL::HMAC.hexdigest(:sha1, key, time)}",
|
|
|
|
"hub.lease_seconds" => "432000",
|
|
|
|
"hub.secret" => key.to_s,
|
|
|
|
"hub.secret" => key.to_s,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|