@@ -1515,6 +1515,10 @@ msgstr "Пресеты общие для всех — их нельзя удал msgid "Smooth motion mode is available only for 5-second videos at 540p and 720p quality" msgstr "Режим «Плавное движение» доступен только для 5-секундных видео в качестве 540p и 720p" +#, python-format +msgid "This video duration is not allowed for %(quality)s quality." +msgstr "Для качества %(quality)s такая продолжительность видео не поддерживается." + #~ msgid "Account is already confirmed" #~ msgstr "Аккаунт уже подтвержден" @@ -32,24 +32,6 @@ class Hunyuan(SimpleService): 'Киберпанк': 'cyberpunk', 'Комикс': 'comic', } - EFFECTS = { - 'Без эффекта': 'None', - 'Танец YMCA': "Let's YMCA!", - 'Лихорадка Subject 3': 'Subject 3 Fever', - 'Гибли в жизни': 'Ghibli Live!', - 'Стильный свэг в костюме': 'Suit Swagger', - 'Мышечный буст': 'Muscle Surge', - 'Микроволновка 360°': '360° Microwave', - 'Тепло Иисуса': 'Warmth of Jesus', - 'Экстренный бит': 'Emergency Beat', - 'Что угодно, робот': 'Anything, Robot', - 'Клуб кунг-фу': 'Kungfu Club', - 'Мята в коробке': 'Mint in Box', - 'Ретро аниме поп': 'Retro Anime Pop', - 'Походка Vogue': 'Vogue Walk', - 'Мега-прыжок': 'Mega Dive', - 'Злой триггер': 'Evil Trigger', - } PRICING_UNITS = { '540p': { 5: { @@ -112,7 +94,13 @@ class Hunyuan(SimpleService): motion_mode_ru = input_message.info.pop('motion_mode') motion_mode = self.MOTION_MODES.get(motion_mode_ru, 'normal') sound_effect_switch = input_message.info.get('sound_effect_switch', False) - units = self.PRICING_UNITS[quality][duration].get(motion_mode, {}) + modes_for_duration = self.PRICING_UNITS[quality].get(duration) + if not modes_for_duration: + raise InvalidParameterError( + _('This video duration is not allowed for %(quality)s quality.') + % {'quality': quality} + ) + units = modes_for_duration.get(motion_mode, {}) if not units: raise InvalidParameterError( _('Smooth motion mode is available only for 5-second videos at 540p and 720p quality') @@ -127,7 +115,6 @@ class Hunyuan(SimpleService): 'prompt': input_message.content, 'motion_mode': motion_mode, 'style': self.STYLES.get(input_message.info.pop('style', None), 'None'), - 'effect': self.EFFECTS.get(input_message.info.pop('effect', None), 'None'), **input_message.info, } if image := input_message.file: