diff --git a/classes/enums/submission_types.py b/classes/enums/submission_types.py index 265ce7a..2bd043f 100644 --- a/classes/enums/submission_types.py +++ b/classes/enums/submission_types.py @@ -4,5 +4,5 @@ from enum import Enum class SubmissionType(Enum): DOCUMENT = "document" VIDEO = "video" - ANIMATION = "animation" + # ANIMATION = "animation" PHOTO = "photo" diff --git a/classes/pyroclient.py b/classes/pyroclient.py index 4377a8b..54f2edc 100644 --- a/classes/pyroclient.py +++ b/classes/pyroclient.py @@ -199,15 +199,15 @@ class PyroClient(PyroClient): ), caption="queue", ) - elif db_entry["type"] == SubmissionType.ANIMATION.value: - response = await video_upload( - self.config["posting"]["api"]["album"], - client=client, - multipart_data=BodyVideoUpload( - File(media_bytes, filepath.name, "video/*") - ), - caption="queue", - ) + # elif db_entry["type"] == SubmissionType.ANIMATION.value: + # response = await video_upload( + # self.config["posting"]["api"]["album"], + # client=client, + # multipart_data=BodyVideoUpload( + # File(media_bytes, filepath.name, "video/*") + # ), + # caption="queue", + # ) except UnexpectedStatus as exp: raise SubmissionUnsupportedError(str(filepath)) from exp diff --git a/config_example.json b/config_example.json index c91d8bd..481317d 100644 --- a/config_example.json +++ b/config_example.json @@ -51,7 +51,6 @@ "move_sent": false, "use_interval": false, "interval": "1h30m", - "page_size": 300, "submitted_caption": { "enabled": true, "ignore_admins": true, @@ -59,14 +58,12 @@ }, "types": { "photo": true, - "video": false, - "animation": false + "video": false }, "extensions": { "photo": [ "jpg", "png", - "gif", "jpeg" ], "video": [ @@ -114,7 +111,6 @@ }, "mime_types": [ "image/png", - "image/gif", "image/jpeg", "video/mp4", "video/quicktime" diff --git a/plugins/handlers/submission.py b/plugins/handlers/submission.py index 8dcb270..43e8113 100644 --- a/plugins/handlers/submission.py +++ b/plugins/handlers/submission.py @@ -23,7 +23,7 @@ logger = logging.getLogger(__name__) @Client.on_message( ~filters.scheduled & filters.private & filters.photo | filters.video - | filters.animation + # | filters.animation | filters.document ) async def get_submission(app: PyroClient, msg: Message): @@ -103,27 +103,27 @@ async def get_submission(app: PyroClient, msg: Message): save_tmp = False contents = msg.video.file_id, SubmissionType.VIDEO # , msg.video.file_name - if msg.animation is not None: - logger.info( - "User %s is trying to submit an animation with name '%s' and size of %s MB", - msg.from_user.id, - msg.animation.file_name, - msg.animation.file_size / 1024 / 1024, - ) - if msg.animation.file_size > app.config["submission"]["file_size"]: - await msg.reply_text( - app._("document_too_large", "message", locale=user_locale).format( - str(app.config["submission"]["file_size"] / 1024 / 1024) - ), - quote=True, - ) - return - if msg.animation.file_size > app.config["submission"]["tmp_size"]: - save_tmp = False - contents = ( - msg.animation.file_id, - SubmissionType.ANIMATION, - ) # , msg.animation.file_name + # if msg.animation is not None: + # logger.info( + # "User %s is trying to submit an animation with name '%s' and size of %s MB", + # msg.from_user.id, + # msg.animation.file_name, + # msg.animation.file_size / 1024 / 1024, + # ) + # if msg.animation.file_size > app.config["submission"]["file_size"]: + # await msg.reply_text( + # app._("document_too_large", "message", locale=user_locale).format( + # str(app.config["submission"]["file_size"] / 1024 / 1024) + # ), + # quote=True, + # ) + # return + # if msg.animation.file_size > app.config["submission"]["tmp_size"]: + # save_tmp = False + # contents = ( + # msg.animation.file_id, + # SubmissionType.ANIMATION, + # ) # , msg.animation.file_name if msg.photo is not None: logger.info(