show urls for new pastes
This commit is contained in:
parent
8d18076ad9
commit
3b035ab9a7
1 changed files with 8 additions and 2 deletions
6
srht.py
6
srht.py
|
@ -123,6 +123,12 @@ 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)
|
||||||
|
if r.status_code == 201:
|
||||||
|
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.status_code)
|
||||||
print(r.text)
|
print(r.text)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue