-
-
Notifications
You must be signed in to change notification settings - Fork 280
/
defaults.js
67 lines (65 loc) · 2.52 KB
/
defaults.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
const defaultRequestUserAgent = 'website-scraper (https://github.com/website-scraper/node-website-scraper)';
const config = {
defaultFilename: 'index.html',
prettifyUrls: false,
sources: [
{ selector: 'style' },
{ selector: '[style]', attr: 'style' },
{ selector: 'img', attr: 'src' },
{ selector: 'img', attr: 'srcset' },
{ selector: 'input', attr: 'src' },
{ selector: 'object', attr: 'data' },
{ selector: 'embed', attr: 'src' },
{ selector: 'param[name="movie"]', attr: 'value' },
{ selector: 'script', attr: 'src' },
{ selector: 'link[rel="stylesheet"]', attr: 'href' },
{ selector: 'link[rel*="icon"]', attr: 'href' },
{ selector: 'svg *[xlink\\:href]', attr: 'xlink:href' },
{ selector: 'svg *[href]', attr: 'href' },
{ selector: 'picture source', attr: 'srcset' },
{ selector: 'meta[property="og\\:image"]', attr: 'content' },
{ selector: 'meta[property="og\\:image\\:url"]', attr: 'content' },
{ selector: 'meta[property="og\\:image\\:secure_url"]', attr: 'content' },
{ selector: 'meta[property="og\\:audio"]', attr: 'content' },
{ selector: 'meta[property="og\\:audio\\:url"]', attr: 'content' },
{ selector: 'meta[property="og\\:audio\\:secure_url"]', attr: 'content' },
{ selector: 'meta[property="og\\:video"]', attr: 'content' },
{ selector: 'meta[property="og\\:video\\:url"]', attr: 'content' },
{ selector: 'meta[property="og\\:video\\:secure_url"]', attr: 'content' },
{ selector: 'video', attr: 'src' },
{ selector: 'video source', attr: 'src' },
{ selector: 'video track', attr: 'src' },
{ selector: 'audio', attr: 'src' },
{ selector: 'audio source', attr: 'src' },
{ selector: 'audio track', attr: 'src' },
{ selector: 'frame', attr: 'src' },
{ selector: 'iframe', attr: 'src' },
{ selector: '[background]', attr: 'background' }
],
subdirectories: [
{ directory: 'images', extensions: ['.png', '.jpg', '.jpeg', '.gif', '.webp'] },
{ directory: 'js', extensions: ['.js'] },
{ directory: 'css', extensions: ['.css'] },
{ directory: 'media', extensions: ['.mp4', '.mp3', '.ogg', '.webm', '.mov', '.wave', '.wav', '.flac'] },
{ directory: 'fonts', extensions: ['.ttf', '.woff', '.woff2', '.eot', '.svg'] }
],
request: {
throwHttpErrors: false,
responseType: 'buffer',
//cookieJar: true,
decompress: true,
headers: {
'user-agent': defaultRequestUserAgent
},
https: {
rejectUnauthorized: false
}
},
requestConcurrency: Infinity,
urlFilter: null,
recursive: false,
maxRecursiveDepth: null,
maxDepth: null,
ignoreErrors: false
};
export default config;