5

I have LevelDB (IndexedDB) file from my Google Chrome, the file is located in this folder:

/home/<user>/.config/google-chrome/Default/IndexedDB/https_<site>_0.indexeddb.leveldb/

The folder content is:

$ ls
000005.ldb  000006.log  CURRENT  LOCK  LOG  MANIFEST-000001

And I have a very simple python script for opening it:

#!/bin/python
import leveldb
db = leveldb.LevelDB('./000005.ldb')

Now I always get this error:

leveldb.LevelDBError: IO error: ./000005.ldb/LOCK: Not a directory

Does anyone have information about how correctly access the data stored in my IndexDB files? Basically, I just need to get the same information like from the 'Developers Tool' view but using Bash or Python.

ccamacho
  • 707
  • 8
  • 22
  • Not a duplicate, but worth knowing: https://stackoverflow.com/questions/35074659/how-to-access-google-chromes-indexeddb-leveldb-files – Josh Lee Dec 10 '18 at 13:13

2 Answers2

7

You have to open the directory with this API, not a file. Also it worth noting that using plyvel library is probably better:

import plyvel
db = plyvel.DB('/home/<user>/.config/google-chrome/Default/IndexedDB/https_<site>_0.indexeddb.leveldb')
for key, value in db:
    print("{0} : {1}".format(key, value)) 
Anton Kochkov
  • 1,117
  • 1
  • 9
  • 25
0

You can use this:

db = leveldb.LevelDB('./Here must be a folder containing all of the levelDB database files')
Reza Rahemtola
  • 1,182
  • 7
  • 16
  • 30
hrdom
  • 83
  • 1
  • 7