forked from MarseyWorld/MarseyWorld
fds
parent
d712b8cf94
commit
3ae131f5d6
|
@ -15,9 +15,11 @@ 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")
|
||||
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: return req['files'][0]['url']
|
||||
except: return {"error": req['description']}
|
||||
|
||||
|
|
Loading…
Reference in New Issue