Hoangsontung_Jusst

API PASTERBIN TEXT

Aug 9th, 2022
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. import urllib.request
  2. import urllib.parse
  3.  
  4.  
  5. def main():
  6.  
  7. def pastebinner():
  8. site = 'https://pastebin.com/api/api_post.php'
  9. dev_key = 'APIKEYGOESHERE'
  10. code = "12345678910, test"
  11. our_data = urllib.parse.urlencode({"api_dev_key": dev_key, "api_option": "paste", "api_paste_code": code})
  12. our_data = our_data.encode()
  13. request = urllib.request.Request(site, method='POST')
  14. resp = urllib.request.urlopen(request, our_data)
  15. print(resp.read())
  16.  
  17. pastebinner()
  18.  
  19.  
  20. if __name__ == "__main__":
  21. main()
Advertisement
Add Comment
Please, Sign In to add comment