mirror of
https://github.com/leiurayer/downkyi.git
synced 2025-03-13 18:50:15 +08:00
Compare commits
10 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
2c227d5d26 | ||
|
e0ac25efbc | ||
|
1088b70cc8 | ||
|
d891541b4e | ||
|
29c6aa0375 | ||
|
6bf03de4f3 | ||
|
0a5a13cdd6 | ||
|
c5db2cfb40 | ||
|
6e9fef3d64 | ||
|
1a158dce32 |
@ -1,5 +1,10 @@
|
||||
# 更新日志
|
||||
|
||||
## `2023/12/10` v1.6.1
|
||||
|
||||
* [优化] 如果存在下载完成列表,弹出选择框是否再次下载。
|
||||
* [修复] 更新wbi签名算法,解决无法解析下载视频的问题。
|
||||
|
||||
## `2023/12/09` v1.6.0
|
||||
|
||||
* [优化] 下载列表弹出框。
|
||||
|
@ -120,7 +120,7 @@ namespace DownKyi.Core.BiliApi.Login
|
||||
public static BitmapImage GetLoginQRCode(string url)
|
||||
{
|
||||
// 设置的参数影响app能否成功扫码
|
||||
Bitmap qrCode = Utils.QRCode.EncodeQRCode(url, 10, 10, null, 0, 0, false);
|
||||
Bitmap qrCode = Utils.QRCode.EncodeQRCode(url, 12, 10, null, 0, 0, false);
|
||||
|
||||
MemoryStream ms = new MemoryStream();
|
||||
qrCode.Save(ms, System.Drawing.Imaging.ImageFormat.Bmp);
|
||||
|
@ -83,7 +83,7 @@ namespace DownKyi.Core.BiliApi.LoginNew
|
||||
public static BitmapImage GetLoginQRCode(string url)
|
||||
{
|
||||
// 设置的参数影响app能否成功扫码
|
||||
Bitmap qrCode = Utils.QRCode.EncodeQRCode(url, 10, 10, null, 0, 0, false);
|
||||
Bitmap qrCode = Utils.QRCode.EncodeQRCode(url, 12, 10, null, 0, 0, false);
|
||||
|
||||
MemoryStream ms = new MemoryStream();
|
||||
qrCode.Save(ms, System.Drawing.Imaging.ImageFormat.Bmp);
|
||||
|
@ -2,6 +2,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net.Http;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
@ -39,7 +40,7 @@ namespace DownKyi.Core.BiliApi.Sign
|
||||
/// </summary>
|
||||
/// <param name="parameters"></param>
|
||||
/// <returns></returns>
|
||||
public static string ParametersToQuery(Dictionary<string, object> parameters)
|
||||
public static string ParametersToQuery(Dictionary<string, string> parameters)
|
||||
{
|
||||
var keys = parameters.Keys.ToList();
|
||||
var queryList = new List<string>();
|
||||
@ -56,9 +57,51 @@ namespace DownKyi.Core.BiliApi.Sign
|
||||
/// </summary>
|
||||
/// <param name="parameters"></param>
|
||||
/// <returns></returns>
|
||||
public static Dictionary<string, object> EncodeWbi(Dictionary<string, object> parameters)
|
||||
public static Dictionary<string, string> EncodeWbi(Dictionary<string, object> parameters)
|
||||
{
|
||||
return EncodeWbi(parameters, GetKey().Item1, GetKey().Item2);
|
||||
return EncWbi(parameters, GetKey().Item1, GetKey().Item2);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Wbi签名,返回所有参数字典
|
||||
/// </summary>
|
||||
/// <param name="parameters"></param>
|
||||
/// <param name="imgKey"></param>
|
||||
/// <param name="subKey"></param>
|
||||
/// <returns></returns>
|
||||
private static Dictionary<string, string> EncWbi(Dictionary<string, object> parameters, string imgKey, string subKey)
|
||||
{
|
||||
Dictionary<string, string> paraStr = new Dictionary<string, string>();
|
||||
foreach (var para in parameters)
|
||||
{
|
||||
var key = para.Key;
|
||||
var value = para.Value.ToString();
|
||||
paraStr.Add(key, value);
|
||||
}
|
||||
|
||||
string mixinKey = GetMixinKey(imgKey + subKey);
|
||||
string currTime = DateTimeOffset.Now.ToUnixTimeSeconds().ToString();
|
||||
//添加 wts 字段
|
||||
paraStr["wts"] = currTime;
|
||||
// 按照 key 重排参数
|
||||
paraStr = paraStr.OrderBy(p => p.Key).ToDictionary(p => p.Key, p => p.Value);
|
||||
//过滤 value 中的 "!'()*" 字符
|
||||
paraStr = paraStr.ToDictionary(
|
||||
kvp => kvp.Key,
|
||||
kvp => new string(kvp.Value.Where(chr => !"!'()*".Contains(chr)).ToArray())
|
||||
);
|
||||
// 序列化参数
|
||||
string query = new FormUrlEncodedContent(paraStr).ReadAsStringAsync().Result;
|
||||
//计算 w_rid
|
||||
using (MD5 md5 = MD5.Create())
|
||||
{
|
||||
//using MD5 md5 = MD5.Create();
|
||||
byte[] hashBytes = md5.ComputeHash(Encoding.UTF8.GetBytes(query + mixinKey));
|
||||
string wbiSign = BitConverter.ToString(hashBytes).Replace("-", "").ToLower();
|
||||
paraStr["w_rid"] = wbiSign;
|
||||
}
|
||||
|
||||
return paraStr;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -76,7 +119,7 @@ namespace DownKyi.Core.BiliApi.Sign
|
||||
|
||||
var newParameters = new Dictionary<string, object>
|
||||
{
|
||||
{ "wts", (long)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds }
|
||||
{ "wts", DateTimeOffset.Now.ToUnixTimeSeconds().ToString() }
|
||||
};
|
||||
|
||||
foreach (var para in parameters)
|
||||
|
@ -103,6 +103,7 @@ namespace DownKyi.Core.BiliApi.VideoStream
|
||||
{
|
||||
var parameters = new Dictionary<string, object>
|
||||
{
|
||||
{ "from_client", "BROWSER" },
|
||||
{ "fourk", 1 },
|
||||
{ "fnver", 0 },
|
||||
{ "fnval", 4048 },
|
||||
|
@ -52,20 +52,20 @@
|
||||
<Reference Include="Brotli.Core, Version=2.1.1.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Brotli.NET.2.1.1\lib\net45\Brotli.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Google.Protobuf, Version=3.21.12.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Google.Protobuf.3.21.12\lib\net45\Google.Protobuf.dll</HintPath>
|
||||
<Reference Include="Google.Protobuf, Version=3.29.3.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Google.Protobuf.3.29.3\lib\net45\Google.Protobuf.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Newtonsoft.Json.13.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
<HintPath>..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="PresentationFramework" />
|
||||
<Reference Include="QRCoder, Version=1.4.3.0, Culture=neutral, PublicKeyToken=c4ed5b9ae8358a28, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\QRCoder.1.4.3\lib\net40\QRCoder.dll</HintPath>
|
||||
<Reference Include="QRCoder, Version=1.6.0.0, Culture=neutral, PublicKeyToken=c4ed5b9ae8358a28, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\QRCoder.1.6.0\lib\net40\QRCoder.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll</HintPath>
|
||||
<Reference Include="System.Buffers, Version=4.0.4.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Buffers.4.6.0\lib\net462\System.Buffers.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Data.SQLite, Version=1.0.112.1, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
|
||||
@ -73,15 +73,15 @@
|
||||
</Reference>
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Management" />
|
||||
<Reference Include="System.Memory, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Memory.4.5.5\lib\net461\System.Memory.dll</HintPath>
|
||||
<Reference Include="System.Memory, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Memory.4.6.0\lib\net462\System.Memory.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Numerics" />
|
||||
<Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
|
||||
<Reference Include="System.Numerics.Vectors, Version=4.1.5.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Numerics.Vectors.4.6.0\lib\net462\System.Numerics.Vectors.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net461\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
|
||||
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.6.1.0\lib\net462\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Runtime.InteropServices.RuntimeInformation, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Runtime.InteropServices.RuntimeInformation.4.3.0\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll</HintPath>
|
||||
@ -392,9 +392,9 @@
|
||||
<Error Condition="!Exists('..\packages\Brotli.NET.2.1.1\build\Brotli.NET.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Brotli.NET.2.1.1\build\Brotli.NET.targets'))" />
|
||||
<Error Condition="!Exists('..\packages\System.Data.SQLite.Core.1.0.112.2\build\net40\System.Data.SQLite.Core.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\System.Data.SQLite.Core.1.0.112.2\build\net40\System.Data.SQLite.Core.targets'))" />
|
||||
<Error Condition="!Exists('..\packages\WebPSharp.0.5.1\build\WebPSharp.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\WebPSharp.0.5.1\build\WebPSharp.targets'))" />
|
||||
<Error Condition="!Exists('..\packages\Google.Protobuf.Tools.3.21.12\build\Google.Protobuf.Tools.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Google.Protobuf.Tools.3.21.12\build\Google.Protobuf.Tools.targets'))" />
|
||||
<Error Condition="!Exists('..\packages\Google.Protobuf.Tools.3.29.3\build\Google.Protobuf.Tools.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Google.Protobuf.Tools.3.29.3\build\Google.Protobuf.Tools.targets'))" />
|
||||
</Target>
|
||||
<Import Project="..\packages\System.Data.SQLite.Core.1.0.112.2\build\net40\System.Data.SQLite.Core.targets" Condition="Exists('..\packages\System.Data.SQLite.Core.1.0.112.2\build\net40\System.Data.SQLite.Core.targets')" />
|
||||
<Import Project="..\packages\WebPSharp.0.5.1\build\WebPSharp.targets" Condition="Exists('..\packages\WebPSharp.0.5.1\build\WebPSharp.targets')" />
|
||||
<Import Project="..\packages\Google.Protobuf.Tools.3.21.12\build\Google.Protobuf.Tools.targets" Condition="Exists('..\packages\Google.Protobuf.Tools.3.21.12\build\Google.Protobuf.Tools.targets')" />
|
||||
<Import Project="..\packages\Google.Protobuf.Tools.3.29.3\build\Google.Protobuf.Tools.targets" Condition="Exists('..\packages\Google.Protobuf.Tools.3.29.3\build\Google.Protobuf.Tools.targets')" />
|
||||
</Project>
|
@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
||||
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
|
||||
//通过使用 "*",如下所示:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("2.2.0.0")]
|
||||
[assembly: AssemblyFileVersion("2.2.0.0")]
|
||||
[assembly: AssemblyVersion("2.2.1.0")]
|
||||
[assembly: AssemblyFileVersion("2.2.1.0")]
|
||||
|
@ -199,7 +199,7 @@ namespace DownKyi.Core.Utils
|
||||
destName = Regex.Replace(destName, @"\p{C}+", string.Empty);
|
||||
|
||||
// 如果只有空白字符、dot符
|
||||
if (destName == " " || destName == ".")
|
||||
if (string.IsNullOrWhiteSpace(destName) || destName == ".")
|
||||
{
|
||||
return "[empty title]";
|
||||
}
|
||||
|
@ -4,11 +4,11 @@
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-6.0.1.0" newVersion="6.0.1.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.1.2" newVersion="4.0.1.2" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
|
@ -1,15 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Brotli.NET" version="2.1.1" targetFramework="net472" />
|
||||
<package id="Google.Protobuf" version="3.21.12" targetFramework="net472" />
|
||||
<package id="Google.Protobuf.Tools" version="3.21.12" targetFramework="net472" />
|
||||
<package id="Newtonsoft.Json" version="13.0.2" targetFramework="net472" />
|
||||
<package id="QRCoder" version="1.4.3" targetFramework="net472" />
|
||||
<package id="System.Buffers" version="4.5.1" targetFramework="net472" />
|
||||
<package id="Google.Protobuf" version="3.29.3" targetFramework="net472" />
|
||||
<package id="Google.Protobuf.Tools" version="3.29.3" targetFramework="net472" />
|
||||
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net472" />
|
||||
<package id="QRCoder" version="1.6.0" targetFramework="net472" />
|
||||
<package id="System.Buffers" version="4.6.0" targetFramework="net472" />
|
||||
<package id="System.Data.SQLite.Core" version="1.0.112.2" targetFramework="net472" />
|
||||
<package id="System.Memory" version="4.5.5" targetFramework="net472" />
|
||||
<package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net472" />
|
||||
<package id="System.Runtime.CompilerServices.Unsafe" version="6.0.0" targetFramework="net472" />
|
||||
<package id="System.Memory" version="4.6.0" targetFramework="net472" />
|
||||
<package id="System.Numerics.Vectors" version="4.6.0" targetFramework="net472" />
|
||||
<package id="System.Runtime.CompilerServices.Unsafe" version="6.1.0" targetFramework="net472" />
|
||||
<package id="System.Runtime.InteropServices.RuntimeInformation" version="4.3.0" targetFramework="net472" />
|
||||
<package id="WebPSharp" version="0.5.1" targetFramework="net472" />
|
||||
</packages>
|
@ -562,10 +562,10 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Hardcodet.NotifyIcon.Wpf">
|
||||
<Version>1.1.0</Version>
|
||||
<Version>2.0.1</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Newtonsoft.Json">
|
||||
<Version>13.0.2</Version>
|
||||
<Version>13.0.3</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Prism.DryIoc" Version="8.1.97" />
|
||||
<PackageReference Include="System.Data.SQLite.Core">
|
||||
|
@ -144,7 +144,8 @@
|
||||
|
||||
<system:String x:Key="TipAlreadyToAddDownloading">已经添加到下载列表~</system:String>
|
||||
<system:String x:Key="TipAlreadyToAddDownloaded">已经下载完成~</system:String>
|
||||
<system:String x:Key="TipAddDownloadingZero">没有选中项符合下载要求!</system:String>
|
||||
<system:String x:Key="TipAlreadyToAddDownloaded2">该视频已经下载完成,是否重新下载?</system:String>
|
||||
<system:String x:Key="TipAddDownloadingZero">没有添加任何视频~</system:String>
|
||||
<system:String x:Key="TipAddDownloadingFinished1">成功添加了</system:String>
|
||||
<system:String x:Key="TipAddDownloadingFinished2">项~</system:String>
|
||||
|
||||
|
@ -11,7 +11,7 @@ namespace DownKyi.Models
|
||||
|
||||
const int a = 1;
|
||||
const int b = 6;
|
||||
const int c = 0;
|
||||
const int c = 1;
|
||||
|
||||
public AppInfo()
|
||||
{
|
||||
|
@ -51,5 +51,5 @@ using System.Windows;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.6.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.6.0.0")]
|
||||
[assembly: AssemblyVersion("1.6.1.0")]
|
||||
[assembly: AssemblyFileVersion("1.6.1.0")]
|
||||
|
@ -67,10 +67,15 @@ namespace DownKyi.Services
|
||||
{ "message", message },
|
||||
{ "button_number", buttonNumber }
|
||||
};
|
||||
dialogService.ShowDialog(ViewAlertDialogViewModel.Tag, param, buttonResult =>
|
||||
|
||||
App.PropertyChangeAsync(() =>
|
||||
{
|
||||
result = buttonResult.Result;
|
||||
dialogService.ShowDialog(ViewAlertDialogViewModel.Tag, param, buttonResult =>
|
||||
{
|
||||
result = buttonResult.Result;
|
||||
});
|
||||
});
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -221,7 +221,7 @@ namespace DownKyi.Services.Download
|
||||
/// <param name="directory">下载路径</param>
|
||||
/// <param name="isAll">是否下载所有,包括未选中项</param>
|
||||
/// <returns>添加的数量</returns>
|
||||
public int AddToDownload(IEventAggregator eventAggregator, string directory, bool isAll = false)
|
||||
public int AddToDownload(IEventAggregator eventAggregator, IDialogService dialogService, string directory, bool isAll = false)
|
||||
{
|
||||
if (directory == null || directory == string.Empty) { return -1; }
|
||||
if (videoSections == null) { return -1; }
|
||||
@ -269,7 +269,7 @@ namespace DownKyi.Services.Download
|
||||
}
|
||||
if (isDownloading) { continue; }
|
||||
|
||||
// TODO 如果存在下载完成列表,弹出选择框是否再次下载
|
||||
// 如果存在下载完成列表,弹出选择框是否再次下载
|
||||
bool isDownloaded = false;
|
||||
foreach (DownloadedItem item in App.DownloadedList)
|
||||
{
|
||||
@ -277,8 +277,25 @@ namespace DownKyi.Services.Download
|
||||
|
||||
if (item.DownloadBase.Cid == page.Cid && item.Resolution.Id == page.VideoQuality.Quality && item.AudioCodec.Name == page.AudioQualityFormat && item.VideoCodecName == page.VideoQuality.SelectedVideoCodec)
|
||||
{
|
||||
eventAggregator.GetEvent<MessageEvent>().Publish($"{page.Name}{DictionaryResource.GetString("TipAlreadyToAddDownloaded")}");
|
||||
isDownloaded = true;
|
||||
//eventAggregator.GetEvent<MessageEvent>().Publish($"{page.Name}{DictionaryResource.GetString("TipAlreadyToAddDownloaded")}");
|
||||
//isDownloaded = true;
|
||||
|
||||
AlertService alertService = new AlertService(dialogService);
|
||||
ButtonResult result = alertService.ShowInfo(DictionaryResource.GetString("TipAlreadyToAddDownloaded2"));
|
||||
if (result == ButtonResult.OK)
|
||||
{
|
||||
App.PropertyChangeAsync(() =>
|
||||
{
|
||||
App.DownloadedList.Remove(item);
|
||||
});
|
||||
|
||||
isDownloaded = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
isDownloaded = true;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -295,7 +295,7 @@ namespace DownKyi.ViewModels
|
||||
addToDownloadService.GetVideo();
|
||||
addToDownloadService.ParseVideo(videoInfoService);
|
||||
// 下载
|
||||
i += addToDownloadService.AddToDownload(eventAggregator, directory);
|
||||
i += addToDownloadService.AddToDownload(eventAggregator, dialogService, directory);
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -348,7 +348,7 @@ namespace DownKyi.ViewModels
|
||||
addToDownloadService.GetVideo();
|
||||
addToDownloadService.ParseVideo(service);
|
||||
// 下载
|
||||
i += addToDownloadService.AddToDownload(eventAggregator, directory);
|
||||
i += addToDownloadService.AddToDownload(eventAggregator, dialogService, directory);
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -378,7 +378,7 @@ namespace DownKyi.ViewModels
|
||||
addToDownloadService.GetVideo();
|
||||
addToDownloadService.ParseVideo(videoInfoService);
|
||||
// 下载
|
||||
i += addToDownloadService.AddToDownload(eventAggregator, directory);
|
||||
i += addToDownloadService.AddToDownload(eventAggregator, dialogService, directory);
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -291,7 +291,7 @@ namespace DownKyi.ViewModels
|
||||
addToDownloadService.GetVideo();
|
||||
addToDownloadService.ParseVideo(service);
|
||||
// 下载
|
||||
i += addToDownloadService.AddToDownload(eventAggregator, directory);
|
||||
i += addToDownloadService.AddToDownload(eventAggregator, dialogService, directory);
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -277,7 +277,7 @@ namespace DownKyi.ViewModels
|
||||
addToDownloadService.GetVideo();
|
||||
addToDownloadService.ParseVideo(videoInfoService);
|
||||
// 下载
|
||||
i += addToDownloadService.AddToDownload(eventAggregator, directory);
|
||||
i += addToDownloadService.AddToDownload(eventAggregator, dialogService, directory);
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -298,7 +298,7 @@ namespace DownKyi.ViewModels
|
||||
addToDownloadService.GetVideo();
|
||||
addToDownloadService.ParseVideo(videoInfoService);
|
||||
// 下载
|
||||
i += addToDownloadService.AddToDownload(eventAggregator, directory);
|
||||
i += addToDownloadService.AddToDownload(eventAggregator, dialogService, directory);
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -332,7 +332,7 @@ namespace DownKyi.ViewModels
|
||||
addToDownloadService.GetVideo();
|
||||
addToDownloadService.ParseVideo(videoInfoService);
|
||||
// 下载
|
||||
i += addToDownloadService.AddToDownload(eventAggregator, directory);
|
||||
i += addToDownloadService.AddToDownload(eventAggregator, dialogService, directory);
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -296,7 +296,7 @@ namespace DownKyi.ViewModels
|
||||
addToDownloadService.GetVideo();
|
||||
addToDownloadService.ParseVideo(videoInfoService);
|
||||
// 下载
|
||||
i += addToDownloadService.AddToDownload(eventAggregator, directory);
|
||||
i += addToDownloadService.AddToDownload(eventAggregator, dialogService, directory);
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -362,7 +362,7 @@ namespace DownKyi.ViewModels
|
||||
sexUri = new Uri($"pack://application:,,,/Resources/sex/female.png");
|
||||
}
|
||||
// 显示vip信息
|
||||
if (userInfo.Vip.Label.Text == null || userInfo.Vip.Label.Text == "")
|
||||
if (userInfo.Vip == null || userInfo.Vip.Label.Text == null || userInfo.Vip.Label.Text == "")
|
||||
{
|
||||
VipTypeVisibility = Visibility.Collapsed;
|
||||
}
|
||||
|
@ -34,6 +34,9 @@ namespace DownKyi.ViewModels
|
||||
// 保存输入字符串,避免被用户修改
|
||||
private string input = null;
|
||||
|
||||
// 保存当前页面服务,减少new的开销和接口调用次数
|
||||
private IInfoService infoService;
|
||||
|
||||
#region 页面属性申明
|
||||
|
||||
private VectorImage arrowBack;
|
||||
@ -233,7 +236,7 @@ namespace DownKyi.ViewModels
|
||||
input = InputText;
|
||||
|
||||
// 更新页面
|
||||
UnityUpdateView(UpdateView, input, null);
|
||||
UnityUpdateView(UpdateView, input, null, true);
|
||||
|
||||
// 是否自动解析视频
|
||||
if (SettingsManager.GetInstance().IsAutoParseVideo() == AllowStatus.YES)
|
||||
@ -410,7 +413,7 @@ namespace DownKyi.ViewModels
|
||||
{
|
||||
LogManager.Debug(Tag, $"Video Page: {videoPage.Cid}");
|
||||
|
||||
UnityUpdateView(ParseVideo, input, videoPage);
|
||||
UnityUpdateView(ParseVideo, input, videoPage, true);
|
||||
});
|
||||
}
|
||||
catch (Exception e)
|
||||
@ -635,25 +638,34 @@ namespace DownKyi.ViewModels
|
||||
/// <param name="action"></param>
|
||||
/// <param name="input"></param>
|
||||
/// <param name="page"></param>
|
||||
private void UnityUpdateView(Action<IInfoService, VideoPage> action, string input, VideoPage page)
|
||||
/// <param name="force">强制new</param>
|
||||
private void UnityUpdateView(Action<IInfoService, VideoPage> action, string input, VideoPage page,bool force = false)
|
||||
{
|
||||
// 视频
|
||||
if (ParseEntrance.IsAvUrl(input) || ParseEntrance.IsBvUrl(input))
|
||||
if (infoService == null || force)
|
||||
{
|
||||
action(new VideoInfoService(input), page);
|
||||
}
|
||||
// 视频
|
||||
if (ParseEntrance.IsAvUrl(input) || ParseEntrance.IsBvUrl(input))
|
||||
{
|
||||
infoService = new VideoInfoService(input);
|
||||
}
|
||||
|
||||
// 番剧(电影、电视剧)
|
||||
if (ParseEntrance.IsBangumiSeasonUrl(input) || ParseEntrance.IsBangumiEpisodeUrl(input) || ParseEntrance.IsBangumiMediaUrl(input))
|
||||
{
|
||||
action(new BangumiInfoService(input), page);
|
||||
}
|
||||
// 番剧(电影、电视剧)
|
||||
if (ParseEntrance.IsBangumiSeasonUrl(input) || ParseEntrance.IsBangumiEpisodeUrl(input) || ParseEntrance.IsBangumiMediaUrl(input))
|
||||
{
|
||||
infoService = new BangumiInfoService(input);
|
||||
}
|
||||
|
||||
// 课程
|
||||
if (ParseEntrance.IsCheeseSeasonUrl(input) || ParseEntrance.IsCheeseEpisodeUrl(input))
|
||||
{
|
||||
action(new CheeseInfoService(input), page);
|
||||
// 课程
|
||||
if (ParseEntrance.IsCheeseSeasonUrl(input) || ParseEntrance.IsCheeseEpisodeUrl(input))
|
||||
{
|
||||
infoService = new CheeseInfoService(input);
|
||||
}
|
||||
}
|
||||
if (infoService == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
action(infoService, page);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -773,7 +785,7 @@ namespace DownKyi.ViewModels
|
||||
// 传递video对象
|
||||
addToDownloadService.GetVideo(VideoInfoView, VideoSections.ToList());
|
||||
// 下载
|
||||
i = addToDownloadService.AddToDownload(eventAggregator, directory, isAll);
|
||||
i = addToDownloadService.AddToDownload(eventAggregator, dialogService, directory, isAll);
|
||||
});
|
||||
|
||||
if (directory == null)
|
||||
|
8
src/NuGet.config
Normal file
8
src/NuGet.config
Normal file
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<packageSources>
|
||||
<!-- 下一行的 clear 如果取消了注释,那么就会清除掉全局的 NuGet 源,而注释掉可以继承全局 NuGet 源,只是额外添加。 -->
|
||||
<!-- <clear /> -->
|
||||
<add key="MyNuget" value="../third_party" />
|
||||
</packageSources>
|
||||
</configuration>
|
Loading…
Reference in New Issue
Block a user