Repository: yt-dlp/yt-dlp

Issue:
Arte extractor fails on georestricted content
### 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.19** ([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

France, Germany

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

Attempting to download georestricted content from the Arte site, while being located outside the allowed areas, fails when the circumventing code is triggered.

It seems to be due to a structure declared as a set, but used by `random.choice()` later on (which expects an indexable sequence).

### 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 --list-formats https://www.arte.tv/fr/videos/106616-001-A/squadra-criminale-saison-4-1-12/
[debug] Command-line config: ['-vU', '--list-formats', 'https://www.arte.tv/fr/videos/106616-001-A/squadra-criminale-saison-4-1-12/']
[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.19 [48c88e088] (source)
[debug] Lazy loading extractors is disabled
[debug] Plugins: ['SamplePluginIE', 'SamplePluginPP']
[debug] Git HEAD: a1af51625
[debug] Python 3.10.6 (CPython 64bit) - Linux-5.17.4-mooch-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-2022.06.15, mutagen-1.45.1, pyxattr-0.7.2, sqlite3-2.6.0, websockets-10.2
[debug] Proxy map: {}
[debug] Loaded 1662 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Latest version: 2022.08.19, Current version: 2022.08.19
yt-dlp is up to date (2022.08.19)
[debug] [ArteTV] Extracting URL: https://www.arte.tv/fr/videos/106616-001-A/squadra-criminale-saison-4-1-12/
[ArteTV] 106616-001-A: Downloading JSON metadata
ERROR: 'set' object is not subscriptable
Traceback (most recent call last):
  File "/usr/src/yt-dlp/yt_dlp/extractor/common.py", line 670, in extract
    ie_result = self._real_extract(url)
  File "/usr/src/yt-dlp/yt_dlp/extractor/arte.py", line 128, in _real_extract
    raise GeoRestrictedError(f'Video restricted to {geoblocking["code"]!r}',
yt_dlp.utils.GeoRestrictedError: Video restricted to 'EUR_DE_FR'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/yt-dlp/yt_dlp/YoutubeDL.py", line 1452, in wrapper
    return func(self, *args, **kwargs)
  File "/usr/src/yt-dlp/yt_dlp/YoutubeDL.py", line 1528, in __extract_info
    ie_result = ie.extract(url)
  File "/usr/src/yt-dlp/yt_dlp/extractor/common.py", line 681, in extract
    if self.__maybe_fake_ip_and_retry(e.countries):
  File "/usr/src/yt-dlp/yt_dlp/extractor/common.py", line 708, in __maybe_fake_ip_and_retry
    country_code = random.choice(countries)
  File "/usr/lib/python3.10/random.py", line 378, in choice
    return seq[self._randbelow(len(seq))]
TypeError: 'set' object is not subscriptable
```
```



Discussion:

Resolving patch:
diff --git a/yt_dlp/extractor/arte.py b/yt_dlp/extractor/arte.py
--- a/yt_dlp/extractor/arte.py
+++ b/yt_dlp/extractor/arte.py
@@ -95,24 +95,24 @@ class ArteTVIE(ArteTVBaseIE):
 
     # all obtained by exhaustive testing
     _COUNTRIES_MAP = {
-        'DE_FR': {
+        'DE_FR': (
             'BL', 'DE', 'FR', 'GF', 'GP', 'MF', 'MQ', 'NC',
             'PF', 'PM', 'RE', 'WF', 'YT',
-        },
+        ),
         # with both of the below 'BE' sometimes works, sometimes doesn't
-        'EUR_DE_FR': {
+        'EUR_DE_FR': (
             'AT', 'BL', 'CH', 'DE', 'FR', 'GF', 'GP', 'LI',
             'MC', 'MF', 'MQ', 'NC', 'PF', 'PM', 'RE', 'WF',
             'YT',
-        },
-        'SAT': {
+        ),
+        'SAT': (
             'AD', 'AT', 'AX', 'BG', 'BL', 'CH', 'CY', 'CZ',
             'DE', 'DK', 'EE', 'ES', 'FI', 'FR', 'GB', 'GF',
             'GR', 'HR', 'HU', 'IE', 'IS', 'IT', 'KN', 'LI',
             'LT', 'LU', 'LV', 'MC', 'MF', 'MQ', 'MT', 'NC',
             'NL', 'NO', 'PF', 'PL', 'PM', 'PT', 'RE', 'RO',
             'SE', 'SI', 'SK', 'SM', 'VA', 'WF', 'YT',
-        },
+        ),
     }
 
     def _real_extract(self, url):


Test patch: