Repository: yt-dlp/yt-dlp

Issue:
raiplay
### 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 broken site
- [X] I've verified that I'm running yt-dlp version **2022.08.14** ([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/ytdl-org/youtube-dl#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)
- [X] I've read about [sharing account credentials](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#are-you-willing-to-share-account-details-if-needed) and I'm willing to share it if required

### Region

Italy

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

It seems that some URLs from raiplay do not work.

I haven't seen a pattern, just some do and some other do not.

### 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
$ yt-dlp -vU https://www.raiplay.it/programmi/ficodindia
[debug] Command-line config: ['-vU', 'https://www.raiplay.it/programmi/ficodindia']
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version 2022.08.14 [55937202b] (debian*)
[debug] Python 3.10.6 (CPython 64bit) - Linux-5.16.0-1-amd64-x86_64-with-glibc2.34 (glibc 2.34)
[debug] Checking exe version: ffmpeg -bsfs
[debug] Checking exe version: ffprobe -bsfs
[debug] exe versions: ffmpeg 5.1-2 (setts), ffprobe 5.1-2, rtmpdump 2.4
[debug] Optional libraries: Cryptodome-3.11.0, brotli-1.0.9, certifi-2020.06.20, mutagen-1.45.1, pyxattr-0.7.2, secretstorage-3.3.3, sqlite3-2.6.0, websockets-10.2
[debug] Proxy map: {}
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Latest version: 2022.08.14, Current version: 2022.08.14
yt-dlp is up to date (2022.08.14)
[debug] [RaiPlayPlaylist] Extracting URL: https://www.raiplay.it/programmi/ficodindia
[RaiPlayPlaylist] ficodindia: Downloading program JSON
[RaiPlayPlaylist] ContentSet-5c93f8ad-d049-4f8a-b365-5c8a7a6422f4: Downloading content set JSON
[download] Downloading playlist: Fico d'India
[RaiPlayPlaylist] Playlist Fico d'India: Downloading 1 videos of 1
[download] Downloading video 1 of 1
[debug] [RaiPlay] Extracting URL: https://www.raiplay.it/video/2016/07/Fico-d-India-ea6a12e9-69d1-4948-abed-65f315c6fc2f.json
[RaiPlay] ea6a12e9-69d1-4948-abed-65f315c6fc2f: Downloading video JSON
[RaiPlay] ea6a12e9-69d1-4948-abed-65f315c6fc2f: Downloading XML metadata for platform mon
[RaiPlay] ea6a12e9-69d1-4948-abed-65f315c6fc2f: Downloading m3u8 information
[RaiPlay] ea6a12e9-69d1-4948-abed-65f315c6fc2f: Downloading XML metadata for platform flash
[RaiPlay] ea6a12e9-69d1-4948-abed-65f315c6fc2f: Downloading XML metadata for platform native
ERROR: ea6a12e9-69d1-4948-abed-65f315c6fc2f: An extractor error has occurred. (caused by KeyError('200')); please report this issue on  https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template. Confirm you are on the latest version using  yt-dlp -U
  File "/usr/lib/python3/dist-packages/yt_dlp/extractor/common.py", line 666, in extract
    ie_result = self._real_extract(url)
  File "/usr/lib/python3/dist-packages/yt_dlp/extractor/rai.py", line 315, in _real_extract
    relinker_info = self._extract_relinker_info(video['content_url'], video_id)
  File "/usr/lib/python3/dist-packages/yt_dlp/extractor/rai.py", line 113, in _extract_relinker_info
    formats.extend(self._create_http_urls(relinker_url, formats))
  File "/usr/lib/python3/dist-packages/yt_dlp/extractor/rai.py", line 205, in _create_http_urls
    **get_format_info(q)
  File "/usr/lib/python3/dist-packages/yt_dlp/extractor/rai.py", line 180, in get_format_info
    'width': _QUALITY[tbr][0],
KeyError: '200'

[download] Finished downloading playlist: Fico d'India
```



Discussion:
@nixxo 
sorry, a mistake introduced in one of my latest PR. I'll fix it asap.

```
❯ ydpm https://www.raiplay.it/programmi/ficodindia -F
[RaiPlayPlaylist] ficodindia: Downloading program JSON
[RaiPlayPlaylist] ContentSet-5c93f8ad-d049-4f8a-b365-5c8a7a6422f4: Downloading content set JSON
[download] Downloading playlist: Fico d'India
[RaiPlayPlaylist] Playlist Fico d'India: Downloading 1 videos of 1
[download] Downloading video 1 of 1
[RaiPlay] ea6a12e9-69d1-4948-abed-65f315c6fc2f: Downloading video JSON
[RaiPlay] ea6a12e9-69d1-4948-abed-65f315c6fc2f: Downloading XML metadata for platform mon
[RaiPlay] ea6a12e9-69d1-4948-abed-65f315c6fc2f: Downloading m3u8 information
[RaiPlay] ea6a12e9-69d1-4948-abed-65f315c6fc2f: Downloading XML metadata for platform flash
[RaiPlay] ea6a12e9-69d1-4948-abed-65f315c6fc2f: Downloading XML metadata for platform native
[info] Available formats for ea6a12e9-69d1-4948-abed-65f315c6fc2f:
ID         EXT RESOLUTION FPS |   FILESIZE   TBR PROTO | VCODEC        VBR ACODEC    ABR
----------------------------------------------------------------------------------------
https-250  mp4 352x198        | ~170.50MiB  250k https | unknown      250k unknown    0k
https-400  mp4 512x288        | ~272.80MiB  400k https | unknown      400k unknown    0k
https-700  mp4 512x288        | ~477.40MiB  700k https | unknown      700k unknown    0k
hls-1303   mp4 736x414     25 | ~888.73MiB 1303k m3u8  | avc1.4d401f 1303k mp4a.40.2  0k
https-1200 mp4 736x414     25 | ~888.73MiB 1303k https | avc1.4d401f 1303k mp4a.40.2  0k
hls-1906   mp4 736x414     25 | ~  1.27GiB 1906k m3u8  | avc1.4d401f 1906k mp4a.40.2  0k
https-1800 mp4 736x414     25 | ~  1.27GiB 1906k https | avc1.4d401f 1906k mp4a.40.2  0k
hls-2508   mp4 736x414     25 | ~  1.67GiB 2509k m3u8  | avc1.4d401f 2509k mp4a.40.2  0k
https-2400 mp4 736x414     25 | ~  1.67GiB 2509k https | avc1.4d401f 2509k mp4a.40.2  0k
https-3200 mp4 1440x810       | ~  2.13GiB 3200k https | unknown     3200k unknown    0k
https-5000 mp4 1920x1080      | ~  3.33GiB 5000k https | unknown     5000k unknown    0k
[download] Finished downloading playlist: Fico d'India
```

Resolving patch:
diff --git a/yt_dlp/extractor/rai.py b/yt_dlp/extractor/rai.py
--- a/yt_dlp/extractor/rai.py
+++ b/yt_dlp/extractor/rai.py
@@ -156,7 +156,7 @@ def get_format_info(tbr):
             br = int_or_none(tbr)
             if len(fmts) == 1 and not br:
                 br = fmts[0].get('tbr')
-            if br or 0 > 300:
+            if br and br > 300:
                 tbr = compat_str(math.floor(br / 100) * 100)
             else:
                 tbr = '250'


Test patch: