forked from MarseyWorld/MarseyWorld
sfd
parent
ee9b5f2bcd
commit
10723940d1
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue