WIP: Video support

This commit is contained in:
2023-06-22 15:17:44 +02:00
parent 070acb474d
commit f29c1e7ae6
6 changed files with 144 additions and 56 deletions

View File

@@ -18,7 +18,7 @@ from ujson import loads
from classes.pyroclient import PyroClient
from modules.api_client import (
BodyPhotoUploadAlbumsAlbumPhotosPost,
BodyPhotoUpload,
File,
client,
photo_delete,
@@ -158,7 +158,7 @@ async def cmd_import(app: PyroClient, msg: Message):
uploaded = await photo_upload(
app.config["posting"]["api"]["album"],
client=client,
multipart_data=BodyPhotoUploadAlbumsAlbumPhotosPost(
multipart_data=BodyPhotoUpload(
File(photo_bytes, Path(filename).name, "image/jpeg")
),
ignore_duplicates=app.config["submission"]["allow_duplicates"],

View File

@@ -215,7 +215,7 @@ async def get_submission(app: PyroClient, msg: Message):
and app.config["submission"]["require_confirmation"]["admins"] is False
):
try:
submitted = await app.submit_photo(str(inserted.inserted_id))
submitted = await app.submit_media(str(inserted.inserted_id))
await msg.reply_text(
app._("sub_yes_auto", "message", locale=user_locale),
disable_notification=True,