From ca164a4ef2dd819aed73be7aed6959deeefb29c6 Mon Sep 17 00:00:00 2001 From: uduki Date: Wed, 9 Sep 2026 19:27:30 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20VJAV/FC2/LAXD/XVIDEOS=E7=AD=89=E3=81=AE?= =?UTF-8?q?=E7=99=BB=E9=8C=B2=E5=8B=95=E7=94=BB=E3=82=B5=E3=82=A4=E3=83=88?= =?UTF-8?q?=E3=81=AE=E5=9F=8B=E3=82=81=E8=BE=BC=E3=81=BFplay=E3=83=91?= =?UTF-8?q?=E3=83=A9=E3=83=A1=E3=83=BC=E3=82=BF=E7=94=9F=E6=88=90=E3=82=92?= =?UTF-8?q?=E6=9C=80=E5=84=AA=E5=85=88=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 +- .../Eroterest/MovieEroterestVideoParser.cs | 72 +++++++++++++++++-- 2 files changed, 70 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index dd87710..b68fc30 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,8 @@ -################################################################################ +################################################################################ # この .gitignore ファイルは Microsoft(R) Visual Studio によって自動的に作成されました。 ################################################################################ /.vs /rss-generator/bin /rss-generator/obj +/app diff --git a/rss-generator/Class/Eroterest/MovieEroterestVideoParser.cs b/rss-generator/Class/Eroterest/MovieEroterestVideoParser.cs index 374e7c8..94c6013 100644 --- a/rss-generator/Class/Eroterest/MovieEroterestVideoParser.cs +++ b/rss-generator/Class/Eroterest/MovieEroterestVideoParser.cs @@ -337,12 +337,76 @@ internal static class MovieEroterestVideoParser return; } - // 7. 実動画URLが存在する場合 (LAXD, Xvideos, その他) + // VJAV + if (info.VideoSiteName == "vjav" && !string.IsNullOrWhiteSpace(info.VideoSiteId)) + { + var play = $"https://vjav.com/embed/{info.VideoSiteId}/"; + info.ViewerUrl = $"{baseViewer}/video?site=vjav&id={Uri.EscapeDataString(info.VideoSiteId)}&play={Uri.EscapeDataString(play)}&url={Uri.EscapeDataString(info.ActualVideoUrl ?? "")}&title={Uri.EscapeDataString(info.Title)}"; + return; + } + + // FC2動画 + if ((info.VideoSiteName == "fc2" || info.VideoSiteName == "fc2video") && !string.IsNullOrWhiteSpace(info.VideoSiteId)) + { + var play = $"https://video.fc2.com/a/embed/player/{info.VideoSiteId}/"; + info.ViewerUrl = $"{baseViewer}/video?site=fc2&id={Uri.EscapeDataString(info.VideoSiteId)}&play={Uri.EscapeDataString(play)}&url={Uri.EscapeDataString(info.ActualVideoUrl ?? "")}&title={Uri.EscapeDataString(info.Title)}"; + return; + } + + // LAXD + if (info.VideoSiteName == "laxd" && !string.IsNullOrWhiteSpace(info.VideoSiteId)) + { + var play = $"https://video.laxd.com/a/embed/player/{info.VideoSiteId}/"; + info.ViewerUrl = $"{baseViewer}/video?site=laxd&id={Uri.EscapeDataString(info.VideoSiteId)}&play={Uri.EscapeDataString(play)}&url={Uri.EscapeDataString(info.ActualVideoUrl ?? "")}&title={Uri.EscapeDataString(info.Title)}"; + return; + } + + // XVIDEOS + if (info.VideoSiteName == "xvideos" && !string.IsNullOrWhiteSpace(info.VideoSiteId)) + { + var play = $"https://www.xvideos.com/embedframe/{info.VideoSiteId}"; + info.ViewerUrl = $"{baseViewer}/video?site=xvideos&id={Uri.EscapeDataString(info.VideoSiteId)}&play={Uri.EscapeDataString(play)}&url={Uri.EscapeDataString(info.ActualVideoUrl ?? "")}&title={Uri.EscapeDataString(info.Title)}"; + return; + } + + // 7. 実動画URLが存在する場合 (上記以外の動画サイトまたは未知サイト) if (!string.IsNullOrWhiteSpace(info.ActualVideoUrl)) { - var siteParam = !string.IsNullOrWhiteSpace(info.VideoSiteName) ? $"&site={Uri.EscapeDataString(info.VideoSiteName)}" : ""; - var idParam = !string.IsNullOrWhiteSpace(info.VideoSiteId) ? $"&id={Uri.EscapeDataString(info.VideoSiteId)}" : ""; - info.ViewerUrl = $"{baseViewer}/video?url={Uri.EscapeDataString(info.ActualVideoUrl)}{siteParam}{idParam}&title={Uri.EscapeDataString(info.Title)}"; + // URLから既知の動画サイト判定を試行し、埋め込み可能な場合はplayパラメータを付与 + string? fallbackPlay = null; + string? detectedSite = info.VideoSiteName; + string? detectedId = info.VideoSiteId; + + if (info.ActualVideoUrl.Contains("vjav.com", StringComparison.OrdinalIgnoreCase)) + { + detectedSite = "vjav"; + detectedId ??= System.Text.RegularExpressions.Regex.Match(info.ActualVideoUrl, @"/videos/([0-9]+)").Groups[1].Value; + if (!string.IsNullOrWhiteSpace(detectedId)) fallbackPlay = $"https://vjav.com/embed/{detectedId}/"; + } + else if (info.ActualVideoUrl.Contains("video.laxd.com", StringComparison.OrdinalIgnoreCase) || info.ActualVideoUrl.Contains("laxd.com", StringComparison.OrdinalIgnoreCase)) + { + detectedSite = "laxd"; + detectedId ??= System.Text.RegularExpressions.Regex.Match(info.ActualVideoUrl, @"laxd\.com/(?:content/|embed/)?([0-9a-zA-Z_\-]+)").Groups[1].Value; + if (!string.IsNullOrWhiteSpace(detectedId)) fallbackPlay = $"https://video.laxd.com/a/embed/player/{detectedId}/"; + } + else if (info.ActualVideoUrl.Contains("fc2.com", StringComparison.OrdinalIgnoreCase)) + { + detectedSite = "fc2"; + detectedId ??= System.Text.RegularExpressions.Regex.Match(info.ActualVideoUrl, @"(?:article/|aid=|content/)([0-9a-zA-Z_\-]+)").Groups[1].Value; + if (!string.IsNullOrWhiteSpace(detectedId)) fallbackPlay = $"https://video.fc2.com/a/embed/player/{detectedId}/"; + } + else if (info.ActualVideoUrl.Contains("xvideos.com", StringComparison.OrdinalIgnoreCase)) + { + detectedSite = "xvideos"; + detectedId ??= System.Text.RegularExpressions.Regex.Match(info.ActualVideoUrl, @"(?:video\.|video)([0-9]+)").Groups[1].Value; + if (!string.IsNullOrWhiteSpace(detectedId)) fallbackPlay = $"https://www.xvideos.com/embedframe/{detectedId}"; + } + + var siteParam = !string.IsNullOrWhiteSpace(detectedSite) ? $"&site={Uri.EscapeDataString(detectedSite)}" : ""; + var idParam = !string.IsNullOrWhiteSpace(detectedId) ? $"&id={Uri.EscapeDataString(detectedId)}" : ""; + var playParam = !string.IsNullOrWhiteSpace(fallbackPlay) ? $"&play={Uri.EscapeDataString(fallbackPlay)}" : ""; + + info.ViewerUrl = $"{baseViewer}/video?url={Uri.EscapeDataString(info.ActualVideoUrl)}{siteParam}{idParam}{playParam}&title={Uri.EscapeDataString(info.Title)}"; return; }