Skip to content

imnotjames/pastebin_mirror

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pastebin_mirror

Scrape and mirror Pastebin.com to a local database.

Getting Started

Installing

Install with pip

pip install pastebin-mirror

Running

After installing with pip, run the module, specifying the SQLite file to write to.

python -m pastebin_mirror ./pastebin.db

Querying

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'

About

Mirror Pastebin.com to a local SQLite

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages