优化混流顺序和语言识别

This commit is contained in:
nilaoda 2022-08-26 22:20:42 +08:00
parent 8eee867cff
commit c2d7fb9900
5 changed files with 10 additions and 6 deletions

View File

@ -92,6 +92,7 @@ namespace N_m3u8DL_RE.CommandLine
} }
imports.Add(new OutputFile() imports.Add(new OutputFile()
{ {
Index = 999,
FilePath = path, FilePath = path,
LangCode = lang, LangCode = lang,
Description = name Description = name

View File

@ -543,7 +543,7 @@ namespace N_m3u8DL_RE.DownloadManager
//记录所有文件信息 //记录所有文件信息
if (File.Exists(output)) if (File.Exists(output))
OutputFiles.Add(new OutputFile() { FilePath = output, LangCode = streamSpec.Language, Description = streamSpec.Name }); OutputFiles.Add(new OutputFile() { Index = task.Id, FilePath = output, LangCode = streamSpec.Language, Description = streamSpec.Name });
return true; return true;
} }
@ -603,6 +603,7 @@ namespace N_m3u8DL_RE.DownloadManager
//混流 //混流
if (success && DownloaderConfig.MyOptions.MuxAfterDone && OutputFiles.Count > 0) if (success && DownloaderConfig.MyOptions.MuxAfterDone && OutputFiles.Count > 0)
{ {
OutputFiles = OutputFiles.OrderBy(o => o.Index).ToList();
if (DownloaderConfig.MyOptions.MuxImports != null) if (DownloaderConfig.MyOptions.MuxImports != null)
{ {
OutputFiles.AddRange(DownloaderConfig.MyOptions.MuxImports); OutputFiles.AddRange(DownloaderConfig.MyOptions.MuxImports);

View File

@ -8,6 +8,7 @@ namespace N_m3u8DL_RE.Entity
{ {
internal class OutputFile internal class OutputFile
{ {
public required int Index { get; set; }
public required string FilePath { get; set; } public required string FilePath { get; set; }
public string? LangCode { get; set; } public string? LangCode { get; set; }
public string? Description { get; set; } public string? Description { get; set; }

View File

@ -119,6 +119,7 @@ namespace N_m3u8DL_RE
parserConfig.UrlProcessors.Insert(0, new NowehoryzontyUrlProcessor()); parserConfig.UrlProcessors.Insert(0, new NowehoryzontyUrlProcessor());
var url = string.Empty; var url = string.Empty;
//url = "https://play.itunes.apple.com/WebObjects/MZPlay.woa/hls/subscription/playlist.m3u8?cc=US&svcId=tvs.vds.4105&a=1580273278&isExternal=true&brandId=tvs.sbd.4000&id=337246031&l=en-US&aec=UHD&xtrick=true&webbrowser=true"; //啥都有
//url = "https://media.axprod.net/TestVectors/v7-Clear/Manifest_1080p.mpd"; //多音轨多字幕 //url = "https://media.axprod.net/TestVectors/v7-Clear/Manifest_1080p.mpd"; //多音轨多字幕
//url = "https://cmafref.akamaized.net/cmaf/live-ull/2006350/akambr/out.mpd"; //直播 //url = "https://cmafref.akamaized.net/cmaf/live-ull/2006350/akambr/out.mpd"; //直播
//url = "http://playertest.longtailvideo.com/adaptive/oceans_aes/oceans_aes.m3u8"; //url = "http://playertest.longtailvideo.com/adaptive/oceans_aes/oceans_aes.m3u8";
@ -127,7 +128,6 @@ namespace N_m3u8DL_RE
//url = "http://tv-live.ynkmit.com/tv/anning.m3u8?txSecret=7528f35fb4b62bd24d55b891899db68f&txTime=632C8680"; //直播 //url = "http://tv-live.ynkmit.com/tv/anning.m3u8?txSecret=7528f35fb4b62bd24d55b891899db68f&txTime=632C8680"; //直播
//url = "https://rest-as.ott.kaltura.com/api_v3/service/assetFile/action/playManifest/partnerId/147/assetId/1304099/assetType/media/assetFileId/16136929/contextType/PLAYBACK/isAltUrl/False/ks/djJ8MTQ3fMusTFH6PCZpcrfKLQwI-pPm9ex6b6r49wioe32WH2udXeM4reyWIkSDpi7HhvhxBHAHAKiHrcnkmIJQpyAt4MuDBG0ywGQ-jOeqQFcTRQ8BGJGw6g-smSBLwSbo4CCx9M9vWNJX3GkOfhoMAY4yRU-ur3okHiVq1mUJ82XBd_iVqLuzodnc9sJEtcHH0zc5CoPiTq2xor-dq3yDURnZm3isfSN3t9uLIJEW09oE-SJ84DM5GUuFUdbnIV8bdcWUsPicUg-Top1G2D3WcWXq4EvPnwvD8jrC_vsiOpLHf5akAwtdGsJ6__cXUmT7a-QlfjdvaZ5T8UhDLnttHmsxYs2E5c0lh4uOvvJou8dD8iYxUexlPI2j4QUkBRxqOEVLSNV3Y82-5TTRqgnK_uGYXHwk7EAmDws7hbLj2-DJ1heXDcye3OJYdunJgAS-9ma5zmQQNiY_HYh6wj2N1HpCTNAtWWga6R9fC0VgBTZbidW-YwMSGzIvMQfIfWKe15X7Oc_hCs-zGfW9XeRJZrutcWKK_D_HlzpQVBF2vIF3XgaI/a.mpd"; //url = "https://rest-as.ott.kaltura.com/api_v3/service/assetFile/action/playManifest/partnerId/147/assetId/1304099/assetType/media/assetFileId/16136929/contextType/PLAYBACK/isAltUrl/False/ks/djJ8MTQ3fMusTFH6PCZpcrfKLQwI-pPm9ex6b6r49wioe32WH2udXeM4reyWIkSDpi7HhvhxBHAHAKiHrcnkmIJQpyAt4MuDBG0ywGQ-jOeqQFcTRQ8BGJGw6g-smSBLwSbo4CCx9M9vWNJX3GkOfhoMAY4yRU-ur3okHiVq1mUJ82XBd_iVqLuzodnc9sJEtcHH0zc5CoPiTq2xor-dq3yDURnZm3isfSN3t9uLIJEW09oE-SJ84DM5GUuFUdbnIV8bdcWUsPicUg-Top1G2D3WcWXq4EvPnwvD8jrC_vsiOpLHf5akAwtdGsJ6__cXUmT7a-QlfjdvaZ5T8UhDLnttHmsxYs2E5c0lh4uOvvJou8dD8iYxUexlPI2j4QUkBRxqOEVLSNV3Y82-5TTRqgnK_uGYXHwk7EAmDws7hbLj2-DJ1heXDcye3OJYdunJgAS-9ma5zmQQNiY_HYh6wj2N1HpCTNAtWWga6R9fC0VgBTZbidW-YwMSGzIvMQfIfWKe15X7Oc_hCs-zGfW9XeRJZrutcWKK_D_HlzpQVBF2vIF3XgaI/a.mpd";
//url = "https://dash.akamaized.net/dash264/TestCases/2c/qualcomm/1/MultiResMPEG2.mpd"; //url = "https://dash.akamaized.net/dash264/TestCases/2c/qualcomm/1/MultiResMPEG2.mpd";
//url = "http://playertest.longtailvideo.com/adaptive/oceans_aes/oceans_aes.m3u8";
url = "https://cmaf.lln.latam.hbomaxcdn.com/videos/GYPGKMQjoDkVLBQEAAAAo/1/1b5ad5/1_single_J8sExA_1080hi.mpd"; url = "https://cmaf.lln.latam.hbomaxcdn.com/videos/GYPGKMQjoDkVLBQEAAAAo/1/1b5ad5/1_single_J8sExA_1080hi.mpd";
//url = "https://livesim.dashif.org/dash/vod/testpic_2s/multi_subs.mpd"; //ttml + mp4 //url = "https://livesim.dashif.org/dash/vod/testpic_2s/multi_subs.mpd"; //ttml + mp4
//url = "http://media.axprod.net/TestVectors/v6-Clear/Manifest_1080p.mpd"; //vtt + mp4 //url = "http://media.axprod.net/TestVectors/v6-Clear/Manifest_1080p.mpd"; //vtt + mp4

View File

@ -158,7 +158,7 @@ namespace N_m3u8DL_RE.Util
//MAP //MAP
for (int i = 0; i < files.Length; i++) for (int i = 0; i < files.Length; i++)
{ {
command.Append($" -map {i} "); command.Append($" -map {i}:0 ");
} }
if (mp4) if (mp4)
@ -225,10 +225,11 @@ namespace N_m3u8DL_RE.Util
private static void ConvertLangCodeAndDisplayName(OutputFile outputFile) private static void ConvertLangCodeAndDisplayName(OutputFile outputFile)
{ {
if (string.IsNullOrEmpty(outputFile.LangCode)) return; if (string.IsNullOrEmpty(outputFile.LangCode)) return;
outputFile.LangCode = outputFile.LangCode.Split('-')[0];
CultureInfo[] cultures = CultureInfo.GetCultures(CultureTypes.AllCultures); CultureInfo[] cultures = CultureInfo.GetCultures(CultureTypes.AllCultures);
foreach (var c in cultures) foreach (var c in cultures)
{ {
if (outputFile.LangCode.Split('-')[0] == c.TwoLetterISOLanguageName) if (outputFile.LangCode == c.TwoLetterISOLanguageName)
{ {
outputFile.LangCode = c.ThreeLetterISOLanguageName; outputFile.LangCode = c.ThreeLetterISOLanguageName;
if (string.IsNullOrEmpty(outputFile.Description)) if (string.IsNullOrEmpty(outputFile.Description))
@ -240,8 +241,8 @@ namespace N_m3u8DL_RE.Util
} }
//有的播放器不识别zho统一转为chi //有的播放器不识别zho统一转为chi
if (outputFile.LangCode == "zho") outputFile.LangCode = "chi"; if (outputFile.LangCode == "zho") outputFile.LangCode = "chi";
if (outputFile.LangCode == "cmn") outputFile.LangCode = "chi"; else if (outputFile.LangCode == "cmn") outputFile.LangCode = "chi";
if (outputFile.LangCode == "yue") outputFile.LangCode = "chi"; else if (outputFile.LangCode == "yue") outputFile.LangCode = "chi";
} }
} }
} }