mirror of
https://github.com/leiurayer/downkyi.git
synced 2025-04-27 05:30:47 +08:00
v1.3.1 beta
This commit is contained in:
parent
587fcfb777
commit
f6d72b5a48
@ -1,5 +1,13 @@
|
||||
# 更新日志
|
||||
|
||||
* `2021/01/01` v1.3.1 beta
|
||||
1. [修复] Aria2c下载时出现503错误的问题。
|
||||
2. [修复] 选择文件夹时,若取消选择仍然会添加到下载的问题。
|
||||
3. [修复] 标题中含有转义字符时的问题。
|
||||
4. [修复] 其他已知问题。
|
||||
5. [优化] 启动时先杀死以开启的Aria2c进程。
|
||||
6. [优化] 关于页面添加github链接。
|
||||
|
||||
* `2020/12/26` v1.3.0 beta
|
||||
1. [新增] 使用Aria下载器。
|
||||
2. [新增] 暂停、继续、删除下载项功能。
|
||||
@ -13,3 +21,4 @@
|
||||
10. [优化] 下载管理上方控制面板是否显示根据已下载视频数量动态变化。
|
||||
11. [新增] 下载列表的历史记录,重启程序后恢复下载。
|
||||
12. [新增] 视频详情页的封面增加右键菜单:复制封面图片、复制封面url。
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
# downkyi
|
||||
哔哩下载姬
|
||||

|
||||
|
||||
## 关于
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
|
||||
## 下载
|
||||
|
||||
[哔哩下载姬 v1.3.0 beta](https://github.com/FlySelfLog/downkyi/releases/download/v1.3.0-beta/DownKyi-23-1.3.0.beta.zip)
|
||||
[哔哩下载姬 v1.3.1 beta](https://github.com/FlySelfLog/downkyi/releases/download/v1.3.1-beta/DownKyi-24-1.3.1.beta.zip)
|
||||
|
||||
## 赞助
|
||||
|
||||
|
BIN
images/app/index.png
Normal file
BIN
images/app/index.png
Normal file
Binary file not shown.
After ![]() (image error) Size: 38 KiB |
@ -64,7 +64,20 @@ namespace Core.aria2cNet
|
||||
}
|
||||
if (status.Result.Result.ErrorCode != null && status.Result.Result.ErrorCode != "0")
|
||||
{
|
||||
Console.WriteLine(status.Result.Result.ErrorMessage);
|
||||
Console.WriteLine("ErrorMessage: " + status.Result.Result.ErrorMessage);
|
||||
|
||||
//// 如果返回状态码不是200,则继续
|
||||
//if (status.Result.Result.ErrorMessage.Contains("The response status is not successful"))
|
||||
//{
|
||||
// Thread.Sleep(1000);
|
||||
// continue;
|
||||
//}
|
||||
|
||||
// aira中删除记录
|
||||
var ariaRemove1 = AriaClient.RemoveDownloadResultAsync(gid);
|
||||
Console.WriteLine(ariaRemove1);
|
||||
|
||||
// 返回回调信息,退出函数
|
||||
OnDownloadFinish(false, null, gid, status.Result.Result.ErrorMessage);
|
||||
return DownloadStatus.FAILED;
|
||||
}
|
||||
@ -76,6 +89,35 @@ namespace Core.aria2cNet
|
||||
return DownloadStatus.SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
//private async void Poll()
|
||||
//{
|
||||
// while (true)
|
||||
// {
|
||||
// // 查询全局status
|
||||
// var globalStatus = await AriaClient.GetGlobalStatAsync();
|
||||
// if (globalStatus == null || globalStatus.Result == null) { continue; }
|
||||
|
||||
// long globalSpeed = long.Parse(globalStatus.Result.DownloadSpeed);
|
||||
// // 回调
|
||||
// OnGetGlobalStatus(globalSpeed);
|
||||
|
||||
// // 查询gid对应的项目的status
|
||||
// foreach (var gid in gidList)
|
||||
// {
|
||||
// var status = await AriaClient.TellStatus(gid);
|
||||
// if (status == null || status.Result == null) { continue; }
|
||||
|
||||
// long totalLength = long.Parse(status.Result.TotalLength);
|
||||
// long completedLength = long.Parse(status.Result.CompletedLength);
|
||||
// long speed = long.Parse(status.Result.DownloadSpeed);
|
||||
// // 回调
|
||||
// OnTellStatus(totalLength, completedLength, speed, gid);
|
||||
// }
|
||||
|
||||
// }
|
||||
//}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -36,6 +36,15 @@ namespace Core.aria2cNet.client.entity
|
||||
[JsonProperty("dir")]
|
||||
public string Dir { get; set; }
|
||||
|
||||
//[JsonProperty("header")]
|
||||
//public string Header { get; set; }
|
||||
|
||||
//[JsonProperty("use-head")]
|
||||
//public string UseHead { get; set; }
|
||||
|
||||
//[JsonProperty("user-agent")]
|
||||
//public string UserAgent { get; set; }
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return JsonConvert.SerializeObject(this);
|
||||
|
@ -1,4 +1,6 @@
|
||||
namespace Core.aria2cNet.server
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Core.aria2cNet.server
|
||||
{
|
||||
/// <summary>
|
||||
/// Aria服务器的启动配置
|
||||
@ -11,6 +13,7 @@
|
||||
public int MaxConcurrentDownloads { get; set; } // 最大同时下载数(任务数),取值:1-*
|
||||
public int MaxConnectionPerServer { get; set; } // 同服务器连接数,取值:1-16
|
||||
public int Split { get; set; } // 单文件最大线程数,取值:1-*
|
||||
//public int MaxTries { get; set; } //当服务器返回503错误时,尝试重连;尝试重连次数,0代表无限,默认:5
|
||||
public int MinSplitSize { get; set; } // 最小文件分片大小, 下载线程数上限取决于能分出多少片, 对于小文件重要,单位MB
|
||||
public long MaxOverallDownloadLimit { get; set; } // 下载速度限制,取值:1-*
|
||||
public long MaxDownloadLimit { get; set; } // 下载单文件速度限制,取值:1-*
|
||||
@ -18,6 +21,8 @@
|
||||
public long MaxUploadLimit { get; set; } // 上传单文件速度限制,取值:1-*
|
||||
public bool ContinueDownload { get; set; } // 断点续传
|
||||
public AriaConfigFileAllocation FileAllocation { get; set; } // 文件预分配, none prealloc
|
||||
|
||||
public List<string> Headers { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -23,11 +23,20 @@ namespace Core.aria2cNet.server
|
||||
/// <returns></returns>
|
||||
public static async Task<bool> StartServerAsync(AriaConfig config, TextBox output = null, Window window = null)
|
||||
{
|
||||
// aria端口
|
||||
ListenPort = config.ListenPort;
|
||||
string ariaDir = Environment.CurrentDirectory + "\\aria\\"; // aria目录
|
||||
string sessionFile = ariaDir + "aira.session.gz"; // 会话文件
|
||||
string logFile = ariaDir + "aira.log"; // 日志文件
|
||||
int saveSessionInterval = 30; // 自动保存会话文件的时间间隔
|
||||
// aria目录
|
||||
string ariaDir = Environment.CurrentDirectory + "\\aria\\";
|
||||
// 会话文件
|
||||
#if DEBUG
|
||||
string sessionFile = ariaDir + "aira.session";
|
||||
#else
|
||||
string sessionFile = ariaDir + "aira.session.gz";
|
||||
#endif
|
||||
// 日志文件
|
||||
string logFile = ariaDir + "aira.log";
|
||||
// 自动保存会话文件的时间间隔
|
||||
int saveSessionInterval = 30;
|
||||
|
||||
// --enable-rpc --rpc-listen-all=true --rpc-allow-origin-all=true --continue=true
|
||||
await Task.Run(() =>
|
||||
@ -65,6 +74,17 @@ namespace Core.aria2cNet.server
|
||||
}
|
||||
}
|
||||
|
||||
// header 解析
|
||||
string headers = string.Empty;
|
||||
if (config.Headers != null)
|
||||
{
|
||||
foreach (var header in config.Headers)
|
||||
{
|
||||
headers += $"--header=\"{header}\" ";
|
||||
}
|
||||
}
|
||||
Console.WriteLine(headers);
|
||||
|
||||
ExcuteProcess("aria2c.exe",
|
||||
$"--enable-rpc --rpc-listen-all=true --rpc-allow-origin-all=true " +
|
||||
$"--rpc-listen-port={config.ListenPort} " +
|
||||
@ -75,14 +95,17 @@ namespace Core.aria2cNet.server
|
||||
$"--max-concurrent-downloads={config.MaxConcurrentDownloads} " + // 最大同时下载数(任务数)
|
||||
$"--max-connection-per-server={config.MaxConnectionPerServer} " + // 同服务器连接数
|
||||
$"--split={config.Split} " + // 单文件最大线程数
|
||||
//$"--max-tries={config.MaxTries} retry-wait=3 " + // 尝试重连次数
|
||||
$"--min-split-size={config.MinSplitSize}M " + // 最小文件分片大小, 下载线程数上限取决于能分出多少片, 对于小文件重要
|
||||
$"--max-overall-download-limit={config.MaxOverallDownloadLimit} " + // 下载速度限制
|
||||
$"--max-download-limit={config.MaxDownloadLimit} " + // 下载单文件速度限制
|
||||
$"--max-overall-upload-limit={config.MaxOverallUploadLimit} " + // 上传速度限制
|
||||
$"--max-upload-limit={config.MaxUploadLimit} " + // 上传单文件速度限制
|
||||
$"--continue {config.ContinueDownload.ToString().ToLower()} " + // 断点续传
|
||||
$"--allow-overwrite true " + // 允许复写文件
|
||||
$"--continue={config.ContinueDownload.ToString().ToLower()} " + // 断点续传
|
||||
$"--allow-overwrite=true " + // 允许复写文件
|
||||
$"--auto-file-renaming=false " +
|
||||
$"--file-allocation={config.FileAllocation.ToString("G").ToLower()} " + // 文件预分配, none prealloc
|
||||
$"{headers}" + // header
|
||||
"",
|
||||
null, (s, e) =>
|
||||
{
|
||||
@ -154,6 +177,28 @@ namespace Core.aria2cNet.server
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 杀死Aria进程
|
||||
/// </summary>
|
||||
/// <param name="processName"></param>
|
||||
/// <returns></returns>
|
||||
public static bool KillServer(string processName = "aria2c")
|
||||
{
|
||||
Process[] processes = Process.GetProcessesByName(processName);
|
||||
foreach (var process in processes)
|
||||
{
|
||||
try
|
||||
{
|
||||
process.Kill();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine("KillServer()发生异常: {0}", e);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
private static void ExcuteProcess(string exe, string arg, string workingDirectory, DataReceivedEventHandler output)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user