Repository: yt-dlp/yt-dlp
File: yt_dlp/extractor/mildom.py (Python)

Code before:
    update_url_query,
    random_uuidv4,
    try_get,
    float_or_none,
    dict_get
)
from ..compat import (
    compat_str
)


class MildomBaseIE(InfoExtractor):
    _GUEST_ID = None
    _DISPATCHER_CONFIG = None

    def _call_api(self, url, video_id, query={}, note='Downloading JSON metadata', init=False):
        query = query or {}
        if query:
            query['__platform'] = 'web'
        url = update_url_query(url, self._common_queries(query, init=init))
        content = self._download_json(url, video_id, note=note)
        if content['code'] == 0:
            return content['body']
        else:
            self.raise_no_formats('Video not found or premium content. Mildom error code %i, "%s"'
                                  % (content['code'], content['message']), expected=True)

    def _common_queries(self, query={}, init=False):
        dc = self._fetch_dispatcher_config()
        r = {
            'timestamp': self.iso_timestamp(),
            '__guest_id': '' if init else self.guest_id(),
            '__location': dc['location'],
            '__country': dc['country'],
            '__cluster': dc['cluster'],
            '__platform': 'web',
            '__la': self.lang_code(),
            '__pcv': 'v2.9.44',
            'sfr': 'pc',
            'accessToken': '',
        }
        r.update(query)
        return r

    def _fetch_dispatcher_config(self):
        if not self._DISPATCHER_CONFIG:
            tmp = self._download_json(
                'https://disp.mildom.com/serverListV2', 'initialization',
                note='Downloading dispatcher_config', data=json.dumps({
                    'protover': 0,
                    'data': base64.b64encode(json.dumps({

Review comment (suggestion):
```suggestion
            self.raise_no_formats(
                f'Video not found or premium content. {content["code"]} - {content["message"]}',
                expected=True)
```

Code after:
    update_url_query,
    random_uuidv4,
    try_get,
    float_or_none,
    dict_get
)
from ..compat import (
    compat_str,
)


class MildomBaseIE(InfoExtractor):
    _GUEST_ID = None
    _DISPATCHER_CONFIG = None

    def _call_api(self, url, video_id, query=None, note='Downloading JSON metadata', init=False):
        query = query or {}
        if query:
            query['__platform'] = 'web'
        url = update_url_query(url, self._common_queries(query, init=init))
        content = self._download_json(url, video_id, note=note)
        if content['code'] == 0:
            return content['body']
        else:
            self.raise_no_formats(
                f'Video not found or premium content. {content["code"]} - {content["message"]}',
                expected=True)

    def _common_queries(self, query={}, init=False):
        dc = self._fetch_dispatcher_config()
        r = {
            'timestamp': self.iso_timestamp(),
            '__guest_id': '' if init else self.guest_id(),
            '__location': dc['location'],
            '__country': dc['country'],
            '__cluster': dc['cluster'],
            '__platform': 'web',
            '__la': self.lang_code(),
            '__pcv': 'v2.9.44',
            'sfr': 'pc',
            'accessToken': '',
        }
        r.update(query)
        return r

    def _fetch_dispatcher_config(self):
        if not self._DISPATCHER_CONFIG:
            tmp = self._download_json(
                'https://disp.mildom.com/serverListV2', 'initialization',
                note='Downloading dispatcher_config', data=json.dumps({
                    'protover': 0,