feat: add oEmbed support (#6)

* feat: add oEmbed support

* more safelisted features

* fix the syntax

* Update README.md

* permissions

* names

* playerを使うように

* fix type error

* support width (for size ratio)

* test for type: video

* nullable width

* restore max height test

* ignored permissions

* restore autoplay

* Use WHATWG URL

---------

Co-authored-by: tamaina <tamaina@hotmail.co.jp>
This commit is contained in:
Kagami Sascha Rosylight
2023-03-13 18:46:41 +01:00
committed by GitHub
parent 51f3870e1f
commit eab3766db9
46 changed files with 3936 additions and 112 deletions

View File

@ -1,5 +1,5 @@
/// <reference types="node" />
import * as URL from 'node:url';
import { URL } from 'node:url';
import summary from '../summary.js';
export declare function test(url: URL.Url): boolean;
export declare function summarize(url: URL.Url): Promise<summary>;
export declare function test(url: URL): boolean;
export declare function summarize(url: URL): Promise<summary>;

View File

@ -36,8 +36,9 @@ export async function summarize(url) {
player: {
url: playerUrl || null,
width: playerWidth ? parseInt(playerWidth) : null,
height: playerHeight ? parseInt(playerHeight) : null
height: playerHeight ? parseInt(playerHeight) : null,
allow: playerUrl ? ['fullscreen', 'encrypted-media'] : [],
},
sitename: 'Amazon'
sitename: 'Amazon',
};
}

View File

@ -1,5 +1,5 @@
/// <reference types="node" />
import * as URL from 'node:url';
import { URL } from 'node:url';
import summary from '../summary.js';
export declare function test(url: URL.Url): boolean;
export declare function summarize(url: URL.Url): Promise<summary>;
export declare function test(url: URL): boolean;
export declare function summarize(url: URL): Promise<summary>;

View File

@ -29,8 +29,9 @@ export async function summarize(url) {
player: {
url: null,
width: null,
height: null
height: null,
allow: [],
},
sitename: 'Wikipedia'
sitename: 'Wikipedia',
};
}