Repository: streamlink/streamlink

Issue:
plugins.brightcove: regarding type "application/x-mpegURL"
### Checklist

- [X] This is a plugin issue and not a different kind of issue
- [X] [I have read the contribution guidelines](https://github.com/streamlink/streamlink/blob/master/CONTRIBUTING.md#contributing-to-streamlink)
- [X] [I have checked the list of open and recently closed plugin issues](https://github.com/streamlink/streamlink/issues?q=is%3Aissue+label%3A%22plugin+issue%22)
- [X] [I have checked the commit log of the master branch](https://github.com/streamlink/streamlink/commits/master)

### Streamlink version

Latest build from the master branch

### Description

Recent change #4070 to brightcove plugin dropped type "application/x-mpegURL" for HLS playlists. There are several Japanese TV stations that use brightcove to offer the programs, but the type is set to "application/x-mpegURL" thus will not be played after this change.
ex. https://players.brightcove.net/3971130137001/TxOyQoAlL_default/index.html?videoId=6278443298001 (will expire within a week and might be geo-restricted to Japan.)

Would it be possible to add type "application/x-mpegURL" to brightcove plugin?
I'm not thinking of plugin requests because the programs are VODs only.


### Debug log

```text
[cli][debug] OS:         macOS 10.12.6
[cli][debug] Python:     3.9.7
[cli][debug] Streamlink: 2.4.0+60.g6e07f55
[cli][debug] Requests(2.26.0), Socks(1.7.1), Websocket(1.2.1)
[cli][debug] Arguments:
[cli][debug]  url=https://players.brightcove.net/3971130137001/TxOyQoAlL_default/index.html?videoId=6278443298001
[cli][debug]  --loglevel=debug
[cli][info] Found matching plugin brightcove for URL https://players.brightcove.net/3971130137001/TxOyQoAlL_default/index.html?videoId=6278443298001
[plugins.brightcove][debug] Creating player for account 3971130137001 (player_id=TxOyQoAlL_default)
[plugins.brightcove][debug] Finding streams for video: 6278443298001
[plugins.brightcove][debug] Found policy key: BCpkADawqM1F2YPxbuFJzWtohXjxdgDgIJcsnWacQKaAuaf0gyu8yxCQUlca9Dh7V0Uu_8Rt5JUWZTpgcqzD_IT5hRVde8JIR7r1UYR73ne8S9iLSroqTOA2P-jtl2EUw_OrSMAtenvuaXRF
error: No playable streams found on this URL: https://players.brightcove.net/3971130137001/TxOyQoAlL_default/index.html?videoId=6278443298001

With 2.4.0:
[cli][debug] OS:         macOS 10.12.6
[cli][debug] Python:     3.9.7
[cli][debug] Streamlink: 2.4.0
[cli][debug] Requests(2.26.0), Socks(1.7.1), Websocket(1.2.1)
[cli][debug] Arguments:
[cli][debug]  url=https://players.brightcove.net/3971130137001/TxOyQoAlL_default/index.html?videoId=6278443298001
[cli][debug]  --loglevel=debug
[cli][info] Found matching plugin brightcove for URL https://players.brightcove.net/3971130137001/TxOyQoAlL_default/index.html?videoId=6278443298001
[plugins.brightcove][debug] Creating player for account 3971130137001 (player_id=TxOyQoAlL_default)
[plugins.brightcove][debug] Finding streams for video: 6278443298001
[plugins.brightcove][debug] Found policy key: BCpkADawqM1F2YPxbuFJzWtohXjxdgDgIJcsnWacQKaAuaf0gyu8yxCQUlca9Dh7V0Uu_8Rt5JUWZTpgcqzD_IT5hRVde8JIR7r1UYR73ne8S9iLSroqTOA2P-jtl2EUw_OrSMAtenvuaXRF
[utils.l10n][debug] Language code: en_US
[utils.l10n][debug] Language code: en_US
[utils.l10n][debug] Language code: en_US
[stream.hls][debug] Using external audio tracks for stream 270p (language=en, name=en (Main))
[stream.hls][debug] Using external audio tracks for stream 432p (language=en, name=en (Main))
[stream.hls][debug] Using external audio tracks for stream 720p (language=en, name=en (Main))
[stream.hls][debug] Using external audio tracks for stream 1080p (language=en, name=en (Main))
[utils.l10n][debug] Language code: en_US
[stream.hls][debug] Using external audio tracks for stream 270p (language=en, name=en (Main))
[stream.hls][debug] Using external audio tracks for stream 432p (language=en, name=en (Main))
[stream.hls][debug] Using external audio tracks for stream 720p (language=en, name=en (Main))
[stream.hls][debug] Using external audio tracks for stream 1080p (language=en, name=en (Main))
Available streams: 270p_hls, 432p_hls, 720p_hls, 1080p_hls, 270p_alt (worst), 270p, 432p_alt, 432p, 720p_alt, 720p, 1080p_alt, 1080p (best)
```



Discussion:
Can you apply the following diff and see if it works? The content you've linked is geo-blocked and I can't access it. The reason why "application/x-mpegURL" got removed is that I couldn't see it anywhere in the data I've checked. Previously, there was also the URL-ends-with-m3u8 check, which seemed redundant.

```diff
diff --git a/src/streamlink/plugins/brightcove.py b/src/streamlink/plugins/brightcove.py
index 02321ed9..079a2db9 100644
--- a/src/streamlink/plugins/brightcove.py
+++ b/src/streamlink/plugins/brightcove.py
@@ -64,7 +64,7 @@ class BrightcovePlayer:
         )
 
         for source in sources:
-            if source.get("type") == "application/vnd.apple.mpegurl":
+            if source.get("type") in ("application/vnd.apple.mpegurl", "application/x-mpegURL"):
                 yield from HLSStream.parse_variant_playlist(self.session, source.get("src")).items()
 
             elif source.get("container") == "MP4":
```
Thank you for your quick reply. Yes, it worked.

The second test URL https://players.brightcove.net/6093072304001/Ff8ZOjI1z_default/index.html?videoId=6275508909001 in #4070 is returning "application/x-mpegURL", actually.

Resolving patch:
diff --git a/src/streamlink/plugins/brightcove.py b/src/streamlink/plugins/brightcove.py
--- a/src/streamlink/plugins/brightcove.py
+++ b/src/streamlink/plugins/brightcove.py
@@ -64,7 +64,7 @@ def get_streams(self, video_id):
         )
 
         for source in sources:
-            if source.get("type") == "application/vnd.apple.mpegurl":
+            if source.get("type") in ("application/vnd.apple.mpegurl", "application/x-mpegURL"):
                 yield from HLSStream.parse_variant_playlist(self.session, source.get("src")).items()
 
             elif source.get("container") == "MP4":


Test patch: