Repository: streamlink/streamlink

Issue:
hls-audio-select option preclude downloading of default audio
This does not happen in streamlink 0.14.2, but issue is present in git version of streamlink.

I am downloading mlb games using streamlink. There are usually 3 audio streams. One default called "English" and two additional ones called "English radio" and "Natural sound". Without using hls-audio-select it downloads video with default stream as expected. If I add --hls-audio-select "English Radio", it does not download default stream. Using --hls-audio-select "*" downloads English Radio and Natural Sound audio. Default audio is still not present.


Discussion:
probably related to https://github.com/streamlink/streamlink/pull/1926

the default `LANGUAGE="en",NAME="English"` does not have an `URI`
and is most likely coupled with the video URI

I think the issue is that streamlink only accepts the video URI as a video instead of video/audio in this case

```
#EXTM3U
#EXT-X-INDEPENDENT-SEGMENTS
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="aac",LANGUAGE="en",NAME="English",AUTOSELECT=YES,DEFAULT=YES
#EXT-X-MEDIA:TYPE=CLOSED-CAPTIONS,GROUP-ID="cc",LANGUAGE="en",NAME="English",INSTREAM-ID="CC1"
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="aac",NAME="Natural Sound",LANGUAGE="zxx",AUTOSELECT=NO,URI="ballpark_48K/48_complete-trimmed.m3u8"
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="aac",NAME="English Radio",LANGUAGE="en",AUTOSELECT=NO,URI="eng_48K/48_complete-trimmed.m3u8"
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="aac",NAME="Radio Española",LANGUAGE="es",AUTOSELECT=NO,URI="spa_48K/48_complete-trimmed.m3u8"
#EXT-X-STREAM-INF:BANDWIDTH=2120000,RESOLUTION=896x504,FRAME-RATE=29.97,CODECS="mp4a.40.2,avc1.4d001f",CLOSED-CAPTIONS="cc",AUDIO="aac"
1800K/1800_complete-trimmed.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=620000,RESOLUTION=400x224,FRAME-RATE=29.97,CODECS="mp4a.40.2,avc1.4d001f",CLOSED-CAPTIONS="cc",AUDIO="aac"
514K/514_complete-trimmed.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=960000,RESOLUTION=512x288,FRAME-RATE=29.97,CODECS="mp4a.40.2,avc1.4d001f",CLOSED-CAPTIONS="cc",AUDIO="aac"
800K/800_complete-trimmed.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=1400000,RESOLUTION=640x360,FRAME-RATE=29.97,CODECS="mp4a.40.2,avc1.4d001f",CLOSED-CAPTIONS="cc",AUDIO="aac"
1200K/1200_complete-trimmed.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=2950000,RESOLUTION=960x540,FRAME-RATE=29.97,CODECS="mp4a.40.2,avc1.4d001f",CLOSED-CAPTIONS="cc",AUDIO="aac"
2500K/2500_complete-trimmed.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=4160000,RESOLUTION=1280x720,FRAME-RATE=29.97,CODECS="mp4a.40.2,avc1.640028",CLOSED-CAPTIONS="cc",AUDIO="aac"
3500K/3500_complete-trimmed.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=6600000,RESOLUTION=1280x720,FRAME-RATE=59.94,CODECS="mp4a.40.2,avc1.640028",CLOSED-CAPTIONS="cc",AUDIO="aac"
5600K/5600_complete-trimmed.m3u8
#EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=62000,RESOLUTION=400x224,CODECS="avc1.4d001f,mp4a.40.2",URI="514K/514_complete_iframe-trimmed.m3u8"
#EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=295000,RESOLUTION=960x540,CODECS="avc1.4d001f,mp4a.40.2",URI="2500K/2500_complete_iframe-trimmed.m3u8"
```

Resolving patch:
diff --git a/src/streamlink/stream/hls.py b/src/streamlink/stream/hls.py
--- a/src/streamlink/stream/hls.py
+++ b/src/streamlink/stream/hls.py
@@ -295,7 +295,7 @@ class MuxedHLSStream(MuxedStream):
 
     def __init__(self, session, video, audio, force_restart=False, ffmpeg_options=None, **args):
         tracks = [video]
-        maps = ["0:v"]
+        maps = ["0:v?", "0:a?"]
         if audio:
             if isinstance(audio, list):
                 tracks.extend(audio)


Test patch: