1
1
mirror of https://github.com/r4sas/PBinCLI synced 2025-01-10 06:47:58 +00:00
PBinCLI/pbincli/transports.py
2017-02-20 20:56:37 +03:00

28 lines
812 B
Python

import requests
#import urllib
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'}
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}
r = requests.post(url=self.server, headers=self.headers, proxies=self.proxies, data=request)
return r.text