Repository: yt-dlp
Issue: Douyu live downloader appears to use the wrong URL
Labels: site-bug,triage

### DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE

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

### Checklist

- [X] I'm reporting that yt-dlp is broken on a **supported** site
- [X] I've verified that I have **updated yt-dlp to nightly or master** ([update instructions](https://github.com/yt-dlp/yt-dlp#update-channels))
- [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 [known issues](https://github.com/yt-dlp/yt-dlp/issues/3766) and 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

Sweden

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

Downloading livestreams from douyu doesn't work and this appears to be because it's using the wrong URL. yt-dlp attempts to get the livestream from "https://wsa.douyucdn.cn/..." which results in a 403 response but the browser seems to use "https://wsa.douyucdn.cn/live/...".

### 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] If using API, add `'verbose': True` to `YoutubeDL` params instead
- [X] Copy the WHOLE output (starting with `[debug] Command-line config`) and insert it below

### Complete Verbose Output

```shell
[debug] Command-line config: ['-vU', 'https://www.douyu.com/252140']
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version nightly@2024.12.26.232815 from yt-dlp/yt-dlp-nightly-builds [0b6b7742c] (zip)
[debug] Python 3.13.1 (CPython x86_64 64bit) - Linux-6.12.7-arch1-1-x86_64-with-glibc2.40 (OpenSSL 3.4.0 22 Oct 2024, glibc 2.40)
[debug] exe versions: ffmpeg 7.1 (setts), ffprobe 7.1, phantomjs 2.1.1
[debug] Optional libraries: certifi-2024.12.14, requests-2.32.3, sqlite3-3.47.2, urllib3-2.3.0
[debug] Proxy map: {}
[debug] Request Handlers: urllib, requests
[debug] Loaded 1837 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp-nightly-builds/releases/latest
Latest version: nightly@2024.12.26.232815 from yt-dlp/yt-dlp-nightly-builds
yt-dlp is up to date (nightly@2024.12.26.232815 from yt-dlp/yt-dlp-nightly-builds)
[DouyuTV] Extracting URL: https://www.douyu.com/252140
[DouyuTV] 252140: Downloading webpage
[DouyuTV] 252140: Downloading room info
WARNING: [DouyuTV] Unable to download JSON metadata: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
WARNING: [DouyuTV] unable to extract JS sign func; 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
[DouyuTV] 252140: Getting signing script
[debug] Loading douyu.crypto-js-md5 from cache
[DouyuTV] 252140: Executing JS signing script
[debug] [DouyuTV] PhantomJS command line: phantomjs --ssl-protocol=any /tmp/tmp3y6ybflu
[DouyuTV] 252140: Downloading livestream format
[DouyuTV] 252140: Downloading livestream format 4
[DouyuTV] 252140: Downloading livestream format 3
[DouyuTV] 252140: Downloading livestream format 2
WARNING: Extractor failed to obtain "title". Creating a generic title instead
[debug] Formats sorted by: hasvid, ie_pref, lang, quality, res, fps, hdr:12(7), vcodec, channels, acodec, size, br, asr, proto, vext, aext, hasaud, source, id
[debug] Default format spec: best/bestvideo+bestaudio
[info] 252140: Downloading 1 format(s): 0
[debug] Invoking http downloader on "https://wsa.douyucdn.cn/252140rz7aIq14cx.flv?wsAuth=c015a434ab0e2ef168f7fc9e259d241b&token=web-h5-0-252140-4a0485261c3115820b2589f84fb2a8d2a9689931ae6e6381&logo=0&expire=0&did=41aa1c3a8f6f4efd8693591266b377e3&pt=2&st=0&sid=406802186&mcid2=0&origin=tct&fcdn=ws&fo=0&mix=0&isp="
ERROR: unable to download video data: HTTP Error 403: Forbidden
Traceback (most recent call last):
  File "/home/ant/Downloads/yt-dlp/./yt-dlp/yt_dlp/YoutubeDL.py", line 3489, in process_info
    success, real_download = self.dl(temp_filename, info_dict)
                             ~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ant/Downloads/yt-dlp/./yt-dlp/yt_dlp/YoutubeDL.py", line 3209, in dl
    return fd.download(name, new_info, subtitle)
           ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ant/Downloads/yt-dlp/./yt-dlp/yt_dlp/downloader/common.py", line 464, in download
    ret = self.real_download(filename, info_dict)
  File "/home/ant/Downloads/yt-dlp/./yt-dlp/yt_dlp/downloader/http.py", line 367, in real_download
    establish_connection()
    ~~~~~~~~~~~~~~~~~~~~^^
  File "/home/ant/Downloads/yt-dlp/./yt-dlp/yt_dlp/downloader/http.py", line 118, in establish_connection
    ctx.data = self.ydl.urlopen(request)
               ~~~~~~~~~~~~~~~~^^^^^^^^^
  File "/home/ant/Downloads/yt-dlp/./yt-dlp/yt_dlp/YoutubeDL.py", line 4172, in urlopen
    return self._request_director.send(req)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^
  File "/home/ant/Downloads/yt-dlp/./yt-dlp/yt_dlp/networking/common.py", line 117, in send
    response = handler.send(request)
  File "/home/ant/Downloads/yt-dlp/./yt-dlp/yt_dlp/networking/_helper.py", line 208, in wrapper
    return func(self, *args, **kwargs)
  File "/home/ant/Downloads/yt-dlp/./yt-dlp/yt_dlp/networking/common.py", line 340, in send
    return self._send(request)
           ~~~~~~~~~~^^^^^^^^^
  File "/home/ant/Downloads/yt-dlp/./yt-dlp/yt_dlp/networking/_requests.py", line 365, in _send
    raise HTTPError(res, redirect_loop=max_redirects_exceeded)
yt_dlp.networking.exceptions.HTTPError: HTTP Error 403: Forbidden
```