Repository: yt-dlp/yt-dlp
File: test/test_youtube_signature.py (Python)

Code before:
        'ir9-V6cdbCiyKxhr', '9YE85kNjZiS4',
    ),
    (
        'https://www.youtube.com/s/player/20830619/player-plasma-ias-phone-en_US.vflset/base.js',
        'ir9-V6cdbCiyKxhr', '9YE85kNjZiS4',
    ),
    (
        'https://www.youtube.com/s/player/20830619/player-plasma-ias-tablet-en_US.vflset/base.js',
        'ir9-V6cdbCiyKxhr', '9YE85kNjZiS4',
    ),
    (
        'https://www.youtube.com/s/player/8a8ac953/player_ias_tce.vflset/en_US/base.js',
        'MiBYeXx_vRREbiCCmh', 'RtZYMVvmkE0JE',
    ),
    (
        'https://www.youtube.com/s/player/8a8ac953/tv-player-es6.vflset/tv-player-es6.js',
        'MiBYeXx_vRREbiCCmh', 'RtZYMVvmkE0JE',
    ),
    (
        'https://www.youtube.com/s/player/59b252b9/player_ias.vflset/en_US/base.js',
        'D3XWVpYgwhLLKNK4AGX', 'aZrQ1qWJ5yv5h',
    ),
    (
        'https://www.youtube.com/s/player/fc2a56a5/player_ias.vflset/en_US/base.js',
        'qTKWg_Il804jd2kAC', 'OtUAm2W6gyzJjB9u',
    ),
]


@is_download_test
class TestPlayerInfo(unittest.TestCase):
    def test_youtube_extract_player_info(self):
        PLAYER_URLS = (
            ('https://www.youtube.com/s/player/4c3f79c5/player_ias.vflset/en_US/base.js', '4c3f79c5'),
            ('https://www.youtube.com/s/player/64dddad9/player_ias.vflset/en_US/base.js', '64dddad9'),
            ('https://www.youtube.com/s/player/64dddad9/player_ias.vflset/fr_FR/base.js', '64dddad9'),
            ('https://www.youtube.com/s/player/64dddad9/player-plasma-ias-phone-en_US.vflset/base.js', '64dddad9'),
            ('https://www.youtube.com/s/player/64dddad9/player-plasma-ias-phone-de_DE.vflset/base.js', '64dddad9'),
            ('https://www.youtube.com/s/player/64dddad9/player-plasma-ias-tablet-en_US.vflset/base.js', '64dddad9'),
            ('https://www.youtube.com/s/player/e7567ecf/player_ias_tce.vflset/en_US/base.js', 'e7567ecf'),
            ('https://www.youtube.com/s/player/643afba4/tv-player-ias.vflset/tv-player-ias.js', '643afba4'),
            # obsolete
            ('https://www.youtube.com/yts/jsbin/player_ias-vfle4-e03/en_US/base.js', 'vfle4-e03'),
            ('https://www.youtube.com/yts/jsbin/player_ias-vfl49f_g4/en_US/base.js', 'vfl49f_g4'),
            ('https://www.youtube.com/yts/jsbin/player_ias-vflCPQUIL/en_US/base.js', 'vflCPQUIL'),
            ('https://www.youtube.com/yts/jsbin/player-vflzQZbt7/en_US/base.js', 'vflzQZbt7'),
            ('https://www.youtube.com/yts/jsbin/player-en_US-vflaxXRn1/base.js', 'vflaxXRn1'),
            ('https://s.ytimg.com/yts/jsbin/html5player-en_US-vflXGBaUN.js', 'vflXGBaUN'),
            ('https://s.ytimg.com/yts/jsbin/html5player-en_US-vflKjOTVq/html5player.js', 'vflKjOTVq'),
        )
        for player_url, expected_player_id in PLAYER_URLS:

Review comment (suggestion):
```suggestion
    ),
    (
        'https://www.youtube.com/s/player/fc2a56a5/tv-player-ias.vflset/tv-player-ias.js',
        'qTKWg_Il804jd2kAC', 'OtUAm2W6gyzJjB9u',
    ),
```

Code after:
        'ir9-V6cdbCiyKxhr', '9YE85kNjZiS4',
    ),
    (
        'https://www.youtube.com/s/player/20830619/player-plasma-ias-phone-en_US.vflset/base.js',
        'ir9-V6cdbCiyKxhr', '9YE85kNjZiS4',
    ),
    (
        'https://www.youtube.com/s/player/20830619/player-plasma-ias-tablet-en_US.vflset/base.js',
        'ir9-V6cdbCiyKxhr', '9YE85kNjZiS4',
    ),
    (
        'https://www.youtube.com/s/player/8a8ac953/player_ias_tce.vflset/en_US/base.js',
        'MiBYeXx_vRREbiCCmh', 'RtZYMVvmkE0JE',
    ),
    (
        'https://www.youtube.com/s/player/8a8ac953/tv-player-es6.vflset/tv-player-es6.js',
        'MiBYeXx_vRREbiCCmh', 'RtZYMVvmkE0JE',
    ),
    (
        'https://www.youtube.com/s/player/59b252b9/player_ias.vflset/en_US/base.js',
        'D3XWVpYgwhLLKNK4AGX', 'aZrQ1qWJ5yv5h',
    ),
    (
        'https://www.youtube.com/s/player/fc2a56a5/player_ias.vflset/en_US/base.js',
        'qTKWg_Il804jd2kAC', 'OtUAm2W6gyzJjB9u',
    ),
    (
        'https://www.youtube.com/s/player/fc2a56a5/tv-player-ias.vflset/tv-player-ias.js',
        'qTKWg_Il804jd2kAC', 'OtUAm2W6gyzJjB9u',
    ),
]


@is_download_test
class TestPlayerInfo(unittest.TestCase):
    def test_youtube_extract_player_info(self):
        PLAYER_URLS = (
            ('https://www.youtube.com/s/player/4c3f79c5/player_ias.vflset/en_US/base.js', '4c3f79c5'),
            ('https://www.youtube.com/s/player/64dddad9/player_ias.vflset/en_US/base.js', '64dddad9'),
            ('https://www.youtube.com/s/player/64dddad9/player_ias.vflset/fr_FR/base.js', '64dddad9'),
            ('https://www.youtube.com/s/player/64dddad9/player-plasma-ias-phone-en_US.vflset/base.js', '64dddad9'),
            ('https://www.youtube.com/s/player/64dddad9/player-plasma-ias-phone-de_DE.vflset/base.js', '64dddad9'),
            ('https://www.youtube.com/s/player/64dddad9/player-plasma-ias-tablet-en_US.vflset/base.js', '64dddad9'),
            ('https://www.youtube.com/s/player/e7567ecf/player_ias_tce.vflset/en_US/base.js', 'e7567ecf'),
            ('https://www.youtube.com/s/player/643afba4/tv-player-ias.vflset/tv-player-ias.js', '643afba4'),
            # obsolete
            ('https://www.youtube.com/yts/jsbin/player_ias-vfle4-e03/en_US/base.js', 'vfle4-e03'),
            ('https://www.youtube.com/yts/jsbin/player_ias-vfl49f_g4/en_US/base.js', 'vfl49f_g4'),
            ('https://www.youtube.com/yts/jsbin/player_ias-vflCPQUIL/en_US/base.js', 'vflCPQUIL'),
            ('https://www.youtube.com/yts/jsbin/player-vflzQZbt7/en_US/base.js', 'vflzQZbt7'),
            ('https://www.youtube.com/yts/jsbin/player-en_US-vflaxXRn1/base.js', 'vflaxXRn1'),