diff --git a/packages/anitomy/src/tokenizer.ts b/packages/anitomy/src/tokenizer.ts index e8dc1d2c..2997ba1c 100644 --- a/packages/anitomy/src/tokenizer.ts +++ b/packages/anitomy/src/tokenizer.ts @@ -142,7 +142,19 @@ export function tokenize(filename: string, options: AnitomyOptions) { function validateDelimiterTokens() { for (let i = 0; i < tokens.length; i++) { const token = tokens[i]; - if (token.category !== TokenCategory.Delimiter) continue; + if (token.category !== TokenCategory.Delimiter) { + // Hack for "【我推的孩子】" + if (token.content === '我推的孩子') { + if (tokens[i - 1]?.content === '【' && tokens[i + 1]?.content === '】') { + tokens[i - 1].category = TokenCategory.Invalid; + tokens[i].content = '【我推的孩子】'; + tokens[i].enclosed = false; + tokens[i + 1].category = TokenCategory.Invalid; + } + } + continue; + } + const delimiter = token.content[0]; const prevToken = findPrevToken(tokens, i, TokenFlag.Valid); diff --git a/packages/anitomy/test/__snapshots__/lilithraws.test.ts.snap b/packages/anitomy/test/__snapshots__/lilithraws.test.ts.snap index cef57259..ccc5a2cd 100644 --- a/packages/anitomy/test/__snapshots__/lilithraws.test.ts.snap +++ b/packages/anitomy/test/__snapshots__/lilithraws.test.ts.snap @@ -416,7 +416,7 @@ exports[`Lilith-Raws > should parse 13`] = ` "season": undefined, "source": "WEB-DL", "subtitles": undefined, - "title": "/ Oshi no Ko", + "title": "【我推的孩子】 / Oshi no Ko", "type": undefined, "video": { "resolution": "1080p", diff --git a/packages/anitomy/test/__snapshots__/tokenizer.test.ts.snap b/packages/anitomy/test/__snapshots__/tokenizer.test.ts.snap index 851a0606..2646001f 100644 --- a/packages/anitomy/test/__snapshots__/tokenizer.test.ts.snap +++ b/packages/anitomy/test/__snapshots__/tokenizer.test.ts.snap @@ -7078,20 +7078,10 @@ exports[`tokenize > should work 37`] = ` "content": " ", "enclosed": false, }, - { - "category": "Bracket", - "content": "【", - "enclosed": true, - }, { "category": "Unknown", - "content": "我推的孩子", - "enclosed": true, - }, - { - "category": "Bracket", - "content": "】", - "enclosed": true, + "content": "【我推的孩子】", + "enclosed": false, }, { "category": "Delimiter",