mirror of
https://gitea.invidious.io/iv-org/invidious.git
synced 2024-08-15 00:53:41 +00:00
commit
fa6c5158c5
2 changed files with 3 additions and 3 deletions
|
@ -219,7 +219,7 @@ module Invidious::Routes::API::V1::Videos
|
||||||
|
|
||||||
storyboard[:storyboard_count].times do |i|
|
storyboard[:storyboard_count].times do |i|
|
||||||
url = storyboard[:url]
|
url = storyboard[:url]
|
||||||
authority = /(i\d?).ytimg.com/.match(url).not_nil![1]?
|
authority = /(i\d?).ytimg.com/.match!(url)[1]?
|
||||||
url = url.gsub("$M", i).gsub(%r(https://i\d?.ytimg.com/sb/), "")
|
url = url.gsub("$M", i).gsub(%r(https://i\d?.ytimg.com/sb/), "")
|
||||||
url = "#{HOST_URL}/sb/#{authority}/#{url}"
|
url = "#{HOST_URL}/sb/#{authority}/#{url}"
|
||||||
|
|
||||||
|
@ -254,7 +254,7 @@ module Invidious::Routes::API::V1::Videos
|
||||||
if CONFIG.cache_annotations && (cached_annotation = Invidious::Database::Annotations.select(id))
|
if CONFIG.cache_annotations && (cached_annotation = Invidious::Database::Annotations.select(id))
|
||||||
annotations = cached_annotation.annotations
|
annotations = cached_annotation.annotations
|
||||||
else
|
else
|
||||||
index = CHARS_SAFE.index(id[0]).not_nil!.to_s.rjust(2, '0')
|
index = CHARS_SAFE.index!(id[0]).to_s.rjust(2, '0')
|
||||||
|
|
||||||
# IA doesn't handle leading hyphens,
|
# IA doesn't handle leading hyphens,
|
||||||
# so we use https://archive.org/details/youtubeannotations_64
|
# so we use https://archive.org/details/youtubeannotations_64
|
||||||
|
|
|
@ -182,7 +182,7 @@ struct Invidious::User
|
||||||
if is_opml?(type, extension)
|
if is_opml?(type, extension)
|
||||||
subscriptions = XML.parse(body)
|
subscriptions = XML.parse(body)
|
||||||
user.subscriptions += subscriptions.xpath_nodes(%q(//outline[@type="rss"])).map do |channel|
|
user.subscriptions += subscriptions.xpath_nodes(%q(//outline[@type="rss"])).map do |channel|
|
||||||
channel["xmlUrl"].match(/UC[a-zA-Z0-9_-]{22}/).not_nil![0]
|
channel["xmlUrl"].match!(/UC[a-zA-Z0-9_-]{22}/)[0]
|
||||||
end
|
end
|
||||||
elsif extension == "json" || type == "application/json"
|
elsif extension == "json" || type == "application/json"
|
||||||
subscriptions = JSON.parse(body)
|
subscriptions = JSON.parse(body)
|
||||||
|
|
Loading…
Reference in a new issue