mirror of
https://github.com/91270/MeiamSubtitles.git
synced 2026-02-03 02:24:16 +08:00
Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8bebe5ba5b | ||
|
|
0c5a3656c8 | ||
|
|
339b05b763 | ||
|
|
54b13d647d | ||
|
|
2e06131f8d | ||
|
|
8f69a7ffca | ||
|
|
bf178f7cef | ||
|
|
39aafddd23 | ||
|
|
f8854e2a85 | ||
|
|
d63de08b8e |
@@ -1,8 +1,8 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<AssemblyVersion>1.0.7.0</AssemblyVersion>
|
||||
<FileVersion>1.0.7.0</FileVersion>
|
||||
<Version>1.0.7</Version>
|
||||
<AssemblyVersion>1.0.9.0</AssemblyVersion>
|
||||
<FileVersion>1.0.9.0</FileVersion>
|
||||
<Version>1.0.9</Version>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace Emby.MeiamSub.Shooter
|
||||
private readonly IJsonSerializer _jsonSerializer;
|
||||
private readonly IHttpClient _httpClient;
|
||||
|
||||
public int Order => 0;
|
||||
public int Order => 1;
|
||||
public string Name => "MeiamSub.Shooter";
|
||||
|
||||
/// <summary>
|
||||
@@ -75,6 +75,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>();
|
||||
@@ -84,9 +90,11 @@ namespace Emby.MeiamSub.Shooter
|
||||
|
||||
var hash = ComputeFileHash(fileInfo);
|
||||
|
||||
_logger.Info($"{Name} Search | FileHash -> { 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 = "*/*",
|
||||
@@ -133,7 +141,8 @@ namespace Emby.MeiamSub.Shooter
|
||||
Author = "Meiam ",
|
||||
ProviderName = $"{Name}",
|
||||
Format = subFile.Ext,
|
||||
Comment = $"Format : { ExtractFormat(subFile.Ext)}"
|
||||
Comment = $"Format : { ExtractFormat(subFile.Ext)}",
|
||||
IsHashMatch = true
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -178,8 +187,6 @@ 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 } ");
|
||||
|
||||
var response = await _httpClient.GetResponse(new HttpRequestOptions
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<AssemblyVersion>1.0.7.0</AssemblyVersion>
|
||||
<FileVersion>1.0.7.0</FileVersion>
|
||||
<Version>1.0.7</Version>
|
||||
<AssemblyVersion>1.0.9.0</AssemblyVersion>
|
||||
<FileVersion>1.0.9.0</FileVersion>
|
||||
<Version>1.0.9</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
|
||||
@@ -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>
|
||||
@@ -75,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>();
|
||||
@@ -82,6 +85,8 @@ namespace Emby.MeiamSub.Thunder
|
||||
|
||||
var cid = GetCidByFile(request.MediaPath);
|
||||
|
||||
_logger.Info($"{Name} Search | FileHash -> { cid }");
|
||||
|
||||
var response = await _httpClient.GetResponse(new HttpRequestOptions
|
||||
{
|
||||
//Url = $"http://sub.xmp.sandai.net:8000/subxl/{cid}.json",
|
||||
@@ -116,12 +121,13 @@ namespace Emby.MeiamSub.Thunder
|
||||
Language = request.Language,
|
||||
IsForced = request.IsForced
|
||||
})),
|
||||
Name = $"[MEIAMSUB] { Path.GetFileName(request.MediaPath) } | {request.Language} | 迅雷",
|
||||
Name = $"[MEIAMSUB] { Path.GetFileName(request.MediaPath) } | {m.language} | 迅雷",
|
||||
Author = "Meiam ",
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
<Version>1.0.7</Version>
|
||||
<AssemblyVersion>1.0.7.0</AssemblyVersion>
|
||||
<FileVersion>1.0.7.0</FileVersion>
|
||||
<Version>1.0.9</Version>
|
||||
<AssemblyVersion>1.0.9.0</AssemblyVersion>
|
||||
<FileVersion>1.0.9.0</FileVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -5,7 +5,8 @@
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
<ApplicationIcon />
|
||||
<StartupObject />
|
||||
<Version>1.0.7</Version>
|
||||
<Version>1.0.9</Version>
|
||||
<AssemblyVersion>1.0.9.0</AssemblyVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,8 @@ Emby Jellyfin 中文字幕插件 ,支持 迅雷影音、射手网、 精准匹
|
||||
## 给个星星! ⭐️
|
||||
如果你喜欢这个项目或者它帮助你, 请给 Star~(辛苦咯)
|
||||
|
||||
如果你能赞助稳定 Google Drive 团队盘用于媒体库插件测试, 请于我联系 91270#QQ.COM
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -60,7 +62,7 @@ Emby Jellyfin 中文字幕插件 ,支持 迅雷影音、射手网、 精准匹
|
||||
|
||||
### 群晖
|
||||
```bash
|
||||
复制插件文件到 /var/packages/EmbyServer/target/var/plugins
|
||||
复制插件文件到 /var/packages/EmbyServer/var/plugins
|
||||
复制插件文件到 /var/packages/EmbyServer/target/system/plugins
|
||||
重启服务
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user