feat: 動画プレイヤー下部テキストボックスのフルURLエラー修正、画像・動画両対応の自動判別ナビゲーションおよび相互リダイレクトの実装、探索階層10化
This commit is contained in:
1 parent
3df8a7c244
commit
01a6376328
3 files changed
+378
-166
No files matched your search
@@ -1523,43 +1523,176 @@ public static class HtmlRenderer
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 動画URL/IDの判定と遷移
|
// 汎用URL/IDナビゲーション処理(画像ギャラリー・動画の両対応判定)
|
||||||
function navigateVideoInput(input) {
|
function navigateUniversalInput(input) {
|
||||||
if (!input) return;
|
if (!input) return;
|
||||||
input = input.trim();
|
input = input.trim();
|
||||||
|
|
||||||
// 123av判定
|
// 1. フルURL(http:// または https://)の場合
|
||||||
|
if (input.startsWith('http://') || input.startsWith('https://')) {
|
||||||
|
try {
|
||||||
|
const urlObj = new URL(input);
|
||||||
|
const host = urlObj.hostname.toLowerCase();
|
||||||
|
const path = urlObj.pathname.replace(/^\/+|\/+$/g, '');
|
||||||
|
|
||||||
|
// 画像ギャラリーサイト判定
|
||||||
|
if (host.includes('e-hentai.org') || host.includes('exhentai.org')) {
|
||||||
|
const gm = path.match(/g\/(\d+)\/([a-z0-9]+)/i);
|
||||||
|
if (gm) {
|
||||||
|
window.location.href = '/ehentai/' + gm[1] + '/' + gm[2] + '/';
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
window.location.href = '/view?url=' + encodeURIComponent(input);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (host.includes('hitomi.la')) {
|
||||||
|
const hm = path.match(/(?:doujinshi|manga|gamecg|artistcg|anime)\/[^\/]+-(\d+)\.html/i) || path.match(/(\d+)\.html/i) || path.match(/(\d+)$/i);
|
||||||
|
if (hm) {
|
||||||
|
window.location.href = '/hitomi/' + hm[1] + '/';
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
window.location.href = '/view?url=' + encodeURIComponent(input);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (host.includes('aurahentai.com')) {
|
||||||
|
const am = path.match(/gallery\/([0-9a-zA-Z_\-]+)/i);
|
||||||
|
if (am) {
|
||||||
|
window.location.href = '/aurahentai/' + am[1] + '/';
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
window.location.href = '/view?url=' + encodeURIComponent(input);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (host.includes('momon-ga.com') || host.includes('momonga')) {
|
||||||
|
const mm = path.match(/(?:fanzine|magazine|comic)\/([0-9a-zA-Z_\-]+)/i) || path.match(/(mo\d+)/i);
|
||||||
|
if (mm) {
|
||||||
|
window.location.href = '/momonga/' + mm[1] + '/';
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
window.location.href = '/view?url=' + encodeURIComponent(input);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (host.includes('mangalear.com') || host.includes('mangalear.blog')) {
|
||||||
|
const p = urlObj.searchParams.get('p');
|
||||||
|
if (p) {
|
||||||
|
window.location.href = '/mangalear/' + p + '/';
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const ml = path.match(/(?:manga|series|detail)\/([0-9a-zA-Z_\-]+)/i) || path.match(/(\d+)/i);
|
||||||
|
if (ml) {
|
||||||
|
window.location.href = '/mangalear/' + ml[1] + '/';
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
window.location.href = '/view?url=' + encodeURIComponent(input);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (host.includes('hentaipaw.com')) {
|
||||||
|
const hp = path.match(/doujinshi\/([0-9a-zA-Z_\-]+)/i) || path.match(/(\d+)/i);
|
||||||
|
if (hp) {
|
||||||
|
window.location.href = '/hentaipaw/' + hp[1] + '/';
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
window.location.href = '/view?url=' + encodeURIComponent(input);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 主要動画サイト判定
|
||||||
|
if (host.includes('123av')) {
|
||||||
|
const match = path.match(/(?:video\/|^)([a-zA-Z0-9_-]+)/i);
|
||||||
|
if (match) {
|
||||||
|
window.location.href = '/123av/' + encodeURIComponent(match[1]);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (host.includes('missav')) {
|
||||||
|
const match = path.match(/(?:[a-z]{2}\/)?([a-zA-Z0-9_-]+)$/i);
|
||||||
|
if (match) {
|
||||||
|
window.location.href = '/missav/' + encodeURIComponent(match[1]);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (host.includes('spankbang')) {
|
||||||
|
const sbMatch = path.match(/([a-z0-9]+)(?:\/(?:video|play|embed)|\/|$)/i);
|
||||||
|
if (sbMatch) {
|
||||||
|
window.location.href = '/spankbang/' + encodeURIComponent(sbMatch[1]);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 動画ホストまたはまとめブログ等は /video?url=
|
||||||
|
const videoHosts = ['do-ga.eroterest.net', 'movie.eroterest.net', 'vjav.com', 'laxd.com', 'fc2.com', 'inporn.com', 'bdsmx.tube', 'senzuri.tube', 'txxx.com', 'hclips.com', 'hdzog.com', 'upornia.com', 'youjizz.com', 'xvideos.com', 'blogterest.net', 'blog.2nt.com'];
|
||||||
|
if (videoHosts.some(vh => host.includes(vh))) {
|
||||||
|
window.location.href = '/video?url=' + encodeURIComponent(input);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// デフォルト画像ビューアー
|
||||||
|
window.location.href = '/view?url=' + encodeURIComponent(input);
|
||||||
|
return;
|
||||||
|
} catch (e) {
|
||||||
|
window.location.href = '/view?url=' + encodeURIComponent(input);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 2. プレフィックス付きサイト指定 (/site/id や site/id)
|
||||||
|
const slashMatch = input.match(/^([a-z0-9_-]+)\/([a-z0-9_\-\/]+)$/i);
|
||||||
|
if (slashMatch) {
|
||||||
|
const s = slashMatch[1].toLowerCase();
|
||||||
|
const v = slashMatch[2].replace(/^\/+|\/+$/g, '');
|
||||||
|
const gallerySites = ['ehentai', 'hitomi', 'aurahentai', 'momonga', 'mangalear', 'hentaipaw'];
|
||||||
|
const videoSites = ['123av', 'missav', 'spankbang', 'doga', 'vjav', 'laxd', 'fc2', 'xvideos', 'inporn', 'bdsmx', 'senzuri', 'txxx', 'hclips', 'hdzog', 'upornia', 'youjizz'];
|
||||||
|
if (gallerySites.includes(s)) {
|
||||||
|
window.location.href = '/' + s + '/' + v + '/';
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (videoSites.includes(s)) {
|
||||||
|
window.location.href = '/' + s + '/' + encodeURIComponent(v);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 3. 123av / missav / spankbang のキーワード判定
|
||||||
if (input.toLowerCase().includes('123av')) {
|
if (input.toLowerCase().includes('123av')) {
|
||||||
const match = input.match(/(?:123av\.com\/[a-z]{2}\/(?:video\/)?|^123av\/)([^/?#]+)/i);
|
const id = input.replace(/^123av\//i, '').replace(/^\/+|\/+$/g, '');
|
||||||
const id = match ? match[1] : input.replace(/^123av\//i, '').replace(/^\/+|\/+$/g, '');
|
|
||||||
window.location.href = '/123av/' + encodeURIComponent(id);
|
window.location.href = '/123av/' + encodeURIComponent(id);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// missav判定
|
|
||||||
if (input.toLowerCase().includes('missav')) {
|
if (input.toLowerCase().includes('missav')) {
|
||||||
const match = input.match(/(?:missav\.[a-z]+\/[a-z]{2}\/|^missav\/)([^/?#]+)/i);
|
const id = input.replace(/^missav\//i, '').replace(/^\/+|\/+$/g, '');
|
||||||
const id = match ? match[1] : input.replace(/^missav\//i, '').replace(/^\/+|\/+$/g, '');
|
|
||||||
window.location.href = '/missav/' + encodeURIComponent(id);
|
window.location.href = '/missav/' + encodeURIComponent(id);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (input.toLowerCase().includes('spankbang')) {
|
||||||
// SpankBang判定
|
const id = input.replace(/^spankbang\//i, '').replace(/^\/+|\/+$/g, '');
|
||||||
const sbMatch = input.match(/spankbang\.(?:com|party)\/([a-z0-9]+)(?:\/(?:video|play|embed)|\/|$)/i) || input.match(/^spankbang\/([a-z0-9]+)/i);
|
window.location.href = '/spankbang/' + encodeURIComponent(id);
|
||||||
if (sbMatch) {
|
|
||||||
window.location.href = '/spankbang/' + encodeURIComponent(sbMatch[1]);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// デフォルト: 汎用 /video
|
// 4. E-Hentai の gid/token 形式 (例: 4159771/95d2fa13bd または 4159771_95d2fa13bd)
|
||||||
window.location.href = '/video?url=' + encodeURIComponent(input);
|
const ehPair = input.match(/^(\d+)[/_ -]([a-z0-9]{10})$/i);
|
||||||
|
if (ehPair) {
|
||||||
|
window.location.href = '/ehentai/' + ehPair[1] + '/' + ehPair[2] + '/';
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 5. 自動判定
|
||||||
|
if (/^\d{7,}$/.test(input)) {
|
||||||
|
window.location.href = '/hitomi/' + input + '/';
|
||||||
|
} else if (/^\d+$/.test(input)) {
|
||||||
|
window.location.href = '/aurahentai/' + input + '/';
|
||||||
|
} else if (input.startsWith('mo') || input.startsWith('MO')) {
|
||||||
|
window.location.href = '/momonga/' + input + '/';
|
||||||
|
} else {
|
||||||
|
window.location.href = '/view?url=' + encodeURIComponent(input);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 動画用フォーム送信イベント
|
// 動画用フォーム送信イベント
|
||||||
document.getElementById('videoForm').addEventListener('submit', function(e) {
|
document.getElementById('videoForm').addEventListener('submit', function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
const input = document.getElementById('videoUrlInput').value.trim();
|
const input = document.getElementById('videoUrlInput').value.trim();
|
||||||
navigateVideoInput(input);
|
navigateUniversalInput(input);
|
||||||
});
|
});
|
||||||
|
|
||||||
// 画像用フォーム送信イベント
|
// 画像用フォーム送信イベント
|
||||||
@@ -1569,116 +1702,19 @@ public static class HtmlRenderer
|
|||||||
const siteSelect = document.getElementById('siteSelect').value;
|
const siteSelect = document.getElementById('siteSelect').value;
|
||||||
if (!input) return;
|
if (!input) return;
|
||||||
|
|
||||||
// 動画サイト選択または動画URLの判定
|
|
||||||
if (siteSelect === 'spankbang' || siteSelect === '123av' || siteSelect === 'missav' ||
|
|
||||||
input.toLowerCase().includes('spankbang') || input.toLowerCase().includes('123av') || input.toLowerCase().includes('missav')) {
|
|
||||||
if (siteSelect === '123av' && !input.toLowerCase().includes('123av')) {
|
|
||||||
window.location.href = '/123av/' + encodeURIComponent(input);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (siteSelect === 'missav' && !input.toLowerCase().includes('missav')) {
|
|
||||||
window.location.href = '/missav/' + encodeURIComponent(input);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (siteSelect === 'spankbang' && !input.toLowerCase().includes('spankbang')) {
|
|
||||||
window.location.href = '/spankbang/' + encodeURIComponent(input);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
navigateVideoInput(input);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 完全URLの場合
|
|
||||||
if (input.startsWith('http://') || input.startsWith('https://')) {
|
|
||||||
try {
|
|
||||||
const url = new URL(input);
|
|
||||||
const host = url.hostname.toLowerCase();
|
|
||||||
const path = url.pathname.replace(/^\/+|\/+$/g, '');
|
|
||||||
|
|
||||||
if (host.includes('e-hentai.org') || host.includes('exhentai.org')) {
|
|
||||||
const gm = path.match(/g\/(\d+)\/([a-z0-9]+)/i);
|
|
||||||
if (gm) {
|
|
||||||
window.location.href = '/ehentai/' + gm[1] + '/' + gm[2] + '/';
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const sm = path.match(/s\/([a-z0-9]+)\/(\d+)-/i);
|
|
||||||
if (sm) {
|
|
||||||
window.location.href = '/view?url=' + encodeURIComponent(input);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (host.includes('hitomi.la')) {
|
|
||||||
const m = path.match(/(?:-|\/)(\d{5,8})(?:\.html)?$/) || path.match(/\d{5,8}/);
|
|
||||||
const id = m ? m[1] || m[0] : path;
|
|
||||||
window.location.href = '/hitomi/' + id + '/';
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (host.includes('aurahentai.com')) {
|
|
||||||
const segs = path.split('/');
|
|
||||||
const id = segs.length >= 2 ? segs[1] : segs[0];
|
|
||||||
window.location.href = '/aurahentai/' + id + '/';
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (host.includes('momon-ga.com')) {
|
|
||||||
const segs = path.split('/');
|
|
||||||
const id = segs.length >= 2 ? segs[1] : segs[0];
|
|
||||||
window.location.href = '/momonga/' + id + '/';
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (host.includes('mangalear.blog')) {
|
|
||||||
const p = url.searchParams.get('p');
|
|
||||||
if (p) {
|
|
||||||
window.location.href = '/mangalear/' + p + '/';
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const segs = path.split('/');
|
|
||||||
const id = segs.length >= 2 ? segs[1] : segs[0];
|
|
||||||
window.location.href = '/mangalear/' + id + '/';
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 汎用ビューアーへ
|
|
||||||
window.location.href = '/view?url=' + encodeURIComponent(input);
|
|
||||||
return;
|
|
||||||
} catch(err) {
|
|
||||||
window.location.href = '/view?url=' + encodeURIComponent(input);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// サイト選択が明示されている場合
|
// サイト選択が明示されている場合
|
||||||
if (siteSelect !== 'auto') {
|
if (siteSelect !== 'auto') {
|
||||||
const cleanId = input.replace(/^\/+|\/+$/g, '');
|
const cleanId = input.replace(/^\/+|\/+$/g, '');
|
||||||
|
const videoSites = ['123av', 'missav', 'spankbang'];
|
||||||
|
if (videoSites.includes(siteSelect)) {
|
||||||
|
window.location.href = '/' + siteSelect + '/' + encodeURIComponent(cleanId);
|
||||||
|
return;
|
||||||
|
}
|
||||||
window.location.href = '/' + siteSelect + '/' + cleanId + '/';
|
window.location.href = '/' + siteSelect + '/' + cleanId + '/';
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// E-Hentai の gid/token 形式 (例: 4159771/95d2fa13bd または 4159771_95d2fa13bd)
|
// URLまたはIDを画像・動画両対応でスマートに判定・遷移
|
||||||
const ehPair = input.match(/^(\d+)[/_ -]([a-z0-9]{10})$/i);
|
|
||||||
if (ehPair) {
|
|
||||||
window.location.href = '/ehentai/' + ehPair[1] + '/' + ehPair[2] + '/';
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// スラッシュが含まれる場合 (例: ehentai/4159771/95d2fa13bd や hitomi/4159707 や momonga/mo3469109)
|
|
||||||
if (input.includes('/')) {
|
|
||||||
window.location.href = '/' + input.replace(/^\/+|\/+$/g, '') + '/';
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 自動判定
|
|
||||||
if (/^\d{7,}$/.test(input)) {
|
|
||||||
// 7桁以上の数字 -> hitomi
|
|
||||||
window.location.href = '/hitomi/' + input + '/';
|
|
||||||
} else if (/^\d+$/.test(input)) {
|
|
||||||
// 6桁以下の数字 -> aurahentai
|
|
||||||
window.location.href = '/aurahentai/' + input + '/';
|
|
||||||
} else if (input.startsWith('mo') || input.startsWith('MO')) {
|
|
||||||
// moで始まる -> momonga
|
|
||||||
window.location.href = '/momonga/' + input + '/';
|
|
||||||
} else {
|
|
||||||
window.location.href = '/view?id=' + encodeURIComponent(input);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
@@ -2414,10 +2450,10 @@ public static class HtmlRenderer
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<label style="font-size: 0.85rem; font-weight: 600; color: var(--text-muted); display: block; margin-bottom: 6px;">別の動画を再生する (123av / missav / SpankBang に対応)</label>
|
<label style="font-size: 0.85rem; font-weight: 600; color: var(--text-muted); display: block; margin-bottom: 6px;">別の作品・動画を閲覧/再生する (画像・動画のURLまたはIDに対応)</label>
|
||||||
<form id="switchForm" class="quick-switch-form">
|
<form id="switchForm" class="quick-switch-form">
|
||||||
<input type="text" id="switchInput" class="quick-input" placeholder="動画URL または ID (例: 56b3d, 123avのID, missavのID)" required autocomplete="off" />
|
<input type="text" id="switchInput" class="quick-input" placeholder="URL または ID (画像ギャラリー / 各種動画 / まとめブログ等)" required autocomplete="off" />
|
||||||
<button type="submit" class="quick-submit-btn">再生切り替え</button>
|
<button type="submit" class="quick-submit-btn">閲覧・再生</button>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -2492,37 +2528,159 @@ public static class HtmlRenderer
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 動画切り替えフォーム
|
// 汎用URL・IDナビゲーション処理(画像ギャラリー・動画の両対応判定)
|
||||||
document.getElementById('switchForm').addEventListener('submit', (e) => {
|
function navigateUniversalInput(input) {
|
||||||
e.preventDefault();
|
|
||||||
const input = document.getElementById('switchInput').value.trim();
|
|
||||||
if (!input) return;
|
if (!input) return;
|
||||||
|
input = input.trim();
|
||||||
|
|
||||||
// 123av判定
|
// 1. フルURL(http:// または https://)の場合
|
||||||
|
if (input.startsWith('http://') || input.startsWith('https://')) {
|
||||||
|
try {
|
||||||
|
const urlObj = new URL(input);
|
||||||
|
const host = urlObj.hostname.toLowerCase();
|
||||||
|
const path = urlObj.pathname.replace(/^\/+|\/+$/g, '');
|
||||||
|
|
||||||
|
// 画像ギャラリーサイト判定
|
||||||
|
if (host.includes('e-hentai.org') || host.includes('exhentai.org')) {
|
||||||
|
const gm = path.match(/g\/(\d+)\/([a-z0-9]+)/i);
|
||||||
|
if (gm) {
|
||||||
|
window.location.href = '/ehentai/' + gm[1] + '/' + gm[2] + '/';
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
window.location.href = '/view?url=' + encodeURIComponent(input);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (host.includes('hitomi.la')) {
|
||||||
|
const hm = path.match(/(?:doujinshi|manga|gamecg|artistcg|anime)\/[^\/]+-(\d+)\.html/i) || path.match(/(\d+)\.html/i) || path.match(/(\d+)$/i);
|
||||||
|
if (hm) {
|
||||||
|
window.location.href = '/hitomi/' + hm[1] + '/';
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
window.location.href = '/view?url=' + encodeURIComponent(input);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (host.includes('aurahentai.com')) {
|
||||||
|
const am = path.match(/gallery\/([0-9a-zA-Z_\-]+)/i);
|
||||||
|
if (am) {
|
||||||
|
window.location.href = '/aurahentai/' + am[1] + '/';
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
window.location.href = '/view?url=' + encodeURIComponent(input);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (host.includes('momon-ga.com') || host.includes('momonga')) {
|
||||||
|
const mm = path.match(/(?:fanzine|magazine|comic)\/([0-9a-zA-Z_\-]+)/i) || path.match(/(mo\d+)/i);
|
||||||
|
if (mm) {
|
||||||
|
window.location.href = '/momonga/' + mm[1] + '/';
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
window.location.href = '/view?url=' + encodeURIComponent(input);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (host.includes('mangalear.com')) {
|
||||||
|
const ml = path.match(/(?:manga|series|detail)\/([0-9a-zA-Z_\-]+)/i) || path.match(/(\d+)/i);
|
||||||
|
if (ml) {
|
||||||
|
window.location.href = '/mangalear/' + ml[1] + '/';
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
window.location.href = '/view?url=' + encodeURIComponent(input);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (host.includes('hentaipaw.com')) {
|
||||||
|
const hp = path.match(/doujinshi\/([0-9a-zA-Z_\-]+)/i) || path.match(/(\d+)/i);
|
||||||
|
if (hp) {
|
||||||
|
window.location.href = '/hentaipaw/' + hp[1] + '/';
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
window.location.href = '/view?url=' + encodeURIComponent(input);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 主要動画サイト判定
|
||||||
|
if (host.includes('123av')) {
|
||||||
|
const match = path.match(/(?:video\/|^)([a-zA-Z0-9_-]+)/i);
|
||||||
|
if (match) {
|
||||||
|
window.location.href = '/123av/' + encodeURIComponent(match[1]);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (host.includes('missav')) {
|
||||||
|
const match = path.match(/(?:[a-z]{2}\/)?([a-zA-Z0-9_-]+)$/i);
|
||||||
|
if (match) {
|
||||||
|
window.location.href = '/missav/' + encodeURIComponent(match[1]);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (host.includes('spankbang')) {
|
||||||
|
const sbMatch = path.match(/([a-z0-9]+)(?:\/(?:video|play|embed)|\/|$)/i);
|
||||||
|
if (sbMatch) {
|
||||||
|
window.location.href = '/spankbang/' + encodeURIComponent(sbMatch[1]);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// その他の動画ホストまたはまとめブログ等は /video?url= でサーバー自動解決
|
||||||
|
window.location.href = '/video?url=' + encodeURIComponent(input);
|
||||||
|
return;
|
||||||
|
} catch (e) {
|
||||||
|
window.location.href = '/video?url=' + encodeURIComponent(input);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 2. プレフィックス付きサイト指定 (/site/id や site/id)
|
||||||
|
const slashMatch = input.match(/^([a-z0-9_-]+)\/([a-z0-9_\-\/]+)$/i);
|
||||||
|
if (slashMatch) {
|
||||||
|
const s = slashMatch[1].toLowerCase();
|
||||||
|
const v = slashMatch[2].replace(/^\/+|\/+$/g, '');
|
||||||
|
const gallerySites = ['ehentai', 'hitomi', 'aurahentai', 'momonga', 'mangalear', 'hentaipaw'];
|
||||||
|
const videoSites = ['123av', 'missav', 'spankbang', 'doga', 'vjav', 'laxd', 'fc2', 'xvideos', 'inporn', 'bdsmx', 'senzuri', 'txxx', 'hclips', 'hdzog', 'upornia', 'youjizz'];
|
||||||
|
if (gallerySites.includes(s)) {
|
||||||
|
window.location.href = '/' + s + '/' + v + '/';
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (videoSites.includes(s)) {
|
||||||
|
window.location.href = '/' + s + '/' + encodeURIComponent(v);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 3. 123av / missav / spankbang のキーワード判定
|
||||||
if (input.toLowerCase().includes('123av')) {
|
if (input.toLowerCase().includes('123av')) {
|
||||||
const match = input.match(/(?:123av\.com\/[a-z]{2}\/(?:video\/)?|^123av\/)([^/?#]+)/i);
|
const id = input.replace(/^123av\//i, '').replace(/^\/+|\/+$/g, '');
|
||||||
const id = match ? match[1] : input.replace(/^123av\//i, '').replace(/^\/+|\/+$/g, '');
|
|
||||||
window.location.href = '/123av/' + encodeURIComponent(id);
|
window.location.href = '/123av/' + encodeURIComponent(id);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// missav判定
|
|
||||||
if (input.toLowerCase().includes('missav')) {
|
if (input.toLowerCase().includes('missav')) {
|
||||||
const match = input.match(/(?:missav\.[a-z]+\/[a-z]{2}\/|^missav\/)([^/?#]+)/i);
|
const id = input.replace(/^missav\//i, '').replace(/^\/+|\/+$/g, '');
|
||||||
const id = match ? match[1] : input.replace(/^missav\//i, '').replace(/^\/+|\/+$/g, '');
|
|
||||||
window.location.href = '/missav/' + encodeURIComponent(id);
|
window.location.href = '/missav/' + encodeURIComponent(id);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (input.toLowerCase().includes('spankbang')) {
|
||||||
// SpankBang判定
|
const id = input.replace(/^spankbang\//i, '').replace(/^\/+|\/+$/g, '');
|
||||||
const sbMatch = input.match(/spankbang\.(?:com|party)\/([a-z0-9]+)(?:\/(?:video|play|embed)|\/|$)/i);
|
window.location.href = '/spankbang/' + encodeURIComponent(id);
|
||||||
if (sbMatch) {
|
|
||||||
window.location.href = '/spankbang/' + encodeURIComponent(sbMatch[1]);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 現在のサイトとして遷移
|
// 4. E-Hentai の {gid}/{token} 形式判定
|
||||||
window.location.href = '/' + currentSite + '/' + encodeURIComponent(input);
|
if (/^\d+\/[a-z0-9]+$/i.test(input)) {
|
||||||
|
window.location.href = '/ehentai/' + input + '/';
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 5. 現在のサイトが動画プレイヤーの場合のフォールバック
|
||||||
|
if (currentSite && currentSite !== 'video') {
|
||||||
|
window.location.href = '/' + currentSite + '/' + encodeURIComponent(input);
|
||||||
|
} else {
|
||||||
|
window.location.href = '/video?id=' + encodeURIComponent(input);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 切り替えフォーム送信イベント
|
||||||
|
document.getElementById('switchForm').addEventListener('submit', (e) => {
|
||||||
|
e.preventDefault();
|
||||||
|
const input = document.getElementById('switchInput').value.trim();
|
||||||
|
navigateUniversalInput(input);
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@@ -341,13 +341,13 @@ public class VideoUrlResolver
|
|||||||
int currentDepth,
|
int currentDepth,
|
||||||
CancellationToken ct)
|
CancellationToken ct)
|
||||||
{
|
{
|
||||||
if (currentDepth > 3)
|
if (currentDepth > 10)
|
||||||
{
|
{
|
||||||
return new ResolvedVideoResult
|
return new ResolvedVideoResult
|
||||||
{
|
{
|
||||||
IsSuccess = false,
|
IsSuccess = false,
|
||||||
OriginalUrl = pageUrl,
|
OriginalUrl = pageUrl,
|
||||||
ErrorMessage = "探索階層の深さ上限(3階層)に達しました。"
|
ErrorMessage = "探索階層の深さ上限(10階層)に達しました。"
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+77
-23
@@ -84,30 +84,10 @@ app.MapGet("/view", async (string? url, string? site, string? id, string? catego
|
|||||||
return Results.Redirect("/");
|
return Results.Redirect("/");
|
||||||
}
|
}
|
||||||
|
|
||||||
// 動画サイト判定(SpankBang, 123av, missav)
|
// 動画サイト・動画URL判定(各種動画サイトまたはまとめブログのURLであれば /video へ自動リダイレクト)
|
||||||
if (string.Equals(site, "spankbang", StringComparison.OrdinalIgnoreCase) || target.Contains("spankbang", StringComparison.OrdinalIgnoreCase))
|
if (IsVideoUrlOrSite(site, target))
|
||||||
{
|
{
|
||||||
var sbId = ExtractSpankBangId(target);
|
return Results.Redirect($"/video?url={Uri.EscapeDataString(target)}");
|
||||||
if (!string.IsNullOrWhiteSpace(sbId))
|
|
||||||
{
|
|
||||||
return Results.Redirect($"/spankbang/{sbId}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (string.Equals(site, "123av", StringComparison.OrdinalIgnoreCase) || target.Contains("123av", StringComparison.OrdinalIgnoreCase))
|
|
||||||
{
|
|
||||||
var vId = Extract123AvId(target);
|
|
||||||
if (!string.IsNullOrWhiteSpace(vId))
|
|
||||||
{
|
|
||||||
return Results.Redirect($"/123av/{vId}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (string.Equals(site, "missav", StringComparison.OrdinalIgnoreCase) || target.Contains("missav", StringComparison.OrdinalIgnoreCase))
|
|
||||||
{
|
|
||||||
var vId = ExtractMissAvId(target);
|
|
||||||
if (!string.IsNullOrWhiteSpace(vId))
|
|
||||||
{
|
|
||||||
return Results.Redirect($"/missav/{vId}");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return await RenderGalleryResponseAsync(site, target, category, galleryService, ct);
|
return await RenderGalleryResponseAsync(site, target, category, galleryService, ct);
|
||||||
@@ -130,6 +110,12 @@ app.MapGet("/video", async (
|
|||||||
return Results.Redirect("/");
|
return Results.Redirect("/");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 画像ギャラリーURL判定(画像サイトのURLであれば /view へ自動リダイレクト)
|
||||||
|
if (IsGalleryUrlOrSite(site, target))
|
||||||
|
{
|
||||||
|
return Results.Redirect($"/view?url={Uri.EscapeDataString(target!)}");
|
||||||
|
}
|
||||||
|
|
||||||
// 1. target が URL かつ play/stream が渡されていない場合、記事URL(galgaldoga等)または未解決動画URLを自動探索
|
// 1. target が URL かつ play/stream が渡されていない場合、記事URL(galgaldoga等)または未解決動画URLを自動探索
|
||||||
if (target != null && target.StartsWith("http", StringComparison.OrdinalIgnoreCase) && string.IsNullOrWhiteSpace(play) && string.IsNullOrWhiteSpace(stream))
|
if (target != null && target.StartsWith("http", StringComparison.OrdinalIgnoreCase) && string.IsNullOrWhiteSpace(play) && string.IsNullOrWhiteSpace(stream))
|
||||||
{
|
{
|
||||||
@@ -577,4 +563,72 @@ static string? ExtractMissAvId(string input)
|
|||||||
return input;
|
return input;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool IsGalleryUrlOrSite(string? site, string? urlOrId)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrWhiteSpace(urlOrId)) return false;
|
||||||
|
var lower = urlOrId.ToLowerInvariant();
|
||||||
|
if (string.Equals(site, "ehentai", StringComparison.OrdinalIgnoreCase) ||
|
||||||
|
string.Equals(site, "hitomi", StringComparison.OrdinalIgnoreCase) ||
|
||||||
|
string.Equals(site, "aurahentai", StringComparison.OrdinalIgnoreCase) ||
|
||||||
|
string.Equals(site, "momonga", StringComparison.OrdinalIgnoreCase) ||
|
||||||
|
string.Equals(site, "mangalear", StringComparison.OrdinalIgnoreCase) ||
|
||||||
|
string.Equals(site, "hentaipaw", StringComparison.OrdinalIgnoreCase))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return lower.Contains("e-hentai.org") ||
|
||||||
|
lower.Contains("exhentai.org") ||
|
||||||
|
lower.Contains("hitomi.la") ||
|
||||||
|
lower.Contains("aurahentai.com") ||
|
||||||
|
lower.Contains("momon-ga.com") ||
|
||||||
|
lower.Contains("mangalear.com") ||
|
||||||
|
lower.Contains("hentaipaw.com");
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool IsVideoUrlOrSite(string? site, string? urlOrId)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrWhiteSpace(urlOrId)) return false;
|
||||||
|
var lower = urlOrId.ToLowerInvariant();
|
||||||
|
if (string.Equals(site, "spankbang", StringComparison.OrdinalIgnoreCase) ||
|
||||||
|
string.Equals(site, "123av", StringComparison.OrdinalIgnoreCase) ||
|
||||||
|
string.Equals(site, "missav", StringComparison.OrdinalIgnoreCase) ||
|
||||||
|
string.Equals(site, "doga", StringComparison.OrdinalIgnoreCase) ||
|
||||||
|
string.Equals(site, "eroterest_doga", StringComparison.OrdinalIgnoreCase) ||
|
||||||
|
string.Equals(site, "vjav", StringComparison.OrdinalIgnoreCase) ||
|
||||||
|
string.Equals(site, "laxd", StringComparison.OrdinalIgnoreCase) ||
|
||||||
|
string.Equals(site, "fc2", StringComparison.OrdinalIgnoreCase) ||
|
||||||
|
string.Equals(site, "inporn", StringComparison.OrdinalIgnoreCase) ||
|
||||||
|
string.Equals(site, "bdsmx", StringComparison.OrdinalIgnoreCase) ||
|
||||||
|
string.Equals(site, "senzuri", StringComparison.OrdinalIgnoreCase) ||
|
||||||
|
string.Equals(site, "txxx", StringComparison.OrdinalIgnoreCase) ||
|
||||||
|
string.Equals(site, "hclips", StringComparison.OrdinalIgnoreCase) ||
|
||||||
|
string.Equals(site, "hdzog", StringComparison.OrdinalIgnoreCase) ||
|
||||||
|
string.Equals(site, "upornia", StringComparison.OrdinalIgnoreCase) ||
|
||||||
|
string.Equals(site, "youjizz", StringComparison.OrdinalIgnoreCase) ||
|
||||||
|
string.Equals(site, "xvideos", StringComparison.OrdinalIgnoreCase))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return lower.Contains("spankbang") ||
|
||||||
|
lower.Contains("123av") ||
|
||||||
|
lower.Contains("missav") ||
|
||||||
|
lower.Contains("do-ga.eroterest.net") ||
|
||||||
|
lower.Contains("movie.eroterest.net") ||
|
||||||
|
lower.Contains("vjav.com") ||
|
||||||
|
lower.Contains("laxd.com") ||
|
||||||
|
lower.Contains("fc2.com") ||
|
||||||
|
lower.Contains("inporn.com") ||
|
||||||
|
lower.Contains("bdsmx.tube") ||
|
||||||
|
lower.Contains("senzuri.tube") ||
|
||||||
|
lower.Contains("txxx.com") ||
|
||||||
|
lower.Contains("hclips.com") ||
|
||||||
|
lower.Contains("hdzog.com") ||
|
||||||
|
lower.Contains("upornia.com") ||
|
||||||
|
lower.Contains("youjizz.com") ||
|
||||||
|
lower.Contains("xvideos.com") ||
|
||||||
|
lower.Contains("blogterest.net") ||
|
||||||
|
lower.Contains("blog.2nt.com");
|
||||||
|
}
|
||||||
|
|
||||||
app.Run();
|
app.Run();
|
||||||
Reference in new issue
Block a user