You've already forked N_m3u8DL-CLI
mirror of
https://github.com/nilaoda/N_m3u8DL-CLI
synced 2025-10-09 00:22:13 +02:00
Compare commits
9 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
8b520d0c19 | ||
![]() |
71d69de51a | ||
![]() |
bc89ead00d | ||
![]() |
ae79d6eb3a | ||
![]() |
96bd8af883 | ||
![]() |
89b1e30e0f | ||
![]() |
7a741359ab | ||
![]() |
564b6ad291 | ||
![]() |
a0fc9404f7 |
@@ -65,12 +65,14 @@ namespace N_m3u8DL_CLI
|
||||
{
|
||||
Global.ShouldStop = true;
|
||||
cts.Cancel();
|
||||
timer.Enabled = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
stopCount = 0;
|
||||
Global.BYTEDOWN = 0;
|
||||
Global.ShouldStop = false;
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -328,7 +330,7 @@ namespace N_m3u8DL_CLI
|
||||
Count++;
|
||||
LOGGER.WriteLine(strings.retryCount + Count + " / " + RetryCount);
|
||||
LOGGER.PrintLine(strings.retryCount + Count + " / " + RetryCount, LOGGER.Warning);
|
||||
Thread.Sleep(6000);
|
||||
Thread.Sleep(3000);
|
||||
DoDownload();
|
||||
}
|
||||
}
|
||||
|
@@ -34,7 +34,7 @@ namespace N_m3u8DL_CLI
|
||||
/*===============================================================================*/
|
||||
static Version ver = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;
|
||||
static string nowVer = $"{ver.Major}.{ver.Minor}.{ver.Build}";
|
||||
static string nowDate = "20210201";
|
||||
static string nowDate = "20210325";
|
||||
public static void WriteInit()
|
||||
{
|
||||
Console.Clear();
|
||||
@@ -104,7 +104,7 @@ namespace N_m3u8DL_CLI
|
||||
public static string GetWebSource(String url, string headers = "", int TimeOut = 60000)
|
||||
{
|
||||
string htmlCode = string.Empty;
|
||||
for (int i = 0; i < 10; i++)
|
||||
for (int i = 0; i < 5; i++)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -209,6 +209,7 @@ namespace N_m3u8DL_CLI
|
||||
}
|
||||
catch (Exception e) //捕获所有异常
|
||||
{
|
||||
LOGGER.WriteLine(e.Message);
|
||||
LOGGER.WriteLineError(e.Message);
|
||||
Thread.Sleep(1000); //1秒后重试
|
||||
continue;
|
||||
@@ -544,6 +545,8 @@ namespace N_m3u8DL_CLI
|
||||
/// </summary>
|
||||
public static void HttpDownloadFile(string url, string path, int timeOut = 20000, string headers = "", long startByte = 0, long expectByte = -1)
|
||||
{
|
||||
int retry = 0;
|
||||
reDownload:
|
||||
try
|
||||
{
|
||||
if (File.Exists(path))
|
||||
@@ -674,6 +677,12 @@ namespace N_m3u8DL_CLI
|
||||
{
|
||||
LOGGER.WriteLineError("DOWN: " + e.Message + " " + url);
|
||||
try { File.Delete(path); } catch (Exception) { }
|
||||
if (retry++ < 3)
|
||||
{
|
||||
Thread.Sleep(1000);
|
||||
LOGGER.WriteLineError($"DOWN: AUTO RETRY {retry}/3 " + url);
|
||||
goto reDownload;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -614,7 +614,7 @@ namespace N_m3u8DL_CLI
|
||||
}
|
||||
|
||||
var content = "";
|
||||
if (videoPath == "" && audioPath != "")
|
||||
if ((videoPath == "" && audioPath != "") || Global.VIDEO_TYPE == "IGNORE")
|
||||
{
|
||||
return audioPath;
|
||||
}
|
||||
|
@@ -171,7 +171,7 @@ namespace N_m3u8DL_CLI
|
||||
}
|
||||
}
|
||||
|
||||
//正对Disney+修正
|
||||
//针对Disney+修正
|
||||
if (m3u8Content.Contains("#EXT-X-DISCONTINUITY") && m3u8Content.Contains("#EXT-X-MAP") && M3u8Url.Contains("media.dssott.com/"))
|
||||
{
|
||||
Regex ykmap = new Regex("#EXT-X-MAP:URI=\\\".*?BUMPER/[\\s\\S]+?#EXT-X-DISCONTINUITY");
|
||||
@@ -181,6 +181,17 @@ namespace N_m3u8DL_CLI
|
||||
}
|
||||
}
|
||||
|
||||
//针对AppleTv修正
|
||||
if (m3u8Content.Contains("#EXT-X-DISCONTINUITY") && m3u8Content.Contains("#EXT-X-MAP") && M3u8Url.Contains(".apple.com/"))
|
||||
{
|
||||
//只取加密部分即可
|
||||
Regex ykmap = new Regex("(#EXT-X-KEY:[\\s\\S]*?)#EXT-X-DISCONTINUITY");
|
||||
if (ykmap.IsMatch(m3u8Content))
|
||||
{
|
||||
m3u8Content = "#EXTM3U\r\n" + ykmap.Match(m3u8Content).Groups[1].Value + "\r\n#EXT-X-ENDLIST";
|
||||
}
|
||||
}
|
||||
|
||||
//如果BaseUrl为空则截取字符串充当
|
||||
if (BaseUrl == "")
|
||||
{
|
||||
|
@@ -330,4 +330,11 @@
|
||||
2021年3月3日
|
||||
- 修复M3U8选择音轨/字幕不生效问题
|
||||
- 外挂音轨时enableAudioOnly可仅下载音频
|
||||
- 移除气球云支持
|
||||
- 移除气球云支持
|
||||
2021年3月15日
|
||||
- 修复enableAudioOnly且下载MPD文件时留下冗余(Audio)文件夹的情况
|
||||
2021年3月22日
|
||||
- 适配AppleTv资源
|
||||
2021年3月25日
|
||||
- 优化下载监控
|
||||
- 为下载分片增加了自动重试机制(3次)
|
@@ -25,6 +25,7 @@
|
||||
|
||||
支持下载m3u8链接或文件为`mp4`或`ts`格式,并提供丰富的命令行选项。
|
||||
* **不支持**优酷视频解密
|
||||
* **不支持**气球云视频解密
|
||||
* 支持`AES-128-CBC`加密自动解密
|
||||
* 支持多线程下载
|
||||
* 支持下载限速
|
||||
@@ -37,7 +38,8 @@
|
||||
* 支持下载路径为网络驱动器的情况
|
||||
* 支持下载外挂字幕轨道、音频轨道
|
||||
* 支持仅合并为音频
|
||||
* 自动使用系统代理(可禁止)
|
||||
* 支持设置特定http代理
|
||||
* 支持自动使用系统代理(默认行为, 可禁止)
|
||||
* 提供SimpleG简易的`GUI`生成常用参数
|
||||
|
||||
|
||||
|
@@ -20,7 +20,7 @@ Supports:
|
||||
* Network driver on Windows OS
|
||||
* Alternative audio/video track
|
||||
* Mux without video track
|
||||
* Auto use system proxy
|
||||
* Costom HTTP proxy or Use system proxy
|
||||
* Optimization for Chinese streaming platform
|
||||
|
||||

|
||||
|
Reference in New Issue
Block a user