Repository: yt-dlp/yt-dlp

Issue:
[Twitcasting] Unable to download ongoing twitcasting stream
### 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'm running yt-dlp version **2023.10.13** ([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)
- [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

Japan

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

I threw twitcasting user url  https://twitcasting.tv/icchy8591 (when the page was certainly on live) to download twitcasting streams on live, got an error and that told me to report it. If I try to download archived twitcasting streams, it's done without problem.
I comfirmed it happens with other twitcasting streamer's page.

### 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
# when downloading a twitcasting stream on live, an error raised
> yt-dlp https://twitcasting.tv/icchy8591 -vU
[debug] Command-line config: ['https://twitcasting.tv/icchy8591', '-vU']
[debug] Encodings: locale cp932, fs utf-8, pref cp932, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version stable@2023.10.13 [b634ba742] (pip)
[debug] Python 3.11.2 (CPython AMD64 64bit) - Windows-10-10.0.19045-SP0 (OpenSSL 1.1.1s  1 Nov 2022)
[debug] exe versions: ffmpeg 6.0-essentials_build-www.gyan.dev (setts), ffprobe 6.0-essentials_build-www.gyan.dev
[debug] Optional libraries: Cryptodome-3.18.0, brotli-1.0.9, certifi-2022.12.07, mutagen-1.46.0, sqlite3-3.39.4, websockets-11.0.3
[debug] Proxy map: {}
[debug] Loaded 1890 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Available version: stable@2023.10.13, Current version: stable@2023.10.13
yt-dlp is up to date (stable@2023.10.13)
[TwitCastingLive] Extracting URL: https://twitcasting.tv/icchy8591
[TwitCastingLive] Downloading live video of user icchy8591. Pass "https://twitcasting.tv/icchy8591/show" to download the history
[TwitCastingLive] icchy8591: Downloading webpage
[TwitCastingLive] icchy8591: Downloading live history
[TwitCasting] Extracting URL: https://twitcasting.tv/icchy8591/movie/779552817
[TwitCasting] 779552817: Downloading webpage
[TwitCasting] 779552817: Downloading live info
ERROR: [TwitCasting] 779552817: Failed to get m3u8 playlist; 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
  File "C:\Users\naoto\AppData\Roaming\Python\Python311\site-packages\yt_dlp\extractor\common.py", line 715, in extract
    ie_result = self._real_extract(url)
                ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\naoto\AppData\Roaming\Python\Python311\site-packages\yt_dlp\extractor\twitcasting.py", line 171, in _real_extract
    raise ExtractorError('Failed to get m3u8 playlist')

# when downloading an archived twitcasting stream, done properly
> yt-dlp https://twitcasting.tv/icchy8591/movie/779446556 -vU
[debug] Command-line config: ['https://twitcasting.tv/icchy8591/movie/779446556', '-vU']
[debug] Encodings: locale cp932, fs utf-8, pref cp932, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version stable@2023.10.13 [b634ba742] (pip)
[debug] Python 3.11.2 (CPython AMD64 64bit) - Windows-10-10.0.19045-SP0 (OpenSSL 1.1.1s  1 Nov 2022)
[debug] exe versions: ffmpeg 6.0-essentials_build-www.gyan.dev (setts), ffprobe 6.0-essentials_build-www.gyan.dev
[debug] Optional libraries: Cryptodome-3.18.0, brotli-1.0.9, certifi-2022.12.07, mutagen-1.46.0, sqlite3-3.39.4, websockets-11.0.3
[debug] Proxy map: {}
[debug] Loaded 1890 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Available version: stable@2023.10.13, Current version: stable@2023.10.13
yt-dlp is up to date (stable@2023.10.13)
[TwitCasting] Extracting URL: https://twitcasting.tv/icchy8591/movie/779446556
[TwitCasting] 779446556: Downloading webpage
[TwitCasting] 779446556: Downloading live info
[TwitCasting] 779446556: Downloading m3u8 information
[debug] Formats sorted by: hasvid, ie_pref, lang, quality, res, fps, hdr:12(7), vcodec:vp9.2(10), channels, acodec, size, br, asr, proto, vext, aext, hasaud, source, id
[debug] Default format spec: bestvideo*+bestaudio/best
[info] 779446556: Downloading 1 format(s): 829
[debug] Invoking hlsnative downloader on "https://dl193234.twitcasting.tv/tc.vod.v2/v1/streams/779446556.0.2.1.1698095125/hls/v0/media.m3u8"
[hlsnative] Downloading m3u8 manifest
[hlsnative] Total fragments: 503
[download] Destination: 10⧸24 [779446556].mp4
[debug] File locking is not supported. Proceeding without locking
[download] 100% of  399.22MiB in 00:01:20 at 4.94MiB/s
[debug] ffprobe command line: ffprobe -hide_banner -show_format -show_streams -print_format json "file:10⧸24 [779446556].mp4"
```



Discussion:

Resolving patch:
diff --git a/yt_dlp/extractor/twitcasting.py b/yt_dlp/extractor/twitcasting.py
--- a/yt_dlp/extractor/twitcasting.py
+++ b/yt_dlp/extractor/twitcasting.py
@@ -142,7 +142,7 @@ def _real_extract(self, url):
             'https://twitcasting.tv/streamserver.php?target=%s&mode=client' % uploader_id, video_id,
             'Downloading live info', fatal=False)
 
-        is_live = 'data-status="online"' in webpage
+        is_live = any(f'data-{x}' in webpage for x in ['is-onlive="true"', 'live-type="live"', 'status="online"'])
         if not traverse_obj(stream_server_data, 'llfmp4') and is_live:
             self.raise_login_required(method='cookies')
 


Test patch: