remotes/1693045480750635534/spooky-22
Aevann1 2021-10-03 21:08:07 +02:00
parent 32481b5e6e
commit 71cc85e02b
3 changed files with 7 additions and 6 deletions

View File

@ -2,6 +2,7 @@ from files.helpers.wrappers import *
from files.helpers.security import *
from files.helpers.discord import add_role
from files.__main__ import app
import requests
SERVER_ID = environ.get("DISCORD_SERVER_ID",'').strip()
CLIENT_ID = environ.get("DISCORD_CLIENT_ID",'').strip()

View File

@ -840,10 +840,10 @@ def submit_post(v):
file.save(name)
new_post.url = process_image(name)
elif file.content_type.startswith('video/'):
file.save("video.mp4")
with open("video.mp4", 'rb') as f:
new_post.url = requests.post('https://catbox.moe/user/api.php', data={'userhash':CATBOX_KEY, 'reqtype':'fileupload'}, files={'fileToUpload':f}).text
# elif file.content_type.startswith('video/'):
# file.save("video.mp4")
# with open("video.mp4", 'rb') as f:
# new_post.url = requests.post('https://catbox.moe/user/api.php', data={'userhash':CATBOX_KEY, 'reqtype':'fileupload'}, files={'fileToUpload':f}).text
g.db.add(new_post)

View File

@ -73,7 +73,7 @@
</div>
<div id="image-upload-block">
<div><label class="mt-3">Attachment Upload</label></div>
<div><label class="mt-3">Image Upload</label></div>
<img loading="lazy" id="image-preview" class="w-100">
<label class="btn btn-secondary m-0" for="file-upload">
@ -81,7 +81,7 @@
<input id="file-upload" type="file" name="file" accept="image/*, video/*" hidden>
</label>
<small class="form-text text-muted">Optional if you have text.</small>
<small class="form-text text-muted">You can upload videos up to 1 minute long.</small>
<!-- <small class="form-text text-muted">You can upload videos up to 1 minute long.</small> -->
</div>
</div>