10 Commits

Author SHA1 Message Date
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
Meiam
bf178f7cef 适配 Emby v4.7.1.0 2022-06-02 13:07:33 +08:00
91270
39aafddd23 Merge pull request #46 from LuckyPuppy514/master
适配Emby v4.7.1.0
2022-06-01 17:34:49 +08:00
LuckyPuppy514
f8854e2a85 适配EMBY v4.7.1.0 2022-06-01 17:00:45 +08:00
LuckyPuppy514
d63de08b8e 适配EMBY v4.7.1.0 2022-06-01 16:57:38 +08:00
9 changed files with 61 additions and 47 deletions

View File

@@ -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>

View File

@@ -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

View File

@@ -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>

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>
@@ -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);
}
}

View File

@@ -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'">

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

@@ -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'">

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);
}
}

View File

@@ -16,6 +16,8 @@ Emby Jellyfin 中文字幕插件 ,支持 迅雷影音、射手网、 精准匹
## 给个星星! ⭐️
如果你喜欢这个项目或者它帮助你, 请给 Star~(辛苦咯)
如果你能赞助稳定 Google Drive 团队盘用于媒体库插件测试, 请于我联系 91270#QQ.COM
&nbsp;
@@ -60,7 +62,7 @@ Emby Jellyfin 中文字幕插件 ,支持 迅雷影音、射手网、 精准匹
### 群晖
```bash
复制插件文件到 /var/packages/EmbyServer/target/var/plugins
复制插件文件到 /var/packages/EmbyServer/var/plugins
复制插件文件到 /var/packages/EmbyServer/target/system/plugins
重启服务
```