Repository: yt-dlp/yt-dlp

Issue:
[iPrima] Log-in is broken since launch of Prima+
### DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE

- [X] I understand that I will be **blocked** if I remove or skip any mandatory\* field

### Checklist

- [X] I'm reporting a bug unrelated to a specific site
- [X] I've verified that I'm running yt-dlp version **2023.01.06** ([update instructions](https://github.com/yt-dlp/yt-dlp#update)) or later (specify commit)
- [X] I've checked that all provided URLs are playable in a browser with the same IP and same login details
- [X] I've checked that all URLs and arguments with special characters are [properly quoted or escaped](https://github.com/yt-dlp/yt-dlp/wiki/FAQ#video-url-contains-an-ampersand--and-im-getting-some-strange-output-1-2839-or-v-is-not-recognized-as-an-internal-or-external-command)
- [X] I've searched the [bugtracker](https://github.com/yt-dlp/yt-dlp/issues?q=) for similar issues **including closed ones**. DO NOT post duplicates
- [X] I've read the [guidelines for opening an issue](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#opening-an-issue)

### Provide a description that is worded well enough to be understood

On 2023-02-08, a Prima+ VOD (primaplus.cz) was launched as replacement (or upgrade) for current iPrima.cz.
Downloading could work in similar way as in previous state, however login site was changed and so logging-in process will need to be fixed first.

### Provide verbose output that clearly demonstrates the problem

- [X] Run **your** yt-dlp command with **-vU** flag added (`yt-dlp -vU <your command line>`)
- [X] Copy the WHOLE output (starting with `[debug] Command-line config`) and insert it below

### Complete Verbose Output

```shell
[debug] Command-line config: ['https://cool.iprima.cz/porady/top-gear/7-epizoda-12', '--username', 'PRIVATE', '--password', 'PRIVATE', '-vU']
[debug] Encodings: locale cp1250, fs utf-8, pref cp1250, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version 2023.01.06 [6becd25] (win32_dir)
[debug] Python 3.8.10 (CPython AMD64 64bit) - Windows-10-10.0.19044-SP0 (OpenSSL 1.1.1k  25 Mar 2021)
[debug] exe versions: ffmpeg n5.0.1-4-ga5ebb3d25e-20220603 (setts), ffprobe n5.0.1-4-ga5ebb3d25e-20220603
[debug] Optional libraries: Cryptodome-3.16.0, brotli-1.0.9, certifi-2022.12.07, mutagen-1.46.0, sqlite3-2.6.0, websockets-10.4
[debug] Proxy map: {}
[debug] Loaded 1760 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Latest version: 2023.01.06, Current version: 2023.01.06
yt-dlp is up to date (2023.01.06)
[IPrima] Downloading login page
[IPrima] Logging in
ERROR: 'NoneType' object is not subscriptable
Traceback (most recent call last):
  File "yt_dlp\YoutubeDL.py", line 1502, in wrapper
  File "yt_dlp\YoutubeDL.py", line 1578, in __extract_info
  File "yt_dlp\extractor\common.py", line 677, in extract
  File "yt_dlp\extractor\common.py", line 583, in initialize
  File "yt_dlp\extractor\iprima.py", line 83, in _perform_login
TypeError: 'NoneType' object is not subscriptable
```



Discussion:
free iPrima account:

login: remomo8231@iucake.com
pwd: iPrimaAcc1234
Problem is causing "Profile selector" that appears after successful login.
![image](https://user-images.githubusercontent.com/3188999/218270675-deb8d9d1-3ae7-4593-b6f0-14ee5f1d2839.png)

We'll probably need to extract list of profiles, select one and make a call to `/user/profile-select-perform/{profile-id}?continueUrl=%2Fuser%2Flogin%3Fredirect_uri%3D%2Fuser%2F`


<details>
  <summary>Truncated and filtered Fiddler dump:</summary>

  ```
POST https://auth.iprima.cz/oauth2/login HTTP/1.1
Host: auth.iprima.cz
Connection: keep-alive
Content-Length: 201
Cache-Control: max-age=0
Upgrade-Insecure-Requests: 1
Origin: https://auth.iprima.cz
Content-Type: application/x-www-form-urlencoded
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36 Edg/110.0.1587.41
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
Referer: https://auth.iprima.cz/oauth2/login
Accept-Encoding: gzip, deflate, br
Accept-Language: cs,en;q=0.9,en-GB;q=0.8,en-US;q=0.7

HTTP/1.1 302 Found
Date: Sat, 11 Feb 2023 17:02:25 GMT
Content-Type: text/html; charset=UTF-8
Transfer-Encoding: chunked
Connection: keep-alive
Server: nginx/1.20.0
Set-Cookie: prima_sso_profile=09GICN38FA64SKJN113OMEATVA; path=/; domain=iprima.cz; secure
Set-Cookie: uuseg=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; Max-Age=0; path=/; domain=iprima.cz; secure
Cache-Control: max-age=0, must-revalidate, private
Location: /user/profile-select
Content-Security-Policy: script-src 'nonce-hZKFTK3zjYnskRQtKThUE/zHlcg=' 'unsafe-inline' 'unsafe-eval' 'strict-dynamic' https: http:; object-src 'none';
X-Content-Security-Policy: script-src 'nonce-hZKFTK3zjYnskRQtKThUE/zHlcg=' 'unsafe-inline' 'unsafe-eval' 'strict-dynamic' https: http:; object-src 'none';
X-WebKit-CSP: script-src 'nonce-hZKFTK3zjYnskRQtKThUE/zHlcg=' 'unsafe-inline' 'unsafe-eval' 'strict-dynamic' https: http:; object-src 'none';
Expires: Sat, 11 Feb 2023 17:02:25 GMT

146
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8" />
        <meta http-equiv="refresh" content="0;url='/user/profile-select'" />

        <title>Redirecting to /user/profile-select</title>
    </head>
    <body>
        Redirecting to <a href="/user/profile-select">/user/profile-select</a>.
    </body>
</html>
0



------------------------------------------------------------------

GET https://auth.iprima.cz/user/profile-select HTTP/1.1
Host: auth.iprima.cz
Connection: keep-alive
Cache-Control: max-age=0
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36 Edg/110.0.1587.41
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
Referer: https://auth.iprima.cz/oauth2/login
Accept-Encoding: gzip, deflate, br
Accept-Language: cs,en;q=0.9,en-GB;q=0.8,en-US;q=0.7


HTTP/1.1 200 OK
Date: Sat, 11 Feb 2023 17:02:25 GMT
Content-Type: text/html; charset=UTF-8
Connection: keep-alive
Server: nginx/1.20.0
Cache-Control: max-age=0, must-revalidate, private
Content-Security-Policy: script-src 'nonce-ru+OpR1C4XGQ/NvDlovc2gd6lac=' 'unsafe-inline' 'unsafe-eval' 'strict-dynamic' https: http:; object-src 'none';
X-Content-Security-Policy: script-src 'nonce-ru+OpR1C4XGQ/NvDlovc2gd6lac=' 'unsafe-inline' 'unsafe-eval' 'strict-dynamic' https: http:; object-src 'none';
X-WebKit-CSP: script-src 'nonce-ru+OpR1C4XGQ/NvDlovc2gd6lac=' 'unsafe-inline' 'unsafe-eval' 'strict-dynamic' https: http:; object-src 'none';
Expires: Sat, 11 Feb 2023 17:02:25 GMT
Content-Length: 8153

<!doctype html>
<html lang="en">
<head>
    <!-- Required meta tags -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
            <meta name="sso.auth_server_url" content="https://auth.iprima.cz/">
                                                <meta name="sso.use_cdn" content="true">
                <meta name="sso.auth_cdn_server_url" content="https://authstatic.primacdn.cz">
                                            <meta name="sso.auth_logout_redirect" content="false">
        <meta name="sso.dark_mode" content="false">
                <link crossorigin="anonymous" rel="stylesheet" href="https://authstatic.primacdn.cz/build/bootstrap-cdn.5fabbeb7.css" integrity="sha384-nOYiU1YQVDeo7uZtCI59QSmlqdcNi8YJAdZGYMZao+/dY5QBuhVS5bgT1BOlV4iz" nonce="ru+OpR1C4XGQ/NvDlovc2gd6lac=">
        <link rel="manifest" href="/site.webmanifest" nonce="ru+OpR1C4XGQ/NvDlovc2gd6lac=">
    <title>Kdo se dívá? (=Who is watching? => a.k.a Select profile badge below to procced) | prima+</title>
            <script src="https://code.jquery.com/jquery-3.5.1.min.js" nonce="ru+OpR1C4XGQ/NvDlovc2gd6lac="></script>
        <script src="/cmp/iprima-cmp.js?v=1676134945" nonce="ru+OpR1C4XGQ/NvDlovc2gd6lac="></script>
        <script nonce="ru+OpR1C4XGQ/NvDlovc2gd6lac=">
            function addGTM(w, d, s, l, i) {
                w[l] = w[l] || [];
                w[l].push({ 'gtm.start': new Date().getTime(), event: 'gtm.js' });
                var f = d.getElementsByTagName(s)[0],
                    j = d.createElement(s),
                    dl = l != 'dataLayer' ? '&l=' + l : '';
                j.async = true;
                j.src = 'https://www.googletagmanager.com/gtm.js?id=' + i + dl;
                f.parentNode.insertBefore(j, f);
            }
            window.didomiOnReady = window.didomiOnReady || [];
            window.didomiOnReady.push(function () {
                addGTM(window, document, 'script', 'dataLayer', 'GTM-M8JC22T');
            });
        </script>
    </head>
<body>


    
    <div class="container px-0">

                        <header class="d-flex justify-content-between py-0 ps-4 pe-1 px-lg-5 mb-3 mb-lg-5">
                                                <div id="logo">
                        <a href="https://www.iprima.cz" class="text-dark text-decoration-none">
                            <img alt="Prima+" src="https://authstatic.primacdn.cz/build/images/plus-xvod.59ffbca2.svg" class="d-lg-none">
                            <img alt="Prima+" src="https://authstatic.primacdn.cz/build/images/iprima-xvod.ad93daec.svg" class="d-none d-lg-inline">
                        </a>
                    </div>
                    <div class="text-end">
                        
                        <a href="/user/login?redirect_uri=/user/" class="text-decoration-none text-white p-2">
                            <i class="xvod-icon-close"></i>
                        </a>

                    </div>
                            </header>


                            
        <div id="main-content" class="d-flex">
                <div class="col-12 px-3">
        <div class="row justify-content-center" id="profile-selector" data-continue-url="/user/login?redirect_uri=/user/">
            <div class="col-12 text-center mb-4">
                <h3 class="fw-bolder">Kdo se dívá?</h3>
            </div>
                        <div class="col-4 col-lg-2 profile-select-item p-0">
                <a href="#"
                   data-identifier="09GICN38FA64SKJN113OMEATVA"
                   data-edit-url="/user/profile-edit/09GICN38FA64SKJN113OMEATVA"
                   class="profile-select text-decoration-none">
                    <div class="card bg-transparent">
                        <div class="rounded-circle image-edit d-none">
                            <img src="https://authstatic.primacdn.cz/build/images/edit.a11234a5.svg">
                        </div>
                        <div class="rounded-circle image-load d-flex d-none">
                            <div class="spinner-border text-light my-auto mx-auto" role="status">
                                <span class="visually-hidden">Loading...</span>
                            </div>
                        </div>
                        <div class="rounded-circle image-selected d-none">
                        </div>
                        <div class="profile-avatar">
                            <img src="https://authstatic.primacdn.cz/assets/user-profile-avatar/muz" class="rounded-circle" alt="Profile's name">
                        </div>
                    </div>
                    <div class="card-body text-center">
                        <div class="text-gray text-truncate">Profile's name</div>
                    </div>
                </a>
            </div>
                                    <div class="col-4 col-lg-2 profile-select-item p-0">
                <a href="/user/profile-new" class="text-decoration-none">
                    <div class="card bg-transparent">
                        <div class="profile-add">
                            <img src="https://authstatic.primacdn.cz/build/images/xvod-profile-add.30d6a6cd.svg" class="rounded-circle" alt="Přidat profil">
                        </div>
                        <div class="card-body text-center">
                            <div class="text-gray">Přidat profil</div>
                        </div>
                    </div>
                </a>
            </div>
                    </div>
        <div class="row">
        <div class="col-12 col-lg-4 offset-lg-4 text-center mt-5">
            <button id="showEdit" class="btn btn-dark bg-dark-gray w-100">
                Spravovat&nbsp;profil            </button>
        </div>
    </div>
    </div>
        </div>

        <footer class="p-5 my-5">
            <div class="text-center">
                <small>&copy; FTV Prima 2003 - 2023</small>            </div>
        </footer>
    </div>

    <script crossorigin="anonymous" src="https://authstatic.primacdn.cz/build/runtime.caa40c2d.js" integrity="sha384-8hMhhb0nYutH5NXPturt/Q9D2w+u25LophqBY10cyUnkLaj2VAedpUpX5M7fVko7" nonce="ru+OpR1C4XGQ/NvDlovc2gd6lac="></script><script crossorigin="anonymous" src="https://authstatic.primacdn.cz/build/0.2d0c2c00.js" integrity="sha384-QGg13EYi44Q2KUloULTlWjFU5Jx4PhQ26F+2/bLHkTt8Z8o9nlasApX8qyKDMG/4" nonce="ru+OpR1C4XGQ/NvDlovc2gd6lac="></script><script crossorigin="anonymous" src="https://authstatic.primacdn.cz/build/3.0c895367.js" integrity="sha384-EkJLvJ+2X4m+FJy0DhNE4LNNOgHWBdJnfBbYAeqAlqd1yd+fiKuGNNECtd12HiI2" nonce="ru+OpR1C4XGQ/NvDlovc2gd6lac="></script><script crossorigin="anonymous" src="https://authstatic.primacdn.cz/build/bootstrap-js-cdn.42f0b372.js" integrity="sha384-PCWx9XEN7KKO6zl15WGUyKlhziPhuH/MgVcltTQpWLBtlnqKnG9Mp0/XclzWbbLg" nonce="ru+OpR1C4XGQ/NvDlovc2gd6lac="></script>
    <script crossorigin="anonymous" src="https://authstatic.primacdn.cz/build/hotjar-tracking.34838a23.js" integrity="sha384-Wm9Hnz2sNwXCNdxNtzZQleJcKFu4+6A4Xjw3PYRg6ScorGb0mD/Q31ojCMrxXnJS" nonce="ru+OpR1C4XGQ/NvDlovc2gd6lac="></script>
    <script id="prima.profile.loader" type="text/javascript" src="/sso/profile_select_loader.js?v=2.2" nonce="ru+OpR1C4XGQ/NvDlovc2gd6lac="></script>
    <script crossorigin="anonymous" src="https://authstatic.primacdn.cz/build/1.5ff06390.js" integrity="sha384-LangfkczSMYdRyXDLt/5kJQCuSThRIXarYSPZ6wPHEnqHEtyDjgnbAN6BQLiGURP" nonce="ru+OpR1C4XGQ/NvDlovc2gd6lac="></script><script crossorigin="anonymous" src="https://authstatic.primacdn.cz/build/xvod-profile-select.f527b94a.js" integrity="sha384-sKjDeDfolHE4gwhIAC3UDHQToxUdr4LCiOoloPDQS39ePO2YDiLmp5Q2lTddXgfg" nonce="ru+OpR1C4XGQ/NvDlovc2gd6lac="></script>
    
    
<div class="toast-container fixed-bottom m-1 m-md-5">
                                        </div>

<div class="toast-container fixed-bottom m-1 m-md-5 w-auto">
                                                                                                                                                                    </div>

</body>
</html>


------------------------------------------------------------------

GET https://auth.iprima.cz/user/profile-select-perform/09GICN38FA64SKJN113OMEATVA?continueUrl=%2Fuser%2Flogin%3Fredirect_uri%3D%2Fuser%2F HTTP/1.1
Host: auth.iprima.cz
Connection: keep-alive
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36 Edg/110.0.1587.41
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
Referer: https://auth.iprima.cz/user/profile-select
Accept-Encoding: gzip, deflate, br
Accept-Language: cs,en;q=0.9,en-GB;q=0.8,en-US;q=0.7

HTTP/1.1 302 Found
Date: Sat, 11 Feb 2023 17:02:38 GMT
Content-Type: text/html; charset=UTF-8
Transfer-Encoding: chunked
Connection: keep-alive
Server: nginx/1.20.0
Cache-Control: max-age=0, must-revalidate, private
Location: /user/login?redirect_uri=/user/
Content-Security-Policy: script-src 'nonce-CrTw9wKZLyhTJjt/4kbrelPr2uE=' 'unsafe-inline' 'unsafe-eval' 'strict-dynamic' https: http:; object-src 'none';
X-Content-Security-Policy: script-src 'nonce-CrTw9wKZLyhTJjt/4kbrelPr2uE=' 'unsafe-inline' 'unsafe-eval' 'strict-dynamic' https: http:; object-src 'none';
X-WebKit-CSP: script-src 'nonce-CrTw9wKZLyhTJjt/4kbrelPr2uE=' 'unsafe-inline' 'unsafe-eval' 'strict-dynamic' https: http:; object-src 'none';
Expires: Sat, 11 Feb 2023 17:02:38 GMT
Set-Cookie: uuseg=deleted; expires=Fri, 11-Feb-2022 17:02:37 GMT; Max-Age=0; path=/; domain=iprima.cz; secure; httponly; samesite=lax

172
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8" />
        <meta http-equiv="refresh" content="0;url='/user/login?redirect_uri=/user/'" />

        <title>Redirecting to /user/login?redirect_uri=/user/</title>
    </head>
    <body>
        Redirecting to <a href="/user/login?redirect_uri=/user/">/user/login?redirect_uri=/user/</a>.
    </body>
</html>
0



------------------------------------------------------------------

GET https://auth.iprima.cz/user/login?redirect_uri=/user/ HTTP/1.1
Host: auth.iprima.cz
Connection: keep-alive
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36 Edg/110.0.1587.41
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
Referer: https://auth.iprima.cz/user/profile-select
Accept-Encoding: gzip, deflate, br
Accept-Language: cs,en;q=0.9,en-GB;q=0.8,en-US;q=0.7

HTTP/1.1 302 Found
Date: Sat, 11 Feb 2023 17:02:39 GMT
Content-Type: text/html; charset=UTF-8
Transfer-Encoding: chunked
Connection: keep-alive
Server: nginx/1.20.0
Cache-Control: max-age=0, must-revalidate, private
Location: /oauth2/authorize?response_type=code&client_id=prima_sso&redirect_uri=https://auth.iprima.cz/sso/auth-check&scope=openid%20email%20profile%20phone%20address%20offline_access&state=prima_sso&auth_init_url=/user/&auth_return_url=https://www.iprima.cz?authentication%3Dcancelled
Content-Security-Policy: script-src 'nonce-p2+rzYy2ZvBFXlmsfvvcGL28Vlo=' 'unsafe-inline' 'unsafe-eval' 'strict-dynamic' https: http:; object-src 'none';
X-Content-Security-Policy: script-src 'nonce-p2+rzYy2ZvBFXlmsfvvcGL28Vlo=' 'unsafe-inline' 'unsafe-eval' 'strict-dynamic' https: http:; object-src 'none';
X-WebKit-CSP: script-src 'nonce-p2+rzYy2ZvBFXlmsfvvcGL28Vlo=' 'unsafe-inline' 'unsafe-eval' 'strict-dynamic' https: http:; object-src 'none';
Expires: Sat, 11 Feb 2023 17:02:38 GMT

5a2
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8" />
        <meta http-equiv="refresh" content="0;url='/oauth2/authorize?response_type=code&amp;client_id=prima_sso&amp;redirect_uri=https://auth.iprima.cz/sso/auth-check&amp;scope=openid%20email%20profile%20phone%20address%20offline_access&amp;state=prima_sso&amp;auth_init_url=/user/&amp;auth_return_url=https://www.iprima.cz?authentication%3Dcancelled'" />

        <title>Redirecting to /oauth2/authorize?response_type=code&amp;client_id=prima_sso&amp;redirect_uri=https://auth.iprima.cz/sso/auth-check&amp;scope=openid%20email%20profile%20phone%20address%20offline_access&amp;state=prima_sso&amp;auth_init_url=/user/&amp;auth_return_url=https://www.iprima.cz?authentication%3Dcancelled</title>
    </head>
    <body>
        Redirecting to <a href="/oauth2/authorize?response_type=code&amp;client_id=prima_sso&amp;redirect_uri=https://auth.iprima.cz/sso/auth-check&amp;scope=openid%20email%20profile%20phone%20address%20offline_access&amp;state=prima_sso&amp;auth_init_url=/user/&amp;auth_return_url=https://www.iprima.cz?authentication%3Dcancelled">/oauth2/authorize?response_type=code&amp;client_id=prima_sso&amp;redirect_uri=https://auth.iprima.cz/sso/auth-check&amp;scope=openid%20email%20profile%20phone%20address%20offline_access&amp;state=prima_sso&amp;auth_init_url=/user/&amp;auth_return_url=https://www.iprima.cz?authentication%3Dcancelled</a>.
    </body>
</html>
0



------------------------------------------------------------------

GET https://auth.iprima.cz/oauth2/authorize?response_type=code&client_id=prima_sso&redirect_uri=https://auth.iprima.cz/sso/auth-check&scope=openid%20email%20profile%20phone%20address%20offline_access&state=prima_sso&auth_init_url=/user/&auth_return_url=https://www.iprima.cz?authentication%3Dcancelled HTTP/1.1
Host: auth.iprima.cz
Connection: keep-alive
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36 Edg/110.0.1587.41
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
Referer: https://auth.iprima.cz/user/profile-select
Accept-Encoding: gzip, deflate, br
Accept-Language: cs,en;q=0.9,en-GB;q=0.8,en-US;q=0.7

HTTP/1.1 302 Found
Date: Sat, 11 Feb 2023 17:02:39 GMT
Content-Type: text/html; charset=UTF-8
Transfer-Encoding: chunked
Connection: keep-alive
Server: nginx/1.20.0
Location: https://auth.iprima.cz/sso/auth-check?code=NmZkAj2MTMI5NGQzNjIzN2ZjASliYzlZTkzMzk3YTNhYjk1ZmMyCjYmU5NzJcYjliCVM4Y2ZmMDdkZTg3ZGU3NThjOGIwYmJNzQ2MzYxM4U2ZCBhXjkzMTD4YAY1VAKk&state=prima_sso&redirect_uri=%2Fuser%2F
Cache-Control: max-age=0, must-revalidate, private
Content-Security-Policy: script-src 'nonce-a6FU2AGVWQsGy29N35FBfG/FdmU=' 'unsafe-inline' 'unsafe-eval' 'strict-dynamic' https: http:; object-src 'none';
X-Content-Security-Policy: script-src 'nonce-a6FU2AGVWQsGy29N35FBfG/FdmU=' 'unsafe-inline' 'unsafe-eval' 'strict-dynamic' https: http:; object-src 'none';
X-WebKit-CSP: script-src 'nonce-a6FU2AGVWQsGy29N35FBfG/FdmU=' 'unsafe-inline' 'unsafe-eval' 'strict-dynamic' https: http:; object-src 'none';
Expires: Sat, 11 Feb 2023 17:02:39 GMT

0
------------------------------------------------------------------
  ```
</details>

---

`print(login_handle.geturl())`
=>
```
[IPrima] Logging in
https://auth.iprima.cz/user/profile-select
ERROR: 'NoneType' object is not subscriptable
    code = parse_qs(login_handle.geturl()).get('code')[0]
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^
```

Resolving patch:
diff --git a/yt_dlp/extractor/iprima.py b/yt_dlp/extractor/iprima.py
--- a/yt_dlp/extractor/iprima.py
+++ b/yt_dlp/extractor/iprima.py
@@ -7,7 +7,8 @@
     js_to_json,
     urlencode_postdata,
     ExtractorError,
-    parse_qs
+    parse_qs,
+    traverse_obj
 )
 
 
@@ -15,8 +16,7 @@ class IPrimaIE(InfoExtractor):
     _VALID_URL = r'https?://(?!cnn)(?:[^/]+)\.iprima\.cz/(?:[^/]+/)*(?P<id>[^/?#&]+)'
     _GEO_BYPASS = False
     _NETRC_MACHINE = 'iprima'
-    _LOGIN_URL = 'https://auth.iprima.cz/oauth2/login'
-    _TOKEN_URL = 'https://auth.iprima.cz/oauth2/token'
+    _AUTH_ROOT = 'https://auth.iprima.cz'
     access_token = None
 
     _TESTS = [{
@@ -67,7 +67,7 @@ def _perform_login(self, username, password):
             return
 
         login_page = self._download_webpage(
-            self._LOGIN_URL, None, note='Downloading login page',
+            f'{self._AUTH_ROOT}/oauth2/login', None, note='Downloading login page',
             errnote='Downloading login page failed')
 
         login_form = self._hidden_inputs(login_page)
@@ -76,11 +76,20 @@ def _perform_login(self, username, password):
             '_email': username,
             '_password': password})
 
-        _, login_handle = self._download_webpage_handle(
-            self._LOGIN_URL, None, data=urlencode_postdata(login_form),
+        profile_select_html, login_handle = self._download_webpage_handle(
+            f'{self._AUTH_ROOT}/oauth2/login', None, data=urlencode_postdata(login_form),
             note='Logging in')
 
-        code = parse_qs(login_handle.geturl()).get('code')[0]
+        # a profile may need to be selected first, even when there is only a single one
+        if '/profile-select' in login_handle.geturl():
+            profile_id = self._search_regex(
+                r'data-identifier\s*=\s*["\']?(\w+)', profile_select_html, 'profile id')
+
+            login_handle = self._request_webpage(
+                f'{self._AUTH_ROOT}/user/profile-select-perform/{profile_id}', None,
+                query={'continueUrl': '/user/login?redirect_uri=/user/'}, note='Selecting profile')
+
+        code = traverse_obj(login_handle.geturl(), ({parse_qs}, 'code', 0))
         if not code:
             raise ExtractorError('Login failed', expected=True)
 
@@ -89,10 +98,10 @@ def _perform_login(self, username, password):
             'client_id': 'prima_sso',
             'grant_type': 'authorization_code',
             'code': code,
-            'redirect_uri': 'https://auth.iprima.cz/sso/auth-check'}
+            'redirect_uri': f'{self._AUTH_ROOT}/sso/auth-check'}
 
         token_data = self._download_json(
-            self._TOKEN_URL, None,
+            f'{self._AUTH_ROOT}/oauth2/token', None,
             note='Downloading token', errnote='Downloading token failed',
             data=urlencode_postdata(token_request_data))
 
@@ -115,14 +124,22 @@ def _real_extract(self, url):
 
         webpage = self._download_webpage(url, video_id)
 
-        title = self._html_search_meta(
+        title = self._html_extract_title(webpage) or self._html_search_meta(
             ['og:title', 'twitter:title'],
             webpage, 'title', default=None)
 
         video_id = self._search_regex((
             r'productId\s*=\s*([\'"])(?P<id>p\d+)\1',
-            r'pproduct_id\s*=\s*([\'"])(?P<id>p\d+)\1'),
-            webpage, 'real id', group='id')
+            r'pproduct_id\s*=\s*([\'"])(?P<id>p\d+)\1',
+        ), webpage, 'real id', group='id', default=None)
+
+        if not video_id:
+            nuxt_data = self._search_nuxt_data(webpage, video_id, traverse='data')
+            video_id = traverse_obj(
+                nuxt_data, (..., 'content', 'additionals', 'videoPlayId', {str}), get_all=False)
+
+        if not video_id:
+            self.raise_no_formats('Unable to extract video ID from webpage')
 
         metadata = self._download_json(
             f'https://api.play-backend.iprima.cz/api/v1//products/id-{video_id}/play',


Test patch: