When decoding m3u8 file for an audio playlist, regex.Match throws an ArgumentNullException
andriess opened this issue · 2 comments
This might or might not be a bug, I'm not too familiar with the HLS spec. I'm trying to grab the following root m3u8:
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-STREAM-INF:BANDWIDTH=97341,CODECS="mp4a.40.5"
https://aradiostation.com/hls-radio/gold/chunklist.m3u8
In the Playlist document
the code always expects the RESOLUTION uri token to be present (Link to check). In this case the m3u8 does not have it. Is this radio station using a non compliant format or does the HLS grabber always assume that it tries to grab video instead of audio only.
Or am I just doing something wrong :')
Stack trace:
at System.Text.RegularExpressions.ThrowHelper.ThrowArgumentNullException(ExceptionArgument arg)
at System.Text.RegularExpressions.Regex.Match(String input)
at DotNetTools.SharpGrabber.Hls.PlaylistDocument.ParseUriToken(LoadContext context)
at DotNetTools.SharpGrabber.Hls.PlaylistDocument.LoadAsync(PlaylistTokenizer tokenizer)
at DotNetTools.SharpGrabber.Hls.HlsGrabber.InternalGrabAsync(Uri uri, CancellationToken cancellationToken, GrabOptions options, IProgress`1 progress)
at DotNetTools.SharpGrabber.GrabberBase.GrabAsync(Uri uri, CancellationToken cancellationToken, GrabOptions options, IProgress`1 progress)
at DotNetTools.SharpGrabber.MultiGrabber.InternalGrabAsync(IEnumerable`1 candidateGrabbers, Uri uri, CancellationToken cancellationToken, GrabOptions options, IProgress`1 progress)
I think you're right. I've never tested it with audio and naturally I might have missed this. I'm marking this as a bug.
This might or might not be a bug, I'm not too familiar with the HLS spec. I'm trying to grab the following root m3u8:
#EXTM3U #EXT-X-VERSION:3 #EXT-X-STREAM-INF:BANDWIDTH=97341,CODECS="mp4a.40.5" https://aradiostation.com/hls-radio/gold/chunklist.m3u8
In the
Playlist document
the code always expects the RESOLUTION uri token to be present (Link to check). In this case the m3u8 does not have it. Is this radio station using a non compliant format or does the HLS grabber always assume that it tries to grab video instead of audio only.Or am I just doing something wrong :')
Stack trace:
at System.Text.RegularExpressions.ThrowHelper.ThrowArgumentNullException(ExceptionArgument arg) at System.Text.RegularExpressions.Regex.Match(String input) at DotNetTools.SharpGrabber.Hls.PlaylistDocument.ParseUriToken(LoadContext context) at DotNetTools.SharpGrabber.Hls.PlaylistDocument.LoadAsync(PlaylistTokenizer tokenizer) at DotNetTools.SharpGrabber.Hls.HlsGrabber.InternalGrabAsync(Uri uri, CancellationToken cancellationToken, GrabOptions options, IProgress`1 progress) at DotNetTools.SharpGrabber.GrabberBase.GrabAsync(Uri uri, CancellationToken cancellationToken, GrabOptions options, IProgress`1 progress) at DotNetTools.SharpGrabber.MultiGrabber.InternalGrabAsync(IEnumerable`1 candidateGrabbers, Uri uri, CancellationToken cancellationToken, GrabOptions options, IProgress`1 progress)
NuGet package updated.
https://github.com/dotnettools/SharpGrabber/wiki/04-BlackWidow#installation