how to recover songs from a corrupted shazam library in android

how to recover songs from a corrupted shazam library in android when upgrading my phone recently and trying not to lose anything, my shazam library got corrupted. interestingly, i could still tag just fine, but then noticed later that i couldn’t actually look up my previous tags — any time i tried to open the list, the app crashed a second later.
if you’re in the same situation, here’s a step-by-step tutorial to recover shazamed songs from a corrupted library:

open Root Explorer (or a similar root-enabled app) and navigate to /data/data/com.shazam.encore.android (or any directory starting with the name “com.shazam”, depending on your version).
open the /databases subdirectory and copy library.db to your computer (either by copying it to your “normal” internal storage and transferring, or by sharing directly from the app).

how to recover songs from a corrupted shazam library in android

on your computer, open library.db in SQlite Browser (or similar), open the “Browse Data” tab, and set “table” to “view_myshazam”.
depending on how corrupted your shazam database is, you might find your song info in this table, check for columns “title” and “artist”. you can export this table to a CSV file which you can open in excel, using the “File > Export” function.

how to recover songs from a corrupted shazam library in android

if the “view_myshazam” table is empty and there aren’t even columns titled “title” or “artist”, look at the table named “tag” instead. in this table, there’s not much information that’s helpful to the eye, except the datetime column. export this table to a CSV file using “File > Export” and open in excel (or similar) to get a better look.
if your “track_id” (or “track_key”) column has number in it, this is the important part to recover your songs. skip the next step and just use your tag ID with the below URL to look up the track’s info.
if it doesn’t, use the rightmost column “json” to find the track_id of your songs: look for the string "matches":[{"id": in this column – in the example below the ID is 123692725. the position of this string in the field may change depending on other information included.

how to recover songs from a corrupted shazam library in android

now, in your internet browser type www.shazam.com/track/ and add the ID to the end of the URL, i.e. https://www.shazam.com/track/123692725/

and there you go:

how to recover songs from a corrupted shazam library in android

if you’re looking to do extract the ID from many rows, a quick and dirty way is using excel formulas. note: i’m using a german version of excel, so the screenshots contain the german functions. english ones are in the text below.

let’s say your json column is column S in excel, and your first row of interest is 100 — i.e. the first field containing your track ID is S100.
now, in field T100, enter =FIND("matches"":[{""id"":",S100) make sure you enter double quotation marks as given here. in field U100, enter =MID(S100,U100+16,9)
this should return your ID in its own column so you can copy and paste it. the formula extracts 9 digits which should be good for most current IDs, but there will be some cases where a lower ID number will cause your column to include a comma — you’ll have to remove this comma from the final URL (below) or else it won’t work.

how to recover songs from a corrupted shazam library in android how to recover songs from a corrupted shazam library in android

automating one more step, type the following formula into field V100: ="http://www.shazam.com/track/"&U100 and you’re getting the URL which will contain your track information. copy and paste fields T100 to V100 down along the rest of the dataset and you have your list of URLs to visit.

how to recover songs from a corrupted shazam library in android

6 thoughts on “how to recover songs from a corrupted shazam library in android

  1. Hello,
    I have the same problem as you. This is pretty cool, thanks. However, it seems that my library database is totally corrupted, even the json column is mostly empty. It only starts to contain those from 2016 march, and i have like 200 + searches from before : [
    So i guess those searches are lost…

  2. Hi, I was unable to recover my tracks using your methods. I didn’t understand all steps, could you help me?
    I have 39 songs in “view_myshazam” but only the last six has data in trackKey table. And in the tag table, the track_id column is empty in all 30 entries, and the track_key has a number at the same last six entries.
    I tried to open the libray.db file with Notepad, and i was able to locate some track names, but is all mix up with binary data and no recognized pattern. I have at least 7 data backups from Titanium Backup. The db should be damaged, because Shazam closes when I try to see My Shazam. But before the app closed, I can see a few entries and all has artist name, song name, etc.
    I can’t even access my account from a clean installation because I don’t have access to the e-mail address I used to create my account anymore.

  3. Hi, I just solved. I was lucky to have and find a backup from 2015 with 33 entries with artist and song names. And the last backup has the track_key from line 34 to 39, so I can checked each one manually from shazam website like you did. Thanks!

  4. Thank you SO much for providing this guidance. I’d managed to download my library.db and export to a spreadsheet, but the table fields didn’t match what the other websites and discussion groups described. Your URL for inserting track_id was exactly the kind of thing I was hoping for, but even easier! (It is very hard to Google for “shazam track id” and find problem-solving results!) So thank you!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.