You've already forked N_m3u8DL-CLI
mirror of
https://github.com/nilaoda/N_m3u8DL-CLI
synced 2025-09-07 02:45:59 +02:00
Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
580c374d7b | ||
![]() |
b58dc5d8e0 | ||
![]() |
f50cf7862a | ||
![]() |
fdad68d483 | ||
![]() |
d7aaa5323b | ||
![]() |
6c2e13b800 |
@@ -409,7 +409,8 @@ namespace N_m3u8DL_CLI
|
||||
//检测是否为MPEG-TS封装,不是的话就转换为TS封装
|
||||
foreach (string s in Global.GetFiles(DownDir + "\\Part_0", ".ts"))
|
||||
{
|
||||
if (!FFmpeg.CheckMPEGTS(s))
|
||||
//跳过有MAP的情况
|
||||
if (!File.Exists(DownDir + "\\Part_0\\!MAP.ts") && !FFmpeg.CheckMPEGTS(s))
|
||||
{
|
||||
//转换
|
||||
LOGGER.PrintLine("将文件转换到 MPEG-TS 封装:" + Path.GetFileName(s));
|
||||
@@ -556,7 +557,8 @@ namespace N_m3u8DL_CLI
|
||||
//检测是否为MPEG-TS封装,不是的话就转换为TS封装
|
||||
foreach (string s in Global.GetFiles(DownDir, ".ts"))
|
||||
{
|
||||
if (!FFmpeg.CheckMPEGTS(s))
|
||||
//跳过有MAP的情况
|
||||
if (!File.Exists(DownDir + "\\!MAP.ts") && !FFmpeg.CheckMPEGTS(s))
|
||||
{
|
||||
//转换
|
||||
LOGGER.PrintLine("将文件转换到 MPEG-TS 封装:" + Path.GetFileName(s));
|
||||
@@ -573,7 +575,7 @@ namespace N_m3u8DL_CLI
|
||||
FFmpeg.Merge(Global.GetFiles(DownDir, ".ts"), MuxFormat, MuxFastStart);
|
||||
else
|
||||
{
|
||||
JObject json = JObject.Parse(MuxSetJson);
|
||||
JObject json = JObject.Parse(File.ReadAllText(MuxSetJson, Encoding.UTF8));
|
||||
string muxFormat = json["muxFormat"].Value<string>();
|
||||
bool fastStart = Convert.ToBoolean(json["fastStart"].Value<string>());
|
||||
string poster = json["poster"].Value<string>();
|
||||
|
@@ -30,7 +30,7 @@ namespace N_m3u8DL_CLI
|
||||
|
||||
|
||||
/*===============================================================================*/
|
||||
static string nowVer = "2.4.3";
|
||||
static string nowVer = "2.4.5";
|
||||
static string nowDate = "20191218";
|
||||
public static void WriteInit()
|
||||
{
|
||||
@@ -58,7 +58,10 @@ namespace N_m3u8DL_CLI
|
||||
//尝试下载新版本(去码云)
|
||||
string url = $"https://gitee.com/nilaoda/N_m3u8DL-CLI/raw/master/N_m3u8DL-CLI_v{latestVer}.exe";
|
||||
if (File.Exists(Path.Combine(Path.GetDirectoryName(Process.GetCurrentProcess().MainModule.FileName), $"N_m3u8DL-CLI_v{latestVer}.exe")))
|
||||
{
|
||||
Console.Title = $"检测到更新,版本:{latestVer}! 新版下载成功,请您自行替换";
|
||||
return;
|
||||
}
|
||||
HttpDownloadFile(url, Path.Combine(Path.GetDirectoryName(Process.GetCurrentProcess().MainModule.FileName), $"N_m3u8DL-CLI_v{latestVer}.exe"));
|
||||
if (File.Exists(Path.Combine(Path.GetDirectoryName(Process.GetCurrentProcess().MainModule.FileName), $"N_m3u8DL-CLI_v{latestVer}.exe")))
|
||||
Console.Title = $"检测到更新,版本:{latestVer}! 新版下载成功,请您自行替换";
|
||||
|
@@ -48,6 +48,8 @@ namespace N_m3u8DL_CLI
|
||||
private static string durEnd = "";
|
||||
//是否自动清除优酷广告分片
|
||||
private static bool delAd = true;
|
||||
//标记是否已清除优酷广告分片
|
||||
private static bool hasAd = false;
|
||||
|
||||
public string BaseUrl { get => baseUrl; set => baseUrl = value; }
|
||||
public string M3u8Url { get => m3u8Url; set => m3u8Url = value; }
|
||||
@@ -202,7 +204,16 @@ namespace N_m3u8DL_CLI
|
||||
//解析不连续标记,需要单独合并(timestamp不同)
|
||||
else if (line.StartsWith(HLSTags.ext_x_discontinuity))
|
||||
{
|
||||
if (segments.Count > 1)
|
||||
//修复优酷去除广告后的遗留问题
|
||||
if (hasAd && parts.Count > 0)
|
||||
{
|
||||
segments = (JArray)parts[parts.Count - 1];
|
||||
parts.RemoveAt(parts.Count - 1);
|
||||
hasAd = false;
|
||||
continue;
|
||||
}
|
||||
//常规情况的#EXT-X-DISCONTINUITY标记,新建part
|
||||
if (!hasAd && segments.Count > 1)
|
||||
{
|
||||
parts.Add(segments);
|
||||
segments = new JArray();
|
||||
@@ -309,10 +320,20 @@ namespace N_m3u8DL_CLI
|
||||
segments.Add(segInfo);
|
||||
segInfo = new JObject();
|
||||
//优酷的广告分段则清除此分片
|
||||
if (DelAd && segUrl.Contains("ccode") && segUrl.Contains("/ad/") && segUrl.Contains("duration"))
|
||||
//需要注意,遇到广告说明程序对上文的#EXT-X-DISCONTINUITY做出的动作是不必要的,
|
||||
//其实上下文是同一种编码,需要恢复到原先的part上
|
||||
if (DelAd && segUrl.Contains("ccode=") && segUrl.Contains("/ad/") && segUrl.Contains("duration="))
|
||||
{
|
||||
segments.RemoveAt(segments.Count - 1);
|
||||
segIndex--;
|
||||
hasAd = true;
|
||||
}
|
||||
//优酷广告(4K分辨率测试)
|
||||
if (DelAd && segUrl.Contains("ccode=0902") && segUrl.Contains("duration="))
|
||||
{
|
||||
segments.RemoveAt(segments.Count - 1);
|
||||
segIndex--;
|
||||
hasAd = true;
|
||||
}
|
||||
expectSegment = false;
|
||||
}
|
||||
|
@@ -210,6 +210,9 @@ namespace N_m3u8DL_CLI.NetCore
|
||||
/// 2019年12月18日
|
||||
/// - 修复m3u8解析bug导致的无法合并问题
|
||||
/// - 增加杜比视界识别场景
|
||||
/// - 修复part大于1时读取json混流文件的严重错误
|
||||
/// - 自动去除优酷的广告分片及前情提要
|
||||
/// - 修复腾讯视频HDR10视频下载合并异常问题
|
||||
/// </summary>
|
||||
///
|
||||
|
||||
|
@@ -8,6 +8,8 @@
|
||||
╚═╝ ╚═══╝╚══════╝╚═╝ ╚═╝╚═════╝ ╚═════╝ ╚════╝ ╚═════╝ ╚══════╝ ╚═════╝╚══════╝╚═╝
|
||||
|
||||
```
|
||||
# [ENGLISH VERSION](https://github.com/nilaoda/N_m3u8DL-CLI/blob/master/README_ENG.md)
|
||||
|
||||
# 关于开源
|
||||
本项目已与2019年10月9日开源,代码风格和管理真的很差劲,各取所需就好。
|
||||
|
||||
|
62
README_ENG.md
Normal file
62
README_ENG.md
Normal file
@@ -0,0 +1,62 @@
|
||||
```
|
||||
|
||||
███╗ ██╗ ███╗ ███╗██████╗ ██╗ ██╗ █████╗ ██████╗ ██╗ ██████╗██╗ ██╗
|
||||
████╗ ██║ ████╗ ████║╚════██╗██║ ██║██╔══██╗██╔══██╗██║ ██╔════╝██║ ██║
|
||||
██╔██╗ ██║ ██╔████╔██║ █████╔╝██║ ██║╚█████╔╝██║ ██║██║█████╗██║ ██║ ██║
|
||||
██║╚██╗██║ ██║╚██╔╝██║ ╚═══██╗██║ ██║██╔══██╗██║ ██║██║╚════╝██║ ██║ ██║
|
||||
██║ ╚████║███████╗██║ ╚═╝ ██║██████╔╝╚██████╔╝╚█████╔╝██████╔╝███████╗ ╚██████╗███████╗██║
|
||||
╚═╝ ╚═══╝╚══════╝╚═╝ ╚═╝╚═════╝ ╚═════╝ ╚════╝ ╚═════╝ ╚══════╝ ╚═════╝╚══════╝╚═╝
|
||||
|
||||
```
|
||||
This is a m3u8 downloader.
|
||||
## Summary
|
||||
Supports:
|
||||
* Auto deceypt for `AES-128`
|
||||
* `Master List`
|
||||
* Live stream recording(`BETA`)
|
||||
* `Dolby Vision` from IQiYi, YouKu, Tencent
|
||||
* Customize HTTP headers
|
||||
* Auto merge clips(Binary or ffmpeg)
|
||||
* Select save clip by `time code` or `index`
|
||||
* Network driver on Windows OS
|
||||
* Alternative audio/video track
|
||||
* Mux without video track
|
||||
* Auto use system proxy
|
||||
* Optimization for Chinese streaming platform
|
||||
|
||||

|
||||
|
||||
## GUI
|
||||
* Easy-to-use `GUI`
|
||||
|
||||
## Options
|
||||
```
|
||||
N_m3u8DL-CLI.exe <URL|JSON|FILE> [OPTIONS]
|
||||
|
||||
--workDir Directory Set work dir (Video will be here)
|
||||
--saveName Filename Set save name(Exclude extention)
|
||||
--baseUrl BaseUrl Set Baseurl
|
||||
--headers headers Set HTTP headers,format: key:value user | split all key&value
|
||||
--maxThreads Thread Set max thread(default: 32)
|
||||
--minThreads Thread Set min thread(default: 16)
|
||||
--retryCount Count Set retry times(default: 15)
|
||||
--timeOut Sec Set timeout for http request(second,default: 10)
|
||||
--muxSetJson File Set a json file for mux
|
||||
--useKeyFile File Use 16 bytes file as KEY for AES-128 decryption
|
||||
--useKeyBase64 Base64String Use Base64 String as KEY for AES-128 decryption
|
||||
--downloadRange Range Set range for a video
|
||||
--stopSpeed Number Speed below this, retry(KB/s)
|
||||
--maxSpeed Number Set max download speed(KB/s)
|
||||
--enableDelAfterDone Enable delete clips after download completed
|
||||
--enableMuxFastStart Enable fast start for mp4
|
||||
--enableBinaryMerge Enable use binary merge instead ffmpeg
|
||||
--enableParseOnly Enable parse mode
|
||||
--enableAudioOnly Enable only audio track when mux use ffmpeg
|
||||
--disableDateInfo Disable write date info when mux use ffmpeg
|
||||
--noMerge Disable auto merge
|
||||
--noProxy Disable use system proxy
|
||||
--disableIntegrityCheck Disable integrity check
|
||||
```
|
||||
|
||||
## Document
|
||||
https://nilaoda.github.io/N_m3u8DL-CLI/
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user