优化HLS后缀识别
This commit is contained in:
parent
8cc6507c3f
commit
e25b0d27dc
|
@ -512,8 +512,18 @@ namespace N_m3u8DL_RE.Parser.Extractor
|
||||||
//重新加载m3u8
|
//重新加载m3u8
|
||||||
await LoadM3u8FromUrlAsync(lists[i].Url!);
|
await LoadM3u8FromUrlAsync(lists[i].Url!);
|
||||||
lists[i].Playlist = await ParseListAsync();
|
lists[i].Playlist = await ParseListAsync();
|
||||||
|
if (lists[i].MediaType == MediaType.SUBTITLES)
|
||||||
|
{
|
||||||
|
var a = lists[i].Playlist!.MediaParts.Any(p => p.MediaSegments.Any(m => m.Url.Contains(".ttml")));
|
||||||
|
var b = lists[i].Playlist!.MediaParts.Any(p => p.MediaSegments.Any(m => m.Url.Contains(".vtt") || m.Url.Contains(".webvtt")));
|
||||||
|
if (a) lists[i].Extension = "ttml";
|
||||||
|
if (b) lists[i].Extension = "vtt";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
lists[i].Extension = lists[i].Playlist!.MediaInit != null ? "mp4" : "ts";
|
lists[i].Extension = lists[i].Playlist!.MediaInit != null ? "mp4" : "ts";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue