mirror of
https://github.com/91270/MeiamSubtitles.git
synced 2026-02-03 02:24:16 +08:00
Compare commits
38 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bb8135590f | ||
|
|
f82702f844 | ||
|
|
ded87375e1 | ||
|
|
706971992d | ||
|
|
bbcfd01580 | ||
|
|
008383cf1e | ||
|
|
a6feb50e45 | ||
|
|
0ef2a92705 | ||
|
|
af2d333106 | ||
|
|
630147e853 | ||
|
|
d05afc5ffd | ||
|
|
237839efea | ||
|
|
0e5a5d1b0d | ||
|
|
8bebe5ba5b | ||
|
|
0c5a3656c8 | ||
|
|
339b05b763 | ||
|
|
54b13d647d | ||
|
|
2e06131f8d | ||
|
|
8f69a7ffca | ||
|
|
bf178f7cef | ||
|
|
39aafddd23 | ||
|
|
f8854e2a85 | ||
|
|
d63de08b8e | ||
|
|
ac28e193e3 | ||
|
|
f796c05f99 | ||
|
|
ddeb8e0c14 | ||
|
|
7a0fb35fc5 | ||
|
|
74e576de93 | ||
|
|
bc72ca4ab0 | ||
|
|
2d4940156d | ||
|
|
7da60776cb | ||
|
|
03ce0a0dda | ||
|
|
492294941f | ||
|
|
18e00d72e2 | ||
|
|
ea887747b7 | ||
|
|
08a1936bf5 | ||
|
|
5d4b42c1f8 | ||
|
|
2216cb40b3 |
@@ -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>
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -1,26 +1,34 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<AssemblyVersion>1.0.2.0</AssemblyVersion>
|
||||
<FileVersion>1.0.2.0</FileVersion>
|
||||
<Version>1.0.2</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.6.0.50" />
|
||||
<PackageReference Include="MediaBrowser.Server.Core" Version="4.6.0.50" />
|
||||
<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
" />
|
||||
</Target>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -9,7 +9,6 @@ namespace Emby.MeiamSub.Shooter.Model
|
||||
public string Url { get; set; }
|
||||
public string Format { get; set; }
|
||||
public string Language { get; set; }
|
||||
public string TwoLetterISOLanguageName { get; set; }
|
||||
public bool? IsForced { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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,11 +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("{0} Init", new object[1] { Name });
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -60,7 +62,7 @@ namespace Emby.MeiamSub.Shooter
|
||||
/// <returns></returns>
|
||||
public async Task<IEnumerable<RemoteSubtitleInfo>> Search(SubtitleSearchRequest request, CancellationToken cancellationToken)
|
||||
{
|
||||
_logger.Debug($"MeiamSub.Shooter Search | Request -> { _jsonSerializer.SerializeToString(request) }");
|
||||
_logger.Info("{0} Search | SubtitleSearchRequest -> {1}", new object[2] { Name , _jsonSerializer.SerializeToString(request) });
|
||||
|
||||
var subtitles = await SearchSubtitlesAsync(request);
|
||||
|
||||
@@ -74,6 +76,12 @@ namespace Emby.MeiamSub.Shooter
|
||||
/// <returns></returns>
|
||||
private async Task<IEnumerable<RemoteSubtitleInfo>> SearchSubtitlesAsync(SubtitleSearchRequest request)
|
||||
{
|
||||
if(request.Language == "zh-CN" || request.Language == "zh-TW" || request.Language == "zh-HK"){
|
||||
request.Language = "chi";
|
||||
}
|
||||
if(request.Language == "en"){
|
||||
request.Language = "eng";
|
||||
}
|
||||
if (request.Language != "chi" && request.Language != "eng")
|
||||
{
|
||||
return Array.Empty<RemoteSubtitleInfo>();
|
||||
@@ -83,10 +91,12 @@ 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",
|
||||
UserAgent = "Emby.MeiamSub.Shooter",
|
||||
Url = $"https://www.shooter.cn/api/subapi.php",
|
||||
UserAgent = $"{Name}",
|
||||
TimeoutMs = 30000,
|
||||
AcceptHeader = "*/*",
|
||||
};
|
||||
@@ -99,11 +109,11 @@ namespace Emby.MeiamSub.Shooter
|
||||
{ "lang",request.Language == "chi" ? "chn" : "eng"}
|
||||
});
|
||||
|
||||
_logger.Debug($"MeiamSub.Shooter 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.Debug($"MeiamSub.Shooter 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"))
|
||||
{
|
||||
@@ -111,7 +121,7 @@ namespace Emby.MeiamSub.Shooter
|
||||
|
||||
if (subtitleResponse != null)
|
||||
{
|
||||
_logger.Debug($"MeiamSub.Shooter Search | Response -> { _jsonSerializer.SerializeToString(subtitleResponse) }");
|
||||
_logger.Info("{0} Search | Response -> {1}", new object[2] { Name, _jsonSerializer.SerializeToString(subtitleResponse) });
|
||||
|
||||
var remoteSubtitleInfos = new List<RemoteSubtitleInfo>();
|
||||
|
||||
@@ -126,25 +136,25 @@ namespace Emby.MeiamSub.Shooter
|
||||
Url = subFile.Link,
|
||||
Format = subFile.Ext,
|
||||
Language = request.Language,
|
||||
TwoLetterISOLanguageName = request.TwoLetterISOLanguageName,
|
||||
IsForced = request.IsForced
|
||||
})),
|
||||
Name = $"[MEIAMSUB] { Path.GetFileName(request.MediaPath) } | {request.TwoLetterISOLanguageName} | 射手",
|
||||
Name = $"[MEIAMSUB] { Path.GetFileName(request.MediaPath) } | {request.Language} | 射手",
|
||||
Author = "Meiam ",
|
||||
ProviderName = "MeiamSub.Shooter",
|
||||
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.Debug($"MeiamSub.Shooter Search | Summary -> Get { remoteSubtitleInfos.Count } Subtitles");
|
||||
|
||||
return remoteSubtitleInfos;
|
||||
}
|
||||
}
|
||||
|
||||
_logger.Debug($"MeiamSub.Shooter Search | Summary -> Get 0 Subtitles");
|
||||
_logger.Info("{0} Search | Summary -> Get 0 Subtitles", new object[1] { Name });
|
||||
|
||||
return Array.Empty<RemoteSubtitleInfo>();
|
||||
}
|
||||
@@ -159,10 +169,7 @@ namespace Emby.MeiamSub.Shooter
|
||||
/// <returns></returns>
|
||||
public async Task<SubtitleResponse> GetSubtitles(string id, CancellationToken cancellationToken)
|
||||
{
|
||||
await Task.Run(() =>
|
||||
{
|
||||
_logger.Debug($"MeiamSub.Shooter DownloadSub | Request -> {id}");
|
||||
});
|
||||
_logger.Info("{0} DownloadSub | Request -> {1}", new object[2] { Name, id });
|
||||
|
||||
return await DownloadSubAsync(id);
|
||||
}
|
||||
@@ -176,17 +183,25 @@ namespace Emby.MeiamSub.Shooter
|
||||
{
|
||||
var downloadSub = _jsonSerializer.DeserializeFromString<DownloadSubInfo>(Base64Decode(info));
|
||||
|
||||
_logger.Debug($"MeiamSub.Shooter DownloadSub | Url -> { downloadSub.Url } | Format -> { downloadSub.Format } | Language -> { downloadSub.Language } ");
|
||||
if (downloadSub == null)
|
||||
{
|
||||
return new SubtitleResponse();
|
||||
}
|
||||
|
||||
_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
|
||||
{
|
||||
Url = downloadSub.Url,
|
||||
UserAgent = "Emby.MeiamSub.Shooter",
|
||||
UserAgent = $"{Name}",
|
||||
TimeoutMs = 30000,
|
||||
AcceptHeader = "*/*",
|
||||
});
|
||||
|
||||
_logger.Debug($"MeiamSub.Shooter DownloadSub | Response -> { response.StatusCode }");
|
||||
|
||||
_logger.Info("{0} DownloadSub | Request -> {1}", new object[2] { Name, response.StatusCode });
|
||||
|
||||
|
||||
if (response.StatusCode == HttpStatusCode.OK)
|
||||
{
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<AssemblyVersion>1.0.2.0</AssemblyVersion>
|
||||
<FileVersion>1.0.2.0</FileVersion>
|
||||
<Version>1.0.2</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.6.0.50" />
|
||||
<PackageReference Include="MediaBrowser.Server.Core" Version="4.6.0.50" />
|
||||
<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
" />
|
||||
</Target>
|
||||
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -9,7 +9,6 @@ namespace Emby.MeiamSub.Thunder.Model
|
||||
public string Url { get; set; }
|
||||
public string Format { get; set; }
|
||||
public string Language { get; set; }
|
||||
public string TwoLetterISOLanguageName { get; set; }
|
||||
public bool? IsForced { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,10 +28,6 @@ namespace Emby.MeiamSub.Thunder.Model
|
||||
///
|
||||
/// </summary>
|
||||
public int svote { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public int roffset { get; set; }
|
||||
}
|
||||
|
||||
public class SubtitleResponseRoot
|
||||
|
||||
@@ -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,11 +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("{0} Init", new object[1] { Name });
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -60,7 +61,7 @@ namespace Emby.MeiamSub.Thunder
|
||||
/// <returns></returns>
|
||||
public async Task<IEnumerable<RemoteSubtitleInfo>> Search(SubtitleSearchRequest request, CancellationToken cancellationToken)
|
||||
{
|
||||
_logger.Debug($"MeiamSub.Thunder Search | Request -> { _jsonSerializer.SerializeToString(request) }");
|
||||
_logger.Info($"{0} Search | SubtitleSearchRequest -> {1}", new object[2] { Name, _jsonSerializer.SerializeToString(request) });
|
||||
|
||||
var subtitles = await SearchSubtitlesAsync(request);
|
||||
|
||||
@@ -74,6 +75,9 @@ namespace Emby.MeiamSub.Thunder
|
||||
/// <returns></returns>
|
||||
private async Task<IEnumerable<RemoteSubtitleInfo>> SearchSubtitlesAsync(SubtitleSearchRequest request)
|
||||
{
|
||||
if(request.Language == "zh-CN" || request.Language == "zh-TW" || request.Language == "zh-HK"){
|
||||
request.Language = "chi";
|
||||
}
|
||||
if (request.Language != "chi")
|
||||
{
|
||||
return Array.Empty<RemoteSubtitleInfo>();
|
||||
@@ -81,15 +85,18 @@ 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",
|
||||
UserAgent = "Emby.MeiamSub.Thunder",
|
||||
//Url = $"http://sub.xmp.sandai.net:8000/subxl/{cid}.json",
|
||||
Url = $"http://subtitle.kankan.xunlei.com:8000/subxl/{cid}.json",
|
||||
UserAgent = $"{Name}",
|
||||
TimeoutMs = 30000,
|
||||
AcceptHeader = "*/*",
|
||||
});
|
||||
|
||||
_logger.Debug($"MeiamSub.Thunder Search | Response -> { _jsonSerializer.SerializeToString(response) }");
|
||||
_logger.Info($"{0} Search | Response -> {1}", new object[2] { Name, _jsonSerializer.SerializeToString(response) });
|
||||
|
||||
if (response.StatusCode == HttpStatusCode.OK)
|
||||
{
|
||||
@@ -97,13 +104,13 @@ namespace Emby.MeiamSub.Thunder
|
||||
|
||||
if (subtitleResponse != null)
|
||||
{
|
||||
_logger.Debug($"MeiamSub.Thunder 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.Debug($"MeiamSub.Thunder 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()
|
||||
{
|
||||
@@ -112,21 +119,22 @@ namespace Emby.MeiamSub.Thunder
|
||||
Url = m.surl,
|
||||
Format = ExtractFormat(m.sname),
|
||||
Language = request.Language,
|
||||
TwoLetterISOLanguageName = request.TwoLetterISOLanguageName,
|
||||
IsForced = request.IsForced
|
||||
})),
|
||||
Name = $"[MEIAMSUB] { Path.GetFileName(request.MediaPath) } | {request.TwoLetterISOLanguageName} | 迅雷",
|
||||
Name = $"[MEIAMSUB] { Path.GetFileName(request.MediaPath) } | {m.language} | 迅雷",
|
||||
Author = "Meiam ",
|
||||
CommunityRating = Convert.ToSingle(m.rate),
|
||||
ProviderName = "MeiamSub.Thunder",
|
||||
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.Debug($"MeiamSub.Thunder Search | Summary -> Get 0 Subtitles");
|
||||
_logger.Info($"{0} Search | Summary -> Get 0 Subtitles", new object[1] { Name });
|
||||
|
||||
|
||||
return Array.Empty<RemoteSubtitleInfo>();
|
||||
}
|
||||
@@ -141,10 +149,7 @@ namespace Emby.MeiamSub.Thunder
|
||||
/// <returns></returns>
|
||||
public async Task<SubtitleResponse> GetSubtitles(string id, CancellationToken cancellationToken)
|
||||
{
|
||||
await Task.Run(() =>
|
||||
{
|
||||
_logger.Debug($"MeiamSub.Thunder DownloadSub | Request -> {id}");
|
||||
});
|
||||
_logger.Info($"{0} DownloadSub | Request -> {1}", new object[2] { Name, id });
|
||||
|
||||
return await DownloadSubAsync(id);
|
||||
}
|
||||
@@ -158,17 +163,23 @@ namespace Emby.MeiamSub.Thunder
|
||||
{
|
||||
var downloadSub = _jsonSerializer.DeserializeFromString<DownloadSubInfo>(Base64Decode(info));
|
||||
|
||||
_logger.Debug($"MeiamSub.Thunder DownloadSub | Url -> { downloadSub.Url } | Format -> { downloadSub.Format } | Language -> { downloadSub.Language } ");
|
||||
if (downloadSub == null)
|
||||
{
|
||||
return new SubtitleResponse();
|
||||
}
|
||||
|
||||
_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
|
||||
{
|
||||
Url = downloadSub.Url,
|
||||
UserAgent = "Emby.MeiamSub.Thunder",
|
||||
UserAgent = $"{Name}",
|
||||
TimeoutMs = 30000,
|
||||
AcceptHeader = "*/*",
|
||||
});
|
||||
|
||||
_logger.Debug($"MeiamSub.Thunder DownloadSub | Response -> { response.StatusCode }");
|
||||
_logger.Info($"{0} DownloadSub | Response -> {1}", new object[2] { Name, response.StatusCode });
|
||||
|
||||
if (response.StatusCode == HttpStatusCode.OK)
|
||||
{
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.31424.327
|
||||
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("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Emby.MeiamSub.Shooter", "Emby.MeiamSub.Shooter\Emby.MeiamSub.Shooter.csproj", "{0F502AEB-0FF4-44FA-8391-13AD61FC5490}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
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
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {AC5A2964-C7C8-419B-A8DD-63424233E6AA}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -0,0 +1,12 @@
|
||||
using MediaBrowser.Model.Plugins;
|
||||
|
||||
namespace Jellyfin.MeiamSub.Shooter.Configuration
|
||||
{
|
||||
/// <summary>
|
||||
/// Plugin configuration.
|
||||
/// </summary>
|
||||
public class PluginConfiguration : BasePluginConfiguration
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
22
Jellyfin.MeiamSub.Shooter/Jellyfin.MeiamSub.Shooter.csproj
Normal file
22
Jellyfin.MeiamSub.Shooter/Jellyfin.MeiamSub.Shooter.csproj
Normal file
@@ -0,0 +1,22 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<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'">
|
||||
<OutputPath>..\Release</OutputPath>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Jellyfin.Controller" Version="10.9.2" />
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
||||
<Exec Command="Copy $(TargetDir)$(TargetFileName) $(SolutionDir)$(ConfigurationName)\$(TargetFileName) /y
" />
|
||||
</Target>
|
||||
|
||||
</Project>
|
||||
15
Jellyfin.MeiamSub.Shooter/Model/DownloadSubInfo.cs
Normal file
15
Jellyfin.MeiamSub.Shooter/Model/DownloadSubInfo.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Jellyfin.MeiamSub.Shooter.Model
|
||||
{
|
||||
public class DownloadSubInfo
|
||||
{
|
||||
public string Url { get; set; }
|
||||
public string Format { get; set; }
|
||||
public string Language { get; set; }
|
||||
public string TwoLetterISOLanguageName { get; set; }
|
||||
public bool? IsForced { get; set; }
|
||||
}
|
||||
}
|
||||
19
Jellyfin.MeiamSub.Shooter/Model/SubtitleResponseRoot.cs
Normal file
19
Jellyfin.MeiamSub.Shooter/Model/SubtitleResponseRoot.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace Jellyfin.MeiamSub.Shooter.Model
|
||||
{
|
||||
public class SubtitleResponseRoot
|
||||
{
|
||||
public string Desc { get; set; }
|
||||
public int Delay { get; set; }
|
||||
public SubFileInfo[] Files { get; set; }
|
||||
}
|
||||
|
||||
public class SubFileInfo
|
||||
{
|
||||
public string Ext { get; set; }
|
||||
public string Link { get; set; }
|
||||
}
|
||||
|
||||
}
|
||||
41
Jellyfin.MeiamSub.Shooter/Plugin.cs
Normal file
41
Jellyfin.MeiamSub.Shooter/Plugin.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
using Jellyfin.MeiamSub.Shooter.Configuration;
|
||||
using MediaBrowser.Common.Configuration;
|
||||
using MediaBrowser.Common.Plugins;
|
||||
using MediaBrowser.Model.Drawing;
|
||||
using MediaBrowser.Model.Serialization;
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace Jellyfin.MeiamSub.Shooter
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 插件入口
|
||||
/// </summary>
|
||||
public class Plugin : BasePlugin<PluginConfiguration>
|
||||
{
|
||||
/// <summary>
|
||||
/// 插件ID
|
||||
/// </summary>
|
||||
public override Guid Id => new Guid("038D37A2-7A1E-4C01-9B6D-AA215D29AB4C");
|
||||
|
||||
/// <summary>
|
||||
/// 插件名称
|
||||
/// </summary>
|
||||
public override string Name => "MeiamSub.Shooter";
|
||||
|
||||
/// <summary>
|
||||
/// 插件描述
|
||||
/// </summary>
|
||||
public override string Description => "Download subtitles from Shooter";
|
||||
|
||||
public Plugin(IApplicationPaths applicationPaths, IXmlSerializer xmlSerializer)
|
||||
: base(applicationPaths, xmlSerializer)
|
||||
{
|
||||
Instance = this;
|
||||
}
|
||||
|
||||
public static Plugin Instance { get; private set; }
|
||||
|
||||
}
|
||||
}
|
||||
20
Jellyfin.MeiamSub.Shooter/PluginServiceRegistrator.cs
Normal file
20
Jellyfin.MeiamSub.Shooter/PluginServiceRegistrator.cs
Normal 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>();
|
||||
}
|
||||
}
|
||||
}
|
||||
315
Jellyfin.MeiamSub.Shooter/ShooterProvider.cs
Normal file
315
Jellyfin.MeiamSub.Shooter/ShooterProvider.cs
Normal file
@@ -0,0 +1,315 @@
|
||||
using Jellyfin.MeiamSub.Shooter.Model;
|
||||
using MediaBrowser.Controller.Providers;
|
||||
using MediaBrowser.Controller.Subtitles;
|
||||
using MediaBrowser.Model.Providers;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web;
|
||||
|
||||
namespace Jellyfin.MeiamSub.Shooter
|
||||
{
|
||||
/// <summary>
|
||||
/// 迅雷字幕组件
|
||||
/// </summary>
|
||||
public class ShooterProvider : ISubtitleProvider, IHasOrder
|
||||
{
|
||||
#region 变量声明
|
||||
public const string ASS = "ass";
|
||||
public const string SSA = "ssa";
|
||||
public const string SRT = "srt";
|
||||
|
||||
private readonly ILogger<ShooterProvider> _logger;
|
||||
private static readonly HttpClient _httpClient = new HttpClient();
|
||||
|
||||
public int Order => 1;
|
||||
public string Name => "MeiamSub.Shooter";
|
||||
|
||||
/// <summary>
|
||||
/// 支持电影、剧集
|
||||
/// </summary>
|
||||
public IEnumerable<VideoContentType> SupportedMediaTypes => new List<VideoContentType>() { VideoContentType.Movie, VideoContentType.Episode };
|
||||
#endregion
|
||||
|
||||
#region 构造函数
|
||||
public ShooterProvider(ILogger<ShooterProvider> logger)
|
||||
{
|
||||
_logger = logger;
|
||||
_httpClient.Timeout = TimeSpan.FromSeconds(30);
|
||||
_logger.LogInformation($"{Name} Init");
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 查询字幕
|
||||
|
||||
/// <summary>
|
||||
/// 查询请求
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<IEnumerable<RemoteSubtitleInfo>> Search(SubtitleSearchRequest request, CancellationToken cancellationToken)
|
||||
{
|
||||
_logger.LogInformation($"{Name} Search | SubtitleSearchRequest -> { JsonSerializer.Serialize(request) }");
|
||||
|
||||
var subtitles = await SearchSubtitlesAsync(request);
|
||||
|
||||
return subtitles;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询字幕
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
private async Task<IEnumerable<RemoteSubtitleInfo>> SearchSubtitlesAsync(SubtitleSearchRequest request)
|
||||
{
|
||||
if (request.Language != "chi" && request.Language != "eng")
|
||||
{
|
||||
return Array.Empty<RemoteSubtitleInfo>();
|
||||
}
|
||||
|
||||
FileInfo fileInfo = new(request.MediaPath);
|
||||
|
||||
var hash = ComputeFileHash(fileInfo);
|
||||
|
||||
_logger.LogInformation($"{Name} Search | FileHash -> { hash }");
|
||||
|
||||
var content = new Dictionary<string, string>
|
||||
{
|
||||
{ "filehash", hash},
|
||||
{ "pathinfo", request.MediaPath},
|
||||
{ "format", "json"},
|
||||
{ "lang", request.Language == "chi" ? "chn" : "eng"}
|
||||
};
|
||||
|
||||
|
||||
HttpRequestMessage requestMessage = new HttpRequestMessage();
|
||||
|
||||
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.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)
|
||||
{
|
||||
var remoteSubtitleInfos = new List<RemoteSubtitleInfo>();
|
||||
|
||||
foreach (var subFileInfo in subtitleResponse)
|
||||
{
|
||||
foreach (var subFile in subFileInfo.Files)
|
||||
{
|
||||
remoteSubtitleInfos.Add(new RemoteSubtitleInfo()
|
||||
{
|
||||
Id = Base64Encode(JsonSerializer.Serialize(new DownloadSubInfo
|
||||
{
|
||||
Url = subFile.Link,
|
||||
Format = subFile.Ext,
|
||||
Language = request.Language,
|
||||
TwoLetterISOLanguageName = request.TwoLetterISOLanguageName,
|
||||
})),
|
||||
Name = $"[MEIAMSUB] { Path.GetFileName(request.MediaPath) } | {request.TwoLetterISOLanguageName} | 射手",
|
||||
Author = "Meiam ",
|
||||
ProviderName = $"{Name}",
|
||||
Format = subFile.Ext,
|
||||
Comment = $"Format : { ExtractFormat(subFile.Ext)}",
|
||||
IsHashMatch = true
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
_logger.LogInformation($"{Name} Search | Summary -> Get { remoteSubtitleInfos.Count } Subtitles");
|
||||
|
||||
return remoteSubtitleInfos;
|
||||
}
|
||||
}
|
||||
|
||||
_logger.LogInformation($"{Name} Search | Summary -> Get 0 Subtitles");
|
||||
|
||||
|
||||
return Array.Empty<RemoteSubtitleInfo>();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 下载字幕
|
||||
/// <summary>
|
||||
/// 下载请求
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<SubtitleResponse> GetSubtitles(string id, CancellationToken cancellationToken)
|
||||
{
|
||||
_logger.LogInformation($"{Name} DownloadSub | Request -> {id}");
|
||||
|
||||
return await DownloadSubAsync(id);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 下载字幕
|
||||
/// </summary>
|
||||
/// <param name="info"></param>
|
||||
/// <returns></returns>
|
||||
private async Task<SubtitleResponse> DownloadSubAsync(string info)
|
||||
{
|
||||
var downloadSub = JsonSerializer.Deserialize<DownloadSubInfo>(Base64Decode(info));
|
||||
|
||||
if (downloadSub == null)
|
||||
{
|
||||
return new SubtitleResponse();
|
||||
}
|
||||
|
||||
_logger.LogInformation($"{Name} DownloadSub | Url -> { downloadSub.Url } | Format -> { downloadSub.Format } | Language -> { downloadSub.Language } ");
|
||||
|
||||
using var options = new HttpRequestMessage
|
||||
{
|
||||
Method = HttpMethod.Get,
|
||||
RequestUri = new Uri(downloadSub.Url),
|
||||
Headers =
|
||||
{
|
||||
UserAgent = { new ProductInfoHeaderValue(new ProductHeaderValue($"{Name}")) },
|
||||
Accept = { new MediaTypeWithQualityHeaderValue("*/*") }
|
||||
}
|
||||
};
|
||||
|
||||
var response = await _httpClient.SendAsync(options);
|
||||
|
||||
_logger.LogInformation($"{Name} DownloadSub | Response -> { response.StatusCode }");
|
||||
|
||||
if (response.StatusCode == HttpStatusCode.OK)
|
||||
{
|
||||
var stream = await response.Content.ReadAsStreamAsync();
|
||||
|
||||
return new SubtitleResponse()
|
||||
{
|
||||
Language = downloadSub.Language,
|
||||
IsForced = false,
|
||||
Format = downloadSub.Format,
|
||||
Stream = stream,
|
||||
};
|
||||
}
|
||||
|
||||
return new SubtitleResponse();
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 内部方法
|
||||
|
||||
/// <summary>
|
||||
/// Base64 加密
|
||||
/// </summary>
|
||||
/// <param name="plainText">明文</param>
|
||||
/// <returns></returns>
|
||||
public static string Base64Encode(string plainText)
|
||||
{
|
||||
var plainTextBytes = Encoding.UTF8.GetBytes(plainText);
|
||||
return Convert.ToBase64String(plainTextBytes);
|
||||
}
|
||||
/// <summary>
|
||||
/// Base64 解密
|
||||
/// </summary>
|
||||
/// <param name="base64EncodedData"></param>
|
||||
/// <returns></returns>
|
||||
public static string Base64Decode(string base64EncodedData)
|
||||
{
|
||||
var base64EncodedBytes = Convert.FromBase64String(base64EncodedData);
|
||||
return Encoding.UTF8.GetString(base64EncodedBytes);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 提取格式化字幕类型
|
||||
/// </summary>
|
||||
/// <param name="text"></param>
|
||||
/// <returns></returns>
|
||||
protected string ExtractFormat(string text)
|
||||
{
|
||||
|
||||
string result = null;
|
||||
|
||||
if (text != null)
|
||||
{
|
||||
text = text.ToLower();
|
||||
if (text.Contains(ASS)) result = ASS;
|
||||
else if (text.Contains(SSA)) result = SSA;
|
||||
else if (text.Contains(SRT)) result = SRT;
|
||||
else result = null;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取文件 Hash (射手)
|
||||
/// </summary>
|
||||
/// <param name="filePath"></param>
|
||||
/// <returns></returns>
|
||||
public static string ComputeFileHash(FileInfo fileInfo)
|
||||
{
|
||||
string ret = "";
|
||||
|
||||
if (!fileInfo.Exists || fileInfo.Length < 8 * 1024)
|
||||
{
|
||||
return ret;
|
||||
}
|
||||
|
||||
FileStream fs = new FileStream(fileInfo.FullName, FileMode.Open, FileAccess.Read);
|
||||
|
||||
long[] offset = new long[4];
|
||||
offset[3] = fileInfo.Length - 8 * 1024;
|
||||
offset[2] = fileInfo.Length / 3;
|
||||
offset[1] = fileInfo.Length / 3 * 2;
|
||||
offset[0] = 4 * 1024;
|
||||
|
||||
byte[] bBuf = new byte[1024 * 4];
|
||||
|
||||
for (int i = 0; i < 4; ++i)
|
||||
{
|
||||
fs.Seek(offset[i], 0);
|
||||
fs.Read(bBuf, 0, 4 * 1024);
|
||||
|
||||
MD5 md5Hash = MD5.Create();
|
||||
byte[] data = md5Hash.ComputeHash(bBuf);
|
||||
StringBuilder sBuilder = new StringBuilder();
|
||||
|
||||
for (int j = 0; j < data.Length; j++)
|
||||
{
|
||||
sBuilder.Append(data[j].ToString("x2"));
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(ret))
|
||||
{
|
||||
ret += ";";
|
||||
}
|
||||
|
||||
ret += sBuilder.ToString();
|
||||
}
|
||||
|
||||
fs.Close();
|
||||
|
||||
return ret;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using MediaBrowser.Model.Plugins;
|
||||
|
||||
namespace Jellyfin.MeiamSub.Thunder.Configuration
|
||||
{
|
||||
/// <summary>
|
||||
/// Plugin configuration.
|
||||
/// </summary>
|
||||
public class PluginConfiguration : BasePluginConfiguration
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
24
Jellyfin.MeiamSub.Thunder/Jellyfin.MeiamSub.Thunder.csproj
Normal file
24
Jellyfin.MeiamSub.Thunder/Jellyfin.MeiamSub.Thunder.csproj
Normal file
@@ -0,0 +1,24 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Library</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ApplicationIcon />
|
||||
<StartupObject />
|
||||
<Version>1.0.10</Version>
|
||||
<AssemblyVersion>1.0.10.0</AssemblyVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
|
||||
<OutputPath>..\Release</OutputPath>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Jellyfin.Controller" Version="10.9.2" />
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
||||
<Exec Command="Copy $(TargetDir)$(TargetFileName) $(SolutionDir)$(ConfigurationName)\$(TargetFileName) /y
" />
|
||||
</Target>
|
||||
|
||||
</Project>
|
||||
14
Jellyfin.MeiamSub.Thunder/Model/DownloadSubInfo.cs
Normal file
14
Jellyfin.MeiamSub.Thunder/Model/DownloadSubInfo.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Jellyfin.MeiamSub.Thunder.Model
|
||||
{
|
||||
public class DownloadSubInfo
|
||||
{
|
||||
public string Url { get; set; }
|
||||
public string Format { get; set; }
|
||||
public string Language { get; set; }
|
||||
public string TwoLetterISOLanguageName { get; set; }
|
||||
}
|
||||
}
|
||||
40
Jellyfin.MeiamSub.Thunder/Model/SubtitleResponseRoot.cs
Normal file
40
Jellyfin.MeiamSub.Thunder/Model/SubtitleResponseRoot.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Jellyfin.MeiamSub.Thunder.Model
|
||||
{
|
||||
public class SublistItem
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string scid { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string sname { get; set; }
|
||||
/// <summary>
|
||||
/// 未知语言
|
||||
/// </summary>
|
||||
public string language { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string rate { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string surl { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public int svote { get; set; }
|
||||
}
|
||||
|
||||
public class SubtitleResponseRoot
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public List<SublistItem> sublist { get; set; }
|
||||
}
|
||||
}
|
||||
39
Jellyfin.MeiamSub.Thunder/Plugin.cs
Normal file
39
Jellyfin.MeiamSub.Thunder/Plugin.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using Jellyfin.MeiamSub.Thunder.Configuration;
|
||||
using MediaBrowser.Common.Configuration;
|
||||
using MediaBrowser.Common.Plugins;
|
||||
using MediaBrowser.Model.Drawing;
|
||||
using MediaBrowser.Model.Serialization;
|
||||
using System;
|
||||
|
||||
namespace Jellyfin.MeiamSub.Thunder
|
||||
{
|
||||
/// <summary>
|
||||
/// 插件入口
|
||||
/// </summary>
|
||||
public class Plugin : BasePlugin<PluginConfiguration>
|
||||
{
|
||||
/// <summary>
|
||||
/// 插件ID
|
||||
/// </summary>
|
||||
public override Guid Id => new Guid("E4CE9DA9-EF00-417C-96F2-861C512D45EB");
|
||||
|
||||
/// <summary>
|
||||
/// 插件名称
|
||||
/// </summary>
|
||||
public override string Name => "MeiamSub.Thunder";
|
||||
|
||||
/// <summary>
|
||||
/// 插件描述
|
||||
/// </summary>
|
||||
public override string Description => "Download subtitles from Thunder XMP";
|
||||
|
||||
|
||||
public Plugin(IApplicationPaths applicationPaths, IXmlSerializer xmlSerializer)
|
||||
: base(applicationPaths, xmlSerializer)
|
||||
{
|
||||
Instance = this;
|
||||
}
|
||||
|
||||
public static Plugin Instance { get; private set; }
|
||||
}
|
||||
}
|
||||
20
Jellyfin.MeiamSub.Thunder/PluginServiceRegistrator.cs
Normal file
20
Jellyfin.MeiamSub.Thunder/PluginServiceRegistrator.cs
Normal 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>();
|
||||
}
|
||||
}
|
||||
}
|
||||
285
Jellyfin.MeiamSub.Thunder/ThunderProvider.cs
Normal file
285
Jellyfin.MeiamSub.Thunder/ThunderProvider.cs
Normal file
@@ -0,0 +1,285 @@
|
||||
using Jellyfin.MeiamSub.Thunder.Model;
|
||||
using MediaBrowser.Controller.Providers;
|
||||
using MediaBrowser.Controller.Subtitles;
|
||||
using MediaBrowser.Model.Providers;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Jellyfin.MeiamSub.Thunder
|
||||
{
|
||||
/// <summary>
|
||||
/// 迅雷字幕组件
|
||||
/// </summary>
|
||||
public class ThunderProvider : ISubtitleProvider, IHasOrder
|
||||
{
|
||||
#region 变量声明
|
||||
public const string ASS = "ass";
|
||||
public const string SSA = "ssa";
|
||||
public const string SRT = "srt";
|
||||
|
||||
private readonly ILogger<ThunderProvider> _logger;
|
||||
private static readonly HttpClient _httpClient = new HttpClient();
|
||||
|
||||
public int Order => 1;
|
||||
public string Name => "MeiamSub.Thunder";
|
||||
|
||||
/// <summary>
|
||||
/// 支持电影、剧集
|
||||
/// </summary>
|
||||
public IEnumerable<VideoContentType> SupportedMediaTypes => new List<VideoContentType>() { VideoContentType.Movie, VideoContentType.Episode };
|
||||
#endregion
|
||||
|
||||
#region 构造函数
|
||||
public ThunderProvider(ILogger<ThunderProvider> logger)
|
||||
{
|
||||
_logger = logger;
|
||||
_httpClient.Timeout = TimeSpan.FromSeconds(30);
|
||||
_logger.LogInformation($"{Name} Init");
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 查询字幕
|
||||
|
||||
/// <summary>
|
||||
/// 查询请求
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<IEnumerable<RemoteSubtitleInfo>> Search(SubtitleSearchRequest request, CancellationToken cancellationToken)
|
||||
{
|
||||
_logger.LogInformation($"{Name} Search | SubtitleSearchRequest -> { JsonSerializer.Serialize(request) }");
|
||||
|
||||
var subtitles = await SearchSubtitlesAsync(request);
|
||||
|
||||
return subtitles;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询字幕
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
private async Task<IEnumerable<RemoteSubtitleInfo>> SearchSubtitlesAsync(SubtitleSearchRequest request)
|
||||
{
|
||||
if (request.Language != "chi")
|
||||
{
|
||||
return Array.Empty<RemoteSubtitleInfo>();
|
||||
}
|
||||
|
||||
var cid = GetCidByFile(request.MediaPath);
|
||||
|
||||
_logger.LogInformation($"{Name} Search | FileHash -> { cid }");
|
||||
|
||||
using var options = new HttpRequestMessage
|
||||
{
|
||||
Method = HttpMethod.Get,
|
||||
//RequestUri = new Uri($"http://sub.xmp.sandai.net:8000/subxl/{cid}.json"),
|
||||
RequestUri = new Uri($"http://subtitle.kankan.xunlei.com:8000/subxl/{cid}.json"),
|
||||
Headers =
|
||||
{
|
||||
UserAgent = { new ProductInfoHeaderValue(new ProductHeaderValue($"{Name}")) },
|
||||
Accept = { new MediaTypeWithQualityHeaderValue("*/*") },
|
||||
}
|
||||
};
|
||||
|
||||
var response = await _httpClient.SendAsync(options);
|
||||
|
||||
_logger.LogInformation($"{Name} Search | Response -> { JsonSerializer.Serialize(response) }");
|
||||
|
||||
if (response.StatusCode == HttpStatusCode.OK)
|
||||
{
|
||||
var subtitleResponse = JsonSerializer.Deserialize<SubtitleResponseRoot>(await response.Content.ReadAsStringAsync());
|
||||
|
||||
if (subtitleResponse != null)
|
||||
{
|
||||
_logger.LogInformation($"{Name} Search | Response -> { JsonSerializer.Serialize(subtitleResponse) }");
|
||||
|
||||
var subtitles = subtitleResponse.sublist.Where(m => !string.IsNullOrEmpty(m.sname));
|
||||
|
||||
if (subtitles.Count() > 0)
|
||||
{
|
||||
_logger.LogInformation($"{Name} Search | Summary -> Get { subtitles.Count() } Subtitles");
|
||||
|
||||
return subtitles.Select(m => new RemoteSubtitleInfo()
|
||||
{
|
||||
Id = Base64Encode(JsonSerializer.Serialize(new DownloadSubInfo
|
||||
{
|
||||
Url = m.surl,
|
||||
Format = ExtractFormat(m.sname),
|
||||
Language = request.Language,
|
||||
TwoLetterISOLanguageName = request.TwoLetterISOLanguageName,
|
||||
})),
|
||||
Name = $"[MEIAMSUB] { Path.GetFileName(request.MediaPath) } | {request.TwoLetterISOLanguageName} | 迅雷",
|
||||
Author = "Meiam ",
|
||||
CommunityRating = Convert.ToSingle(m.rate),
|
||||
ProviderName = $"{Name}",
|
||||
Format = ExtractFormat(m.sname),
|
||||
Comment = $"Format : { ExtractFormat(m.sname)} - Rate : { m.rate }",
|
||||
IsHashMatch = true
|
||||
}).OrderByDescending(m => m.CommunityRating);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
_logger.LogInformation($"{Name} Search | Summary -> Get 0 Subtitles");
|
||||
|
||||
return Array.Empty<RemoteSubtitleInfo>();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 下载字幕
|
||||
/// <summary>
|
||||
/// 下载请求
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<SubtitleResponse> GetSubtitles(string id, CancellationToken cancellationToken)
|
||||
{
|
||||
_logger.LogInformation($"{Name} DownloadSub | Request -> {id}");
|
||||
|
||||
return await DownloadSubAsync(id);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 下载字幕
|
||||
/// </summary>
|
||||
/// <param name="info"></param>
|
||||
/// <returns></returns>
|
||||
private async Task<SubtitleResponse> DownloadSubAsync(string info)
|
||||
{
|
||||
var downloadSub = JsonSerializer.Deserialize<DownloadSubInfo>(Base64Decode(info));
|
||||
|
||||
if (downloadSub == null)
|
||||
{
|
||||
return new SubtitleResponse();
|
||||
}
|
||||
|
||||
_logger.LogInformation($"{Name} DownloadSub | Url -> { downloadSub.Url } | Format -> { downloadSub.Format } | Language -> { downloadSub.Language } ");
|
||||
|
||||
using var options = new HttpRequestMessage
|
||||
{
|
||||
Method = HttpMethod.Get,
|
||||
RequestUri = new Uri(downloadSub.Url),
|
||||
Headers =
|
||||
{
|
||||
UserAgent = { new ProductInfoHeaderValue(new ProductHeaderValue($"{Name}")) },
|
||||
Accept = { new MediaTypeWithQualityHeaderValue("*/*") }
|
||||
}
|
||||
};
|
||||
|
||||
var response = await _httpClient.SendAsync(options);
|
||||
|
||||
_logger.LogInformation($"{Name} DownloadSub | Response -> { response.StatusCode }");
|
||||
|
||||
if (response.StatusCode == HttpStatusCode.OK)
|
||||
{
|
||||
var stream = await response.Content.ReadAsStreamAsync();
|
||||
|
||||
return new SubtitleResponse()
|
||||
{
|
||||
Language = downloadSub.Language,
|
||||
IsForced = false,
|
||||
Format = downloadSub.Format,
|
||||
Stream = stream,
|
||||
};
|
||||
}
|
||||
|
||||
return new SubtitleResponse();
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 内部方法
|
||||
|
||||
/// <summary>
|
||||
/// Base64 加密
|
||||
/// </summary>
|
||||
/// <param name="plainText">明文</param>
|
||||
/// <returns></returns>
|
||||
public static string Base64Encode(string plainText)
|
||||
{
|
||||
var plainTextBytes = Encoding.UTF8.GetBytes(plainText);
|
||||
return Convert.ToBase64String(plainTextBytes);
|
||||
}
|
||||
/// <summary>
|
||||
/// Base64 解密
|
||||
/// </summary>
|
||||
/// <param name="base64EncodedData"></param>
|
||||
/// <returns></returns>
|
||||
public static string Base64Decode(string base64EncodedData)
|
||||
{
|
||||
var base64EncodedBytes = Convert.FromBase64String(base64EncodedData);
|
||||
return Encoding.UTF8.GetString(base64EncodedBytes);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 提取格式化字幕类型
|
||||
/// </summary>
|
||||
/// <param name="text"></param>
|
||||
/// <returns></returns>
|
||||
protected string ExtractFormat(string text)
|
||||
{
|
||||
|
||||
string result = null;
|
||||
|
||||
if (text != null)
|
||||
{
|
||||
text = text.ToLower();
|
||||
if (text.Contains(ASS)) result = ASS;
|
||||
else if (text.Contains(SSA)) result = SSA;
|
||||
else if (text.Contains(SRT)) result = SRT;
|
||||
else result = null;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取文件 CID (迅雷)
|
||||
/// </summary>
|
||||
/// <param name="filePath"></param>
|
||||
/// <returns></returns>
|
||||
private string GetCidByFile(string filePath)
|
||||
{
|
||||
var stream = new FileStream(filePath, FileMode.Open, FileAccess.Read);
|
||||
var reader = new BinaryReader(stream);
|
||||
var fileSize = new FileInfo(filePath).Length;
|
||||
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);
|
||||
}
|
||||
else
|
||||
{
|
||||
reader.Read(buffer, 0, 0x5000);
|
||||
stream.Seek(fileSize / 3, SeekOrigin.Begin);
|
||||
reader.Read(buffer, 0x5000, 0x5000);
|
||||
stream.Seek(fileSize - 0x5000, SeekOrigin.Begin);
|
||||
reader.Read(buffer, 0xa000, 0x5000);
|
||||
|
||||
buffer = sha1.ComputeHash(buffer, 0, 0xf000);
|
||||
}
|
||||
var result = "";
|
||||
foreach (var i in buffer)
|
||||
{
|
||||
result += string.Format("{0:X2}", i);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
49
MeiamSubtitles.sln
Normal file
49
MeiamSubtitles.sln
Normal file
@@ -0,0 +1,49 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.10.34916.146
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
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}") = "Jellyfin.MeiamSub.Thunder", "Jellyfin.MeiamSub.Thunder\Jellyfin.MeiamSub.Thunder.csproj", "{4676AA1B-CC6C-42DC-BD69-6A293BAE8823}"
|
||||
EndProject
|
||||
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
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{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
|
||||
{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
|
||||
{4676AA1B-CC6C-42DC-BD69-6A293BAE8823}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{8F77E155-9A91-4882-82E8-E8D69FECD246}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{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
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {AC5A2964-C7C8-419B-A8DD-63424233E6AA}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
41
README.md
41
README.md
@@ -1,5 +1,5 @@
|
||||
# Emby.MeiamSub
|
||||
Emby 中文字幕插件 ,支持 迅雷影音、射手网、 精准匹配,自动下载
|
||||
# MeiamSubtitles
|
||||
Emby Jellyfin 中文字幕插件 ,支持 迅雷影音、射手网、 精准匹配,自动下载
|
||||
|
||||
|
||||
[](#)
|
||||
@@ -16,14 +16,16 @@ Emby 中文字幕插件 ,支持 迅雷影音、射手网、 精准匹配,自
|
||||
## 给个星星! ⭐️
|
||||
如果你喜欢这个项目或者它帮助你, 请给 Star~(辛苦咯)
|
||||
|
||||
如果你能赞助稳定 Google Drive 团队盘用于媒体库插件测试, 请于我联系 91270#QQ.COM
|
||||
|
||||
|
||||
|
||||
|
||||
## 功能介绍
|
||||
|
||||
|
||||
- [x] 支持 迅雷看看 Hash 匹配自动下载字幕
|
||||
- [x] 支持 射手影音 Hash 匹配自动下载字幕
|
||||
- [x] 支持 迅雷看看 字幕下载 Hash匹配
|
||||
- [x] 支持 射手影音 字幕下载 Hash匹配
|
||||
|
||||
|
||||
## 项目说明
|
||||
@@ -31,13 +33,17 @@ Emby 中文字幕插件 ,支持 迅雷影音、射手网、 精准匹配,自
|
||||
| # | 模块功能 | 项目文件 | 说明
|
||||
|---|-------------------------------|-------------------------------|-------------------------------
|
||||
| 1 | 开发程序 | Emby.MeiamSub.DevTool | 项目开发测试调试使用
|
||||
| 2 | 字幕插件 | Emby.MeiamSub.Thunder | 迅雷看看字幕插件
|
||||
| 3 | 字幕插件 | Emby.MeiamSub.Shooter | 射手影音字幕插件
|
||||
| 2 | 字幕插件 | Emby.MeiamSub.Thunder | 迅雷看看字幕插件 - Emby
|
||||
| 3 | 字幕插件 | Emby.MeiamSub.Shooter | 射手影音字幕插件 - Emby
|
||||
| 4 | 字幕插件 | Jellyfin.MeiamSub.Shooter | 迅雷看看字幕插件 - Jellyfin
|
||||
| 5 | 字幕插件 | Jellyfin.MeiamSub.Thunder | 射手影音字幕插件 - Jellyfin
|
||||
|
||||
|
||||
|
||||
## 使用插件
|
||||
|
||||
首先下载已编译好的插件 [LINK](https://github.com/91270/Emby.MeiamSub/releases)
|
||||
|
||||
### WINDOWS
|
||||
```bash
|
||||
复制插件文件到 Emby-Server\Programdata\Plugins\
|
||||
@@ -54,6 +60,29 @@ Emby 中文字幕插件 ,支持 迅雷影音、射手网、 精准匹配,自
|
||||
|
||||
|
||||
|
||||
### 群晖
|
||||
```bash
|
||||
复制插件文件到 /var/packages/EmbyServer/var/plugins
|
||||
复制插件文件到 /var/packages/EmbyServer/target/system/plugins
|
||||
重启服务
|
||||
```
|
||||
|
||||
### 威联通
|
||||
```bash
|
||||
# 其中`CACHEDEV{num}_DATA`的名称取决于你的qpkg安装位置
|
||||
复制插件文件到 /share/CACHEDEV1_DATA/.qpkg/EmbyServer/programdata/plugins
|
||||
复制插件文件到 /share/CACHEDEV1_DATA/.qpkg/EmbyServer/system/plugins
|
||||
重启服务
|
||||
```
|
||||
|
||||
|
||||
### Jellyfin 可通过存储库安装、更新插件
|
||||
```bash
|
||||
# 通过 控制台 -> 插件 -> 存储库 添加存储库 URL , 即可通过插件目录查看并安装插件
|
||||
https://github.com/91270/MeiamSubtitles.Release/raw/main/Plugin/manifest-stable.json
|
||||
```
|
||||
|
||||
|
||||
|
||||
## 贡献
|
||||
|
||||
|
||||
Reference in New Issue
Block a user