PrivateBin CLI on python 3
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
853 B

import requests
import json
import urllib
from pprint import pprint
class privatebin(object):
def __init__(self):
#self.proxies = {'http': 'http://127.0.0.1:4444'}
self.server = 'http://paste.r4sas.i2p/'
self.headers = {'X-Requested-With': 'JSONHttpRequest'}
8 years ago
def post(self, data, password):
#r = requests.post(url=self.server, headers=self.headers, proxies=self.proxies, data=data)
r = requests.post(url=self.server, headers=self.headers, data=data)
8 years ago
print(r.text)
result = json.loads(r.text)
'''Standart response: {"status":0,"id":"aaabbb","url":"\/?aaabbb","deletetoken":"aaabbbccc"}'''
8 years ago
if result['status'] == 0:
print("Paste uploaded!\nPasteID:\t{}\nPassword:\t{}\nDelete token:\t{}\n".format(result['id'], password.decode("UTF-8"), result['deletetoken']))