Skip to content

Commit

Permalink
RSS: return 404 if youtube playlist doesnt exist
Browse files Browse the repository at this point in the history
  • Loading branch information
ChunkyProgrammer committed Oct 30, 2024
1 parent 2e3a7ad commit 1827203
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/invidious/routes/feeds.cr
Original file line number Diff line number Diff line change
Expand Up @@ -309,8 +309,9 @@ module Invidious::Routes::Feeds
end

response = YT_POOL.client &.get("/feeds/videos.xml?playlist_id=#{plid}")
document = XML.parse(response.body)
return error_atom(404, NotFoundException.new("Playlist does not exist.")) if response.status_code == 404

document = XML.parse(response.body)
document.xpath_nodes(%q(//*[@href]|//*[@url])).each do |node|
node.attributes.each do |attribute|
case attribute.name
Expand Down

0 comments on commit 1827203

Please sign in to comment.