bbb
This commit is contained in:
parent
3584db9e71
commit
4103e808bb
12 changed files with 62 additions and 60 deletions
|
@ -264,7 +264,7 @@ def settings_profile_post(v):
|
|||
elif file.content_type.startswith('video/'):
|
||||
file.save("video.mp4")
|
||||
with open("video.mp4", 'rb') as f:
|
||||
try: url = requests.request("POST", "https://api.imgur.com/3/upload", headers={'Authorization': f'Client-ID {IMGUR_KEY}'}, files=[('video', f)]).json()['data']['link']
|
||||
try: url = requests.request("POST", "https://api.imgur.com/3/upload", headers={'Authorization': f'Client-ID {IMGUR_KEY}'}, files=[('video', f)], timeout=5).json()['data']['link']
|
||||
except: return {"error": "Imgur error"}, 400
|
||||
if url.endswith('.'): url += 'mp4'
|
||||
bio += f"\n\n{url}"
|
||||
|
@ -458,7 +458,7 @@ def gumroad(v):
|
|||
return {"error": f"You must have a verified email to verify {patron} status and claim your rewards"}, 400
|
||||
|
||||
data = {'access_token': GUMROAD_TOKEN, 'email': v.email}
|
||||
response = requests.get('https://api.gumroad.com/v2/sales', data=data).json()["sales"]
|
||||
response = requests.get('https://api.gumroad.com/v2/sales', data=data, timeout=5).json()["sales"]
|
||||
|
||||
if len(response) == 0: return {"error": "Email not found"}, 404
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue