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

Code before:
        "\u0412": "B",
        "\u0415": "E",
        "\u041a": "K",
        "\u041c": "M",
        "\u041d": "H",
        "\u041e": "O",
        "\u0420": "P",
        "\u0421": "C",
        "\u0425": "X",
        ",": "/",
        ".": "+",
        "~": "=",
    }

    def _decode_base64(self, text):
        for from_char, to_char in self._BASE64_CHAR_REPL_MAP.items():
            text = text.replace(from_char, to_char)
        return base64.b64decode(text).decode('utf-8')

    def _get_format_id(self, format_id):
        if not format_id:
            return None
        elif isinstance(format_id, list):
            return '' if len(format_id) == 0 else format_id[0].lstrip('_')
        else:
            return format_id.lstrip('_')


class TxxxIE(TxxxBaseIE):
    _VALID_URL = r'''(?x)
                     https?://
                     (?:(?:www\.)?(?P<host>
                     hclips\.com|
                     hdzog\.com|
                     hotmovs\.com|
                     inporn\.com|
                     privatehomeclips\.com|
                     tubepornclassic\.com|
                     txxx\.com|
                     txxx\.tube|
                     upornia\.com|
                     vjav\.com|
                     vxxx\.com|
                     voyeurhit\.com|
                     voyeurhit\.tube))
                     (?:/(?:video/|videos/|video-|embed/)(?P<id>[^/]+)/)
                  '''
    _TESTS = [{
        'url': 'https://txxx.com/videos/16574965/digital-desire-malena-morgan/',
        'md5': 'c54e4ace54320aaf8e2a72df87859391',
        'info_dict': {

Review comment (suggestion):
```suggestion
        return try_call(lambda: variadic(format_id)[0].lstrip('_'))
```
doesnt even need to be a function

Code after:
    return base64.b64decode(text.translate(text.maketrans({
        '\u0405': 'S',
        '\u0406': 'I',
        '\u0408': 'J',
        '\u0410': 'A',
        '\u0412': 'B',
        '\u0415': 'E',
        '\u041a': 'K',
        '\u041c': 'M',
        '\u041d': 'H',
        '\u041e': 'O',
        '\u0420': 'P',
        '\u0421': 'C',
        '\u0425': 'X',
        ',': '/',
        '.': '+',
        '~': '=',
    }))).decode()


def get_formats(host, video_file):
    return [{
        'url': urljoin(f'https://{host}', decode_base64(video['video_url'])),
        'format_id': try_call(lambda: variadic(video['format'])[0].lstrip('_')),
        'quality': index,
    } for index, video in enumerate(video_file) if video.get('video_url')]


class TxxxIE(InfoExtractor):
    _DOMAINS = (
        'hclips.com',
        'hdzog.com',
        'hdzog.tube',
        'hotmovs.com',
        'hotmovs.tube',
        'inporn.com',
        'privatehomeclips.com',
        'tubepornclassic.com',
        'txxx.com',
        'txxx.tube',
        'upornia.com',
        'upornia.tube',
        'vjav.com',
        'vjav.tube',
        'vxxx.com',
        'voyeurhit.com',
        'voyeurhit.tube',
    )
    _VALID_URL = rf'''(?x)
        https?://(?:www\.)?(?P<host>{"|".join(map(re.escape, _DOMAINS))})/
        (?:videos?[/-]|embed/)(?P<id>\d+)(?:/(?P<display_id>[^/?#]+))?