Skip to content

Instantly share code, notes, and snippets.

@elwayman02
Last active November 29, 2016 13:10
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elwayman02/000ea0ca4c0f20bb6905 to your computer and use it in GitHub Desktop.
Save elwayman02/000ea0ca4c0f20bb6905 to your computer and use it in GitHub Desktop.
Save Plug.DJ Playlists
  1. Login to plug.dj
  2. Visit this url: https://plug.dj/_/playlists
  3. Copy the resulting JSON into a text editor for reference. Mine is pasted below.
  4. Select the playlist you want to save and copy its id (such as 6782961)
  5. Visit this url, putting your playlist id in where it says [ID]: https://plug.dj/_/playlists/[ID]/media (ex: https://plug.dj/_/playlists/8096724/media)
  6. Copy the resulting JSON into a text editor for reference.

Note: This will only work for your own playlists, and only while you are logged in. Other user's playlist ids (such as the examples above) will return empty results.

YouTube

Choose any track with format of 1 (indicating a YouTube video) and copy its cid into this url: https://youtu.be/[CID] (ex: https://youtu.be/hgozboU7ne0)

SoundCloud

Choose any track with format of 2 (indicating a SoundCloud track) and copy its cid into this url: https://api.soundcloud.com/tracks/[CID]?client_id=[APIKEY]

Note: You will need to register a SoundCloud application in order to get a client_id. You can do that here, and then past it into the url above in order to retrieve soundcloud information.

The resulting JSON from the SoundCloud API will have a permalink_url which you can use to access the track and listen to it.

// playlists
{
  "data": [
    {
      "active": false,
      "count": 200,
      "id": 6782961,
      "name": "Fusion 2"
    },
    {
      "active": false,
      "count": 27,
      "id": 7843516,
      "name": "xEvent Mixes"
    },
    {
      "active": false,
      "count": 200,
      "id": 6877928,
      "name": "Old: Chill 4"
    },
    {
      "active": false,
      "count": 200,
      "id": 6289562,
      "name": "Old: Chill 2"
    },
    {
      "active": false,
      "count": 199,
      "id": 7600757,
      "name": "Old: Chill 5"
    },
    {
      "active": false,
      "count": 18,
      "id": 6074305,
      "name": "Soundcloud Favorites"
    },
    {
      "active": false,
      "count": 127,
      "id": 8096724,
      "name": "Fusion 3"
    },
    {
      "active": false,
      "count": 200,
      "id": 6450166,
      "name": "Old: Chill 3"
    },
    {
      "active": false,
      "count": 200,
      "id": 6083321,
      "name": "Old: Chill"
    },
    {
      "active": false,
      "count": 173,
      "id": 8214053,
      "name": "Chill 6"
    },
    {
      "active": true,
      "count": 154,
      "id": 7376114,
      "name": "Chilliest"
    },
    {
      "active": false,
      "count": 200,
      "id": 6083001,
      "name": "Fusion"
    }
  ],
  "meta": {},
  "status": "ok",
  "time": 11.608123779296875
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment