You've already forked N_m3u8DL-CLI
mirror of
https://github.com/nilaoda/N_m3u8DL-CLI
synced 2025-09-13 22:40:51 +02:00
Compare commits
11 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
985f6e57c3 | ||
![]() |
d9eea2e80f | ||
![]() |
0cc4a87a4c | ||
![]() |
66d0864d72 | ||
![]() |
965ac2b513 | ||
![]() |
a95334ec57 | ||
![]() |
e05a21a034 | ||
![]() |
13cd5d0870 | ||
![]() |
8d9ad7af41 | ||
![]() |
0a11816acf | ||
![]() |
81ba4ff7d3 |
13
.github/FUNDING.yml
vendored
Normal file
13
.github/FUNDING.yml
vendored
Normal 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']
|
@@ -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;
|
||||
|
@@ -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 };
|
||||
|
@@ -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;
|
||||
}
|
||||
}
|
||||
|
@@ -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
|
||||
|
||||
# 赞赏
|
||||

|
||||
|
@@ -101,4 +101,4 @@ URI Decode Result:
|
||||
https://nilaoda.github.io/N_m3u8DL-CLI/
|
||||
|
||||
## Chit-chat
|
||||
https://discord.gg/W5tvcRJDPs
|
||||
https://discord.gg/RscAJZv3Yq
|
||||
|
Reference in New Issue
Block a user