Repository: yt-dlp/yt-dlp

Issue:
[Freesound] Downloads are broken
### 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 **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)
- [ ] 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

_No response_

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

Freesound.org downloads are broken due to how the preview URLs sometimes appear in the HTML: `<meta property="og:audio" content="https://freesound.orghttps://cdn.freesound.org/..." />`

I have made a fix for this and will be opening a PR shortly.

### 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.freesound.org/people/miklovan/sounds/194503/
[debug] Command-line config: ['-vU', 'https://www.freesound.org/people/miklovan/sounds/194503/']
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version 2023.01.06 [6becd25] (pip)
[debug] Python 3.10.2 (CPython AMD64 64bit) - Windows-10-10.0.19044-SP0 (OpenSSL 1.1.1m  14 Dec 2021)
[debug] exe versions: ffmpeg git-2019-11-13-a7245ad, ffprobe 5.1.2-full_build-www.gyan.dev
[debug] Optional libraries: Cryptodome-3.12.0, brotli-1.0.9, certifi-2021.10.08, mutagen-1.45.1, sqlite3-2.6.0, websockets-10.1
[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)
[Freesound] Extracting URL: https://www.freesound.org/people/miklovan/sounds/194503/
[Freesound] 194503: Downloading webpage
[debug] Formats sorted by: hasvid, ie_pref, lang, quality, res, fps, hdr:12(7), vcodec:vp9.2(10), channels, acodec, filesize, fs_approx, tbr, vbr, abr, asr, proto, vext, aext, hasaud, source, id
[debug] Default format spec: bestvideo*+bestaudio/best
[info] 194503: Downloading 1 format(s): 1
[debug] Invoking http downloader on "https://freesound.orghttps://cdn.freesound.org/previews/194/194503_224081-hq.mp3"
[download] Got error: <urlopen error [Errno 11001] getaddrinfo failed>. Retrying (1/10)...
[download] Got error: <urlopen error [Errno 11001] getaddrinfo failed>. Retrying (2/10)...
[download] Got error: <urlopen error [Errno 11001] getaddrinfo failed>. Retrying (3/10)...
[download] Got error: <urlopen error [Errno 11001] getaddrinfo failed>. Retrying (4/10)...
[download] Got error: <urlopen error [Errno 11001] getaddrinfo failed>. Retrying (5/10)...
[download] Got error: <urlopen error [Errno 11001] getaddrinfo failed>. Retrying (6/10)...
[download] Got error: <urlopen error [Errno 11001] getaddrinfo failed>. Retrying (7/10)...
[download] Got error: <urlopen error [Errno 11001] getaddrinfo failed>. Retrying (8/10)...
[download] Got error: <urlopen error [Errno 11001] getaddrinfo failed>. Retrying (9/10)...
[download] Got error: <urlopen error [Errno 11001] getaddrinfo failed>. Retrying (10/10)...
[download] Got error: <urlopen error [Errno 11001] getaddrinfo failed>. Giving up after 10 retries
  File "C:\Program Files\Python310\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Program Files\Python310\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Program Files\Python310\Scripts\yt-dlp.exe\__main__.py", line 7, in <module>
    sys.exit(main())
  File "C:\Program Files\Python310\lib\site-packages\yt_dlp\__init__.py", line 970, in main
    _exit(*variadic(_real_main(argv)))
  File "C:\Program Files\Python310\lib\site-packages\yt_dlp\__init__.py", line 960, in _real_main
    return ydl.download(all_urls)
  File "C:\Program Files\Python310\lib\site-packages\yt_dlp\YoutubeDL.py", line 3358, in download
    self.__download_wrapper(self.extract_info)(
  File "C:\Program Files\Python310\lib\site-packages\yt_dlp\YoutubeDL.py", line 3333, in wrapper
    res = func(*args, **kwargs)
  File "C:\Program Files\Python310\lib\site-packages\yt_dlp\YoutubeDL.py", line 1491, in extract_info
    return self.__extract_info(url, self.get_info_extractor(key), download, extra_info, process)
  File "C:\Program Files\Python310\lib\site-packages\yt_dlp\YoutubeDL.py", line 1502, in wrapper
    return func(self, *args, **kwargs)
  File "C:\Program Files\Python310\lib\site-packages\yt_dlp\YoutubeDL.py", line 1599, in __extract_info
    return self.process_ie_result(ie_result, download, extra_info)
  File "C:\Program Files\Python310\lib\site-packages\yt_dlp\YoutubeDL.py", line 1658, in process_ie_result
    ie_result = self.process_video_result(ie_result, download=download)
  File "C:\Program Files\Python310\lib\site-packages\yt_dlp\YoutubeDL.py", line 2772, in process_video_result
    self.process_info(new_info)
  File "C:\Program Files\Python310\lib\site-packages\yt_dlp\YoutubeDL.py", line 3236, in process_info
    success, real_download = self.dl(temp_filename, info_dict)
  File "C:\Program Files\Python310\lib\site-packages\yt_dlp\YoutubeDL.py", line 2959, in dl
    return fd.download(name, new_info, subtitle)
  File "C:\Program Files\Python310\lib\site-packages\yt_dlp\downloader\common.py", line 444, in download
    ret = self.real_download(filename, info_dict)
  File "C:\Program Files\Python310\lib\site-packages\yt_dlp\downloader\http.py", line 369, in real_download
    for retry in RetryManager(self.params.get('retries'), self.report_retry):
  File "C:\Program Files\Python310\lib\site-packages\yt_dlp\utils.py", line 6023, in __iter__
    self.error_callback(self.error, self.attempt, self.retries)
  File "C:\Program Files\Python310\lib\site-packages\yt_dlp\downloader\common.py", line 389, in report_retry
    RetryManager.report_retry(
  File "C:\Program Files\Python310\lib\site-packages\yt_dlp\utils.py", line 6030, in report_retry
    return error(f'{e}. Giving up after {count - 1} retries') if count > 1 else error(str(e))
  File "C:\Program Files\Python310\lib\site-packages\yt_dlp\downloader\common.py", line 392, in <lambda>
    error=IDENTITY if not fatal else lambda e: self.report_error(f'\r[download] Got error: {e}'),
  File "C:\Program Files\Python310\lib\site-packages\yt_dlp\YoutubeDL.py", line 1012, in report_error
    self.trouble(f'{self._format_err("ERROR:", self.Styles.ERROR)} {message}', *args, **kwargs)
  File "C:\Program Files\Python310\lib\site-packages\yt_dlp\YoutubeDL.py", line 941, in trouble
    tb_data = traceback.format_list(traceback.extract_stack())
```



Discussion:

Resolving patch:
diff --git a/yt_dlp/extractor/freesound.py b/yt_dlp/extractor/freesound.py
--- a/yt_dlp/extractor/freesound.py
+++ b/yt_dlp/extractor/freesound.py
@@ -52,6 +52,7 @@ def _real_extract(self, url):
         tags_str = get_element_by_class('tags', webpage)
         tags = re.findall(r'<a[^>]+>([^<]+)', tags_str) if tags_str else None
 
+        audio_url = re.sub(r'^https?://freesound\.org(https?://)', r'\1', audio_url)
         audio_urls = [audio_url]
 
         LQ_FORMAT = '-lq.mp3'


Test patch: