Piped icon indicating copy to clipboard operation
Piped copied to clipboard

Backend: NullPointers when trying to import playlist

Open samip5 opened this issue 1 year ago • 5 comments

Official Instance

Describe the bug

It seems that playlist import doesn't appear to work with the route /user/playlists/create

To Reproduce

  1. Export your already existing playlist from YouTube via Google Takeout
  2. Notice that it may be in different language than English
  3. See that the import fails with a ERROR 500 and NullPointer in backend logs

Expected behavior

I would have expected it to have imported my playlist.

Logs/Errors

An error occoured in the path: /user/playlists/add
java.lang.NullPointerException: Cannot invoke "com.fasterxml.jackson.databind.JsonNode.textValue()" because the return value of "com.fasterxml.jackson.databind.JsonNode.get(String)" is null
        at me.kavin.piped.server.ServerLauncher.lambda$mainServlet$46(ServerLauncher.java:415)
        at io.activej.http.AsyncServlet.lambda$ofBlocking$0(AsyncServlet.java:43)
        at io.activej.promise.Promise.lambda$ofBlocking$12(Promise.java:249)
        at java.base/java.util.concurrent.ThreadPerTaskExecutor$TaskRunner.run(ThreadPerTaskExecutor.java:314)
        at java.base/java.lang.VirtualThread.run(VirtualThread.java:311)

Browser, and OS with Version.

Not applicable

Additional context

No response

samip5 avatar Oct 28 '23 09:10 samip5

I had the same problem, manually added the playlists, now export to jason button for playlists not working (it worked once). I think I should open a new issue.

abuturabofficial avatar Oct 30 '23 13:10 abuturabofficial

#2866

Facni avatar Oct 30 '23 22:10 Facni

Is there an example playlist file that could be shared?

FireMasterK avatar Nov 01 '23 00:11 FireMasterK

I'm having the same problem here, but it's a little different.

When I try to "Restore Preferences" then the import section is broken and when I go to the "Feed" section there is a box that says "Do you want to delete the playlist" (not sure if it's totally accurate traduction). Screenshot 2023-12-01 at 22-24-26 Piped

And I can only press on "Yes" and when I did it, I have an error. Screenshot from 2023-12-01 22-25-14

I hope this will help.

preferences.json

klamares avatar Dec 01 '23 21:12 klamares

I just had the same problem and after some digging it looks like the front-end sends an empty JSON object to the back-end, although the back-end expects a name property. I will look around a bit more, see if I find anything.

Edit: The culprit is in this Function, I think. The code in there does not correspond to the current format of Google Takeout, which looks like this:

Video ID,Playlist Video Creation Timestamp
xxxxxxxxxxx,2024-04-13T16:42:44+00:00

kmoschcau avatar May 31 '24 12:05 kmoschcau

As a workaround for Takeout playlists, you can add this to the beginning of the CSV:


,,,,<playlist name>


<rest of the original file>

kmoschcau avatar May 31 '24 13:05 kmoschcau

Thanks, that workaround did the trick for now.

The blank lines are indeed needed as well.

samip5 avatar Jun 12 '24 23:06 samip5