NFP Image Convert for ComputerCraft compat
This commit is contained in:
parent
bf62abff05
commit
90650c678b
5 changed files with 208 additions and 0 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