19 Commits

Author SHA1 Message Date
Meiam
bb8135590f Emby .NET 框架更换到 netstandard2.0 适配最新版本 2024-05-24 09:37:43 +08:00
Meiam
f82702f844 解决 Jellyfin 新版调整依赖注入 2024-05-23 19:51:52 +08:00
Meiam
ded87375e1 适配新版 Jellyfin 2024-05-23 16:58:41 +08:00
91270
706971992d Update README.md 2023-06-09 17:24:54 +08:00
Meiam
bbcfd01580 Update README.md 2023-02-15 13:08:59 +08:00
Meiam
008383cf1e Update 2023-02-14 21:58:18 +08:00
Meiam
a6feb50e45 Update 2023-02-14 21:41:57 +08:00
Meiam
0ef2a92705 Update 2023-02-14 21:41:14 +08:00
Meiam
af2d333106 Update 2023-02-14 21:40:21 +08:00
Meiam
630147e853 更新库文件 2023-02-14 21:36:02 +08:00
Meiam
d05afc5ffd 插件库更新 2023-02-14 21:14:40 +08:00
Meiam
237839efea 添加插件库 2023-02-14 21:07:23 +08:00
Meiam
0e5a5d1b0d 编译后执行操作 2023-02-14 19:57:08 +08:00
Meiam
8bebe5ba5b 修复射手无法查询无字幕问题 2023-02-09 22:38:29 +08:00
91270
0c5a3656c8 Update README.md 2023-02-09 16:29:38 +08:00
Meiam
339b05b763 Update 2023-02-07 20:50:19 +08:00
91270
54b13d647d Update README.md 2023-02-02 21:01:48 +08:00
91270
2e06131f8d Update README.md 2023-02-02 21:00:57 +08:00
91270
8f69a7ffca Update README.md 2023-02-02 21:00:40 +08:00
14 changed files with 191 additions and 111 deletions

View File

@@ -1,8 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
</Project>

View File

@@ -1,5 +1,6 @@
using System;
using System.IO;
using System.Runtime.Intrinsics.Arm;
using System.Security.Cryptography;
using System.Text;
@@ -19,12 +20,12 @@ namespace Emby.Subtitle.DevTool
var stream = new FileStream(filePath, FileMode.Open, FileAccess.Read);
var reader = new BinaryReader(stream);
var fileSize = new FileInfo(filePath).Length;
var SHA1 = new SHA1CryptoServiceProvider();
var sha1 = SHA1.Create();
var buffer = new byte[0xf000];
if (fileSize < 0xf000)
{
reader.Read(buffer, 0, (int)fileSize);
buffer = SHA1.ComputeHash(buffer, 0, (int)fileSize);
buffer = sha1.ComputeHash(buffer, 0, (int)fileSize);
}
else
{
@@ -34,7 +35,7 @@ namespace Emby.Subtitle.DevTool
stream.Seek(fileSize - 0x5000, SeekOrigin.Begin);
reader.Read(buffer, 0xa000, 0x5000);
buffer = SHA1.ComputeHash(buffer, 0, 0xf000);
buffer = sha1.ComputeHash(buffer, 0, 0xf000);
}
var result = "";
foreach (var i in buffer)

View File

@@ -1,26 +1,34 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<AssemblyVersion>1.0.8.0</AssemblyVersion>
<FileVersion>1.0.8.0</FileVersion>
<Version>1.0.8</Version>
<AssemblyVersion>1.0.10.0</AssemblyVersion>
<FileVersion>1.0.10.0</FileVersion>
<Version>1.0.10</Version>
</PropertyGroup>
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<WarningLevel>2</WarningLevel>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<OutputPath>..\Release</OutputPath>
</PropertyGroup>
<ItemGroup>
<None Remove="Thumb.png" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Thumb.png" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="MediaBrowser.Common" Version="4.4.2" />
<PackageReference Include="MediaBrowser.Server.Core" Version="4.4.2" />
<PackageReference Include="MediaBrowser.Common" Version="4.8.5" />
<PackageReference Include="MediaBrowser.Server.Core" Version="4.8.5" />
</ItemGroup>
</Project>
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="Copy $(TargetDir)$(TargetFileName) $(SolutionDir)$(ConfigurationName)\$(TargetFileName) /y&#xD;&#xA;" />
</Target>
</Project>

View File

@@ -15,6 +15,7 @@ using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Web;
using static System.Net.Mime.MediaTypeNames;
namespace Emby.MeiamSub.Shooter
{
@@ -28,11 +29,11 @@ namespace Emby.MeiamSub.Shooter
public const string SSA = "ssa";
public const string SRT = "srt";
private readonly ILogger _logger;
protected readonly ILogger _logger;
private readonly IJsonSerializer _jsonSerializer;
private readonly IHttpClient _httpClient;
public int Order => 0;
public int Order => 1;
public string Name => "MeiamSub.Shooter";
/// <summary>
@@ -42,12 +43,12 @@ namespace Emby.MeiamSub.Shooter
#endregion
#region
public ShooterProvider(ILogger logger, IJsonSerializer jsonSerializer,IHttpClient httpClient)
public ShooterProvider(ILogManager logManager, IJsonSerializer jsonSerializer,IHttpClient httpClient)
{
_logger = logger;
_logger = logManager.GetLogger(GetType().Name);
_jsonSerializer = jsonSerializer;
_httpClient = httpClient;
_logger.Info($"{Name} Init");
_logger.Info("{0} Init", new object[1] { Name });
}
#endregion
@@ -61,7 +62,7 @@ namespace Emby.MeiamSub.Shooter
/// <returns></returns>
public async Task<IEnumerable<RemoteSubtitleInfo>> Search(SubtitleSearchRequest request, CancellationToken cancellationToken)
{
_logger.Info($"{Name} Search | SubtitleSearchRequest -> { _jsonSerializer.SerializeToString(request) }");
_logger.Info("{0} Search | SubtitleSearchRequest -> {1}", new object[2] { Name , _jsonSerializer.SerializeToString(request) });
var subtitles = await SearchSubtitlesAsync(request);
@@ -90,9 +91,11 @@ namespace Emby.MeiamSub.Shooter
var hash = ComputeFileHash(fileInfo);
_logger.Info("{0} Search | FileHash -> {1}", new object[2] { Name, hash });
HttpRequestOptions options = new HttpRequestOptions
{
Url = $"http://www.shooter.cn/api/subapi.php",
Url = $"https://www.shooter.cn/api/subapi.php",
UserAgent = $"{Name}",
TimeoutMs = 30000,
AcceptHeader = "*/*",
@@ -106,11 +109,11 @@ namespace Emby.MeiamSub.Shooter
{ "lang",request.Language == "chi" ? "chn" : "eng"}
});
_logger.Info($"{Name} Search | Request -> { _jsonSerializer.SerializeToString(options) }");
_logger.Info("{0} Search | Request -> {1}", new object[2] { Name, _jsonSerializer.SerializeToString(options) });
var response = await _httpClient.Post(options);
_logger.Info($"{Name} Search | Response -> { _jsonSerializer.SerializeToString(response) }");
_logger.Info("{0} Search | Response -> {1}", new object[2] { Name, _jsonSerializer.SerializeToString(response) });
if (response.StatusCode == HttpStatusCode.OK && response.ContentType.Contains("application/json"))
{
@@ -118,7 +121,7 @@ namespace Emby.MeiamSub.Shooter
if (subtitleResponse != null)
{
_logger.Info($"{Name} Search | Response -> { _jsonSerializer.SerializeToString(subtitleResponse) }");
_logger.Info("{0} Search | Response -> {1}", new object[2] { Name, _jsonSerializer.SerializeToString(subtitleResponse) });
var remoteSubtitleInfos = new List<RemoteSubtitleInfo>();
@@ -139,18 +142,19 @@ namespace Emby.MeiamSub.Shooter
Author = "Meiam ",
ProviderName = $"{Name}",
Format = subFile.Ext,
Comment = $"Format : { ExtractFormat(subFile.Ext)}"
Comment = $"Format : { ExtractFormat(subFile.Ext)}",
IsHashMatch = true
});
}
}
_logger.Info("{0} Search | Summary -> Get {1} Subtitles", new object[2] { Name, remoteSubtitleInfos.Count });
_logger.Info($"{Name} Search | Summary -> Get { remoteSubtitleInfos.Count } Subtitles");
return remoteSubtitleInfos;
}
}
_logger.Info($"{Name} Search | Summary -> Get 0 Subtitles");
_logger.Info("{0} Search | Summary -> Get 0 Subtitles", new object[1] { Name });
return Array.Empty<RemoteSubtitleInfo>();
}
@@ -165,7 +169,7 @@ namespace Emby.MeiamSub.Shooter
/// <returns></returns>
public async Task<SubtitleResponse> GetSubtitles(string id, CancellationToken cancellationToken)
{
_logger.Info($"{Name} DownloadSub | Request -> {id}");
_logger.Info("{0} DownloadSub | Request -> {1}", new object[2] { Name, id });
return await DownloadSubAsync(id);
}
@@ -184,9 +188,8 @@ namespace Emby.MeiamSub.Shooter
return new SubtitleResponse();
}
downloadSub.Url = downloadSub.Url.Replace("https://www.shooter.cn", "http://www.shooter.cn");
_logger.Info($"{Name} DownloadSub | Url -> { downloadSub.Url } | Format -> { downloadSub.Format } | Language -> { downloadSub.Language } ");
_logger.Info($"{0} DownloadSub | Url -> {1} | Format -> {2} | Language -> {3} " ,
new object[4] { Name, downloadSub.Url, downloadSub.Format, downloadSub.Language });
var response = await _httpClient.GetResponse(new HttpRequestOptions
{
@@ -197,7 +200,8 @@ namespace Emby.MeiamSub.Shooter
});
_logger.Info($"{Name} DownloadSub | Response -> { response.StatusCode }");
_logger.Info("{0} DownloadSub | Request -> {1}", new object[2] { Name, response.StatusCode });
if (response.StatusCode == HttpStatusCode.OK)
{

View File

@@ -1,15 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<AssemblyVersion>1.0.8.0</AssemblyVersion>
<FileVersion>1.0.8.0</FileVersion>
<Version>1.0.8</Version>
<AssemblyVersion>1.0.10.0</AssemblyVersion>
<FileVersion>1.0.10.0</FileVersion>
<Version>1.0.10</Version>
</PropertyGroup>
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<OutputPath>..\Release</OutputPath>
</PropertyGroup>
@@ -22,9 +22,15 @@
<EmbeddedResource Include="Thumb.png" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="MediaBrowser.Common" Version="4.4.2" />
<PackageReference Include="MediaBrowser.Server.Core" Version="4.4.2" />
<PackageReference Include="MediaBrowser.Common" Version="4.8.5" />
<PackageReference Include="MediaBrowser.Server.Core" Version="4.8.5" />
</ItemGroup>
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="Copy $(TargetDir)$(TargetFileName) $(SolutionDir)$(ConfigurationName)\$(TargetFileName) /y&#xD;&#xA;" />
</Target>
</Project>

View File

@@ -32,7 +32,7 @@ namespace Emby.MeiamSub.Thunder
private readonly IJsonSerializer _jsonSerializer;
private readonly IHttpClient _httpClient;
public int Order => 0;
public int Order => 1;
public string Name => "MeiamSub.Thunder";
/// <summary>
@@ -42,12 +42,12 @@ namespace Emby.MeiamSub.Thunder
#endregion
#region
public ThunderProvider(ILogger logger, IJsonSerializer jsonSerializer,IHttpClient httpClient)
public ThunderProvider(ILogManager logManager, IJsonSerializer jsonSerializer, IHttpClient httpClient)
{
_logger = logger;
_logger = logManager.GetLogger(GetType().Name);
_jsonSerializer = jsonSerializer;
_httpClient = httpClient;
_logger.Info($"{Name} Init");
_logger.Info("{0} Init", new object[1] { Name });
}
#endregion
@@ -61,7 +61,7 @@ namespace Emby.MeiamSub.Thunder
/// <returns></returns>
public async Task<IEnumerable<RemoteSubtitleInfo>> Search(SubtitleSearchRequest request, CancellationToken cancellationToken)
{
_logger.Info($"{Name} Search | SubtitleSearchRequest -> { _jsonSerializer.SerializeToString(request) }");
_logger.Info($"{0} Search | SubtitleSearchRequest -> {1}", new object[2] { Name, _jsonSerializer.SerializeToString(request) });
var subtitles = await SearchSubtitlesAsync(request);
@@ -85,6 +85,8 @@ namespace Emby.MeiamSub.Thunder
var cid = GetCidByFile(request.MediaPath);
_logger.Info($"{0} Search | FileHash -> {1}", new object[2] { Name, cid });
var response = await _httpClient.GetResponse(new HttpRequestOptions
{
//Url = $"http://sub.xmp.sandai.net:8000/subxl/{cid}.json",
@@ -94,7 +96,7 @@ namespace Emby.MeiamSub.Thunder
AcceptHeader = "*/*",
});
_logger.Info($"{Name} Search | Response -> { _jsonSerializer.SerializeToString(response) }");
_logger.Info($"{0} Search | Response -> {1}", new object[2] { Name, _jsonSerializer.SerializeToString(response) });
if (response.StatusCode == HttpStatusCode.OK)
{
@@ -102,13 +104,13 @@ namespace Emby.MeiamSub.Thunder
if (subtitleResponse != null)
{
_logger.Info($"{Name} Search | Response -> { _jsonSerializer.SerializeToString(subtitleResponse) }");
_logger.Info($"{0} Search | Response -> {1}", new object[2] { Name, _jsonSerializer.SerializeToString(subtitleResponse) });
var subtitles = subtitleResponse.sublist.Where(m => !string.IsNullOrEmpty(m.sname));
if (subtitles.Count() > 0)
{
_logger.Info($"{Name} Search | Summary -> Get { subtitles.Count() } Subtitles");
_logger.Info($"{0} Search | Summary -> Get {1} Subtitles", new object[2] { Name, subtitles.Count() });
return subtitles.Select(m => new RemoteSubtitleInfo()
{
@@ -124,13 +126,15 @@ namespace Emby.MeiamSub.Thunder
CommunityRating = Convert.ToSingle(m.rate),
ProviderName = $"{Name}",
Format = ExtractFormat(m.sname),
Comment = $"Format : { ExtractFormat(m.sname)} - Rate : { m.rate }"
Comment = $"Format : { ExtractFormat(m.sname)} - Rate : { m.rate }",
IsHashMatch = true
}).OrderByDescending(m => m.CommunityRating);
}
}
}
_logger.Info($"{Name} Search | Summary -> Get 0 Subtitles");
_logger.Info($"{0} Search | Summary -> Get 0 Subtitles", new object[1] { Name });
return Array.Empty<RemoteSubtitleInfo>();
}
@@ -145,7 +149,7 @@ namespace Emby.MeiamSub.Thunder
/// <returns></returns>
public async Task<SubtitleResponse> GetSubtitles(string id, CancellationToken cancellationToken)
{
_logger.Info($"{Name} DownloadSub | Request -> {id}");
_logger.Info($"{0} DownloadSub | Request -> {1}", new object[2] { Name, id });
return await DownloadSubAsync(id);
}
@@ -164,7 +168,8 @@ namespace Emby.MeiamSub.Thunder
return new SubtitleResponse();
}
_logger.Info($"{Name} DownloadSub | Url -> { downloadSub.Url } | Format -> { downloadSub.Format } | Language -> { downloadSub.Language } ");
_logger.Info($"{0} DownloadSub | Url -> {1} | Format -> {2} | Language -> {3} ",
new object[4] { Name, downloadSub.Url, downloadSub.Format, downloadSub.Language });
var response = await _httpClient.GetResponse(new HttpRequestOptions
{
@@ -174,7 +179,7 @@ namespace Emby.MeiamSub.Thunder
AcceptHeader = "*/*",
});
_logger.Info($"{Name} DownloadSub | Response -> { response.StatusCode }");
_logger.Info($"{0} DownloadSub | Response -> {1}", new object[2] { Name, response.StatusCode });
if (response.StatusCode == HttpStatusCode.OK)
{

View File

@@ -1,10 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<Version>1.0.8</Version>
<AssemblyVersion>1.0.8.0</AssemblyVersion>
<FileVersion>1.0.8.0</FileVersion>
<TargetFramework>net8.0</TargetFramework>
<Version>1.0.10</Version>
<AssemblyVersion>1.0.10.0</AssemblyVersion>
<FileVersion>1.0.10.0</FileVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
@@ -12,7 +12,11 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Jellyfin.Controller" Version="10.7.0" />
<PackageReference Include="Jellyfin.Controller" Version="10.9.2" />
</ItemGroup>
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="Copy $(TargetDir)$(TargetFileName) $(SolutionDir)$(ConfigurationName)\$(TargetFileName) /y&#xD;&#xA;" />
</Target>
</Project>

View File

@@ -0,0 +1,20 @@
using MediaBrowser.Controller.Plugins;
using MediaBrowser.Controller.Subtitles;
using MediaBrowser.Controller;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Jellyfin.MeiamSub.Shooter
{
public class PluginServiceRegistrator : IPluginServiceRegistrator
{
public void RegisterServices(IServiceCollection serviceCollection, IServerApplicationHost applicationHos)
{
serviceCollection.AddSingleton<ISubtitleProvider, ShooterProvider>();
}
}
}

View File

@@ -32,7 +32,7 @@ namespace Jellyfin.MeiamSub.Shooter
private readonly ILogger<ShooterProvider> _logger;
private static readonly HttpClient _httpClient = new HttpClient();
public int Order => 0;
public int Order => 1;
public string Name => "MeiamSub.Shooter";
/// <summary>
@@ -83,42 +83,38 @@ namespace Jellyfin.MeiamSub.Shooter
var hash = ComputeFileHash(fileInfo);
var content = new StringContent(JsonSerializer.Serialize(new
{
filehash = HttpUtility.UrlEncode(hash),
pathinfo = HttpUtility.UrlEncode(request.MediaPath),
format = "json",
lang = request.Language == "chi" ? "chn" : "eng"
}), Encoding.UTF8, "application/json");
_logger.LogInformation($"{Name} Search | FileHash -> { hash }");
var options = new HttpRequestMessage
var content = new Dictionary<string, string>
{
Method = HttpMethod.Post,
RequestUri = new Uri($"http://www.shooter.cn/api/subapi.php"),
Content = content,
Headers =
{
UserAgent = { new ProductInfoHeaderValue(new ProductHeaderValue($"{Name}")) },
Accept = { new MediaTypeWithQualityHeaderValue("*/*") }
}
{ "filehash", hash},
{ "pathinfo", request.MediaPath},
{ "format", "json"},
{ "lang", request.Language == "chi" ? "chn" : "eng"}
};
_logger.LogInformation($"{Name} Search | Request -> { JsonSerializer.Serialize(options) }");
HttpRequestMessage requestMessage = new HttpRequestMessage();
var response = await _httpClient.SendAsync(options);
requestMessage.Method = HttpMethod.Post;
requestMessage.RequestUri = new Uri($"https://www.shooter.cn/api/subapi.php");
requestMessage.Content = new FormUrlEncodedContent(content);
requestMessage.Headers.Add("User-Agent", $"{Name}");
requestMessage.Headers.Add("Accept-Encoding", $"gzip, deflate, br");
requestMessage.Headers.Add("Accept", $"*/*");
var response = await _httpClient.SendAsync(requestMessage);
_logger.LogInformation($"{Name} Search | Response -> { JsonSerializer.Serialize(response) }");
if (response.StatusCode == HttpStatusCode.OK && response.Headers.Any(m => m.Value.Contains("application/json")))
if (response.StatusCode == HttpStatusCode.OK && response.Content.Headers.Any(m => m.Value.Contains("application/json; charset=utf-8")))
{
var subtitleResponse = JsonSerializer.Deserialize<List<SubtitleResponseRoot>>(await response.Content.ReadAsStringAsync());
_logger.LogInformation($"{Name} Search | Response -> { JsonSerializer.Serialize(subtitleResponse) }");
if (subtitleResponse != null)
{
_logger.LogInformation($"{Name} Search | Response -> { JsonSerializer.Serialize(subtitleResponse) }");
var remoteSubtitleInfos = new List<RemoteSubtitleInfo>();
foreach (var subFileInfo in subtitleResponse)
@@ -138,7 +134,8 @@ namespace Jellyfin.MeiamSub.Shooter
Author = "Meiam ",
ProviderName = $"{Name}",
Format = subFile.Ext,
Comment = $"Format : { ExtractFormat(subFile.Ext)}"
Comment = $"Format : { ExtractFormat(subFile.Ext)}",
IsHashMatch = true
});
}
}
@@ -184,8 +181,6 @@ namespace Jellyfin.MeiamSub.Shooter
return new SubtitleResponse();
}
downloadSub.Url = downloadSub.Url.Replace("https://www.shooter.cn", "http://www.shooter.cn");
_logger.LogInformation($"{Name} DownloadSub | Url -> { downloadSub.Url } | Format -> { downloadSub.Format } | Language -> { downloadSub.Language } ");
using var options = new HttpRequestMessage

View File

@@ -2,10 +2,11 @@
<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ApplicationIcon />
<StartupObject />
<Version>1.0.8</Version>
<Version>1.0.10</Version>
<AssemblyVersion>1.0.10.0</AssemblyVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
@@ -13,7 +14,11 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Jellyfin.Controller" Version="10.7.0" />
<PackageReference Include="Jellyfin.Controller" Version="10.9.2" />
</ItemGroup>
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="Copy $(TargetDir)$(TargetFileName) $(SolutionDir)$(ConfigurationName)\$(TargetFileName) /y&#xD;&#xA;" />
</Target>
</Project>

View File

@@ -0,0 +1,20 @@
using MediaBrowser.Controller.Plugins;
using MediaBrowser.Controller.Subtitles;
using MediaBrowser.Controller;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Jellyfin.MeiamSub.Thunder
{
public class PluginServiceRegistrator : IPluginServiceRegistrator
{
public void RegisterServices(IServiceCollection serviceCollection, IServerApplicationHost applicationHos)
{
serviceCollection.AddSingleton<ISubtitleProvider, ThunderProvider>();
}
}
}

View File

@@ -31,7 +31,7 @@ namespace Jellyfin.MeiamSub.Thunder
private readonly ILogger<ThunderProvider> _logger;
private static readonly HttpClient _httpClient = new HttpClient();
public int Order => 0;
public int Order => 1;
public string Name => "MeiamSub.Thunder";
/// <summary>
@@ -80,6 +80,8 @@ namespace Jellyfin.MeiamSub.Thunder
var cid = GetCidByFile(request.MediaPath);
_logger.LogInformation($"{Name} Search | FileHash -> { cid }");
using var options = new HttpRequestMessage
{
Method = HttpMethod.Get,
@@ -124,7 +126,8 @@ namespace Jellyfin.MeiamSub.Thunder
CommunityRating = Convert.ToSingle(m.rate),
ProviderName = $"{Name}",
Format = ExtractFormat(m.sname),
Comment = $"Format : { ExtractFormat(m.sname)} - Rate : { m.rate }"
Comment = $"Format : { ExtractFormat(m.sname)} - Rate : { m.rate }",
IsHashMatch = true
}).OrderByDescending(m => m.CommunityRating);
}
}
@@ -253,12 +256,12 @@ namespace Jellyfin.MeiamSub.Thunder
var stream = new FileStream(filePath, FileMode.Open, FileAccess.Read);
var reader = new BinaryReader(stream);
var fileSize = new FileInfo(filePath).Length;
var SHA1 = new SHA1CryptoServiceProvider();
var sha1 = SHA1.Create();
var buffer = new byte[0xf000];
if (fileSize < 0xf000)
{
reader.Read(buffer, 0, (int)fileSize);
buffer = SHA1.ComputeHash(buffer, 0, (int)fileSize);
buffer = sha1.ComputeHash(buffer, 0, (int)fileSize);
}
else
{
@@ -268,7 +271,7 @@ namespace Jellyfin.MeiamSub.Thunder
stream.Seek(fileSize - 0x5000, SeekOrigin.Begin);
reader.Read(buffer, 0xa000, 0x5000);
buffer = SHA1.ComputeHash(buffer, 0, 0xf000);
buffer = sha1.ComputeHash(buffer, 0, 0xf000);
}
var result = "";
foreach (var i in buffer)

View File

@@ -1,17 +1,17 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.31424.327
# Visual Studio Version 17
VisualStudioVersion = 17.10.34916.146
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Emby.MeiamSub.Thunder", "Emby.MeiamSub.Thunder\Emby.MeiamSub.Thunder.csproj", "{96F3F427-0EC3-4610-81C3-2C92D773EDC8}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Emby.MeiamSub.DevTool", "Emby.MeiamSub.DevTool\Emby.MeiamSub.DevTool.csproj", "{6B0C23EA-EC24-4FB0-948E-094E84AEBF21}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Emby.MeiamSub.Shooter", "Emby.MeiamSub.Shooter\Emby.MeiamSub.Shooter.csproj", "{0F502AEB-0FF4-44FA-8391-13AD61FC5490}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Jellyfin.MeiamSub.Thunder", "Jellyfin.MeiamSub.Thunder\Jellyfin.MeiamSub.Thunder.csproj", "{4676AA1B-CC6C-42DC-BD69-6A293BAE8823}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Jellyfin.MeiamSub.Shooter", "Jellyfin.MeiamSub.Shooter\Jellyfin.MeiamSub.Shooter.csproj", "{8F77E155-9A91-4882-82E8-E8D69FECD246}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Jellyfin.MeiamSub.Shooter", "Jellyfin.MeiamSub.Shooter\Jellyfin.MeiamSub.Shooter.csproj", "{8F77E155-9A91-4882-82E8-E8D69FECD246}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Emby.MeiamSub.Shooter", "Emby.MeiamSub.Shooter\Emby.MeiamSub.Shooter.csproj", "{F2636BCB-111D-4F22-AA06-8852E96D05C4}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Emby.MeiamSub.Thunder", "Emby.MeiamSub.Thunder\Emby.MeiamSub.Thunder.csproj", "{96F4C65C-11B1-46F4-B343-115168688C2D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -19,18 +19,10 @@ Global
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{96F3F427-0EC3-4610-81C3-2C92D773EDC8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{96F3F427-0EC3-4610-81C3-2C92D773EDC8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{96F3F427-0EC3-4610-81C3-2C92D773EDC8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{96F3F427-0EC3-4610-81C3-2C92D773EDC8}.Release|Any CPU.Build.0 = Release|Any CPU
{6B0C23EA-EC24-4FB0-948E-094E84AEBF21}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6B0C23EA-EC24-4FB0-948E-094E84AEBF21}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6B0C23EA-EC24-4FB0-948E-094E84AEBF21}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6B0C23EA-EC24-4FB0-948E-094E84AEBF21}.Release|Any CPU.Build.0 = Release|Any CPU
{0F502AEB-0FF4-44FA-8391-13AD61FC5490}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0F502AEB-0FF4-44FA-8391-13AD61FC5490}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0F502AEB-0FF4-44FA-8391-13AD61FC5490}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0F502AEB-0FF4-44FA-8391-13AD61FC5490}.Release|Any CPU.Build.0 = Release|Any CPU
{4676AA1B-CC6C-42DC-BD69-6A293BAE8823}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4676AA1B-CC6C-42DC-BD69-6A293BAE8823}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4676AA1B-CC6C-42DC-BD69-6A293BAE8823}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -39,6 +31,14 @@ Global
{8F77E155-9A91-4882-82E8-E8D69FECD246}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8F77E155-9A91-4882-82E8-E8D69FECD246}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8F77E155-9A91-4882-82E8-E8D69FECD246}.Release|Any CPU.Build.0 = Release|Any CPU
{F2636BCB-111D-4F22-AA06-8852E96D05C4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F2636BCB-111D-4F22-AA06-8852E96D05C4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F2636BCB-111D-4F22-AA06-8852E96D05C4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F2636BCB-111D-4F22-AA06-8852E96D05C4}.Release|Any CPU.Build.0 = Release|Any CPU
{96F4C65C-11B1-46F4-B343-115168688C2D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{96F4C65C-11B1-46F4-B343-115168688C2D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{96F4C65C-11B1-46F4-B343-115168688C2D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{96F4C65C-11B1-46F4-B343-115168688C2D}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@@ -16,6 +16,8 @@ Emby Jellyfin 中文字幕插件 ,支持 迅雷影音、射手网、 精准匹
## 给个星星! ⭐️
如果你喜欢这个项目或者它帮助你, 请给 Star~(辛苦咯)
如果你能赞助稳定 Google Drive 团队盘用于媒体库插件测试, 请于我联系 91270#QQ.COM
&nbsp;
@@ -33,8 +35,8 @@ Emby Jellyfin 中文字幕插件 ,支持 迅雷影音、射手网、 精准匹
| 1 | 开发程序 | Emby.MeiamSub.DevTool | 项目开发测试调试使用
| 2 | 字幕插件 | Emby.MeiamSub.Thunder | 迅雷看看字幕插件 - Emby
| 3 | 字幕插件 | Emby.MeiamSub.Shooter | 射手影音字幕插件 - Emby
| 3 | 字幕插件 | Jellyfin.MeiamSub.Shooter | 迅雷看看字幕插件 - Jellyfin
| 3 | 字幕插件 | Jellyfin.MeiamSub.Thunder | 射手影音字幕插件 - Jellyfin
| 4 | 字幕插件 | Jellyfin.MeiamSub.Shooter | 迅雷看看字幕插件 - Jellyfin
| 5 | 字幕插件 | Jellyfin.MeiamSub.Thunder | 射手影音字幕插件 - Jellyfin
@@ -60,7 +62,7 @@ Emby Jellyfin 中文字幕插件 ,支持 迅雷影音、射手网、 精准匹
### 群晖
```bash
复制插件文件到 /var/packages/EmbyServer/target/var/plugins
复制插件文件到 /var/packages/EmbyServer/var/plugins
复制插件文件到 /var/packages/EmbyServer/target/system/plugins
重启服务
```
@@ -73,6 +75,13 @@ Emby Jellyfin 中文字幕插件 ,支持 迅雷影音、射手网、 精准匹
重启服务
```
### Jellyfin 可通过存储库安装、更新插件
```bash
# 通过 控制台 -> 插件 -> 存储库 添加存储库 URL , 即可通过插件目录查看并安装插件
https://github.com/91270/MeiamSubtitles.Release/raw/main/Plugin/manifest-stable.json
```
&nbsp;
## 贡献