Minor updates / tweaks
This commit is contained in:
parent
33cbf3b4a4
commit
2ca4783a6e
15 changed files with 35 additions and 264 deletions
12
minecraft/convert-nfp/pastebin.py
Normal file
12
minecraft/convert-nfp/pastebin.py
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
import requests
|
||||
|
||||
_KEY = "xxxxxx" # TODO: Provide this key on your own!
|
||||
|
||||
|
||||
def upload(nfp_contents: str) -> str:
|
||||
data = {"api_dev_key": _KEY, "api_paste_code": nfp_contents, "api_option": "paste"}
|
||||
|
||||
resp = requests.post("https://pastebin.com/api/api_post.php", data=data)
|
||||
if resp.status_code == 200:
|
||||
return resp.text.replace("https://pastebin.com/", "")
|
||||
return f"FAILURE: {resp.text}"
|
||||
Loading…
Reference in a new issue