From 692a824e7870ac2cb2917e3372648f1277b42b01 Mon Sep 17 00:00:00 2001 From: "Claude (owner)" Date: Sun, 14 Jun 2026 01:55:33 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EB=AA=A9=EB=A1=9D=20=EB=BD=91=EA=B8=B0?= =?UTF-8?q?=20=E2=80=94=20=EC=A3=BC=EC=86=8C=20=EC=97=86=EB=8A=94=20?= =?UTF-8?q?=EC=98=81=EC=83=81=20=EC=A0=9C=EC=99=B8=20+=20nocookie=20?= =?UTF-8?q?=EB=8F=84=EB=A9=94=EC=9D=B8=20=EC=9D=B8=EC=8B=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 업로드 영상처럼 외부 source_url 이 없는 항목은 `[ID] [URL]` 두 칸 형식이 깨지므로 목록에서 제외한다. youtube-nocookie.com/embed/... 도 YouTube 로 인식해 https://youtu.be/ID 로 간결화한다. Co-Authored-By: Claude Opus 4.7 --- src/routes/op.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/routes/op.ts b/src/routes/op.ts index 35dad0e..139afb3 100644 --- a/src/routes/op.ts +++ b/src/routes/op.ts @@ -308,10 +308,10 @@ opRouter.get( // ─── 목록 뽑기 (영상 ID + 실제 영상 주소 txt) ────────────────────────── -/** YouTube URL 의 11자 영상 ID 추출. watch?v= / youtu.be / embed / shorts / live 형식 지원. */ +/** YouTube URL 의 11자 영상 ID 추출. watch?v= / youtu.be / embed / shorts / live, nocookie 도메인 지원. */ function extractYoutubeId(url: string): string | null { const m = url.match( - /(?:youtu\.be\/|youtube\.com\/(?:watch\?(?:[^#]*&)?v=|embed\/|shorts\/|live\/|v\/))([\w-]{11})/ + /(?:youtu\.be\/|(?:youtube\.com|youtube-nocookie\.com)\/(?:watch\?(?:[^#]*&)?v=|embed\/|shorts\/|live\/|v\/))([\w-]{11})/ ) return m ? m[1] : null } @@ -333,9 +333,12 @@ opRouter.get( res.status(404).send('폴더를 찾을 수 없습니다.') return } - const lines = listVideosInFolder(folder.id).map((v) => - `${v.id} ${videoSourceUrl(v.sourceUrl)}`.trimEnd() - ) + // 실제 외부 주소(유튜브/네이버 등)가 있는 영상만. 업로드 영상처럼 주소가 + // 없는 항목은 `[ID] [URL]` 두 칸 형식이 깨지므로 목록에서 제외한다. + const lines = listVideosInFolder(folder.id) + .map((v) => ({ id: v.id, url: videoSourceUrl(v.sourceUrl) })) + .filter((r) => r.url !== '') + .map((r) => `${r.id} ${r.url}`) const body = lines.join('\n') + (lines.length ? '\n' : '') const baseName = folderPathNames(folder.id).join('_') || 'list' const asciiName = baseName.replace(/[^\x20-\x7e]+/g, '_').replace(/["\\]/g, '_')