show urls for new pastes
This commit is contained in:
parent
8d18076ad9
commit
3b035ab9a7
1 changed files with 8 additions and 2 deletions
10
srht.py
10
srht.py
|
@ -123,8 +123,14 @@ def submit_paste(visibility, filename):
|
||||||
payload['files'] = [blob]
|
payload['files'] = [blob]
|
||||||
|
|
||||||
r = requests.post(url, headers=headers, json=payload)
|
r = requests.post(url, headers=headers, json=payload)
|
||||||
print(r.status_code)
|
if r.status_code == 201:
|
||||||
print(r.text)
|
info = r.json()
|
||||||
|
print(f"https://paste.sr.ht/{info['user']['canonical_name']}/{info['sha']}")
|
||||||
|
for blob in info['files']:
|
||||||
|
print(f"https://paste.sr.ht/blob/{blob['blob_id']}")
|
||||||
|
else:
|
||||||
|
print(r.status_code)
|
||||||
|
print(r.text)
|
||||||
|
|
||||||
@paste.command("delete")
|
@paste.command("delete")
|
||||||
@click.argument('sha')
|
@click.argument('sha')
|
||||||
|
|
Loading…
Reference in a new issue