从Bash或Python获取Google Chrome IndexedDB中的数据 [英] Getting data inside a google Chrome IndexedDB from Bash or Python
问题描述
我的Google Chrome浏览器具有LevelDB(IndexedDB)文件,该文件位于此文件夹中:
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/
文件夹内容为:
$ ls
000005.ldb 000006.log CURRENT LOCK LOG MANIFEST-000001
我有一个非常简单的python脚本来打开它:
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
有人知道如何正确访问存储在我的IndexDB文件中的数据的信息吗?基本上,我只需要从'Developers Tool'视图中获取相同的信息,但是使用Bash或Python.
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.
推荐答案
您必须使用此API(而不是文件)打开目录.另外值得注意的是,使用 plyvel
库可能更好:
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))
这篇关于从Bash或Python获取Google Chrome IndexedDB中的数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!