master
Aevann1 2022-05-22 20:03:54 +02:00
parent 9bc310a6a4
commit c41f6977e7
1 changed files with 4 additions and 8 deletions

View File

@ -15,16 +15,12 @@ def process_video(file):
os.remove(name)
with open(f"{name}.mp4", 'rb') as f:
if SITE_NAME != 'rDrama' or os.stat(f'{name}.mp4').st_size > 8 * 1024 * 1024:
os.remove(f"{name}.mp4")
try: req = requests.request("POST", "https://pomf2.lain.la/upload.php", files={'files[]': f}, timeout=20).json()
except requests.Timeout: return {"error": "Video upload timed out, please try again!"}
try: url = req['files'][0]['url']
except: return {"error": req['description']}
if SITE_NAME != 'rDrama' or os.stat(f'{name}.mp4').st_size > 8 * 1024 * 1024:
os.remove(f"{name}.mp4")
return url
try: return req['files'][0]['url']
except: return {"error": req['description']}
def process_image(patron, filename=None, resize=0):