diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/invidious/routes/embed.cr | 10 | ||||
| -rw-r--r-- | src/invidious/views/licenses.ecr | 18 |
2 files changed, 26 insertions, 2 deletions
diff --git a/src/invidious/routes/embed.cr b/src/invidious/routes/embed.cr index 84da9993..e6486587 100644 --- a/src/invidious/routes/embed.cr +++ b/src/invidious/routes/embed.cr @@ -2,11 +2,16 @@ module Invidious::Routes::Embed def self.redirect(env) + locale = env.get("preferences").as(Preferences).locale if plid = env.params.query["list"]?.try &.gsub(/[^a-zA-Z0-9_-]/, "") begin playlist = get_playlist(plid) offset = env.params.query["index"]?.try &.to_i? || 0 videos = get_playlist_videos(playlist, offset: offset) + if videos.empty? + url = "/playlist?list=#{plid}" + raise NotFoundException.new(translate(locale, "error_video_not_in_playlist", url)) + end rescue ex : NotFoundException return error_template(404, ex) rescue ex @@ -26,6 +31,7 @@ module Invidious::Routes::Embed end def self.show(env) + locale = env.get("preferences").as(Preferences).locale id = env.params.url["id"] plid = env.params.query["list"]?.try &.gsub(/[^a-zA-Z0-9_-]/, "") @@ -62,6 +68,10 @@ module Invidious::Routes::Embed playlist = get_playlist(plid) offset = env.params.query["index"]?.try &.to_i? || 0 videos = get_playlist_videos(playlist, offset: offset) + if videos.empty? + url = "/playlist?list=#{plid}" + raise NotFoundException.new(translate(locale, "error_video_not_in_playlist", url)) + end rescue ex : NotFoundException return error_template(404, ex) rescue ex diff --git a/src/invidious/views/licenses.ecr b/src/invidious/views/licenses.ecr index 25b24ed4..667cfa37 100644 --- a/src/invidious/views/licenses.ecr +++ b/src/invidious/views/licenses.ecr @@ -25,6 +25,20 @@ <tr> <td> + <a href="/js/handlers.js?v=<%= ASSET_COMMIT %>">handlers.js</a> + </td> + + <td> + <a href="https://www.gnu.org/licenses/agpl-3.0.html">AGPL-3.0</a> + </td> + + <td> + <a href="/js/handlers.js?v=<%= ASSET_COMMIT %>"><%= translate(locale, "source") %></a> + </td> + </tr> + + <tr> + <td> <a href="/js/community.js?v=<%= ASSET_COMMIT %>">community.js</a> </td> @@ -169,7 +183,7 @@ </td> <td> - <a href="https://choosealicense.com/licenses/mit/">MIT</a> + <a href="https://choosealicense.com/licenses/mit/">Expat</a> </td> <td> @@ -253,7 +267,7 @@ </td> <td> - <a href="https://choosealicense.com/licenses/mit">MIT</a> + <a href="https://choosealicense.com/licenses/mit">Expat</a> </td> <td> |
