mirror of
https://github.com/misskey-dev/summaly.git
synced 2025-05-17 03:27:27 +09:00
parent
78cca49ee3
commit
2a2eed6836
@ -14,7 +14,7 @@ client.set('headers', {
|
|||||||
});
|
});
|
||||||
client.set('referer', false);
|
client.set('referer', false);
|
||||||
client.set('timeout', 10000);
|
client.set('timeout', 10000);
|
||||||
client.set('maxDataSize', 1024 * 1024);
|
client.set('maxDataSize', 5 * 1024 * 1024);
|
||||||
|
|
||||||
import Summary from './summary';
|
import Summary from './summary';
|
||||||
|
|
||||||
|
@ -8,6 +8,7 @@ client.set('headers', {
|
|||||||
});
|
});
|
||||||
client.set('referer', false);
|
client.set('referer', false);
|
||||||
client.set('timeout', 10000);
|
client.set('timeout', 10000);
|
||||||
|
client.set('maxDataSize', 5 * 1024 * 1024);
|
||||||
|
|
||||||
export function test(url: URL.Url): boolean {
|
export function test(url: URL.Url): boolean {
|
||||||
return url.hostname === 'www.amazon.com' ||
|
return url.hostname === 'www.amazon.com' ||
|
||||||
@ -51,10 +52,10 @@ export async function summarize(url: URL.Url): Promise<summary> {
|
|||||||
$('meta[name="twitter:player:height"]').attr('content'));
|
$('meta[name="twitter:player:height"]').attr('content'));
|
||||||
|
|
||||||
return {
|
return {
|
||||||
title: title || null,
|
title: title ? title.trim() : null,
|
||||||
icon: 'https://www.amazon.com/favicon.ico',
|
icon: 'https://www.amazon.com/favicon.ico',
|
||||||
description: description || null,
|
description: description ? description.trim() : null,
|
||||||
thumbnail: thumbnail || null,
|
thumbnail: thumbnail ? thumbnail.trim() : null,
|
||||||
player: {
|
player: {
|
||||||
url: playerUrl || null,
|
url: playerUrl || null,
|
||||||
width: playerWidth || null,
|
width: playerWidth || null,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user