Repository: yt-dlp/yt-dlp

Issue:
ShemarooMe
### 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 a bug unrelated to a specific site
- [X] I've verified that I'm running yt-dlp version **2023.03.04** ([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 [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)

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

I have a subscription on this platform. The streams are available, but when select a stream I'm getting a HTTP error.

### Provide verbose output that clearly demonstrates the problem

- [X] Run **your** yt-dlp command with **-vU** flag added (`yt-dlp -vU <your command line>`)
- [ ] 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
yt-dlp -vU -F --cookies-from-browser chrome https://www.shemaroome.com/shows/shravani/shravani-ep-28
[debug] Command-line config: ['-vU', '-F', '--cookies-from-browser', 'chrome', 'https://www.shemaroome.com/shows/shravani/shravani-ep-28']
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version stable@2023.03.04 [392389b7d] (darwin_exe)
[debug] Python 3.8.9 (CPython x86_64 64bit) - macOS-13.4-x86_64-i386-64bit (LibreSSL 2.8.3)
[debug] exe versions: ffmpeg 6.0 (setts), ffprobe 6.0
[debug] Optional libraries: Cryptodome-3.17, brotli-1.0.9, certifi-2022.12.07, mutagen-1.46.0, sqlite3-2.6.0, websockets-10.4
[Cookies] Extracting cookies from chrome
[debug] Extracting cookies from: "/Library/Application Support/Google/Chrome/Default/Cookies"
[debug] using find-generic-password to obtain password from OSX keychain
[Cookies] Extracted 3160 cookies from chrome
[debug] cookie version breakdown: {'v10': 3110, 'other': 0, 'unencrypted': 50}
[debug] Proxy map: {}
[debug] Loaded 1786 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Available version: stable@2023.03.04, Current version: stable@2023.03.04
Current Build Hash: 1f893f5fb990b1df08820be3fac6c46ee93c0b2f797b72a104bbd485139a8e9d
yt-dlp is up to date (stable@2023.03.04)
[ShemarooMe] Extracting URL: https://www.shemaroome.com/shows/shravani/shravani-ep-28
[ShemarooMe] shravani_shravani-ep-28: Downloading webpage
[ShemarooMe] shravani_shravani-ep-28: Downloading JSON metadata
[ShemarooMe] shravani_shravani-ep-28: Downloading m3u8 information
[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
[info] Available formats for shravani_shravani-ep-28:
ID   EXT RESOLUTION │   TBR PROTO │ VCODEC        VBR ACODEC    ABR
───────────────────────────────────────────────────────────────────
552  mp4 640x360    │  552k m3u8  │ avc1.4D401E  552k mp4a.40.2  0k
859  mp4 854x480    │  859k m3u8  │ avc1.4D401E  859k mp4a.40.2  0k
1466 mp4 1280x720   │ 1466k m3u8  │ avc1.4D401F 1466k mp4a.40.2  0k
2743 mp4 1920x1080  │ 2744k m3u8  │ avc1.4D4028 2744k mp4a.40.2  0k
~ % yt-dlp -vU -f 2743 --cookies-from-browser chrome https://www.shemaroome.com/shows/shravani/shravani-ep-28
[debug] Command-line config: ['-vU', '-f', '2743', '--cookies-from-browser', 'chrome', 'https://www.shemaroome.com/shows/shravani/shravani-ep-28']
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version stable@2023.03.04 [392389b7d] (darwin_exe)
[debug] Python 3.8.9 (CPython x86_64 64bit) - macOS-13.4-x86_64-i386-64bit (LibreSSL 2.8.3)
[debug] exe versions: ffmpeg 6.0 (setts), ffprobe 6.0
[debug] Optional libraries: Cryptodome-3.17, brotli-1.0.9, certifi-2022.12.07, mutagen-1.46.0, sqlite3-2.6.0, websockets-10.4
[Cookies] Extracting cookies from chrome
[debug] Extracting cookies from: "/Users/Library/Application Support/Google/Chrome/Default/Cookies"
[debug] using find-generic-password to obtain password from OSX keychain
[Cookies] Extracted 3160 cookies from chrome
[debug] cookie version breakdown: {'v10': 3110, 'other': 0, 'unencrypted': 50}
[debug] Proxy map: {}
[debug] Loaded 1786 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Available version: stable@2023.03.04, Current version: stable@2023.03.04
Current Build Hash: 1f893f5fb990b1df08820be3fac6c46ee93c0b2f797b72a104bbd485139a8e9d
yt-dlp is up to date (stable@2023.03.04)
[ShemarooMe] Extracting URL: https://www.shemaroome.com/shows/shravani/shravani-ep-28
[ShemarooMe] shravani_shravani-ep-28: Downloading webpage
[ShemarooMe] shravani_shravani-ep-28: Downloading JSON metadata
[ShemarooMe] shravani_shravani-ep-28: Downloading m3u8 information
[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
[info] shravani_shravani-ep-28: Downloading 1 format(s): 2743
[debug] Invoking hlsnative downloader on "https://d10ywznpycs72s.cloudfront.net/shemaroo-vod/altplatform/646d0a528530b83c94a82a14/1080/media-1/video.m3u8"
[hlsnative] Downloading m3u8 manifest
ERROR: unable to download video data: HTTP Error 503: Service Temporarily Unavailable
Traceback (most recent call last):
  File "yt_dlp/YoutubeDL.py", line 3247, in process_info
  File "yt_dlp/YoutubeDL.py", line 2970, in dl
  File "yt_dlp/downloader/common.py", line 444, in download
  File "yt_dlp/downloader/hls.py", line 66, in real_download
  File "yt_dlp/YoutubeDL.py", line 3742, in urlopen
  File "urllib/request.py", line 531, in open
  File "urllib/request.py", line 640, in http_response
  File "urllib/request.py", line 569, in error
  File "urllib/request.py", line 502, in _call_chain
  File "urllib/request.py", line 649, in http_error_default
urllib.error.HTTPError: HTTP Error 503: Service Temporarily Unavailable
```



Discussion:

Resolving patch:
diff --git a/yt_dlp/extractor/shemaroome.py b/yt_dlp/extractor/shemaroome.py
--- a/yt_dlp/extractor/shemaroome.py
+++ b/yt_dlp/extractor/shemaroome.py
@@ -73,7 +73,10 @@ def _real_extract(self, url):
         key = bytes_to_intlist(compat_b64decode(data_json['key']))
         iv = [0] * 16
         m3u8_url = unpad_pkcs7(intlist_to_bytes(aes_cbc_decrypt(url_data, key, iv))).decode('ascii')
-        formats, m3u8_subs = self._extract_m3u8_formats_and_subtitles(m3u8_url, video_id, fatal=False, headers={'stream_key': data_json['stream_key']})
+        headers = {'stream_key': data_json['stream_key']}
+        formats, m3u8_subs = self._extract_m3u8_formats_and_subtitles(m3u8_url, video_id, fatal=False, headers=headers)
+        for fmt in formats:
+            fmt['http_headers'] = headers
 
         release_date = self._html_search_regex(
             (r'itemprop="uploadDate">\s*([\d-]+)', r'id="release_date" value="([\d-]+)'),


Test patch: