RSS: return 404 if youtube playlist doesnt exist

This commit is contained in:
ChunkyProgrammer 2023-11-29 21:59:19 -05:00
parent eda7444ca4
commit c1b40e0d22
1 changed files with 2 additions and 1 deletions

View File

@ -311,8 +311,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