Repository: yt-dlp/yt-dlp

Issue:
[rainews.it] TGR broken, but works with youtube-dl
### Checklist

- [X] I'm reporting a broken site
- [X] I've verified that I'm running yt-dlp version **2021.12.01**. ([update instructions](https://github.com/yt-dlp/yt-dlp#update))
- [X] I've checked that all provided URLs are alive and playable in a browser
- [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)
- [ ] 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 (but I don't know if it's accessible worldwide)

### Description

TGR videos from [rainews.it](https://www.rainews.it), available through `top-left menu -> "TGR" -> pick any region`, don't work with yt-dlp, but work fine with youtube-dl (version 2021.06.06).

I tried to fetch <https://www.rainews.it/tgr/emiliaromagna/notiziari/video/2021/12/ContentItem-d3afaafc-166f-40c3-9b34-1de5c736f39d.html> and I got `TypeError: '>' not supported between instances of 'NoneType' and 'int'`.

### Verbose log

```shell
[debug] Command-line config: ['-Uv', 'https://www.rainews.it/tgr/emiliaromagna/notiziari/video/2021/12/ContentItem-d3afaafc-166f-40c3-9b34-1de5c736f39d.html']
[debug] Encodings: locale UTF-8, fs utf-8, out utf-8 (No ANSI), err utf-8 (No ANSI), pref UTF-8
[debug] yt-dlp version 2021.12.01 [91f071af6]
[debug] Python version 3.10.0 (CPython 64bit) - Linux-5.10.82_1-x86_64-with-glibc2.32
[debug] exe versions: ffmpeg present (needs_adtstoasc,setts), ffprobe present
[debug] Optional libraries: mutagen, sqlite
[debug] Proxy map: {}
Latest version: 2021.12.01, Current version: 2021.12.01
yt-dlp is up to date (2021.12.01)
[debug] [Rai] Extracting URL: https://www.rainews.it/tgr/emiliaromagna/notiziari/video/2021/12/ContentItem-d3afaafc-166f-40c3-9b34-1de5c736f39d.html
[Rai] d3afaafc-166f-40c3-9b34-1de5c736f39d: Downloading webpage
[Rai] d3afaafc-166f-40c3-9b34-1de5c736f39d: Downloading video JSON
[Rai] d3afaafc-166f-40c3-9b34-1de5c736f39d: Downloading XML metadata for platform mon
[Rai] d3afaafc-166f-40c3-9b34-1de5c736f39d: Downloading m3u8 information
[Rai] d3afaafc-166f-40c3-9b34-1de5c736f39d: Downloading XML metadata for platform flash
[Rai] d3afaafc-166f-40c3-9b34-1de5c736f39d: Downloading XML metadata for platform native
ERROR: '>' not supported between instances of 'NoneType' and 'int'
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/yt_dlp/YoutubeDL.py", line 1329, in wrapper
    return func(self, *args, **kwargs)
  File "/usr/lib/python3.10/site-packages/yt_dlp/YoutubeDL.py", line 1398, in __extract_info
    ie_result = ie.extract(url)
  File "/usr/lib/python3.10/site-packages/yt_dlp/extractor/common.py", line 597, in extract
    ie_result = self._real_extract(url)
  File "/usr/lib/python3.10/site-packages/yt_dlp/extractor/rai.py", line 554, in _real_extract
    return self._extract_from_content_id(content_item_id, url)
  File "/usr/lib/python3.10/site-packages/yt_dlp/extractor/rai.py", line 487, in _extract_from_content_id
    relinker_info = self._extract_relinker_info(media['mediaUri'], content_id)
  File "/usr/lib/python3.10/site-packages/yt_dlp/extractor/rai.py", line 103, in _extract_relinker_info
    formats.extend(self._create_http_urls(relinker_url, formats))
  File "/usr/lib/python3.10/site-packages/yt_dlp/extractor/rai.py", line 193, in _create_http_urls
    fmt.update(get_format_info(q))
  File "/usr/lib/python3.10/site-packages/yt_dlp/extractor/rai.py", line 146, in get_format_info
    if br > 300:
TypeError: '>' not supported between instances of 'NoneType' and 'int'
```



Discussion:
@nixxo

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
@@ -17,6 +17,7 @@
     get_element_by_class,
     HEADRequest,
     int_or_none,
+    join_nonempty,
     parse_duration,
     parse_list,
     remove_start,
@@ -138,6 +139,9 @@ def test_url(url):
                 return False if resp.url == url else resp.url
             return None
 
+        # filter out audio-only formats
+        fmts = [f for f in fmts if not f.get('vcodec') == 'none']
+
         def get_format_info(tbr):
             import math
             br = int_or_none(tbr)
@@ -229,7 +233,7 @@ class RaiPlayIE(RaiBaseIE):
             'id': 'cb27157f-9dd0-4aee-b788-b1f67643a391',
             'ext': 'mp4',
             'title': 'Report del 07/04/2014',
-            'alt_title': 'St 2013/14 - Espresso nel caffè - 07/04/2014',
+            'alt_title': 'St 2013/14 - Report - Espresso nel caffè - 07/04/2014',
             'description': 'md5:d730c168a58f4bb35600fc2f881ec04e',
             'thumbnail': r're:^https?://.*\.jpg$',
             'uploader': 'Rai Gulp',
@@ -237,7 +241,7 @@ class RaiPlayIE(RaiBaseIE):
             'series': 'Report',
             'season': '2013/14',
             'subtitles': {
-                'it': 'count:2',
+                'it': 'count:4',
             },
         },
         'params': {
@@ -245,18 +249,18 @@ class RaiPlayIE(RaiBaseIE):
         },
     }, {
         # 1080p direct mp4 url
-        'url': 'https://www.raiplay.it/video/2021/03/Leonardo-S1E1-b5703b02-82ee-475a-85b6-c9e4a8adf642.html',
-        'md5': '2e501e8651d72f05ffe8f5d286ad560b',
+        'url': 'https://www.raiplay.it/video/2021/11/Blanca-S1E1-Senza-occhi-b1255a4a-8e72-4a2f-b9f3-fc1308e00736.html',
+        'md5': 'aeda7243115380b2dd5e881fd42d949a',
         'info_dict': {
-            'id': 'b5703b02-82ee-475a-85b6-c9e4a8adf642',
+            'id': 'b1255a4a-8e72-4a2f-b9f3-fc1308e00736',
             'ext': 'mp4',
-            'title': 'Leonardo - S1E1',
-            'alt_title': 'St 1 Ep 1 - Episodio 1',
-            'description': 'md5:f5360cd267d2de146e4e3879a5a47d31',
+            'title': 'Blanca - S1E1 - Senza occhi',
+            'alt_title': 'St 1 Ep 1 - Blanca - Senza occhi',
+            'description': 'md5:75f95d5c030ec8bac263b1212322e28c',
             'thumbnail': r're:^https?://.*\.jpg$',
             'uploader': 'Rai 1',
-            'duration': 3229,
-            'series': 'Leonardo',
+            'duration': 6493,
+            'series': 'Blanca',
             'season': 'Season 1',
         },
     }, {
@@ -309,12 +313,14 @@ def _real_extract(self, url):
         program_info = media.get('program_info') or {}
         season = media.get('season')
 
+        alt_title = join_nonempty(media.get('subtitle'), media.get('toptitle'), delim=' - ')
+
         info = {
             'id': remove_start(media.get('id'), 'ContentItem-') or video_id,
             'display_id': video_id,
             'title': self._live_title(title) if relinker_info.get(
                 'is_live') else title,
-            'alt_title': strip_or_none(media.get('subtitle')),
+            'alt_title': strip_or_none(alt_title),
             'description': media.get('description'),
             'uploader': strip_or_none(media.get('channel')),
             'creator': strip_or_none(media.get('editor') or None),


Test patch: