dfsfs
This commit is contained in:
parent
65bc7c83f8
commit
90aecd8712
3 changed files with 7 additions and 6 deletions
|
@ -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()
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -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>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue