4

The Grooveshark music streaming service has been shut down without previous notification. I had many playlists that I would like to recover (playlists I made over several years).

Is there any way I could recover them? A script or something automated would be awesome.

Peque
  • 13,638
  • 11
  • 69
  • 105
  • 3
    See this site: [Groove Backup](http://googleglass.my/groovebackup/) – kenorb May 13 '15 at 10:45
  • If you don't want an automatic way (are afraid or do not know how to run scripts), then [there is a manual way of recovering your playlists as well](http://webapps.stackexchange.com/questions/77840/how-to-recover-your-playlists-from-grooveshark-after-shutdown). – Peque Sep 03 '15 at 11:24
  • @kenorb: that trick does not work anymore. Have a look at the link I posted in my comment just above. – Peque Sep 03 '15 at 11:25

2 Answers2

17

Update [2018-05-11]

Three years have passed since this answer was posted and it seems this script no longer works. If you are still in need to recover your old Grooveshark playlists, it might not be possible anymore. Good luck and, if you find a way to do it, share it here! I will be happy to accept your answer instead. :-)


I made a script that will try to find all the playlists made by the user and download them in an output directory as CSV files. It is made in Python.

  • You must just pass your username as parameter to the script (i.e. python pysharkbackup.py "my_user_name"). Your email address should work as well (the one you used for registering in Grooveshark).
  • The output directory is set by default to ./pysharkbackup_$USERNAME.

Here is the script:

#!/bin/python

import os
import sys
import csv
import argparse
import requests


URI = 'http://playlist.fish/api'

description = 'Download your Grooveshark playlists as CSV.'
parser = argparse.ArgumentParser(description = description)
parser.add_argument('USER', type=str, help='Grooveshar user name')
args = parser.parse_args()
user = args.USER

with requests.Session() as session:
    # Login as user
    data = {'method': 'login', 'params': {'username': user}}
    response = session.post(URI, json=data).json()
    if not response['success']:
        print('Could not login as user "%s"! (%s)' %
              (user, response['result']))
        sys.exit()

    # Get user playlists
    data = {'method': 'getplaylists'}
    response = session.post(URI, json=data).json()
    if not response['success']:
        print('Could not get "%s" playlists! (%s)' %
              (user, response['result']))
        sys.exit()

    # Save to CSV
    playlists = response['result']
    if not playlists:
        print('No playlists found for user %s!' % user)
        sys.exit()
    path = './pysharkbackup_%s' % user
    if not os.path.exists(path):
        os.makedirs(path)
    for p in playlists:
        plid = p['id']
        name = p['n']
        data = {'method': 'getPlaylistSongs', 'params': {'playlistID': plid}}
        response = session.post(URI, json=data).json()
        if not response['success']:
            print('Could not get "%s" songs! (%s)' %
                  (name, response['result']))
            continue
        playlist = response['result']
        f = csv.writer(open(path + '/%s.csv' % name, 'w'))
        f.writerow(['Artist', 'Album', 'Name'])
        for song in playlist:
            f.writerow([song['Artist'], song['Album'], song['Name']])
Peque
  • 13,638
  • 11
  • 69
  • 105
  • 1
    @Peque perfect ! I've downloaded the playlists thank you very much, and great job for your script – Nico Jun 14 '15 at 17:17
  • im thinking this somehow is just an http request with some cookies, but I am new with linux type commands, could you spell it out for me so that I make the request using fiddler? – luisgepeto Sep 02 '15 at 23:21
  • @LuisBecerril: I posted a new implementation in Python. That may help you. The old implementation does not work anymore. – Peque Sep 03 '15 at 12:58
  • @vibhu It does not. I updated the answer to note it. :-) – Peque May 11 '18 at 15:35
  • @Peque, thanks buddy. I guess I was late. If somebody finds a solution, please share here. – vibhu May 12 '18 at 07:38
5

You can access some information left in your browser by checking the localStorage variable.

  1. Go to grooveshark.com
  2. Open dev tools (Right click -> Inspect Element)
  3. Go to Resources -> LocalStorage -> grooveshark.com
  4. Look for library variables: recentListens, library and storedQueue
  5. Parse those variables to extract your songs

Might not give your playlists, but can help retrieving some of your collection.

Anoyz
  • 7,431
  • 3
  • 30
  • 35
  • 2
    You didn't ask for a script, you asked how YOU could make one, and I gave you a strategy. It might not work for everyone, but this isn't really a question with a programatic solution as the problem is that the service as gone down forever. I'm sorry I disapointed you, but this might still help someone. – Anoyz May 19 '15 at 10:04