feat: movie.eroterest.netの多階層動画探索エンジンおよびサイト別フォルダ・クラス構成の実装
This commit is contained in:
1 parent
0e095c8fa3
commit
838ff22c5e
20 files changed
+1257
-276
No files matched your search
@@ -0,0 +1,45 @@
|
||||
using AngleSharp.Dom;
|
||||
using rss_generator.Class.Eroterest.Core;
|
||||
using System;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace rss_generator.Class.Eroterest.Upornia;
|
||||
|
||||
/// <summary>
|
||||
/// Upornia (upornia.com) の動画解析リゾルバー
|
||||
/// </summary>
|
||||
internal class UporniaSiteResolver : IEroterestSiteResolver
|
||||
{
|
||||
public string SiteName => "upornia";
|
||||
public int Priority => 90;
|
||||
|
||||
public bool CanHandle(string url, IDocument? doc = null)
|
||||
{
|
||||
return !string.IsNullOrWhiteSpace(url) && url.Contains("upornia.com", StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
public Task<SiteResolveResult> ResolveAsync(
|
||||
HttpClient client,
|
||||
string url,
|
||||
IDocument? preloadedDoc,
|
||||
SiteResolveContext context,
|
||||
CancellationToken ct)
|
||||
{
|
||||
var result = new SiteResolveResult
|
||||
{
|
||||
VideoPageUrl = url,
|
||||
VideoSiteName = "upornia"
|
||||
};
|
||||
|
||||
// 動画ID抽出 (例: /videos/6167135/...)
|
||||
var match = Regex.Match(url, @"/videos/([0-9]+)");
|
||||
if (match.Success)
|
||||
{
|
||||
result.VideoSiteId = match.Groups[1].Value;
|
||||
}
|
||||
|
||||
return Task.FromResult(result);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user