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,