From aed63e3713ee755e50736bffa192a79ccd0e5b04 Mon Sep 17 00:00:00 2001 From: MaysWind Date: Sun, 3 Dec 2023 13:26:37 +0800 Subject: [PATCH] support utf-8 encoded comment --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 1db0726c..0a8b2a79 100644 --- a/index.js +++ b/index.js @@ -149,7 +149,7 @@ async function decodeTorrentFile (torrent) { if (torrent['creation date']) result.created = new Date(torrent['creation date'] * 1000) if (torrent['created by']) result.createdBy = arr2text(torrent['created by']) - if (ArrayBuffer.isView(torrent.comment)) result.comment = arr2text(torrent.comment) + if (ArrayBuffer.isView(torrent['comment.utf-8'] || torrent.comment)) result.comment = arr2text(torrent['comment.utf-8'] || torrent.comment) // announce and announce-list will be missing if metadata fetched via ut_metadata if (Array.isArray(torrent['announce-list']) && torrent['announce-list'].length > 0) {