added youtube playlist import functionality. fixes issue #2114

Signed-off-by: Gavin Johnson <gavinj1984@gmail.com>
This commit is contained in:
Gavin Johnson
2023-01-28 09:26:16 -08:00
parent 855202e40e
commit 96344f28b4
5 changed files with 86 additions and 72 deletions

View File

@@ -310,6 +310,16 @@ module Invidious::Routes::PreferencesRoute
response: error_template(415, "Invalid subscription file uploaded")
)
end
# Gavin Johnson (thtmnisamnstr), 20230127: Call the Youtube playlist import function
when "import_youtube_pl"
filename = part.filename || ""
success = Invidious::User::Import.from_youtube_pl(user, body, filename, type)
if !success
haltf(env, status_code: 415,
response: error_template(415, "Invalid playlist file uploaded")
)
end
when "import_freetube"
Invidious::User::Import.from_freetube(user, body)
when "import_newpipe_subscriptions"