1
mirror of https://github.com/nilaoda/N_m3u8DL-CLI synced 2025-09-10 12:40:52 +02:00

Compare commits

..

7 Commits
2.6.0 ... 2.6.3

Author SHA1 Message Date
nilaoda
0f25cc0ae8 v2.6.2 2020-04-17 20:17:56 +08:00
nilaoda
1c6bd688e3 Merge branch 'master' of https://github.com/nilaoda/N_m3u8DL-CLI 2020-04-17 19:25:37 +08:00
nilaoda
480857cc3b v2.6.1 2020-04-17 19:25:32 +08:00
nilaoda
52af9a44a8 Update README.md 2020-03-12 14:39:29 +08:00
nilaoda
84d137b504 Update README.md 2020-03-12 00:50:16 +08:00
nilaoda
a4f1064c81 Update README.md 2020-03-11 21:21:25 +08:00
nilaoda
eac08b12f8 v2.6.0 2020-03-11 18:01:33 +08:00
4 changed files with 20 additions and 44 deletions

View File

@@ -1,5 +1,4 @@
//using DecryptYK;
using System;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
@@ -13,8 +12,6 @@ namespace N_m3u8DL_CLI
{
class Downloader
{
public static bool YouKuAES = false;
private int timeOut = 0;
private int retry = 5;
private int count = 0;
@@ -93,23 +90,11 @@ namespace N_m3u8DL_CLI
byte[] encryptedBuff = Global.HttpDownloadFileToBytes(fileUrl, Headers, TimeOut);
//byte[] encryptedBuff = Global.WebClientDownloadToBytes(fileUrl, Headers);
byte[] decryptBuff = null;
if (YouKuAES)
{
//decryptBuff = DecrypterYK.Decrypt(
decryptBuff = Decrypter.AES128Decrypt(
encryptedBuff,
Convert.FromBase64String(Key),
Decrypter.HexStringToBytes(Iv)
);
}
else
{
decryptBuff = Decrypter.AES128Decrypt(
encryptedBuff,
Convert.FromBase64String(Key),
Decrypter.HexStringToBytes(Iv)
);
}
decryptBuff = Decrypter.AES128Decrypt(
encryptedBuff,
Convert.FromBase64String(Key),
Decrypter.HexStringToBytes(Iv)
);
Global.AppendBytesToFileStreamAndDoNotClose(LiveStream, decryptBuff);
LOGGER.PrintLine("<" + SegIndex + " Complete>\r\n");
LOGGER.WriteLine("<" + SegIndex + " Complete>");
@@ -131,7 +116,7 @@ namespace N_m3u8DL_CLI
//LOGGER.STOPLOG = true; //停止记录日志
}
HLSLiveDownloader.REC_DUR += SegDur;
if (HLSLiveDownloader.REC_DUR_LIMIT != -1 && HLSLiveDownloader.REC_DUR >= HLSLiveDownloader.REC_DUR_LIMIT)
if (HLSLiveDownloader.REC_DUR_LIMIT != -1 && HLSLiveDownloader.REC_DUR >= HLSLiveDownloader.REC_DUR_LIMIT)
{
LOGGER.PrintLine("录制已到达限定长度", LOGGER.Warning);
LOGGER.WriteLine("录制已到达限定长度");
@@ -207,16 +192,7 @@ namespace N_m3u8DL_CLI
try
{
byte[] decryptBuff = null;
if (YouKuAES)
{
//decryptBuff = DecrypterYK.Decrypt(
decryptBuff = Decrypter.AES128Decrypt(
File.ReadAllBytes(fi.FullName),
Convert.FromBase64String(Key),
Decrypter.HexStringToBytes(Iv)
);
}
else if(fileUrl.Contains(".51cto.com/")) //使用AES-128-ECB模式解密
if(fileUrl.Contains(".51cto.com/")) //使用AES-128-ECB模式解密
{
decryptBuff = Decrypter.AES128Decrypt(
fi.FullName,
@@ -244,6 +220,7 @@ namespace N_m3u8DL_CLI
{
LOGGER.PrintLine(ex.Message, LOGGER.Error);
LOGGER.WriteLineError(ex.Message);
Thread.Sleep(3000);
Environment.Exit(-1);
}
}

View File

@@ -30,11 +30,12 @@ namespace N_m3u8DL_CLI
/*===============================================================================*/
static string nowVer = "2.5.7";
static string nowDate = "20200305";
static string nowVer = "2.6.2";
static string nowDate = "20200417";
public static void WriteInit()
{
Console.Clear();
Console.SetCursorPosition(0, 0);
Console.BackgroundColor = ConsoleColor.Blue; //设置背景色
Console.ForegroundColor = ConsoleColor.White; //设置前景色,即字体颜色
Console.WriteLine($"N_m3u8DL-CLI v{nowVer} {nowDate}...");
@@ -684,6 +685,7 @@ namespace N_m3u8DL_CLI
p.StartInfo.RedirectStandardOutput = true; //由调用程序获取输出信息
p.StartInfo.RedirectStandardError = true; //重定向标准错误输出
p.StartInfo.CreateNoWindow = true; //不显示程序窗口
p.StartInfo.StandardErrorEncoding = Encoding.UTF8;
p.Start();//启动程序
p.StandardInput.AutoFlush = true;
//获取cmd窗口的输出信息

View File

@@ -234,14 +234,11 @@ namespace N_m3u8DL_CLI.NetCore
/// 2020年2月23日
/// - 不支持的加密方式将标记为NOTSUPPORTED并强制启用二进制合并
/// - 启用二进制合并的情况下如果m3u8文件中存在map文件则合并为mp4格式
/// - 支持优酷视频解密
/// 2020年2月24日
/// - 直播流录制优化逻辑,避免忙等待
/// - 直播Waiting时不再输出Parser内容
/// - 直播录制的日志记录
/// - 增加新的选项--liveRecDur限制直播录制时长
/// 2020年2月25日
/// - 修复优酷解密过程错误写入冗余数据的bug
/// 2020年2月27日
/// - 细节bug修复
/// 2020年2月28日
@@ -263,6 +260,10 @@ namespace N_m3u8DL_CLI.NetCore
/// - 逻辑优化
/// 2020年3月5日
/// - 增加同名文件合并时共存策略
/// 2020年4月17日
/// - 优化异常捕获
/// - 控制台输出设置为UTF-8
/// - 细节优化
/// </summary>
///
@@ -302,6 +303,7 @@ namespace N_m3u8DL_CLI.NetCore
{
SetConsoleCtrlHandler(cancelHandler, true);
ServicePointManager.ServerCertificateValidationCallback = ValidateServerCertificate;
Console.OutputEncoding = Encoding.GetEncoding("gbk");
try
{
@@ -401,7 +403,6 @@ namespace N_m3u8DL_CLI.NetCore
--liveRecDur HH:MM:SS 直播录制时,达到此长度自动退出软件
--stopSpeed Number 当速度低于此值时,重试(单位为KB/s)
--maxSpeed Number 设置下载速度上限(单位为KB/s)
--enableYouKuAes 使用优酷AES-128解密方案
--enableDelAfterDone 开启下载后删除临时文件夹的功能
--enableMuxFastStart 开启混流mp4的FastStart特性
--enableBinaryMerge 开启二进制合并分片
@@ -445,10 +446,6 @@ namespace N_m3u8DL_CLI.NetCore
{
muxFastStart = true;
}
if (arguments.Has("--enableYouKuAes"))
{
Downloader.YouKuAES = true;
}
if (arguments.Has("--disableIntegrityCheck"))
{
DownloadManager.DisableIntegrityCheck = true;
@@ -740,6 +737,7 @@ namespace N_m3u8DL_CLI.NetCore
LOGGER.WriteLineError("Download Failed");
LOGGER.PrintLine("下载失败, 程序退出", LOGGER.Error);
Console.CursorVisible = true;
Thread.Sleep(3000);
Environment.Exit(-1);
//Console.Write("按任意键继续..."); Console.ReadKey(); return;
}

View File

@@ -26,6 +26,7 @@
一个**简单易用的**m3u8下载器下载地址https://github.com/nilaoda/N_m3u8DL-CLI/releases
支持下载m3u8链接或文件为`mp4`或`ts`格式,并提供丰富的命令行选项。
* **不支持**优酷视频解密
* 支持`AES-128-CBC`加密自动解密
* 支持多线程下载
* 支持下载限速
@@ -39,7 +40,6 @@
* 支持下载外挂字幕轨道、音频轨道
* 支持仅合并为音频
* 自动使用系统代理(可禁止)
* 针对国内视频网站`m3u8`进行了优化
* 提供SimpleG简易的`GUI`生成常用参数
@@ -65,7 +65,6 @@ N_m3u8DL-CLI.exe <URL|JSON|FILE> [OPTIONS]
--liveRecDur HH:MM:SS 直播录制时,达到此长度自动退出软件
--stopSpeed Number 当速度低于此值时,重试(单位为KB/s)
--maxSpeed Number 设置下载速度上限(单位为KB/s)
--enableYouKuAes 使用优酷AES-128解密方案
--enableDelAfterDone 开启下载后删除临时文件夹的功能
--enableMuxFastStart 开启混流mp4的FastStart特性
--enableBinaryMerge 开启二进制合并分片