1
mirror of https://github.com/nilaoda/N_m3u8DL-CLI synced 2025-09-13 22:40:51 +02:00

Compare commits

...

11 Commits

Author SHA1 Message Date
nilaoda
985f6e57c3 Fix #785 2023-06-03 17:30:51 +08:00
nilaoda
d9eea2e80f 修正Part分割 2023-03-25 23:17:47 +08:00
nilaoda
0cc4a87a4c Update FUNDING.yml 2022-11-17 23:10:19 +08:00
nilaoda
66d0864d72 update discord link 2022-10-10 13:44:53 +08:00
nilaoda
965ac2b513 update discord link 2022-10-10 13:43:58 +08:00
nilaoda
a95334ec57 fix #718 2022-09-05 21:55:09 +08:00
nilaoda
e05a21a034 Merge pull request #714 from xifangczy/master
修复 录制间隔负数导致错误
2022-08-19 20:12:37 +08:00
O2bmm
13cd5d0870 修复 录制间隔负数导致错误 2022-08-19 19:38:03 +08:00
nilaoda
8d9ad7af41 Update README.md 2022-07-20 21:44:36 +08:00
nilaoda
0a11816acf fix #708 2022-07-20 21:34:18 +08:00
nilaoda
81ba4ff7d3 Create FUNDING.yml 2022-07-14 20:08:45 +08:00
6 changed files with 60 additions and 23 deletions

13
.github/FUNDING.yml vendored Normal file
View File

@@ -0,0 +1,13 @@
# These are supported funding model platforms
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
custom: ['https://nilaoda.github.io/N_m3u8DL-CLI/source/images/alipay.png','https://www.buymeacoffee.com/nilaoda']

View File

@@ -61,7 +61,7 @@ namespace N_m3u8DL_CLI
string m3u8Url = initJson["m3u8"].Value<string>();
targetduration = initJson["m3u8Info"]["targetDuration"].Value<double>();
TotalDuration = initJson["m3u8Info"]["totalDuration"].Value<double>();
timer.Interval = (TotalDuration - targetduration) * 1000;//设置定时器运行间隔
timer.Interval = Math.Abs(TotalDuration - targetduration) * 1000;//设置定时器运行间隔
if (timer.Interval <= 1000) timer.Interval = 10000;
JArray lastSegments = JArray.Parse(initJson["m3u8Info"]["segments"][0].ToString().Trim()); //上次的分段,用于比对新分段
ArrayList tempList = new ArrayList(); //所有待下载的列表
@@ -79,6 +79,7 @@ namespace N_m3u8DL_CLI
}
Parser parser = new Parser();
parser.Headers = Headers;
parser.DownDir = Path.GetDirectoryName(jsonFile);
parser.M3u8Url = m3u8Url;
parser.LiveStream = true;

View File

@@ -563,12 +563,19 @@ namespace N_m3u8DL_CLI
Console.Write("".PadRight(13) + "Enter Numbers Separated By A Space: ");
var input = Console.ReadLine();
cursorIndex += 2;
for (int i = startCursorIndex; i < cursorIndex; i++)
try
{
Console.SetCursorPosition(0, i);
Console.Write("".PadRight(300));
for (int i = startCursorIndex; i < cursorIndex; i++)
{
Console.SetCursorPosition(0, i);
Console.Write("".PadRight(300));
}
Console.SetCursorPosition(0, startCursorIndex);
}
catch (Exception)
{
;
}
Console.SetCursorPosition(0, startCursorIndex);
if (!string.IsNullOrEmpty(input))
{
bestVideo = new Dictionary<string, dynamic>() { ["Tbr"] = 0 };

View File

@@ -327,7 +327,7 @@ namespace N_m3u8DL_CLI
continue;
}
//常规情况的#EXT-X-DISCONTINUITY标记新建part
if (!hasAd && segments.Count > 1)
if (!hasAd && segments.Count >= 1)
{
parts.Add(segments);
segments = new JArray();
@@ -362,20 +362,20 @@ namespace N_m3u8DL_CLI
{
string[] tmp = line.Replace(HLSTags.extinf + ":", "").Split(',');
segDuration = Convert.ToDouble(tmp[0]);
segInfo.Add("index", segIndex);
segInfo.Add("method", m3u8CurrentKey[0]);
segInfo["index"] = segIndex;
segInfo["method"] = m3u8CurrentKey[0];
//是否有加密有的话写入KEY和IV
if (m3u8CurrentKey[0] != "NONE")
{
segInfo.Add("key", m3u8CurrentKey[1]);
segInfo["key"] = m3u8CurrentKey[1];
//没有读取到IV自己生成
if (m3u8CurrentKey[2] == "")
segInfo.Add("iv", "0x" + Convert.ToString(segIndex, 16).PadLeft(32, '0'));
segInfo["iv"] = "0x" + Convert.ToString(segIndex, 16).PadLeft(32, '0');
else
segInfo.Add("iv", m3u8CurrentKey[2]);
segInfo["iv"] = m3u8CurrentKey[2];
}
totalDuration += segDuration;
segInfo.Add("duration", segDuration);
segInfo["duration"] = segDuration;
expectSegment = true;
segIndex++;
}
@@ -636,12 +636,19 @@ namespace N_m3u8DL_CLI
Console.Write("".PadRight(13) + "Enter Number: ");
var input = Console.ReadLine();
cursorIndex += 2;
for (int i = startCursorIndex; i < cursorIndex; i++)
try
{
Console.SetCursorPosition(0, i);
Console.Write("".PadRight(300));
for (int i = startCursorIndex; i < cursorIndex; i++)
{
Console.SetCursorPosition(0, i);
Console.Write("".PadRight(300));
}
Console.SetCursorPosition(0, startCursorIndex);
}
catch (Exception)
{
;
}
Console.SetCursorPosition(0, startCursorIndex);
audioUrl = MEDIA_AUDIO_GROUP[bestUrlAudio][int.Parse(input)].Uri;
}
}
@@ -666,12 +673,19 @@ namespace N_m3u8DL_CLI
Console.Write("".PadRight(13) + "Enter Number: ");
var input = Console.ReadLine();
cursorIndex += 2;
for (int i = startCursorIndex; i < cursorIndex; i++)
try
{
Console.SetCursorPosition(0, i);
Console.Write("".PadRight(300));
for (int i = startCursorIndex; i < cursorIndex; i++)
{
Console.SetCursorPosition(0, i);
Console.Write("".PadRight(300));
}
Console.SetCursorPosition(0, startCursorIndex);
}
catch (Exception)
{
;
}
Console.SetCursorPosition(0, startCursorIndex);
subUrl = MEDIA_SUB_GROUP[bestUrlSub][int.Parse(input)].Uri;
}
}

View File

@@ -22,7 +22,9 @@
本项目已于2019年10月9日开源采用MIT许可证各取所需。
# 关于跨平台
未来可期
* N_m3u8DL-CLI `(本项目)`: 基于 .NET Framework, 不具备跨平台能力. 目前已进入维护阶段.
* [N_m3u8DL-RE](https://github.com/nilaoda/N_m3u8DL-RE) : 抛弃历史包袱从零做起, 支持Win/Linux/Mac, 更丰富的功能会在这里出现 ...
# N_m3u8DL-CLI
一个**简单易用的**m3u8下载器下载地址https://github.com/nilaoda/N_m3u8DL-CLI/releases
@@ -122,7 +124,7 @@ URI解码结果
https://nilaoda.github.io/N_m3u8DL-CLI/
# 聊聊
https://discord.gg/W5tvcRJDPs
https://discord.gg/SSGwKrjC44
# 赞赏
![Wow](https://nilaoda.github.io/N_m3u8DL-CLI/source/images/alipay.png)

View File

@@ -101,4 +101,4 @@ URI Decode Result
https://nilaoda.github.io/N_m3u8DL-CLI/
## Chit-chat
https://discord.gg/W5tvcRJDPs
https://discord.gg/RscAJZv3Yq