remotes/1693045480750635534/spooky-22
Aevann1 2021-12-19 05:13:40 +02:00
parent 0d491a7e83
commit 735420c2f9
2 changed files with 3 additions and 1 deletions

View File

@ -924,6 +924,7 @@ def submit_post(v):
if file.content_type.startswith('image/'):
name = f'/images/{time.time()}'.replace('.','')[:-5] + '.webp'
file.save(name)
url = process_image(name)
body += f"\n\n![]({url})"
elif file.content_type.startswith('video/'):
file.save("video.mp4")
@ -1022,6 +1023,7 @@ def submit_post(v):
file.save("video.mp4")
with open("video.mp4", 'rb') as f:
url = requests.request("POST", "https://api.imgur.com/3/upload", headers={'Authorization': f'Client-ID {CATBOX_KEY}'}, files=[('video', f)]).json()['data']['link']
new_post.url = url
g.db.add(new_post)

View File

@ -324,7 +324,7 @@
<button id="comment-{{c.id}}-up" tabindex="0" onclick="vote('comment', '{{c.id}}', '1')" class="btn m-0 py-0 px-2 nobackground arrow-up" onclick="location.href='/login';"></button>
{% endif %}
<button class="btn m-0 p-0 nobackground"><span class="points" data-bs-toggle="tooltip" data-bs-placement="top" data-bs-original-title="+{{ups}} | -{{downs}}"><span id="comment-mobile-score-{{c.id}}" class="score comment-score-{{c.id}} {% if voted==1 %}score-up{% elif voted==-1%}score-down{% endif %}">{{score}}</span></span></button>
<span style="font-size:14px" class="btn m-0 p-0 nobackground comment-score-{{c.id}} {% if voted==1 %}score-up{% elif voted==-1%}score-down{% endif %}" data-bs-toggle="tooltip" data-bs-placement="top" data-bs-original-title="+{{ups}} | -{{downs}}" id="comment-mobile-score-{{c.id}}">{{score}}</span>
{% if v and request.path.startswith('/@') and v.admin_level == 0 %}
{% if voted==-1 %}