Giter VIP home page Giter VIP logo

Comments (9)

maciejpedzich avatar maciejpedzich commented on May 16, 2024 1

Thanks for your interest in the project!

export a specific state of a playlist to json

Actually, this already exists. You can use the GitHub UI to view pretty/<playlist_id>.json at any commit you'd like.

Here's an example: https://github.com/mackorone/spotify-playlist-archive/blob/bbae5c6306c52b5867c2515ef88f92c3bbdf63e2/playlists/pretty/2dWfCGZguakRQagX7wM6Mi.json

That said, the workflow is not very user-friendly. Many people are not familiar with the GitHub UI, it's tedious to scroll through commit history, and the "view at this point in the history" button is difficult to find. Thankfully, I think there's a better solution to your underlying question:

create a playlist from a specific state

Spotify supports copy-paste for adding tracks to playlists. For example, you should be able to copy the URLs below and paste them into a playlist (using a keyboard shortcut, e.g., CTRL-V):

https://open.spotify.com/track/19fm0eNKTeg1JbHCHwPhLe
https://open.spotify.com/track/6e40mgJiCid5HRAGrbpGA6
https://open.spotify.com/track/0n0eMsX7WgEtc7dlscbuKU

Which means that re-creating old versions of playlists is as easy as curating lists of track URLs. You're entirely correct that it's annoying to curate that information by hand. For now, the best solution is to use jq to parse the "raw" JSON file (from GitHub) corresponding to the playlist you'd like to recreate:

curl $URL | jq -r .tracks[].url

However, an even better solution would be if https://spotifyplaylistarchive.com, which already makes it much easier to find old playlist versions, had a button for copying track URLs in one click. @maciejpedzich, what do you think about that? Is that something you'd be interested in implementing?

Of course I would! It's been a couple months since my last commit, but this feature should be fairly easy to implement. While at it, I could also make it easier for users to obtain the correct playlist ID so as for the less Git-experienced users not to struggle with copying it manually as seen in PR #133.

For the record, I'm not trying to shame that person for getting the wrong string - it's totally understandable, especially since it was their first time using Git and GitHub at all. The query string that Spotify appends when you copy the link from the share option menu didn't help either!

from spotify-playlist-archive.

mackorone avatar mackorone commented on May 16, 2024 1

Responding to @maciejpedzich:

Of course I would!

Nice! When you're done, let me know and I can add "how to restore a playlist" instructions to the README.md.

I could also make it easier for users to obtain the correct playlist ID

This would be great! Same as above, let me know when you're done and I'll update the README.md.

from spotify-playlist-archive.

maciejpedzich avatar maciejpedzich commented on May 16, 2024 1

@mackorone, @atopetiff. I forgot to notify you yesterday (I think I pinged Mack though, but better safe than sorry). I opened a PR in the website's repo that introduces JSON export, among other features. You just need to click the Deploy preview link, choose any playlist's snapshot and click Export to JSON.

from spotify-playlist-archive.

maciejpedzich avatar maciejpedzich commented on May 16, 2024 1

Hey @atopetiff! I've just merged the aforementioned PR, and the changes are now live on https://spotifyplaylistarchive.com! All you need to do is to open up any playlist's snapshot and click Export to JSON (yes, I've mentioned it already, but doing it again wouldn't hurt I guess). @mackorone should add relevant instructions in CONTRIBUTING.md or somewhere else soon

from spotify-playlist-archive.

mackorone avatar mackorone commented on May 16, 2024

Thanks for your interest in the project!

export a specific state of a playlist to json

Actually, this already exists. You can use the GitHub UI to view pretty/<playlist_id>.json at any commit you'd like.

Here's an example: https://github.com/mackorone/spotify-playlist-archive/blob/bbae5c6306c52b5867c2515ef88f92c3bbdf63e2/playlists/pretty/2dWfCGZguakRQagX7wM6Mi.json

That said, the workflow is not very user-friendly. Many people are not familiar with the GitHub UI, it's tedious to scroll through commit history, and the "view at this point in the history" button is difficult to find. Thankfully, I think there's a better solution to your underlying question:

create a playlist from a specific state

Spotify supports copy-paste for adding tracks to playlists. For example, you should be able to copy the URLs below and paste them into a playlist (using a keyboard shortcut, e.g., CTRL-V):

https://open.spotify.com/track/19fm0eNKTeg1JbHCHwPhLe
https://open.spotify.com/track/6e40mgJiCid5HRAGrbpGA6
https://open.spotify.com/track/0n0eMsX7WgEtc7dlscbuKU

Which means that re-creating old versions of playlists is as easy as curating lists of track URLs. You're entirely correct that it's annoying to curate that information by hand. For now, the best solution is to use jq to parse the "raw" JSON file (from GitHub) corresponding to the playlist you'd like to recreate:

curl $URL | jq -r .tracks[].url

However, an even better solution would be if https://spotifyplaylistarchive.com, which already makes it much easier to find old playlist versions, had a button for copying track URLs in one click. @maciejpedzich, what do you think about that? Is that something you'd be interested in implementing?

from spotify-playlist-archive.

atopetiff avatar atopetiff commented on May 16, 2024

thats a creative way. use a git repo as kind of a database.
I found myself an easier solution. i used the network traffic from the development console in browser to get the json. although not usable for non developers but a lot faster. then i used my own nodejs adapter to create playlists out of the json file.
i think the greatest solution for a non dev would be an webapp that accesses the callers spotify account and creates the playlist for him. My personal opinion is that the most people who find your project want to restore a complete playlist not just single tracks. The Spotify Api is easy to use but the authentication for a caller could be interesting. Oh probably there isnt a need for the complete token version perhaps one of the other versions is enough.

Another thing iยดm not sure about. Are your archived playlists in the exact same track order they were at the snapshot date?

from spotify-playlist-archive.

mackorone avatar mackorone commented on May 16, 2024

Responding to @atopetiff:

use a git repo as kind of a database

Yea, that's the idea! See https://simonwillison.net/2020/Oct/9/git-scraping/

webapp that accesses the callers spotify account and creates the playlist for him

Interestingly, @maciejpedzich explored this idea when he built https://spotifyplaylistarchive.com/. I believe he decided to not implement the functionality at the time, given the complexity related to authentication that you mentioned.

Are your archived playlists in the exact same track order

Indeed!

from spotify-playlist-archive.

maciejpedzich avatar maciejpedzich commented on May 16, 2024

i think the greatest solution for a non dev would be an webapp that accesses the callers spotify account and creates the playlist for him. My personal opinion is that the most people who find your project want to restore a complete playlist not just single tracks. The Spotify Api is easy to use but the authentication for a caller could be interesting.

Yeah, that's pretty close to what @mackorone has mentioned, and I've just wanted to elaborate on this one anwyay. So buckle up for a little development backstory!

In May this year I started working on a prototype of this app called Arkivify, which was meant to serve the exact same purpose as spotifyplaylistarchive.com, but instead of having a script running through a specific set of playlists every day, you would instead have to log in via Spotify in order to be able to capture playlists' snapshots (the Spotify API requires an auth token to be provided even with a public playlist request anyway).

The real issue wasn't the in-app implementation, but rather the way Spotify handles new OAuth apps. It initially restricts you to 20 signed up users, which you're also forced to add to an allowlist in order for them to be able to authorise your app in the first place. While it's possible to get a quota extension, this involves your app getting manually reviewed for quality control and compliance with the API's Terms of Service. Speaking of which, there's a teeny-tiny write-up in section 4.3.a.i of said ToS that would effectively put all my effort to waste.

Fast forward to mid-June. Me and @mackorone had already emailed each other back-and-forth about the possibility of me migrating the data he had collected so far over to Arkivify's database, but after I'd discovered that pesky paragrah, I realised I had to change my strategy and essentially turn his Git repo into my web app's database/backend of sorts as you've noticed. And well... here we are today, with https://spotifyplaylistarchive.com up and running since July!

EDIT: If I had a dollar for every time I wrote this year in my message, I would have three dollars. As Aloe Blacc once sang: https://open.spotify.com/track/3oUphdZVPyrsprZ8FgbmQS

from spotify-playlist-archive.

mackorone avatar mackorone commented on May 16, 2024

Thanks for those improvements, @maciejpedzich! I just updated README.md and CONTRIBUTING.md with instructions for recreating playlists and extracting playlist IDs, respectively. I'm considering this issue closed.

@atopetiff, let me know if you have any further questions.

from spotify-playlist-archive.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.