mirror of
https://github.com/iv-org/invidious.git
synced 2026-06-16 19:54:28 +00:00
fix: fix private invidious playlists on rss feeds from being fetched without authentication (#5776)
This commit is contained in:
@@ -283,6 +283,11 @@ module Invidious::Routes::Feeds
|
|||||||
if playlist = Invidious::Database::Playlists.select(id: plid)
|
if playlist = Invidious::Database::Playlists.select(id: plid)
|
||||||
videos = get_playlist_videos(playlist, offset: 0)
|
videos = get_playlist_videos(playlist, offset: 0)
|
||||||
|
|
||||||
|
user = env.get?("user").try &.as(User)
|
||||||
|
if !playlist || playlist.privacy.private? && playlist.author != user.try &.email
|
||||||
|
return error_atom(404, "Playlist does not exist.")
|
||||||
|
end
|
||||||
|
|
||||||
return XML.build(indent: " ", encoding: "UTF-8") do |xml|
|
return XML.build(indent: " ", encoding: "UTF-8") do |xml|
|
||||||
xml.element("feed", "xmlns:yt": "http://www.youtube.com/xml/schemas/2015",
|
xml.element("feed", "xmlns:yt": "http://www.youtube.com/xml/schemas/2015",
|
||||||
"xmlns:media": "http://search.yahoo.com/mrss/", xmlns: "http://www.w3.org/2005/Atom",
|
"xmlns:media": "http://search.yahoo.com/mrss/", xmlns: "http://www.w3.org/2005/Atom",
|
||||||
|
|||||||
Reference in New Issue
Block a user