mirror of
https://github.com/misskey-dev/summaly.git
synced 2025-05-28 17:07:16 +09:00
Merge pull request #6 from armchair-philosophy/feature/#5
follow redirection
This commit is contained in:
commit
25d9232ee2
@ -24,6 +24,7 @@
|
||||
"cheerio-httpcli": "0.6.10",
|
||||
"escape-regexp": "0.0.1",
|
||||
"html-entities": "1.2.0",
|
||||
"request": "2.79.0"
|
||||
"request": "2.79.0",
|
||||
"trace-redirect": "1.0.2-1"
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
import * as URL from 'url';
|
||||
import tracer from 'trace-redirect';
|
||||
import ISummary from './isummary';
|
||||
import IPlugin from './iplugin';
|
||||
import general from './general';
|
||||
@ -9,7 +10,9 @@ const plugins: IPlugin[] = [
|
||||
];
|
||||
|
||||
export default async (url: string): Promise<ISummary> => {
|
||||
const _url = URL.parse(url, true);
|
||||
const realUrl = await tracer(url);
|
||||
|
||||
const _url = URL.parse(realUrl, true);
|
||||
|
||||
const plugin = plugins.filter(plugin => plugin.test(_url))[0];
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user