Importing playlists
You can import a JSON playlist file with the following structure:
{
"name": "playlist name",
"numberOfTrack": 105,
"source": "youtube",
"tracks": [
{
"index": 1,
"id": "xxxxxx",
"thumbnail": "image_url",
"title": "track title",
"album": "album name",
"duration": "3:40",
"artist": "artist name",
"streams": [
{
"source": "youtube",
"id": "xxxxxx"
}
]
},
]
}
source
andid
fields help Nuclear pull streams correctly fromstream provider
.streams
field is only needed when you don't define thesource
field at the top level. This happens when the playlist is not from a single source.
Nuclear is able to import Spotify and Youtube playlists. This is the preferred method, but it's based on scraping, so it can be wonky. We're working on improving it so it's more reliable, but it's a cat and mouse game.
- Go to Playlists and click this button (at the top):
- Paste your playlist's URL into the input box and click "Import"
- Nuclear should start importing the playlist. If it works, you should see progress within a couple of seconds. If it stays at 0%, don't wait for it more than 10s.
- If it hangs, you can retry by following this process again. Sometimes restarting Nuclear also helps.
- You're going to need a playlist link that looks like this: https://www.youtube.com/playlist?list=PLWMjC05R8fbWlVwjhRx2E2jhdreZLr12c
- To get this link, you have to go to the playlist view on Youtube, not to a video in the playlist.
- If you're in a view where a video from the playlist is playing, and the rest of the playlist is in the sidebar, you can go directly to the playlist view by clicking its name:
- Paste the playlist link directly into Nuclear's search box. If you do it correctly, you should see a list of all the tracks in the playlist:
- Now you can add them all to your play queue, and save the queue as a playlist by clicking the three dots above the queue.
You can use this tool (https://github.com/NuclearPlayer/extract-sptf-playlist) to extract the JSON playlist file from Spotify and Youtube. Since this is already built into Nuclear, the script is less convenient and not preferred.
This tool uses puppeteer package to fetch data and requires nodejs in your system.) to extract the JSON playlist file from Spotify and Youtube.
This tool uses puppeteer package to fetch data and requires nodejs in your system.nodejs in your system.
First, open your ternimal and make an empty directory then point to the new directory and install the package by this command:
npm install --save extract-sptf-playlist
Then create a file named
index.js
with the following content:const { getSpotifyPlaylist } = require('extract-sptf-playlist');
const url = 'YOUR PLAYLIST URL';
getSpotifyPlaylist(url, {
filePath: 'data.json',
displayProcess: true,
});
If it's Youtube playlist, replace
getSpotifyPlaylist
by getYoutubePlaylist
;Back to your terminal and execute the file by:
node index.js
The playlist will be exported in the file
data.json
in same directory.