mirror of
https://github.com/iv-org/invidious.git
synced 2024-12-23 05:53:37 +00:00
Fix pubsub feed parsing
similar to what's done in #3793, this is causing an assert on my instance
This commit is contained in:
parent
c005ada487
commit
c864a63b6d
@ -407,12 +407,17 @@ module Invidious::Routes::Feeds
|
|||||||
end
|
end
|
||||||
|
|
||||||
spawn do
|
spawn do
|
||||||
rss = XML.parse_html(body)
|
# TODO: unify this with the other almost identical looking parts in this and channels.cr somehow?
|
||||||
rss.xpath_nodes("//feed/entry").each do |entry|
|
namespaces = {
|
||||||
id = entry.xpath_node("videoid").not_nil!.content
|
"yt" => "http://www.youtube.com/xml/schemas/2015",
|
||||||
author = entry.xpath_node("author/name").not_nil!.content
|
"default" => "http://www.w3.org/2005/Atom",
|
||||||
published = Time.parse_rfc3339(entry.xpath_node("published").not_nil!.content)
|
}
|
||||||
updated = Time.parse_rfc3339(entry.xpath_node("updated").not_nil!.content)
|
rss = XML.parse(body)
|
||||||
|
rss.xpath_nodes("//default:feed/default:entry", namespaces).each do |entry|
|
||||||
|
id = entry.xpath_node("yt:videoId", namespaces).not_nil!.content
|
||||||
|
author = entry.xpath_node("default:author/default:name", namespaces).not_nil!.content
|
||||||
|
published = Time.parse_rfc3339(entry.xpath_node("default:published", namespaces).not_nil!.content)
|
||||||
|
updated = Time.parse_rfc3339(entry.xpath_node("default:updated", namespaces).not_nil!.content)
|
||||||
|
|
||||||
video = get_video(id, force_refresh: true)
|
video = get_video(id, force_refresh: true)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user