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.

28 lines
812 B

import requests
#import urllib
class privatebin(object):
8 years ago
def __init__(self):
8 years ago
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, request):
r = requests.post(url=self.server, headers=self.headers, proxies=self.proxies, data=request)
return r.text, self.server
def get(self, request):
url = self.server + "?" + request
r = requests.get(url=url, headers=self.headers, proxies=self.proxies)
return r.text
def delete(self, pasteid, token):
request = {'pasteid':pasteid,'deletetoken':token}
8 years ago
r = requests.post(url=self.server, headers=self.headers, proxies=self.proxies, data=request)
return r.text