From 2a2eed68368a7fecd309b6909643902ee47c9e4d Mon Sep 17 00:00:00 2001 From: MeiMei <30769358+mei23@users.noreply.github.com> Date: Mon, 2 Sep 2019 05:08:05 +0900 Subject: [PATCH] =?UTF-8?q?Amazon=E3=81=A7=E5=8B=95=E4=BD=9C=E3=81=97?= =?UTF-8?q?=E3=81=AA=E3=81=84=E3=81=AE=E3=82=92=E4=BF=AE=E6=AD=A3=20(#132)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix: Amazonでうごかない * Amazon trim --- src/general.ts | 2 +- src/plugins/amazon.ts | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/general.ts b/src/general.ts index 837cb71..e96714f 100644 --- a/src/general.ts +++ b/src/general.ts @@ -14,7 +14,7 @@ client.set('headers', { }); client.set('referer', false); client.set('timeout', 10000); -client.set('maxDataSize', 1024 * 1024); +client.set('maxDataSize', 5 * 1024 * 1024); import Summary from './summary'; diff --git a/src/plugins/amazon.ts b/src/plugins/amazon.ts index cdaf894..bdacb28 100644 --- a/src/plugins/amazon.ts +++ b/src/plugins/amazon.ts @@ -8,6 +8,7 @@ client.set('headers', { }); client.set('referer', false); client.set('timeout', 10000); +client.set('maxDataSize', 5 * 1024 * 1024); export function test(url: URL.Url): boolean { return url.hostname === 'www.amazon.com' || @@ -51,10 +52,10 @@ export async function summarize(url: URL.Url): Promise { $('meta[name="twitter:player:height"]').attr('content')); return { - title: title || null, + title: title ? title.trim() : null, icon: 'https://www.amazon.com/favicon.ico', - description: description || null, - thumbnail: thumbnail || null, + description: description ? description.trim() : null, + thumbnail: thumbnail ? thumbnail.trim() : null, player: { url: playerUrl || null, width: playerWidth || null,