Invidious is an alternative front-end to YouTube
Fix date parsing for RSS feeds
Omar Rothae10052aaf81
diff --git a/src/invidious.cr b/src/invidious.crindex f4f84e86..26f98b2c 100644--- a/src/invidious.cr+++ b/src/invidious.cr@@ -2072,8 +2072,8 @@ get "/feed/channel/:ucid" do |env|video_id = entry.xpath_node("videoid").not_nil!.contenttitle = entry.xpath_node("title").not_nil!.content- published = Time.parse(entry.xpath_node("published").not_nil!.content, "%FT%X%z", Time::Location.local)- updated = Time.parse(entry.xpath_node("updated").not_nil!.content, "%FT%X%z", Time::Location.local)+ published = Time.parse_rfc3339(entry.xpath_node("published").not_nil!.content)+ updated = Time.parse_rfc3339(entry.xpath_node("updated").not_nil!.content)author = entry.xpath_node("author/name").not_nil!.contentucid = entry.xpath_node("channelid").not_nil!.content@@ -2361,8 +2361,8 @@ post "/feed/webhook/:token" do |env|rss = XML.parse_html(body)rss.xpath_nodes("//feed/entry").each do |entry|id = entry.xpath_node("videoid").not_nil!.content- published = Time.parse(entry.xpath_node("published").not_nil!.content, "%FT%X%z", Time::Location.local)- updated = Time.parse(entry.xpath_node("updated").not_nil!.content, "%FT%X%z", Time::Location.local)+ published = Time.parse_rfc3339(entry.xpath_node("updated").not_nil!.content)+ updated = Time.parse_rfc3339(entry.xpath_node("updated").not_nil!.content)video = get_video(id, PG_DB, proxies, region: nil)video = ChannelVideo.new(id, video.title, published, updated, video.ucid, video.author, video.length_seconds)diff --git a/src/invidious/channels.cr b/src/invidious/channels.crindex 484aac2f..3ecfe529 100644--- a/src/invidious/channels.cr+++ b/src/invidious/channels.cr@@ -112,8 +112,8 @@ def fetch_channel(ucid, db, pull_all_videos = true, locale = nil)rss.xpath_nodes("//feed/entry").each do |entry|video_id = entry.xpath_node("videoid").not_nil!.contenttitle = entry.xpath_node("title").not_nil!.content- published = Time.parse(entry.xpath_node("published").not_nil!.content, "%FT%X%z", Time::Location.local)- updated = Time.parse(entry.xpath_node("updated").not_nil!.content, "%FT%X%z", Time::Location.local)+ published = Time.parse_rfc3339(entry.xpath_node("published").not_nil!.content)+ updated = Time.parse_rfc3339(entry.xpath_node("updated").not_nil!.content)author = entry.xpath_node("author/name").not_nil!.contentucid = entry.xpath_node("channelid").not_nil!.content