Skip to content

Commit b353fda

Browse files
authored
Merge pull request #165 from GulSam00/fix/kyVerify
Fix/ky verify
2 parents f927cc4 + 8fc5445 commit b353fda

5 files changed

Lines changed: 24 additions & 8 deletions

File tree

.github/workflows/update_ky_youtube.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
name: Update ky by Youtube
22

3-
# 실행 일시 중지
43
on:
54
schedule:
65
- cron: "0 14 * * *" # 한국 시간 23:00 실행 (UTC+9 → UTC 14:00)

.github/workflows/verify_ky_youtube.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
name: Verify ky by Youtube
22

33
on:
4+
schedule:
5+
- cron: "0 14 * * *" # 한국 시간 23:00 실행 (UTC+9 → UTC 14:00)
46
workflow_dispatch:
57

68
permissions:

apps/web/src/constants/krToJpnArtist.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ export const krToJpnArtistSort = {
22
// A-Z
33
Ado: 'Ado',
44
Aimer: 'Aimer',
5-
'ASIAN KUNG-FU GENERATION': '아시안 쿵푸 제너레이션',
65

76
DECO27: 'DECO*27',
87
Eve: 'Eve',
@@ -39,6 +38,7 @@ export const krToJpnArtistSort = {
3938
// 아
4039
아라시: '嵐',
4140
아마자라시: 'amazarashi',
41+
'아시안 쿵푸 제너레이션': 'ASIAN KUNG-FU GENERATION',
4242
아이묭: 'あいみょん',
4343
엘레가든: 'ELLEGARDEN',
4444
'오이시 마사요시': 'オーイシマサヨシ',

packages/crawling/src/crawling/crawlYoutubeVerify.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ for (const song of data) {
4545

4646
index++;
4747
console.log('crawlYoutubeVerify : ', index);
48+
49+
if (index >= 2000) break;
4850
}
4951

5052
browser.close();

packages/crawling/src/utils/validateSongMatch.ts

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,22 +25,35 @@ export const validateSongMatch = async (
2525
messages: [
2626
{
2727
role: 'system',
28-
content:
29-
'Decide if two (title, artist) pairs refer to the same song. Allow spelling variants (spaces, en/kr, case). Return JSON: {"isValid":boolean}',
28+
content: `
29+
You are a music database expert.
30+
Decide if two (title, artist) pairs refer to the same song recording.
31+
32+
Rules:
33+
1. Ignore additional info in parentheses like "(Original Artist Name)", "(Movie OST)", or "Remake".
34+
2. Allow spelling variants, spaces, case, and Language mix (KR/EN/JP).
35+
3. If the song title and the PERFORMING artist are the same, it is a MATCH, even if the original composer/artist is mentioned in the found title.
36+
37+
Return JSON: {"isValid": boolean}
38+
`,
3039
},
3140
{
3241
role: 'user',
33-
content: `"${inputTitle}"(${inputArtist}) vs "${foundTitle}"(${foundArtist})`,
42+
content: `Pair A: "${inputTitle}" by "${inputArtist}"\nPair B: "${foundTitle}" by "${foundArtist}"`,
3443
},
3544
],
3645
response_format: { type: 'json_object' },
3746
temperature: 0,
38-
max_tokens: 20,
47+
max_tokens: 50,
3948
});
4049

4150
const content = response.choices[0].message.content;
4251
if (!content) return false;
4352

44-
const result: { isValid: boolean } = JSON.parse(content);
45-
return result.isValid;
53+
try {
54+
const result = JSON.parse(content);
55+
return result.isValid === true;
56+
} catch {
57+
return false;
58+
}
4659
};

0 commit comments

Comments
 (0)