Scrape and mirror Pastebin.com to a local database.
Install with pip
pip install pastebin-mirror
After installing with pip, run the module, specifying the SQLite file to write to.
python -m pastebin_mirror ./pastebin.db
While you can use sqlite pastebin.db
to query the file, SQLite will often
emit the error message Error: database is locked
.
To circumvent this we can enable a timeout and ensure that the database is opened read only. To do so, the following command may be used:
sqlite3 -cmd '.timeout 5000' 'file:pastebin.db?mode=ro'
You can at this point query for the values you'd like using SQL.
SELECT * FROM paste WHERE paste_key='03bRivg4'
To get the content of a paste, you can use the following SQL.
SELECT * FROM paste_content WHERE paste_key='03bRivg4'