openapi: 3.1.0
info:
  title: MEGOGO Content API
  version: 1.0.0
  summary: Каталог, метаданные, авторизация пользователей и воспроизведение для приложений партнеров.
  description: 'Эта спецификация описывает методы Content API, с помощью которых партнеры показывают контент
    MEGOGO в своих приложениях.



    ## Подпись запроса


    Каждый запрос должен содержать query-параметр `sign`:


    1. Соедините параметры запроса в виде `name=value` без разделителя, в том же порядке, что и в URL.
    Параметр `sign` не включайте.

    2. Добавьте в конец приватный ключ. Вычислите MD5-хеш (hex в нижнем регистре).

    3. Добавьте в конец хеша публичный ключ.


    `sign = md5("p1=v1p2=v2…" + private_key) + public_key`


    Передавайте `sign` последним параметром. Для запроса без параметров `sign = md5(private_key) + public_key`.


    ## Структура ответа


    Каждый ответ содержит поля `result` (`ok` или `error`), `code` и `data`. В ответе с ошибкой есть также
    поле `message`.


    ВНИМАНИЕ: Большинство ошибок приходит с HTTP-статусом 200. Например, на неизвестный ID видео API отвечает
    HTTP 200 с `"result": "error", "code": 404`. Проверяйте `result` и `code`, а не HTTP-статус. Неверный
    `sign` дает HTTP 400.


    ## Каталог и `/video/info`


    Каталог можно построить двумя способами: импортировать XML-фид или собирать экраны из запросов списков
    этого API. Отправляйте `/video/info` только после действия пользователя (пользователь открывает страницу
    видео). Не используйте этот запрос, чтобы собирать метаданные многих видео.


    ## Пагинация


    Во всех запросах списков используйте пагинацию по токену:


    1. Отправьте первый запрос с `paging_strategy=token`.

    2. Если в ответе есть `next_page`, элементы еще остались. Чтобы получить следующую страницу, отправьте
    тот же запрос, добавив `page={next_page}`.

    3. Если в ответе нет `next_page`, это последняя страница.


    Значение `page` — это закодированная позиция. Не изменяйте его и не формируйте самостоятельно. Включайте
    `page` в подпись, как и все остальные параметры. В этом режиме ответы содержат `next_page` и `prev_page`,
    но не содержат `total`, `offset` и `has_more`.


    Не используйте `offset` и `limit`: MEGOGO собирается их удалить. Размер страницы — 20 элементов.


    ## Язык


    Передавайте `lang` в каждом запросе. Если `lang` не передан, API берет язык из заголовка `Accept-Language`.
    Если значение заголовка неизвестно, текст возвращается на русском языке.


    ## Ограничения


    1 000 запросов в минуту на каждый ключ. При превышении лимита API может вернуть HTTP 429 Too Many
    Requests. Заголовков с данными о лимите (rate-limit) в ответах нет.


    ## Геолокация


    Если ваше приложение отправляет `/stream` с устройства пользователя, MEGOGO определяет страну пользователя
    по IP-адресу запроса. Если запросы отправляет ваш сервер, MEGOGO включает для вашего ключа фиксированный
    («переопределенный») регион, и местоположение пользователей вы должны контролировать сами.


    ## Тестовые ключи


    Отдельной тестовой среды нет. MEGOGO выдает каждому партнеру тестовый ID партнера (например, `testprod_ua`)
    и тестовые ключи в рабочей среде (production).

    '
  contact:
    name: MEGOGO partner support
    email: supportpartners@megogo.net
servers:
- url: https://api.megogo.net/v1
  description: 'Рабочая среда

    '
tags:
- name: Authorization
- name: Configuration
- name: Catalog
- name: Video
- name: Playback
security:
- signature: []
paths:
  /auth/by_partners:
    get:
      tags:
      - Authorization
      operationId: authorizeUser
      summary: Авторизовать конечного пользователя партнера
      description: 'Возвращает токен доступа для конечного пользователя, у которого есть подписка или
        покупка в партнерском биллинге MEGOGO. Передавайте `access_token` в `/stream` и в другие запросы,
        которым нужен пользователь.


        Это единственный способ авторизации для приложений партнеров. Авторизация через cookie — устаревший
        способ, не используйте его. Когда токен доступа истечет, получите новый. Когда и как это делать
        (новым запросом `auth/by_partners` или с помощью `remember_me_token`), зависит от вашей платформы.


        `token = md5(user_identifier + partner_id + salt)`.


        Если MEGOGO не знает этот идентификатор пользователя, запрос создает для него учетную запись MEGOGO.
        Токен доступа действует около 6 часов, токен «запомнить меня» — около 5 лет. Ответ также содержит
        поля профиля и `is_new_user`: не используйте их.

        '
      parameters:
      - name: isdn
        in: query
        required: true
        description: 'Идентификатор пользователя на стороне партнера (то же значение, что и `userId` в
          запросах биллинга).

          '
        schema:
          type: string
          maxLength: 255
      - name: partner_key
        in: query
        required: true
        description: 'ID партнера.

          '
        schema:
          type: string
      - name: token
        in: query
        required: true
        description: 'Токен авторизации (MD5, hex).

          '
        schema:
          type: string
          pattern: ^[a-f0-9]{32}$
      - $ref: '#/components/parameters/sign'
      responses:
        '200':
          description: 'Пользователь авторизован.

            '
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthResponse'
        '400':
          $ref: '#/components/responses/Error'
  /auth/refresh:
    get:
      tags:
      - Authorization
      operationId: refreshAccessToken
      summary: Получить новый токен доступа по токену «запомнить меня»
      description: 'Возвращает новый токен доступа для пользователя без токена авторизации. Используйте
        `remember_me_token` из ответа `/auth/by_partners`.


        ПРИМЕЧАНИЕ: Параметр называется `rememberme_token` (без второго подчеркивания). С именем `remember_me_token`
        запрос возвращает ошибку.


        Если предыдущий токен доступа еще действителен, ответ может содержать тот же токен доступа.

        '
      parameters:
      - name: rememberme_token
        in: query
        required: true
        description: 'Значение `remember_me_token` из ответа `/auth/by_partners` или предыдущего `/auth/refresh`.

          '
        schema:
          type: string
      - $ref: '#/components/parameters/sign'
      responses:
        '200':
          description: 'Новые токены. Структура та же, что и у `/auth/by_partners`.

            Недействительный токен дает `"result": "error", "code": 400` с HTTP 200.

            '
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthResponse'
        '400':
          $ref: '#/components/responses/Error'
  /configuration:
    get:
      tags:
      - Configuration
      operationId: getConfiguration
      summary: Получить конфигурацию (категории, жанры, гео)
      description: 'Возвращает справочные данные для каталога. Кешируйте ответ на своем сервере.

        '
      parameters:
      - $ref: '#/components/parameters/lang'
      - $ref: '#/components/parameters/did'
      - $ref: '#/components/parameters/sign'
      responses:
        '200':
          description: 'Конфигурация.

            '
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/Envelope'
                - type: object
                  properties:
                    data:
                      $ref: '#/components/schemas/Configuration'
              examples:
                lang_ru:
                  summary: Ответ с lang=ru (тестовый ключ, 2026-10-30). Массивы сокращены
                  description: '`GET /configuration?lang=ru&sign={sign}`

                    '
                  value:
                    result: ok
                    code: 200
                    data:
                      bitrate_from: 0
                      bitrate_to: 2160
                      partner_id: 2331
                      free_vod_types:
                      - ADVOD
                      categories:
                      - id: 16
                        title: Фильмы
                        path: films
                        genres:
                        - 23361
                        - 37
                      - id: 4
                        title: Сериалы
                        path: series
                        genres:
                        - 37
                        - 3
                      member_types:
                      - type: ANNOUNCER
                        title: Дикторы
                      genres:
                      - id: 2
                        title: Комедии
                        path: comedy
                        images: []
                        categories:
                        - id: 4
                        - id: 6
                      - id: 3
                        title: Экшн
                        path: action
                        images: []
                        categories:
                        - id: 4
                        - id: 16
                      video_year_filters:
                      - id: 236
                        year_from: 2026
                        year_to: 2026
                        title: '2026'
                      geo: ua
                      age_limits:
                      - id: 1
                        backdrop_autoplay: false
                        max_age: 6
                        title: 6+
        '400':
          $ref: '#/components/responses/Error'
  /collections:
    get:
      tags:
      - Catalog
      operationId: listCollections
      summary: Получить список подборок
      description: 'MEGOGO создает подборки для некоторых партнеров по запросу.

        Если подборок нет, `collections` — пустой массив.

        '
      parameters:
      - name: category_id
        in: query
        description: 'Возвращать только подборки этой категории.

          '
        schema:
          type: integer
      - $ref: '#/components/parameters/paging_strategy'
      - $ref: '#/components/parameters/page'
      - $ref: '#/components/parameters/offset'
      - $ref: '#/components/parameters/limit'
      - $ref: '#/components/parameters/lang'
      - $ref: '#/components/parameters/did'
      - $ref: '#/components/parameters/sign'
      responses:
        '200':
          description: 'Страница подборок. Значение `limit` по умолчанию — 10.

            '
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/Envelope'
                - type: object
                  properties:
                    data:
                      allOf:
                      - $ref: '#/components/schemas/PageMeta'
                      - type: object
                        properties:
                          collections:
                            type: array
                            items:
                              $ref: '#/components/schemas/Collection'
        '400':
          $ref: '#/components/responses/Error'
  /video/collection:
    get:
      tags:
      - Catalog
      operationId: listCollectionVideos
      summary: Получить видео из подборки
      description: 'Видео одной подборки из `/collections`. Подборки доступны по запросу.

        '
      parameters:
      - name: id
        in: query
        required: true
        description: 'ID подборки.

          '
        schema:
          type: integer
      - $ref: '#/components/parameters/paging_strategy'
      - $ref: '#/components/parameters/page'
      - $ref: '#/components/parameters/offset'
      - $ref: '#/components/parameters/limit'
      - $ref: '#/components/parameters/category_id_filter'
      - $ref: '#/components/parameters/genre'
      - $ref: '#/components/parameters/country'
      - $ref: '#/components/parameters/year_min'
      - $ref: '#/components/parameters/year_max'
      - $ref: '#/components/parameters/vod'
      - $ref: '#/components/parameters/sort'
      - $ref: '#/components/parameters/lang'
      - $ref: '#/components/parameters/access_token'
      - $ref: '#/components/parameters/did'
      - $ref: '#/components/parameters/sign'
      responses:
        '200':
          description: 'Страница видео.

            '
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CollectionVideoPage'
        '400':
          $ref: '#/components/responses/Error'
  /video:
    get:
      tags:
      - Catalog
      operationId: listVideos
      summary: Получить видео категории
      description: 'Страница видео одной категории с фильтрами и сортировкой. Используйте пагинацию по
        токену (`paging_strategy=token`).

        '
      parameters:
      - name: category_id
        in: query
        required: true
        description: 'ID категории из `/configuration`.

          '
        schema:
          type: integer
      - $ref: '#/components/parameters/genre'
      - $ref: '#/components/parameters/sort'
      - $ref: '#/components/parameters/paging_strategy'
      - $ref: '#/components/parameters/page'
      - $ref: '#/components/parameters/offset'
      - $ref: '#/components/parameters/limit'
      - $ref: '#/components/parameters/country'
      - $ref: '#/components/parameters/year_min'
      - $ref: '#/components/parameters/year_max'
      - $ref: '#/components/parameters/lang'
      - $ref: '#/components/parameters/access_token'
      - $ref: '#/components/parameters/did'
      - $ref: '#/components/parameters/sign'
      responses:
        '200':
          description: 'Страница видео.

            '
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoPage'
              examples:
                lang_ru:
                  summary: Ответ с lang=ru (тестовый ключ, 2026-10-30). Массивы сокращены
                  description: '`GET /video?category_id=16&lang=ru&sign={sign}`

                    '
                  value:
                    result: ok
                    code: 200
                    data:
                      limit: 20
                      offset: 0
                      total: 4115
                      has_more: true
                      video_list:
                      - item_type: video
                        id: 3858251
                        title: Привидение
                        image:
                          big: https://s6.vcdn.biz/static/f/11995104381/image.jpg
                          small: https://s8.vcdn.biz/static/f/11995104311/image.jpg
                          original: https://s9.vcdn.biz/static/f/11995104231/image.jpg
                          original_wide: https://s7.vcdn.biz/static/f/11995100521/image.jpg
                          fullscreen: https://s3.vcdn.biz/static/f/6152873961/image.jpg
                          image_470х270: ''
                          image_215х120: ''
                        country: США
                        countries:
                        - 153
                        year: '1990'
                        slug: prividenie
                        categories:
                        - 16
                        age_limit: '12'
                        rating_imdb: '7.1'
                        rating_megogo: '8.4'
                        duration: 7286
                        watched_progress_percent: 0
                        genres:
                        - 25
                        - 39401
                        is_exclusive: false
                        show: show
                        is_sport: false
                        delivery_rules:
                        - svod
        '400':
          $ref: '#/components/responses/Error'
  /video/info:
    get:
      tags:
      - Video
      operationId: getVideoInfo
      summary: Получить информацию о видео
      description: 'Возвращает метаданные видео и данные для покупки.


        **Отправляйте этот запрос только после действия пользователя** (пользователь открывает страницу
        видео). Не используйте `/video/info`, чтобы собирать метаданные многих видео подряд. Чтобы построить
        каталог, используйте XML-фид или запросы списков (`/video`, `/video/collection`, `/catalog/objects`).


        Для платного видео убедитесь, что в ответе есть `purchase_info`. Если его нет, не показывайте
        варианты покупки.


        Если передан `access_token`, поле `is_available` показывает, может ли пользователь смотреть видео.

        '
      parameters:
      - name: id
        in: query
        required: true
        description: 'ID видео.

          '
        schema:
          type: integer
      - name: root_object
        in: query
        description: '`1`: если передан ID серии, ответ содержит данные сериала. Без этого параметра ответ
          содержит данные серии.

          '
        schema:
          type: integer
          enum:
          - 0
          - 1
      - $ref: '#/components/parameters/lang'
      - $ref: '#/components/parameters/access_token'
      - $ref: '#/components/parameters/did'
      - $ref: '#/components/parameters/sign'
      responses:
        '200':
          description: 'Информация о видео.

            '
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/Envelope'
                - type: object
                  properties:
                    data:
                      $ref: '#/components/schemas/VideoInfo'
              examples:
                lang_ru:
                  summary: Ответ с lang=ru (тестовый ключ, 2026-10-30). Массивы сокращены
                  description: '`GET /video/info?id=3858251&lang=ru&sign={sign}`


                    Запрос без `access_token` из страны, где фильм недоступен, поэтому `is_available:
                    false` и ограничение `NO_VOD_COUNTRY`.

                    '
                  value:
                    result: ok
                    code: 200
                    data:
                      item_type: video
                      type: VIDEO
                      id: 3858251
                      title: Привидение
                      image:
                        big: https://s6.vcdn.biz/static/f/11995104381/image.jpg
                        small: https://s8.vcdn.biz/static/f/11995104311/image.jpg
                        original: https://s9.vcdn.biz/static/f/11995104231/image.jpg
                        original_wide: https://s7.vcdn.biz/static/f/11995100521/image.jpg
                        fullscreen: https://s3.vcdn.biz/static/f/6152873961/image.jpg
                        image_470х270: ''
                        image_215х120: ''
                      country: США
                      countries:
                      - 153
                      year: '1990'
                      slug: prividenie
                      categories:
                      - 16
                      age_limit: '12'
                      rating_imdb: '7.1'
                      rating_megogo: '8.4'
                      duration: 7286
                      trailer_id: 23600946
                      quality: Full HD
                      description: 'Сэм и Молли — счастливые влюбленные. Но однажды вечером грабитель,
                        напавший на них, убивает Сэма. Парень не исчезает с лица земли бесследно — он
                        становится призраком. Через некоторое время ему становится ясно, что Молли грозит
                        опасность, а …

                        '
                      short_description: Сэм становится призраком после убийства и пытается предупредить
                        любимую об опасности через эксцентричного медиума.
                      video_url: https://megogo.net/ru/view/3858251
                      full_url: https://megogo.net/ru/view/3858251-prividenie.html
                      title_original: Ghost
                      is_promocode: true
                      is_embed: false
                      people:
                      - id: 43
                        name: Патрик Суэйзи
                        name_original: Patrick Swayze
                        avatar:
                          image_original: https://s1.vcdn.biz/static/f/2312198551/image.jpg
                          image_130x2000: https://s6.vcdn.biz/static/f/2312198601/image.jpg
                          image_540x2000: https://s7.vcdn.biz/static/f/2312198611/image.jpg
                          image_185x185: ''
                          image_240x240: https://s2.vcdn.biz/static/f/2312198651/image.jpg
                          image_360x360: https://s3.vcdn.biz/static/f/2312198661/image.jpg
                        type: ROLE
                        slug: patrik-sueyzi
                      season_list: []
                      subtitles:
                      - Украинский
                      - Русский
                      purchase_info: {}
                      is_available: false
                      is_selling: true
                      allow_external_streaming: true
                      video_type: FILM
                      cartoon: false
                      genres:
                      - 25
                      - 39401
                      is_exclusive: false
                      show: show
                      is_sport: false
                      audio_list:
                      - Украинский
                      is_series: false
                      is_3d: false
                      parental_control_required: false
                      is_wvdrm: false
                      drm_types:
                      - modular
                      - playready
                      restriction: invalid
                      restrictions:
                      - code: NO_VOD_COUNTRY
                        message: Произошла ошибка, попробуйте позже
                      delivery_rules: []
        '400':
          $ref: '#/components/responses/Error'
  /video/episodes:
    get:
      tags:
      - Video
      operationId: listSeasonEpisodes
      summary: Получить серии сезона
      description: '`data` — массив серий. Если ID сезона неверный или сезон недоступен, `data` — пустой
        массив (без ошибки).


        ПРИМЕЧАНИЕ: Для сериала `/video/info` возвращает `season_list`. Серии в `episode_list` есть только
        у первого сезона. У остальных сезонов `episode_list` пустой: для них отправляйте этот запрос с
        ID сезона. С ID сериала запрос возвращает пустой массив.

        '
      parameters:
      - name: id
        in: query
        required: true
        description: 'ID сезона (`season_list[].id` в `/video/info`).

          '
        schema:
          type: integer
      - $ref: '#/components/parameters/lang'
      - $ref: '#/components/parameters/access_token'
      - $ref: '#/components/parameters/did'
      - $ref: '#/components/parameters/sign'
      responses:
        '200':
          description: 'Серии.

            '
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/Envelope'
                - type: object
                  properties:
                    data:
                      type: array
                      items:
                        $ref: '#/components/schemas/Episode'
              examples:
                lang_ru:
                  summary: Ответ с lang=ru (тестовый ключ, 2026-10-30). Массивы сокращены
                  description: '`GET /video/episodes?id=3628801&lang=ru&sign={sign}`

                    '
                  value:
                    result: ok
                    code: 200
                    data:
                    - id: 3628811
                      title: Серия 1. Север помнит
                      title_original: Episode 1. The North Remembers
                      order: 1
                      is_embed: false
                      duration: 3162
                      slug: igra-prestolov-sezon-2-seriya-1-sever-pomnit
                      description: '

                        '
                      watched_progress_percent: 0
                      images:
                        image_original: https://s1.vcdn.biz/static/f/8940091951/image.jpg
                        image_800x450: https://s1.vcdn.biz/static/f/8940091951/image.jpg
                        image_640x360: https://s1.vcdn.biz/static/f/8940091951/image.jpg/pt/c640x360
                        image_162x100: https://s1.vcdn.biz/static/f/8940091951/image.jpg/pt/c162x100
                        image_126x71: https://s1.vcdn.biz/static/f/8940091951/image.jpg/pt/c126x71
                        image_115x120: https://s1.vcdn.biz/static/f/8940091951/image.jpg/pt/c115x120
                      image: https://s1.vcdn.biz/static/f/8940091951/image.jpg
        '400':
          $ref: '#/components/responses/Error'
  /search:
    get:
      tags:
      - Catalog
      operationId: searchVideos
      summary: Искать видео по тексту
      description: 'Видео, название которых соответствует тексту запроса. Используйте пагинацию по токену
        (`paging_strategy=token`).

        '
      parameters:
      - name: text
        in: query
        required: true
        description: 'Текст для поиска.

          '
        schema:
          type: string
      - $ref: '#/components/parameters/category_id_filter'
      - $ref: '#/components/parameters/paging_strategy'
      - $ref: '#/components/parameters/page'
      - $ref: '#/components/parameters/offset'
      - $ref: '#/components/parameters/limit'
      - $ref: '#/components/parameters/lang'
      - $ref: '#/components/parameters/did'
      - $ref: '#/components/parameters/sign'
      responses:
        '200':
          description: 'Страница видео.

            '
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoPage'
        '400':
          $ref: '#/components/responses/Error'
  /stream:
    get:
      tags:
      - Playback
      operationId: getStream
      summary: Получить URL потока видео
      description: 'Возвращает URL манифеста, данные DRM, битрейты, аудиодорожки и субтитры видео.


        **Важно:** если пользователь не может смотреть видео, API возвращает HTTP 200 с `result: ok`,
        пустым `src` и массивом `restrictions`. Всегда проверяйте `src` и `restrictions`.


        ВНИМАНИЕ: URL потока содержит токен доступа и данные пользователя. Не кешируйте этот URL, не записывайте
        его в логи и никому не передавайте.


        Отправляйте этот запрос с устройства конечного пользователя. Если вы отправляете его со своего
        сервера, за гео пользователя отвечаете вы.


        Тип DRM определяется настройками API-ключа.


        ВНИМАНИЕ: Для арендованного видео (TVOD) период аренды начинается с первого ответа, в котором
        есть `src`. Отправляйте этот запрос только тогда, когда пользователь запускает воспроизведение.
        Не отправляйте его, чтобы заранее подготовить или проверить поток.

        '
      parameters:
      - name: video_id
        in: query
        required: true
        description: 'ID фильма, серии или трейлера. Если передан ID сериала, ответ содержит первую серию.

          '
        schema:
          type: integer
      - $ref: '#/components/parameters/lang'
      - $ref: '#/components/parameters/access_token'
      - $ref: '#/components/parameters/did'
      - $ref: '#/components/parameters/sign'
      responses:
        '200':
          description: 'Данные потока или ограничения, если видео недоступно.

            '
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/Envelope'
                - type: object
                  properties:
                    data:
                      $ref: '#/components/schemas/Stream'
              examples:
                lang_ru:
                  summary: Ответ с lang=ru (тестовый ключ, 2026-10-30). Массивы сокращены
                  description: '`GET /stream?video_id=23600946&lang=ru&sign={sign}`


                    Трейлер, без `access_token`. Ссылки на потоки сокращены.

                    '
                  value:
                    result: ok
                    code: 200
                    data:
                      video_id: 23600946
                      root_video_id: 3858251
                      title: Привидение
                      hierarchy_titles:
                        VIDEO: Привидение
                      src: https://meta.vcdn.biz/…/vod/hls/…/playlist.m3u8?…
                      drm_type: ''
                      stream_type: hls
                      content_type: trailer
                      audio_tracks:
                      - id: 14
                        lang: ua
                        lang_iso_639_1: uk
                        lang_tag: uk-x-14
                        lang_original: Українська
                        display_name: Украинский
                        is_active: true
                        index: 0
                        require_subtitles: false
                        subtitles_policy:
                          allowed_subtitles: []
                          is_disableable: true
                      subtitles: []
                      bitrates:
                      - index: 1
                        name: Низкое (240)
                        bitrate: 240
                        src: https://meta.vcdn.biz/…/vod/hls/b/450/…/playlist.m3u8
                        license_server: null
                      - index: 2
                        name: Среднее (320)
                        bitrate: 320
                        src: https://meta.vcdn.biz/…/vod/hls/b/900/…/playlist.m3u8
                        license_server: null
                      cdn_id: 188683801
                      advert_url: ''
                      allow_external_streaming: true
                      start_session_url: ''
                      parental_control_required: false
                      play_start_time: 0
                      watermark: //s4.vcdn.biz/static/79126941/megogo_watermark.png
                      watermark_clickable_enabled: true
                      show_best_quality_link: false
                      share_link: https://megogo.net/ru/view/3858251
                      siblings: {}
                      credits_start: 0
                      external_source: false
                      is_sport: false
                      preview_images:
                        thumbsline_xml: https://s7.vcdn.biz/static/f/7167263551/thumbline.xml
                        thumbsline_list:
                        - id: 1
                          url: https://s5.vcdn.biz/static/f/7167263531/thumbsline_1.jpg
                        thumbsline_list_full_hd:
                        - id: 1
                          url: https://s9.vcdn.biz/static/f/7167263571/thumbsline_144x81_1.jpg
                        thumbsline_list_uhd:
                        - id: 1
                          url: https://s8.vcdn.biz/static/f/7167263561/thumbsline_192x108_1.jpg
                      is_autoplay: true
                      is_embed: false
                      is_hierarchy: true
                      is_wvdrm: false
                      is_uhd: false
                      is_uhd_8k: false
                      is_hdr: false
                      is_tv: false
                      is_3d: false
                      is_live: false
                      is_favorite: false
        '400':
          $ref: '#/components/responses/Error'
  /video/recommended:
    get:
      tags:
      - Catalog
      operationId: listRecommendedVideos
      summary: Получить рекомендации, которые не зависят от пользователя
      description: '`data`: `limit`, `version`, `video_list` (12 видео для фильма). Для того же фильма
        поле `recommended_videos` в `/video/info` было пустым.

        '
      parameters:
      - name: video_id
        in: query
        description: 'Вернуть рекомендации для этого видео.

          '
        schema:
          type: integer
      - $ref: '#/components/parameters/paging_strategy'
      - $ref: '#/components/parameters/page'
      - $ref: '#/components/parameters/offset'
      - $ref: '#/components/parameters/limit'
      - $ref: '#/components/parameters/lang'
      - $ref: '#/components/parameters/sign'
      responses:
        '200':
          description: 'Страница видео.

            '
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoPage'
  /catalog/filters:
    get:
      tags:
      - Catalog
      operationId: getCatalogFilters
      summary: Получить доступные фильтры каталога и варианты сортировки
      description: 'Фильтры, которые ваш ключ может использовать в `/catalog/objects`. Фильтры каталога
        MEGOGO включает для ключа отдельно. Если они не включены, `filter_by` — пустой массив: в этом
        случае используйте фильтры `/video`.


        Каждый элемент `filter_by` содержит `id` (имя query-параметра `/catalog/objects`), `multichoice`
        (можно передать несколько значений через запятую), `inline` и `items` (`id`, `slug`, `enabled`;
        `title` — при `show_title=true`). Фильтры тестового ключа: `category_id`, `video_genre_id`, `country_id`,
        `year_id`, `audiotrack_id`, `subtitle_id`, `video_quality` (`hd`, `hdr`, `4k`), `vod_free`, `vod_sub`,
        `vod_buy`, `finger_language`, `audio_description`.


        Варианты сортировки (`order_by`: `popular`, `add`, `novelty`, `rating_megogo`, `rating_imdb`,
        `recommended`) есть в ответе только при `show_disabled_items=true`.

        '
      parameters:
      - name: show_title
        in: query
        description: '`true`: добавить `title` к фильтрам и их элементам.

          '
        schema:
          type: boolean
      - name: show_disabled_items
        in: query
        description: '`true`: добавить элементы с `enabled: false` и `order_by`.

          '
        schema:
          type: boolean
      - name: category_id
        in: query
        schema:
          type: integer
      - name: video_genre_id
        in: query
        schema:
          type: string
      - $ref: '#/components/parameters/lang'
      - $ref: '#/components/parameters/sign'
      responses:
        '200':
          description: 'Фильтры (`filter_by`) и варианты сортировки (`order_by`).

            '
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Envelope'
              examples:
                lang_ru:
                  summary: Ответ с lang=ru (тестовый ключ, 2026-10-30). Массивы сокращены
                  description: '`GET /catalog/filters?lang=ru&sign={sign}`

                    '
                  value:
                    result: ok
                    code: 200
                    data:
                      filter_by:
                      - id: category_id
                        multichoice: false
                        inline: false
                        items:
                        - id: '16'
                          slug: films
                          enabled: true
  /catalog/objects:
    get:
      tags:
      - Catalog
      operationId: listCatalogObjects
      summary: Получить элементы каталога по выбранным фильтрам
      description: '`data.groups[]` с полями `limit`, `next_page`, `content_type` и `videos`. Передавайте
        каждый фильтр из `/catalog/filters` как query-параметр с `id` элемента, например `video_genre_id=2,25`,
        `country_id=2`, `video_quality=4k`, `vod_buy=true`. Неверный ID элемента дает `code 400`.

        '
      parameters:
      - name: category_id
        in: query
        schema:
          type: integer
      - name: video_genre_id
        in: query
        description: 'ID жанров через запятую.

          '
        schema:
          type: string
      - name: country_id
        in: query
        schema:
          type: string
      - name: year_id
        in: query
        schema:
          type: string
      - name: audiotrack_id
        in: query
        schema:
          type: string
      - name: subtitle_id
        in: query
        schema:
          type: string
      - name: video_quality
        in: query
        schema:
          type: string
          examples:
          - hd
          - hdr
          - 4k
      - name: vod_free
        in: query
        schema:
          type: boolean
      - name: vod_sub
        in: query
        schema:
          type: boolean
      - name: vod_buy
        in: query
        schema:
          type: boolean
      - name: sort
        in: query
        description: 'Значение `order_by` из `/catalog/filters`, например `popular`, `add`.

          '
        schema:
          type: string
      - $ref: '#/components/parameters/paging_strategy'
      - $ref: '#/components/parameters/page'
      - $ref: '#/components/parameters/offset'
      - $ref: '#/components/parameters/limit'
      - $ref: '#/components/parameters/lang'
      - $ref: '#/components/parameters/sign'
      responses:
        '200':
          description: 'Группы элементов каталога.

            '
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Envelope'
              examples:
                lang_ru:
                  summary: Ответ с lang=ru (тестовый ключ, 2026-10-30). Массивы сокращены
                  description: '`GET /catalog/objects?category_id=16&video_genre_id=2&lang=ru&sign={sign}`

                    '
                  value:
                    result: ok
                    code: 200
                    data:
                      groups:
                      - limit: 20
                        next_page: PjIw
                        content_type: video
                        videos:
                        - item_type: video
                          id: 2113971
                          title: Один дома
                          image:
                            big: https://s8.vcdn.biz/static/f/617365781/image.jpg
                            small: https://s7.vcdn.biz/static/f/617365771/image.jpg
                            original: https://s3.vcdn.biz/static/f/617365821/image.jpg
                            original_wide: https://s8.vcdn.biz/static/f/8935233371/image.jpg
                            fullscreen: https://s5.vcdn.biz/static/f/7827511721/image.jpg
                            image_470х270: ''
                            image_215х120: ''
                          country: США
                          countries:
                          - 153
                          year: '1990'
                          slug: odin-doma
                          categories:
                          - 16
                          age_limit: '12'
                          rating_imdb: '7.8'
                          rating_megogo: '9.6'
                          duration: 5914
                          watched_progress_percent: 0
                          genres:
                          - 2
                          - 35
                          is_exclusive: false
                          show: show
                          is_sport: false
                          delivery_rules:
                          - svod
components:
  securitySchemes:
    signature:
      type: apiKey
      in: query
      name: sign
      description: 'Подпись запроса. См. раздел «Подпись запроса» в описании.

        '
  parameters:
    sign:
      name: sign
      in: query
      required: true
      description: '`md5(params + private_key) + public_key`. Передавайте последним параметром.

        '
      schema:
        type: string
        pattern: ^[a-f0-9]{32}_.+$
    lang:
      name: lang
      in: query
      description: 'Язык текста. Коды языков MEGOGO, например `ru`, `ua`, `en`, `kz`, `pl`. Передавайте
        в каждом запросе.

        '
      schema:
        type: string
    did:
      name: did
      in: query
      description: 'ID устройства. Необязательный параметр.

        '
      schema:
        type: string
    access_token:
      name: access_token
      in: query
      description: 'Токен доступа из `/auth/by_partners`. Входит в подпись. Срок действия ≈ 6 часов.

        '
      schema:
        type: string
    paging_strategy:
      name: paging_strategy
      in: query
      description: 'Передавайте `token` в каждом запросе списка. Тогда ответ содержит `next_page` вместо
        `offset`, `total` и `has_more`.

        '
      schema:
        type: string
        enum:
        - token
    page:
      name: page
      in: query
      description: 'Значение `next_page` из предыдущего ответа. Не передавайте его в первом запросе. Не
        изменяйте значение.

        '
      schema:
        type: string
        examples:
        - PjIw
    offset:
      name: offset
      in: query
      deprecated: true
      description: 'Устаревшая пагинация. Не используйте. Используйте `paging_strategy=token`.

        '
      schema:
        type: integer
        minimum: 0
        default: 0
    limit:
      name: limit
      in: query
      deprecated: true
      description: 'Устаревшая пагинация. Не используйте. Без `limit` на странице 20 элементов.

        '
      schema:
        type: integer
        minimum: 1
        default: 20
    category_id_filter:
      name: category_id
      in: query
      description: 'Фильтр по ID категории.

        '
      schema:
        type: integer
    genre:
      name: genre
      in: query
      description: 'Фильтр по ID жанров через запятую.

        '
      schema:
        type: string
        examples:
        - 2,25
    country:
      name: country
      in: query
      description: 'Фильтр по ID стран через запятую.

        '
      schema:
        type: string
    year_min:
      name: year_min
      in: query
      description: 'Первый год выпуска (включительно).

        '
      schema:
        type: integer
    year_max:
      name: year_max
      in: query
      description: 'Последний год выпуска (включительно).

        '
      schema:
        type: integer
    vod:
      name: vod
      in: query
      description: 'Фильтр по моделям доступа через запятую (`svod,tvod,...`).

        '
      schema:
        type: string
    sort:
      name: sort
      in: query
      description: 'Порядок сортировки: `popular` (сначала популярные), `add` (сначала новинки MEGOGO),
        `year` (сначала новые по году выпуска). Без `sort` видео упорядочены не по популярности. Неизвестное
        значение MEGOGO игнорирует без ошибки.

        '
      schema:
        type: string
        enum:
        - popular
        - add
        - year
  responses:
    Error:
      description: 'Ошибка. Пример: неверная подпись → HTTP 400 с `message: "You entered wrong sign key"`.
        Все коды и действия для каждого из них описаны в [каталоге ошибок](../errors/).

        '
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Envelope'
          example:
            result: error
            code: 400
            message: You entered wrong sign key
  schemas:
    Envelope:
      type: object
      required:
      - result
      - code
      properties:
        result:
          type: string
          enum:
          - ok
          - error
        code:
          type: integer
          description: 'Повторяет HTTP-статус.

            '
        message:
          type: string
          description: 'Текст ошибки. Только если `result` равно `error`.

            '
    PageMeta:
      type: object
      properties:
        limit:
          type: integer
          description: 'Количество элементов на странице.

            '
        next_page:
          type: string
          description: 'Пагинация по токену. Значение `page` для следующей страницы. На последней странице
            отсутствует.

            '
        prev_page:
          type: string
          description: 'Пагинация по токену. Значение `page` для предыдущей страницы. На первой странице
            отсутствует.

            '
        offset:
          type: integer
          deprecated: true
          description: 'Только для устаревшей пагинации.

            '
        total:
          type: integer
          deprecated: true
          description: 'Только для устаревшей пагинации. Общее число элементов.

            '
        has_more:
          type: boolean
          deprecated: true
          description: 'Только для устаревшей пагинации.

            '
    VideoPage:
      allOf:
      - $ref: '#/components/schemas/Envelope'
      - type: object
        properties:
          data:
            allOf:
            - $ref: '#/components/schemas/PageMeta'
            - type: object
              properties:
                video_list:
                  type: array
                  items:
                    $ref: '#/components/schemas/VideoShort'
    CollectionVideoPage:
      allOf:
      - $ref: '#/components/schemas/Envelope'
      - type: object
        properties:
          data:
            allOf:
            - $ref: '#/components/schemas/PageMeta'
            - type: object
              properties:
                title:
                  type: string
                  description: 'Название подборки.

                    '
                url:
                  type: string
                featured_source:
                  type: string
                external_type:
                  type: string
                custom_html:
                  type: string
                video_list:
                  type: array
                  items:
                    $ref: '#/components/schemas/VideoShort'
    Image:
      type: object
      description: 'URL постеров. Некоторые значения могут быть пустыми строками.


        ОСТОРОЖНО: Ключи `image_470х270` и `image_215х120` содержат кириллическую букву `х` (U+0445),
        а не латинскую `x`. Используйте ключи точно в таком виде. MEGOGO не планирует их менять. Размеры
        изображений могут меняться: не привязывайте к ним верстку.


        Чтобы получить другой размер или формат, добавьте к URL операцию, например `{url}/pt/r193x272x4`
        (см. страницу «Изображения» в руководстве).

        '
      properties:
        big:
          type: string
          format: uri
          description: 'Вертикальный постер, 300 × 423 px.

            '
        small:
          type: string
          format: uri
          description: 'Вертикальный постер, 162 × 228 px.

            '
        original:
          type: string
          format: uri
          description: 'Вертикальный постер в исходном размере.

            '
        original_wide:
          type: string
          description: 'Горизонтальное изображение 16 : 9 в исходном размере. Может быть пустым.

            '
        fullscreen:
          type: string
          format: uri
          description: 'Горизонтальное изображение 16 : 9 для фона. Может быть пустым.

            '
        image_470х270:
          type: string
        image_215х120:
          type: string
    DeliveryRule:
      type: string
      description: 'Бизнес-модель видео. Для потоков `advod` и `fvod` пользователь не нужен. В приложении
        партнера видео `svod`, `fvod` и `advod` входят в партнерскую подписку: доступ контролирует партнер.

        '
      enum:
      - advod
      - fvod
      - svod
      - tvod
      - dto
    VideoShort:
      type: object
      description: 'Видео в списке.

        '
      properties:
        item_type:
          type: string
          examples:
          - video
          - series
          description: '`video` для фильма, `series` для сериала.

            '
        id:
          type: integer
          description: 'ID объекта. Тот же ID указан в `object@id` в XML-фиде.

            '
        title:
          type: string
          description: 'Название на языке, указанном в `lang`.

            '
        image:
          $ref: '#/components/schemas/Image'
          description: 'URL постеров. Другие размеры описаны на странице «Изображения» руководства.

            '
        country:
          type: string
          description: 'Страны производства в виде строки.

            '
        countries:
          type: array
          items:
            type: integer
          description: 'ID стран производства.

            '
        year:
          type: string
          description: 'Для сериала может быть диапазоном, например «2010 - 2018».

            '
        slug:
          type: string
          description: 'Часть URL страницы видео на megogo.net. Для интеграции не нужна.

            '
        categories:
          type: array
          items:
            type: integer
          description: 'ID категорий (`categories` в `/configuration`).

            '
        genres:
          type: array
          items:
            type: integer
          description: 'ID жанров (`genres` в `/configuration`).

            '
        age_limit:
          type: string
          examples:
          - '0'
          - '6'
          - '12'
          - '16'
          - '18'
          description: 'Минимальный возраст зрителя в виде строки.

            '
        rating_imdb:
          type: string
          description: 'Рейтинг IMDb в виде строки. Пустой, если рейтинга нет.

            '
        rating_kinopoisk:
          type: string
          description: 'Не для партнеров.

            '
        rating_megogo:
          type: string
          description: 'Рейтинг пользователей MEGOGO от 0 до 10 в виде строки.

            '
        duration:
          type: integer
          description: 'Секунды.

            '
        quality:
          type: string
          examples:
          - Full HD
          description: 'Лучшее качество видео, например `Full HD`.

            '
        watched_progress_percent:
          type: integer
          description: 'Какую часть видео пользователь уже посмотрел, в процентах. Только при наличии
            `access_token`, иначе `0`.

            '
        is_exclusive:
          type: boolean
          description: '`true` для эксклюзива MEGOGO.

            '
        is_sport:
          type: boolean
          description: '`true` для спортивного видео.

            '
        show:
          type: string
          description: 'Не для партнеров.

            '
        delivery_rules:
          type: array
          items:
            $ref: '#/components/schemas/DeliveryRule'
          description: 'Как пользователь может получить видео в стране запроса. См. страницу «Модели доступа»
            руководства.

            '
      required:
      - id
      - item_type
      - title
      - image
      - categories
      - genres
      - age_limit
      - delivery_rules
      - year
      - country
      - countries
      - rating_imdb
      - rating_megogo
      - slug
      - is_exclusive
      - is_sport
      - watched_progress_percent
    VideoInfo:
      type: object
      description: 'Подробные данные видео: фильма, сериала или серии.

        '
      properties:
        item_type:
          type: string
          examples:
          - video
          - series
          description: '`video` для фильма или серии, `series` для сериала.

            '
        type:
          type: string
          examples:
          - VIDEO
          - SERIES
          description: '`VIDEO`, `SERIES` или `EPISODE`.

            '
        video_type:
          type: string
          examples:
          - FILM
          - SERIAL
          description: 'Например, `FILM`, `SERIAL`.

            '
        id:
          type: integer
          description: 'ID объекта.

            '
        title:
          type: string
          description: 'Название на языке, указанном в `lang`.

            '
        title_original:
          type: string
          description: 'Оригинальное название.

            '
        image:
          $ref: '#/components/schemas/Image'
          description: 'URL постеров. Другие размеры описаны на странице «Изображения» руководства.

            '
        country:
          type: string
          description: 'Страны производства в виде строки.

            '
        countries:
          type: array
          items:
            type: integer
          description: 'ID стран производства.

            '
        year:
          type: string
        slug:
          type: string
          description: 'Часть URL страницы видео на megogo.net. Для интеграции не нужна.

            '
        categories:
          type: array
          items:
            type: integer
          description: 'ID категорий (`categories` в `/configuration`).

            '
        age_limit:
          type: string
          description: 'Минимальный возраст зрителя в виде строки.

            '
        rating_imdb:
          type: string
          description: 'Рейтинг IMDb в виде строки. Пустой, если рейтинга нет.

            '
        rating_kinopoisk:
          type: string
          description: 'Не для партнеров.

            '
        rating_megogo:
          type: string
          description: 'Рейтинг пользователей MEGOGO от 0 до 10 в виде строки.

            '
        duration:
          type: integer
          description: 'Секунды.

            '
        trailer_id:
          type: integer
          description: 'Передайте его как `video_id` в `/stream`, чтобы воспроизвести трейлер.

            '
        quality:
          type: string
          examples:
          - Full HD
          description: 'Лучшее качество видео, например `Full HD`.

            '
        description:
          type: string
          description: 'Полное описание в виде простого текста.

            '
        short_description:
          type: string
          description: 'Краткое описание. Может быть пустым.

            '
        people:
          type: array
          items:
            type: object
          description: 'Актеры и съемочная группа. Поля каждого элемента: `id`, `name`, `name_original`,
            `type` (`ROLE`, `DIRECTOR`, `SCENARIO`, `PRODUCER`...), `avatar` (URL изображений), `slug`.

            '
        screenshots:
          type: array
          items:
            type: object
          description: 'Кадры из видео. Каждый элемент содержит URL изображений `big` и `small`.

            '
        season_list:
          type: array
          items:
            $ref: '#/components/schemas/Season'
          description: 'Сезоны сериала. `episode_list` есть только у первого сезона; для остальных сезонов
            отправляйте `/video/episodes`.

            '
        subtitles:
          type: array
          items:
            type: string
          description: 'Языки субтитров (названия). Чтобы получить файлы субтитров, используйте `/stream`.

            '
        recommended_videos:
          type: array
          items:
            $ref: '#/components/schemas/VideoShort'
          description: 'Может быть пустым. Для рекомендаций используйте `/video/recommended`.

            '
        purchase_info:
          $ref: '#/components/schemas/PurchaseInfo'
        is_available:
          type: boolean
          description: '`true`, если пользователь (из `access_token`) может смотреть видео.

            '
        is_selling:
          type: boolean
        allow_external_streaming:
          type: boolean
          description: 'AirPlay и Chromecast разрешены.

            '
        is_embed:
          type: boolean
        is_promocode:
          type: boolean
        is_favorite:
          type: boolean
          description: 'Только при наличии `access_token`.

            '
        video_url:
          type: string
          description: 'Страница видео на megogo.net.

            '
        full_url:
          type: string
          description: 'Страница видео на megogo.net, URL со slug.

            '
        watch_target:
          type: object
        watched_progress_percent:
          type: integer
        vote:
          type: integer
        vote_type:
          type: string
        like:
          type: integer
          description: 'Количество лайков от пользователей MEGOGO.

            '
        dislike:
          type: integer
          description: 'Количество дизлайков от пользователей MEGOGO.

            '
        comments_num:
          type: integer
          description: 'Количество комментариев пользователей MEGOGO.

            '
        vod_channel:
          type: boolean
        dvr:
          type: boolean
        tv:
          type: boolean
        genres:
          type: array
          items:
            type: integer
          description: 'ID жанров (`genres` в `/configuration`).

            '
        audio_list:
          type: array
          items:
            type: string
          description: 'Языки аудио (названия). Чтобы получить аудиодорожки, используйте `/stream`.

            '
        delivery_rules:
          type: array
          description: 'Как пользователь может получить видео в стране запроса. Пустое, если видео недоступно;
            в этом случае см. `restrictions`.

            '
          items:
            $ref: '#/components/schemas/DeliveryRule'
        restrictions:
          type: array
          description: 'Только если видео недоступно, например `NO_VOD_COUNTRY`. Те же коды, что и в `/stream`.

            '
          items:
            $ref: '#/components/schemas/Restriction'
        is_series:
          type: boolean
          description: '`true` для сериала.

            '
        drm_types:
          type: array
          items:
            type: string
          description: 'Системы DRM видео, например `modular`, `playready`, `fairplay`. Для видео без
            DRM этого поля в ответе нет.

            '
        is_wvdrm:
          type: boolean
          deprecated: true
          description: 'Всегда `false`. Используйте `drm_types` и `drm_type` в `/stream`.

            '
        is_3d:
          type: boolean
          description: '`true` для 3D-версии.

            '
        is_exclusive:
          type: boolean
          description: '`true` для эксклюзива MEGOGO.

            '
        is_sport:
          type: boolean
          description: '`true` для спортивного видео.

            '
        show:
          type: string
          description: 'Не для партнеров.

            '
        kinopoisk_url:
          type: string
          description: 'Не для партнеров.

            '
      required:
      - id
      - item_type
      - type
      - video_type
      - title
      - title_original
      - image
      - categories
      - genres
      - age_limit
      - year
      - duration
      - description
      - delivery_rules
      - is_available
      - is_series
      - purchase_info
      - season_list
      - people
      - subtitles
      - audio_list
    PurchaseService:
      type: object
      description: 'Предложение TVOD или DTO. В ответе могут быть и другие поля.

        '
      additionalProperties: true
      properties:
        subscription_id:
          type: integer
          description: 'ID предложения (услуги).

            '
        title:
          type: string
        currency_code:
          type: string
          examples:
          - uah
        is_bought:
          type: boolean
          description: '`true`, если пользователь уже купил его. Только при наличии `access_token`.

            '
        tariffs:
          type: array
          items:
            type: object
            properties:
              tariff_id:
                type: integer
                description: 'ID тарифа. Передавайте его как `serviceId` в `buyMovie`. Это не `tariff_id`
                  из XML-фида.

                  '
              price:
                type: number
              period:
                type: integer
                description: 'Период доступа в днях.

                  '
              quality:
                type: object
                properties:
                  group:
                    type: string
                    examples:
                    - HD
                    - SD
                  title:
                    type: string
                    examples:
                    - Full HD
                    - SD
                  bitrate:
                    type: integer
                    examples:
                    - 1080
                    - 576
              is_bought:
                type: boolean
    PurchaseInfo:
      type: object
      description: 'Как пользователь может получить доступ. Структуры SVOD, TVOD и DTO проверены. Объект
        содержит только модели доступа, которые включены для вашего ключа.

        '
      properties:
        svod:
          type: object
          properties:
            subscriptions:
              type: array
              description: 'ID услуг, в которые входит это видео.

                '
              items:
                type: integer
        tvod:
          type: object
          description: 'Предложения аренды (TVOD) этого видео для вашего ключа.

            '
          properties:
            subscriptions:
              type: array
              items:
                $ref: '#/components/schemas/PurchaseService'
        dto:
          type: object
          description: 'Предложения покупки (DTO) этого видео для вашего ключа. Та же структура, что и
            у `tvod`. `period` — период доступа в днях, например 3650. Показывайте его пользователю как
            «навсегда».

            '
          properties:
            subscriptions:
              type: array
              items:
                $ref: '#/components/schemas/PurchaseService'
        advod:
          type: object
          properties:
            subscriptions:
              type: array
              items:
                type: integer
        fvod:
          type: object
          properties:
            subscriptions:
              type: array
              items:
                type: integer
    Season:
      type: object
      properties:
        id:
          type: integer
          description: 'ID сезона. Используйте его в `/video/episodes`.

            '
        order:
          type: integer
          description: 'Номер сезона.

            '
        title:
          type: string
          description: 'Название на языке, указанном в `lang`.

            '
        title_original:
          type: string
          description: 'Оригинальное название.

            '
        total:
          type: integer
          description: 'Количество серий. Может быть больше, чем элементов в `episode_list`.

            '
        episode_list:
          type: array
          items:
            $ref: '#/components/schemas/Episode'
    Episode:
      type: object
      properties:
        id:
          type: integer
          description: 'ID серии. Передавайте его как `video_id` в `/stream`.

            '
        order:
          type: integer
          description: 'Номер серии в сезоне.

            '
        title:
          type: string
          description: 'Название на языке, указанном в `lang`.

            '
        title_original:
          type: string
          description: 'Оригинальное название.

            '
        description:
          type: string
          description: 'Описание. Может быть пустым.

            '
        duration:
          type: integer
          description: 'Секунды.

            '
        image:
          type: string
          format: uri
          description: 'Изображение серии.

            '
        images:
          type: object
          properties:
            image_115x120:
              type: string
              format: uri
            image_126x71:
              type: string
              format: uri
            image_162x100:
              type: string
              format: uri
            image_640x360:
              type: string
              format: uri
            image_800x450:
              type: string
              format: uri
            image_original:
              type: string
              format: uri
          description: 'Изображение серии в нескольких размерах.

            '
        is_embed:
          type: boolean
          description: 'Не для партнеров.

            '
        slug:
          type: string
          description: 'Не для партнеров.

            '
        watched_progress_percent:
          type: integer
          description: 'Какую часть серии пользователь уже посмотрел, в процентах. Только при наличии
            `access_token`.

            '
    Collection:
      type: object
      description: 'Список видео, который составляют редакторы MEGOGO. Подборки MEGOGO включает для некоторых
        партнеров по запросу.

        '
      properties:
        id:
          type: integer
        title:
          type: string
        path:
          type: string
        image:
          type: object
          properties:
            image_horizontal:
              type: string
              format: uri
            image_vertical:
              type: string
              format: uri
    Configuration:
      type: object
      description: 'Конфигурация вашего ключа. Ответ может содержать и другие ключи — игнорируйте их.

        '
      additionalProperties: true
      properties:
        geo:
          type: string
          description: 'Страна пользователя, например `kz`.

            '
        partner_id:
          type: integer
          description: 'Номер вашего партнерского аккаунта. Это не строковый ID партнера. Тот же номер
            есть в URL вашего XML-фида.

            '
        free_vod_types:
          type: array
          items:
            type: string
          examples:
          - - ADVOD
            - FVOD
        categories:
          type: array
          items:
            type: object
            properties:
              id:
                type: integer
              title:
                type: string
        genres:
          type: array
          items:
            type: object
        member_types:
          type: array
          items:
            type: object
        age_limits:
          type: array
          items:
            type: object
        video_country_filters:
          type: array
          items:
            type: object
        video_year_filters:
          type: array
          items:
            type: object
        bitrate_from:
          type: integer
        bitrate_to:
          type: integer
        download:
          type: object
          properties:
            enabled:
              type: boolean
        force_update:
          type: object
          properties:
            is_update:
              type: boolean
        order_strategy:
          type: string
        support_info:
          type: object
        payment_systems:
          type: array
          items: {}
    AuthResponse:
      allOf:
      - $ref: '#/components/schemas/Envelope'
      - type: object
        properties:
          data:
            type: object
            properties:
              user_id:
                type: integer
                description: 'ID пользователя MEGOGO.

                  '
              tokens:
                type: object
                properties:
                  access_token:
                    type: string
                    description: 'Используйте в запросах Content API.

                      '
                  access_token_expires_at:
                    type: integer
                    description: 'Unix-время. ≈ 6 часов после авторизации.

                      '
                  remember_me_token:
                    type: string
                    description: 'Передайте его как `rememberme_token` в `/auth/refresh`, чтобы получить
                      новый токен доступа.

                      '
                  remember_me_token_expires_at:
                    type: integer
                    description: 'Unix-время. ≈ 5 лет после авторизации.

                      '
              is_new_user:
                type: boolean
              is_autouser:
                type: boolean
              extra:
                type: object
                properties:
                  access_key:
                    type: string
                    description: 'Назначение не задокументировано.

                      '
    Restriction:
      type: object
      properties:
        code:
          type: string
          description: 'Причина, по которой пользователь не может смотреть видео. MEGOGO может добавлять
            новые коды: если код вам неизвестен, покажите, что видео недоступно. Что делать при каждом
            коде, описано на странице «Решение проблем» и в каталоге ошибок.

            '
          examples:
          - NOT_PURCHASABLE
          enum:
          - NOT_PURCHASABLE
          - BIZ_CLASS
          - NO_CONTRACT
          - CONTRACT
          - NOT_ENABLED_IN_COUNTRY
          - NO_VOD_COUNTRY
          - DRM
          - NO_DRM_SUPPORT
          - PARTNER_IS_DISABLED
          - NO_BITRATE
          - BITRATE_DISABLED_BY_PURCHASED_SUBSCRIPTION
          - UHD_IS_NOT_SUPPORTED
          - HDR_IS_NOT_SUPPORTED
          - D3_IS_NOT_SUPPORTED
          - NO_SCHEDULE_FOR_CHANNEL
          - INVALID_VIRTUAL_OBJECT_ID
          - CATCH_UP_IS_UNAVAILABLE
        message:
          type: string
          description: 'Общий текст. Не показывайте его как причину.

            '
    Stream:
      type: object
      properties:
        video_id:
          type: integer
          description: 'ID из запроса.

            '
        root_video_id:
          type: integer
          description: 'ID сериала. Только для серии.

            '
        title:
          type: string
          description: 'Название на языке, указанном в `lang`.

            '
        hierarchy_titles:
          type: object
          description: '`VIDEO` для фильма. `SERIES`, `SEASON`, `EPISODE` для серии.

            '
          additionalProperties:
            type: string
        is_hierarchy:
          type: boolean
        prev:
          type: integer
          description: 'ID предыдущей серии. Для первой серии отсутствует.

            '
        next:
          type: integer
          description: 'ID следующей серии. Для последней серии отсутствует.

            '
        src:
          type: string
          description: 'URL манифеста. Пустой, если видео недоступно (см. `restrictions`). HLS (`.m3u8`)
            или DASH (`.mpd`). Запрашивайте новый `src` каждый раз, когда пользователь запускает воспроизведение.
            Не сохраняйте и не кешируйте этот URL.

            '
        stream_type:
          type: string
          enum:
          - hls
          - dash
          - mss
          description: 'Только если `src` не пустой. Протокол MEGOGO задает в настройках вашего ключа.
            Для `mss` путь `src` заканчивается на `/Manifest`.

            '
        content_type:
          type: string
          description: '`vod` для фильма или серии, `trailer` для трейлера. Другие значения относятся
            к ТВ-контенту и прямым трансляциям, которые в этом руководстве не описаны.

            '
        drm_type:
          type: string
          description: 'Пустая строка, если DRM нет. Система DRM задается в настройках ключа: `modular`
            (Widevine, DASH), `playready` (PlayReady, DASH), `fairplay` (FairPlay, HLS).

            '
          enum:
          - ''
          - modular
          - playready
          - fairplay
        license_server:
          type: string
          description: 'URL сервера лицензий DRM. Пустой, если DRM нет.

            '
        license_certificate:
          type: string
          description: 'URL сертификата. Только для FairPlay. Для других систем DRM пустой.

            '
        is_wvdrm:
          type: boolean
          deprecated: true
          description: 'Всегда `false`. Используйте `drm_type`.

            '
        restrictions:
          type: array
          description: 'Только если видео недоступно.

            '
          items:
            $ref: '#/components/schemas/Restriction'
        bitrates:
          type: array
          items:
            $ref: '#/components/schemas/Bitrate'
        audio_tracks:
          type: array
          items:
            $ref: '#/components/schemas/AudioTrack'
        subtitles:
          type: array
          items:
            $ref: '#/components/schemas/Subtitle'
        advert_url:
          type: string
          description: 'Не для партнеров. Игнорируйте это поле.

            '
        start_session_url:
          type: string
          description: 'Не для партнеров.

            '
        allow_external_streaming:
          type: boolean
          description: 'AirPlay и Chromecast разрешены.

            '
        parental_control_required:
          type: boolean
        play_start_time:
          type: integer
          description: 'Секунды. Позиция, на которой пользователь остановил просмотр в прошлый раз.

            '
        credits_start:
          type: integer
          description: 'Секунды. Начало финальных титров.

            '
        preview_images:
          type: object
          properties:
            thumbsline_xml:
              type: string
              format: uri
            thumbsline_list:
              type: array
              items:
                $ref: '#/components/schemas/Thumb'
            thumbsline_list_full_hd:
              type: array
              items:
                $ref: '#/components/schemas/Thumb'
            thumbsline_list_uhd:
              type: array
              items:
                $ref: '#/components/schemas/Thumb'
          description: 'Миниатюры кадров для полосы перемотки.

            '
        share_link:
          type: string
          format: uri
          description: 'Страница видео на megogo.net.

            '
        watermark:
          type: string
          description: 'Не для партнеров.

            '
        watermark_clickable_enabled:
          type: boolean
          description: 'Не для партнеров.

            '
        show_best_quality_link:
          type: boolean
          description: 'Не для партнеров.

            '
        show_vod_recommendations:
          type: boolean
          description: 'Не для партнеров.

            '
        cdn_id:
          type: integer
          description: 'Не для партнеров.

            '
        external_source:
          type: boolean
          description: 'Не для партнеров.

            '
        is_autoplay:
          type: boolean
          description: 'Не для партнеров.

            '
        is_embed:
          type: boolean
          description: 'Не для партнеров.

            '
        is_favorite:
          type: boolean
          description: 'Только при наличии `access_token`.

            '
        is_live:
          type: boolean
          description: '`true` для прямой трансляции (live). Прямые трансляции в этом руководстве не описаны.

            '
        is_tv:
          type: boolean
          description: '`true` для ТВ-контента. ТВ-контент в этом руководстве не описан.

            '
        is_sport:
          type: boolean
          description: '`true` для спортивного видео.

            '
        is_uhd:
          type: boolean
          description: '`true` для 4K-версии. У ключа должна быть настройка 4K; в этом случае `bitrates`
            содержит только 2160.

            '
        is_uhd_8k:
          type: boolean
          description: '`true` для 8K-версии.

            '
        is_hdr:
          type: boolean
          description: '`true` для HDR-версии.

            '
        is_3d:
          type: boolean
          description: '`true` для 3D-версии.

            '
      required:
      - video_id
      - title
      - src
    Thumb:
      type: object
      properties:
        id:
          type: integer
          description: 'Позиция миниатюры.

            '
        url:
          type: string
          format: uri
          description: 'URL изображения.

            '
    Bitrate:
      type: object
      properties:
        index:
          type: integer
          description: 'Порядковый номер в списке.

            '
        bitrate:
          type: integer
          description: 'Разрешение по вертикали

            '
          for example 720.: null
        name:
          type: string
          description: 'Локализованное название, например «High (720)».

            '
        src:
          type: string
          description: 'URL манифеста только для этого битрейта. Пустой, если битрейт недоступен.

            '
        license_server:
          type:
          - string
          - 'null'
          description: 'URL сервера лицензий для этого `src`. С DRM у каждого битрейта свои `src` и `license_server`.

            '
    AudioTrack:
      type: object
      properties:
        id:
          type: integer
          description: 'ID языковой версии. Одинаковый во всех видео (например, 11 — русский).

            '
        index:
          type: integer
          description: 'Значение для сегмента `/a/{index}/` в URL потока (HLS версии 3, MSS). Это не порядок
            в меню: для меню используйте порядок элементов массива `audio_tracks`.

            '
        lang:
          type: string
          description: 'Код языка MEGOGO (`ua`, `ge`, `kz`...). Не ISO. Может повторяться.

            '
        lang_iso_639_1:
          type: string
          description: 'Код ISO 639-1.

            '
        lang_tag:
          type: string
          description: 'Уникальный ключ дорожки: `<ISO 639-1>-x-<id>`. В манифесте то же значение указано
            в `LANGUAGE` (HLS) или `lang` (DASH).

            '
          examples:
          - ru-x-11
        lang_original:
          type: string
          description: 'Название языка на этом же языке.

            '
        display_name:
          type: string
          description: 'Название дорожки на языке, указанном в `lang`. Показывайте его в меню.

            '
        is_active:
          type: boolean
          description: 'Дорожка по умолчанию: первая дорожка с запрошенным `lang`. Начинайте воспроизведение
            с нее. Ищите дорожку в манифесте по `lang_tag`.

            '
        require_subtitles:
          type: boolean
          description: 'С этой дорожкой плеер обязан показывать субтитры. Пользователь не может их выключить,
            но может выбрать их язык. Не предлагайте субтитры на языке дорожки. Если других субтитров
            нет, не показывайте эту дорожку.

            '
        subtitles_policy:
          type: object
          properties:
            allowed_subtitles:
              type: array
              items:
                type: integer
              description: 'ID субтитров.

                '
            is_disableable:
              type: boolean
              description: 'Пользователь может выключить субтитры. `false` для дорожки с `require_subtitles:
                true`.

                '
            preselect:
              type: integer
              description: '`id` субтитров, которые нужно включить с этой дорожкой, если `is_disableable`
                равно `false`. Если `is_disableable` равно `true`, игнорируйте это поле.

                '
    Subtitle:
      type: object
      properties:
        id:
          type: integer
          description: 'ID субтитров. На него ссылаются `subtitles_policy.allowed_subtitles` и `preselect`
            аудиодорожек.

            '
        index:
          type: integer
          description: 'Порядковый номер субтитров.

            '
        type:
          type: string
          examples:
          - srt
          description: 'Формат файла, например `srt`.

            '
        lang:
          type: string
          description: 'Код языка MEGOGO. Не ISO.

            '
        lang_iso_639_1:
          type: string
          description: 'Код ISO 639-1.

            '
        lang_tag:
          type: string
          description: 'Уникальный ключ субтитров: `<ISO 639-1>-x-<id>`.

            '
        lang_original:
          type: string
          description: 'Название языка на этом же языке.

            '
        display_name:
          type: string
          description: 'Название языка на языке, указанном в `lang`. Показывайте его в меню.

            '
        url:
          type: string
          format: uri
          description: 'URL файла субтитров.

            '
