master
Aevann1 2022-05-22 18:19:49 +02:00
parent ee9b5f2bcd
commit 10723940d1
1 changed files with 6 additions and 7 deletions

View File

@ -14,17 +14,16 @@ def process_video(file):
os.system(f'ffmpeg -y -loglevel warning -i {name} -map_metadata -1 {name}.mp4')
os.remove(name)
size = os.stat(f'{name}.mp4').st_size
with open(f"{name}.mp4", 'rb') as f:
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
if SITE_NAME != 'rDrama' or size > 8 * 1024 * 1024: os.remove(f"{name}.mp4")
def process_image(patron, filename=None, resize=0):
size = os.stat(filename).st_size