Update lib/sfilemobi/sfilemobi-dl.js
Browse files
lib/sfilemobi/sfilemobi-dl.js
CHANGED
@@ -4,14 +4,12 @@ import { DEFAULT_HEADERS } from '../constant.js';
|
|
4 |
import { SfilemobidlArgsSchema, SfilemobidlSchema } from '../types/sfilemobi-dl-v1.js';
|
5 |
|
6 |
export async function sfilemobi(url) {
|
7 |
-
SfilemobidlArgsSchema.parse(
|
8 |
|
9 |
const data = await got(url, {
|
10 |
-
headers: {
|
11 |
-
...DEFAULT_HEADERS
|
12 |
-
}
|
13 |
}).text();
|
14 |
-
|
15 |
const $ = cheerio.load(data);
|
16 |
|
17 |
const dlUrl = $('#download').attr('href') || null;
|
|
|
4 |
import { SfilemobidlArgsSchema, SfilemobidlSchema } from '../types/sfilemobi-dl-v1.js';
|
5 |
|
6 |
export async function sfilemobi(url) {
|
7 |
+
SfilemobidlArgsSchema.parse({ url });
|
8 |
|
9 |
const data = await got(url, {
|
10 |
+
headers: { ...DEFAULT_HEADERS }
|
|
|
|
|
11 |
}).text();
|
12 |
+
|
13 |
const $ = cheerio.load(data);
|
14 |
|
15 |
const dlUrl = $('#download').attr('href') || null;
|