rahad-media-downloader 2.1.7 → 2.1.10
Sign up to get free protection for your applications and to get access to all the features.
- package/.cache/typescript/5.3/node_modules/.package-lock.json +54 -0
- package/.cache/typescript/5.3/node_modules/@types/cookie/LICENSE +21 -0
- package/.cache/typescript/5.3/node_modules/@types/cookie/README.md +15 -0
- package/.cache/typescript/5.3/node_modules/@types/cookie/index.d.ts +154 -0
- package/.cache/typescript/5.3/node_modules/@types/cookie/package.json +30 -0
- package/.cache/typescript/5.3/node_modules/@types/domhandler/LICENSE +21 -0
- package/.cache/typescript/5.3/node_modules/@types/domhandler/README.md +92 -0
- package/.cache/typescript/5.3/node_modules/@types/domhandler/index.d.ts +73 -0
- package/.cache/typescript/5.3/node_modules/@types/domhandler/package.json +25 -0
- package/.cache/typescript/5.3/node_modules/@types/domutils/LICENSE +21 -0
- package/.cache/typescript/5.3/node_modules/@types/domutils/README.md +15 -0
- package/.cache/typescript/5.3/node_modules/@types/domutils/index.d.ts +124 -0
- package/.cache/typescript/5.3/node_modules/@types/domutils/package.json +27 -0
- package/.cache/typescript/5.3/node_modules/@types/htmlparser2/LICENSE +21 -0
- package/.cache/typescript/5.3/node_modules/@types/htmlparser2/README.md +15 -0
- package/.cache/typescript/5.3/node_modules/@types/htmlparser2/index.d.ts +120 -0
- package/.cache/typescript/5.3/node_modules/@types/htmlparser2/package.json +45 -0
- package/.cache/typescript/5.3/node_modules/@types/psl/LICENSE +21 -0
- package/.cache/typescript/5.3/node_modules/@types/psl/README.md +52 -0
- package/.cache/typescript/5.3/node_modules/@types/psl/index.d.ts +33 -0
- package/.cache/typescript/5.3/node_modules/@types/psl/package.json +25 -0
- package/.cache/typescript/5.3/node_modules/domelementtype/LICENSE +11 -0
- package/.cache/typescript/5.3/node_modules/domelementtype/index.js +15 -0
- package/.cache/typescript/5.3/node_modules/domelementtype/package.json +16 -0
- package/.cache/typescript/5.3/node_modules/domelementtype/readme.md +1 -0
- package/.cache/typescript/5.3/node_modules/domhandler/.travis.yml +6 -0
- package/.cache/typescript/5.3/node_modules/domhandler/LICENSE +11 -0
- package/.cache/typescript/5.3/node_modules/domhandler/index.js +217 -0
- package/.cache/typescript/5.3/node_modules/domhandler/lib/element.js +20 -0
- package/.cache/typescript/5.3/node_modules/domhandler/lib/node.js +44 -0
- package/.cache/typescript/5.3/node_modules/domhandler/package.json +41 -0
- package/.cache/typescript/5.3/node_modules/domhandler/readme.md +116 -0
- package/.cache/typescript/5.3/node_modules/domhandler/test/cases/01-basic.json +57 -0
- package/.cache/typescript/5.3/node_modules/domhandler/test/cases/02-single_tag_1.json +21 -0
- package/.cache/typescript/5.3/node_modules/domhandler/test/cases/03-single_tag_2.json +21 -0
- package/.cache/typescript/5.3/node_modules/domhandler/test/cases/04-unescaped_in_script.json +27 -0
- package/.cache/typescript/5.3/node_modules/domhandler/test/cases/05-tags_in_comment.json +18 -0
- package/.cache/typescript/5.3/node_modules/domhandler/test/cases/06-comment_in_script.json +18 -0
- package/.cache/typescript/5.3/node_modules/domhandler/test/cases/07-unescaped_in_style.json +20 -0
- package/.cache/typescript/5.3/node_modules/domhandler/test/cases/08-extra_spaces_in_tag.json +20 -0
- package/.cache/typescript/5.3/node_modules/domhandler/test/cases/09-unquoted_attrib.json +20 -0
- package/.cache/typescript/5.3/node_modules/domhandler/test/cases/10-singular_attribute.json +15 -0
- package/.cache/typescript/5.3/node_modules/domhandler/test/cases/11-text_outside_tags.json +40 -0
- package/.cache/typescript/5.3/node_modules/domhandler/test/cases/12-text_only.json +11 -0
- package/.cache/typescript/5.3/node_modules/domhandler/test/cases/13-comment_in_text.json +19 -0
- package/.cache/typescript/5.3/node_modules/domhandler/test/cases/14-comment_in_text_in_script.json +18 -0
- package/.cache/typescript/5.3/node_modules/domhandler/test/cases/15-non-verbose.json +22 -0
- package/.cache/typescript/5.3/node_modules/domhandler/test/cases/16-normalize_whitespace.json +47 -0
- package/.cache/typescript/5.3/node_modules/domhandler/test/cases/17-xml_namespace.json +18 -0
- package/.cache/typescript/5.3/node_modules/domhandler/test/cases/18-enforce_empty_tags.json +16 -0
- package/.cache/typescript/5.3/node_modules/domhandler/test/cases/19-ignore_empty_tags.json +20 -0
- package/.cache/typescript/5.3/node_modules/domhandler/test/cases/20-template_script_tags.json +20 -0
- package/.cache/typescript/5.3/node_modules/domhandler/test/cases/21-conditional_comments.json +15 -0
- package/.cache/typescript/5.3/node_modules/domhandler/test/cases/22-lowercase_tags.json +41 -0
- package/.cache/typescript/5.3/node_modules/domhandler/test/cases/23-dom-lvl1.json +131 -0
- package/.cache/typescript/5.3/node_modules/domhandler/test/cases/24-with-start-indices.json +85 -0
- package/.cache/typescript/5.3/node_modules/domhandler/test/cases/25-with-end-indices.json +86 -0
- package/.cache/typescript/5.3/node_modules/domhandler/test/tests.js +60 -0
- package/.cache/typescript/5.3/package-lock.json +57 -0
- package/.cache/typescript/5.3/package.json +1 -1
- package/README.md +103 -18
- package/index.js +1 -1
- package/package.json +4 -3
- package/test.js +0 -35
@@ -0,0 +1,20 @@
|
|
1
|
+
{
|
2
|
+
"name": "Template script tags",
|
3
|
+
"options": {},
|
4
|
+
"html": "<script type=\"text/template\"><h1>Heading1</h1></script>",
|
5
|
+
"expected": [
|
6
|
+
{
|
7
|
+
"type": "script",
|
8
|
+
"name": "script",
|
9
|
+
"attribs": {
|
10
|
+
"type": "text/template"
|
11
|
+
},
|
12
|
+
"children": [
|
13
|
+
{
|
14
|
+
"data": "<h1>Heading1</h1>",
|
15
|
+
"type": "text"
|
16
|
+
}
|
17
|
+
]
|
18
|
+
}
|
19
|
+
]
|
20
|
+
}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
{
|
2
|
+
"name": "Conditional comments",
|
3
|
+
"options": {},
|
4
|
+
"html": "<!--[if lt IE 7]> <html class='no-js ie6 oldie' lang='en'> <![endif]--><!--[if lt IE 7]> <html class='no-js ie6 oldie' lang='en'> <![endif]-->",
|
5
|
+
"expected": [
|
6
|
+
{
|
7
|
+
"data": "[if lt IE 7]> <html class='no-js ie6 oldie' lang='en'> <![endif]",
|
8
|
+
"type": "comment"
|
9
|
+
},
|
10
|
+
{
|
11
|
+
"data": "[if lt IE 7]> <html class='no-js ie6 oldie' lang='en'> <![endif]",
|
12
|
+
"type": "comment"
|
13
|
+
}
|
14
|
+
]
|
15
|
+
}
|
@@ -0,0 +1,41 @@
|
|
1
|
+
{
|
2
|
+
"name": "lowercase tags",
|
3
|
+
"options": {},
|
4
|
+
"html": "<!DOCTYPE html><HTML><TITLE>The Title</title><BODY>Hello world</body></html>",
|
5
|
+
"expected": [
|
6
|
+
{
|
7
|
+
"name": "!doctype",
|
8
|
+
"data": "!DOCTYPE html",
|
9
|
+
"type": "directive"
|
10
|
+
},
|
11
|
+
{
|
12
|
+
"type": "tag",
|
13
|
+
"name": "html",
|
14
|
+
"attribs": {},
|
15
|
+
"children": [
|
16
|
+
{
|
17
|
+
"type": "tag",
|
18
|
+
"name": "title",
|
19
|
+
"attribs": {},
|
20
|
+
"children": [
|
21
|
+
{
|
22
|
+
"data": "The Title",
|
23
|
+
"type": "text"
|
24
|
+
}
|
25
|
+
]
|
26
|
+
},
|
27
|
+
{
|
28
|
+
"type": "tag",
|
29
|
+
"name": "body",
|
30
|
+
"attribs": {},
|
31
|
+
"children": [
|
32
|
+
{
|
33
|
+
"data": "Hello world",
|
34
|
+
"type": "text"
|
35
|
+
}
|
36
|
+
]
|
37
|
+
}
|
38
|
+
]
|
39
|
+
}
|
40
|
+
]
|
41
|
+
}
|
@@ -0,0 +1,131 @@
|
|
1
|
+
{
|
2
|
+
"name": "DOM level 1",
|
3
|
+
"options": { "withDomLvl1": true },
|
4
|
+
"html": "<div>some stray text<h1>Hello, world.</h1><!-- comment node -->more stray text</div>",
|
5
|
+
"expected": [
|
6
|
+
{
|
7
|
+
"type": "tag",
|
8
|
+
"nodeType": 1,
|
9
|
+
"name": "div",
|
10
|
+
"tagName": "div",
|
11
|
+
"attribs": {},
|
12
|
+
"nodeValue": null,
|
13
|
+
"children": [
|
14
|
+
{
|
15
|
+
"type": "text",
|
16
|
+
"nodeType": 3,
|
17
|
+
"tagName": null,
|
18
|
+
"data": "some stray text",
|
19
|
+
"nodeValue": "some stray text",
|
20
|
+
"childNodes": null,
|
21
|
+
"firstChild": null,
|
22
|
+
"lastChild": null
|
23
|
+
},
|
24
|
+
{
|
25
|
+
"type": "tag",
|
26
|
+
"nodeType": 1,
|
27
|
+
"name": "h1",
|
28
|
+
"tagName": "h1",
|
29
|
+
"nodeValue": null,
|
30
|
+
"attribs": {},
|
31
|
+
"children": [
|
32
|
+
{
|
33
|
+
"type": "text",
|
34
|
+
"nodeType": 3,
|
35
|
+
"tagName": null,
|
36
|
+
"data": "Hello, world.",
|
37
|
+
"nodeValue": "Hello, world.",
|
38
|
+
"childNodes": null,
|
39
|
+
"firstChild": null,
|
40
|
+
"lastChild": null
|
41
|
+
}
|
42
|
+
],
|
43
|
+
"firstChild": {
|
44
|
+
"type": "text",
|
45
|
+
"nodeType": 3,
|
46
|
+
"tagName": null,
|
47
|
+
"data": "Hello, world.",
|
48
|
+
"nodeValue": "Hello, world.",
|
49
|
+
"childNodes": null,
|
50
|
+
"firstChild": null,
|
51
|
+
"lastChild": null
|
52
|
+
},
|
53
|
+
"lastChild": {
|
54
|
+
"type": "text",
|
55
|
+
"nodeType": 3,
|
56
|
+
"tagName": null,
|
57
|
+
"data": "Hello, world.",
|
58
|
+
"nodeValue": "Hello, world.",
|
59
|
+
"childNodes": null,
|
60
|
+
"firstChild": null,
|
61
|
+
"lastChild": null
|
62
|
+
}
|
63
|
+
},
|
64
|
+
{
|
65
|
+
"type": "comment",
|
66
|
+
"nodeType": 8,
|
67
|
+
"tagName": null,
|
68
|
+
"data": " comment node ",
|
69
|
+
"nodeValue": " comment node ",
|
70
|
+
"childNodes": null,
|
71
|
+
"firstChild": null,
|
72
|
+
"lastChild": null,
|
73
|
+
"prev": {
|
74
|
+
"type": "tag",
|
75
|
+
"name": "h1",
|
76
|
+
"nodeValue": null,
|
77
|
+
"attribs": {}
|
78
|
+
},
|
79
|
+
"previousSibling": {
|
80
|
+
"type": "tag",
|
81
|
+
"name": "h1",
|
82
|
+
"nodeValue": null,
|
83
|
+
"attribs": {}
|
84
|
+
},
|
85
|
+
"next": {
|
86
|
+
"type": "text",
|
87
|
+
"tagName": null,
|
88
|
+
"data": "more stray text"
|
89
|
+
},
|
90
|
+
"nextSibling": {
|
91
|
+
"type": "text",
|
92
|
+
"tagName": null,
|
93
|
+
"data": "more stray text"
|
94
|
+
}
|
95
|
+
},
|
96
|
+
{
|
97
|
+
"type": "text",
|
98
|
+
"nodeType": 3,
|
99
|
+
"tagName": null,
|
100
|
+
"data": "more stray text",
|
101
|
+
"nodeValue": "more stray text",
|
102
|
+
"childNodes": null,
|
103
|
+
"firstChild": null,
|
104
|
+
"lastChild": null,
|
105
|
+
"next": null,
|
106
|
+
"nextSibling": null
|
107
|
+
}
|
108
|
+
],
|
109
|
+
"firstChild": {
|
110
|
+
"type": "text",
|
111
|
+
"nodeType": 3,
|
112
|
+
"tagName": null,
|
113
|
+
"data": "some stray text",
|
114
|
+
"nodeValue": "some stray text",
|
115
|
+
"childNodes": null,
|
116
|
+
"firstChild": null,
|
117
|
+
"lastChild": null
|
118
|
+
},
|
119
|
+
"lastChild": {
|
120
|
+
"type": "text",
|
121
|
+
"nodeType": 3,
|
122
|
+
"tagName": null,
|
123
|
+
"data": "more stray text",
|
124
|
+
"nodeValue": "more stray text",
|
125
|
+
"childNodes": null,
|
126
|
+
"firstChild": null,
|
127
|
+
"lastChild": null
|
128
|
+
}
|
129
|
+
}
|
130
|
+
]
|
131
|
+
}
|
@@ -0,0 +1,85 @@
|
|
1
|
+
{
|
2
|
+
"name": "withStartIndices adds correct startIndex properties",
|
3
|
+
"options": {"withStartIndices": true},
|
4
|
+
"streaming": false,
|
5
|
+
"html": "<!DOCTYPE html> <html> <title>The Title</title> <body class='foo'>Hello world <p></p></body> <!-- the comment --> </html> ",
|
6
|
+
"expected": [
|
7
|
+
{
|
8
|
+
"startIndex": 0,
|
9
|
+
"name": "!doctype",
|
10
|
+
"data": "!DOCTYPE html",
|
11
|
+
"type": "directive"
|
12
|
+
},
|
13
|
+
{
|
14
|
+
"type": "text",
|
15
|
+
"data": " "
|
16
|
+
},
|
17
|
+
{
|
18
|
+
"startIndex": 16,
|
19
|
+
"type": "tag",
|
20
|
+
"name": "html",
|
21
|
+
"attribs": {},
|
22
|
+
"parent": null,
|
23
|
+
"children": [
|
24
|
+
{
|
25
|
+
"startIndex": 22,
|
26
|
+
"type": "text",
|
27
|
+
"data": " "
|
28
|
+
},
|
29
|
+
{
|
30
|
+
"startIndex": 23,
|
31
|
+
"type": "tag",
|
32
|
+
"name": "title",
|
33
|
+
"attribs": {},
|
34
|
+
"children": [
|
35
|
+
{
|
36
|
+
"startIndex": 30,
|
37
|
+
"data": "The Title",
|
38
|
+
"type": "text"
|
39
|
+
}
|
40
|
+
]
|
41
|
+
},
|
42
|
+
{
|
43
|
+
"startIndex": 47,
|
44
|
+
"type": "text",
|
45
|
+
"data": " "
|
46
|
+
},
|
47
|
+
{
|
48
|
+
"startIndex": 48,
|
49
|
+
"type": "tag",
|
50
|
+
"name": "body",
|
51
|
+
"attribs": {"class": "foo"},
|
52
|
+
"children": [
|
53
|
+
{
|
54
|
+
"startIndex": 66,
|
55
|
+
"data": "Hello world ",
|
56
|
+
"type": "text"
|
57
|
+
},
|
58
|
+
{
|
59
|
+
"startIndex": 78,
|
60
|
+
"type": "tag",
|
61
|
+
"name": "p",
|
62
|
+
"attribs": {},
|
63
|
+
"children": []
|
64
|
+
}
|
65
|
+
]
|
66
|
+
},
|
67
|
+
{
|
68
|
+
"startIndex": 92,
|
69
|
+
"type": "text",
|
70
|
+
"data": " "
|
71
|
+
},
|
72
|
+
{
|
73
|
+
"startIndex": 93,
|
74
|
+
"type": "comment",
|
75
|
+
"data": " the comment "
|
76
|
+
},
|
77
|
+
{
|
78
|
+
"startIndex": 113,
|
79
|
+
"type": "text",
|
80
|
+
"data": " "
|
81
|
+
}
|
82
|
+
]
|
83
|
+
}
|
84
|
+
]
|
85
|
+
}
|
@@ -0,0 +1,86 @@
|
|
1
|
+
{
|
2
|
+
"name": "withEndIndices adds correct endIndex properties",
|
3
|
+
"options": {"withStartIndices": true,"withEndIndices": true},
|
4
|
+
"streaming": false,
|
5
|
+
"html": "<!DOCTYPE html> <html> <title>The Title</title> <body class='foo'>Hello world <p></p></body> <!-- the comment --> </html> ",
|
6
|
+
"expected": [
|
7
|
+
{
|
8
|
+
"endIndex": null,
|
9
|
+
"name": "!doctype",
|
10
|
+
"data": "!DOCTYPE html",
|
11
|
+
"type": "directive"
|
12
|
+
},
|
13
|
+
{
|
14
|
+
"type": "text",
|
15
|
+
"data": " ",
|
16
|
+
"endIndex": 15
|
17
|
+
},
|
18
|
+
{
|
19
|
+
"endIndex": 120,
|
20
|
+
"type": "tag",
|
21
|
+
"name": "html",
|
22
|
+
"attribs": {},
|
23
|
+
"parent": null,
|
24
|
+
"children": [
|
25
|
+
{
|
26
|
+
"endIndex": 22,
|
27
|
+
"type": "text",
|
28
|
+
"data": " "
|
29
|
+
},
|
30
|
+
{
|
31
|
+
"endIndex": 46,
|
32
|
+
"type": "tag",
|
33
|
+
"name": "title",
|
34
|
+
"attribs": {},
|
35
|
+
"children": [
|
36
|
+
{
|
37
|
+
"endIndex": 38,
|
38
|
+
"data": "The Title",
|
39
|
+
"type": "text"
|
40
|
+
}
|
41
|
+
]
|
42
|
+
},
|
43
|
+
{
|
44
|
+
"endIndex": 47,
|
45
|
+
"type": "text",
|
46
|
+
"data": " "
|
47
|
+
},
|
48
|
+
{
|
49
|
+
"endIndex": 91,
|
50
|
+
"type": "tag",
|
51
|
+
"name": "body",
|
52
|
+
"attribs": {"class": "foo"},
|
53
|
+
"children": [
|
54
|
+
{
|
55
|
+
"endIndex": 77,
|
56
|
+
"data": "Hello world ",
|
57
|
+
"type": "text"
|
58
|
+
},
|
59
|
+
{
|
60
|
+
"endIndex": 84,
|
61
|
+
"type": "tag",
|
62
|
+
"name": "p",
|
63
|
+
"attribs": {},
|
64
|
+
"children": []
|
65
|
+
}
|
66
|
+
]
|
67
|
+
},
|
68
|
+
{
|
69
|
+
"endIndex": 92,
|
70
|
+
"type": "text",
|
71
|
+
"data": " "
|
72
|
+
},
|
73
|
+
{
|
74
|
+
"endIndex": 112,
|
75
|
+
"type": "comment",
|
76
|
+
"data": " the comment "
|
77
|
+
},
|
78
|
+
{
|
79
|
+
"endIndex": 113,
|
80
|
+
"type": "text",
|
81
|
+
"data": " "
|
82
|
+
}
|
83
|
+
]
|
84
|
+
}
|
85
|
+
]
|
86
|
+
}
|
@@ -0,0 +1,60 @@
|
|
1
|
+
var fs = require("fs"),
|
2
|
+
path = require("path"),
|
3
|
+
assert = require("assert"),
|
4
|
+
util = require("util"),
|
5
|
+
Parser = require("htmlparser2").Parser,
|
6
|
+
Handler = require("../");
|
7
|
+
|
8
|
+
var basePath = path.resolve(__dirname, "cases"),
|
9
|
+
inspectOpts = { showHidden: true, depth: null };
|
10
|
+
|
11
|
+
fs
|
12
|
+
.readdirSync(basePath)
|
13
|
+
.filter(RegExp.prototype.test, /\.json$/) //only allow .json files
|
14
|
+
.map(function(name){
|
15
|
+
return path.resolve(basePath, name);
|
16
|
+
})
|
17
|
+
.map(require)
|
18
|
+
.forEach(function(test){
|
19
|
+
it(test.name, function(){
|
20
|
+
var expected = test.expected;
|
21
|
+
|
22
|
+
var handler = new Handler(function(err, actual){
|
23
|
+
assert.ifError(err);
|
24
|
+
try {
|
25
|
+
compare(expected, actual);
|
26
|
+
} catch(e){
|
27
|
+
e.expected = util.inspect(expected, inspectOpts);
|
28
|
+
e.actual = util.inspect(actual, inspectOpts);
|
29
|
+
throw e;
|
30
|
+
}
|
31
|
+
}, test.options);
|
32
|
+
|
33
|
+
var data = test.html;
|
34
|
+
|
35
|
+
var parser = new Parser(handler, test.options);
|
36
|
+
|
37
|
+
//first, try to run the test via chunks
|
38
|
+
if (test.streaming || test.streaming === undefined){
|
39
|
+
for(var i = 0; i < data.length; i++){
|
40
|
+
parser.write(data.charAt(i));
|
41
|
+
}
|
42
|
+
parser.done();
|
43
|
+
}
|
44
|
+
|
45
|
+
//then parse everything
|
46
|
+
parser.parseComplete(data);
|
47
|
+
});
|
48
|
+
});
|
49
|
+
|
50
|
+
function compare(expected, result){
|
51
|
+
assert.equal(typeof expected, typeof result, "types didn't match");
|
52
|
+
if(typeof expected !== "object" || expected === null){
|
53
|
+
assert.strictEqual(expected, result, "result doesn't equal expected");
|
54
|
+
} else {
|
55
|
+
for(var prop in expected){
|
56
|
+
assert.ok(prop in result, "result didn't contain property " + prop);
|
57
|
+
compare(expected[prop], result[prop]);
|
58
|
+
}
|
59
|
+
}
|
60
|
+
}
|
@@ -9,8 +9,11 @@
|
|
9
9
|
},
|
10
10
|
"devDependencies": {
|
11
11
|
"@types/cheerio": "^0.22.35",
|
12
|
+
"@types/cookie": "^0.6.0",
|
13
|
+
"@types/htmlparser2": "^3.10.7",
|
12
14
|
"@types/jsdom": "^21.1.6",
|
13
15
|
"@types/node-fetch": "^2.6.9",
|
16
|
+
"@types/psl": "^1.1.3",
|
14
17
|
"@types/request": "^2.48.12"
|
15
18
|
}
|
16
19
|
},
|
@@ -29,6 +32,39 @@
|
|
29
32
|
"@types/node": "*"
|
30
33
|
}
|
31
34
|
},
|
35
|
+
"node_modules/@types/cookie": {
|
36
|
+
"version": "0.6.0",
|
37
|
+
"resolved": "https://registry.npmjs.org/@types/cookie/-/cookie-0.6.0.tgz",
|
38
|
+
"integrity": "sha512-4Kh9a6B2bQciAhf7FSuMRRkUWecJgJu9nPnx3yzpsfXX/c50REIqpHY4C82bXP90qrLtXtkDxTZosYO3UpOwlA==",
|
39
|
+
"dev": true
|
40
|
+
},
|
41
|
+
"node_modules/@types/domhandler": {
|
42
|
+
"version": "2.4.5",
|
43
|
+
"resolved": "https://registry.npmjs.org/@types/domhandler/-/domhandler-2.4.5.tgz",
|
44
|
+
"integrity": "sha512-lANhC2grmFG1gBac/8sDAKdIXx+TzAdkJIAjEOSMA+qW3297ybACEbacJnG15aNYfrzDO6fdcoouokqAKsy6aQ==",
|
45
|
+
"dev": true
|
46
|
+
},
|
47
|
+
"node_modules/@types/domutils": {
|
48
|
+
"version": "1.7.8",
|
49
|
+
"resolved": "https://registry.npmjs.org/@types/domutils/-/domutils-1.7.8.tgz",
|
50
|
+
"integrity": "sha512-iZGboDV79ibrO3D625p9yD+VgmMDnyJocdIRJvu9Xz66R8SHfOY/XNgdjY5SFoFiLgILceVfSLt7IUhlk1Vhhg==",
|
51
|
+
"dev": true,
|
52
|
+
"dependencies": {
|
53
|
+
"@types/domhandler": "^2.4.0"
|
54
|
+
}
|
55
|
+
},
|
56
|
+
"node_modules/@types/htmlparser2": {
|
57
|
+
"version": "3.10.7",
|
58
|
+
"resolved": "https://registry.npmjs.org/@types/htmlparser2/-/htmlparser2-3.10.7.tgz",
|
59
|
+
"integrity": "sha512-ycBs4PNr9rY9XFFp4WkP+M1UcO49ahn0+9b24cmIY6KWy0w35rW0G8+JTTe9Rp6Wnyqn5SEHZrhCBMa0TIOxBw==",
|
60
|
+
"dev": true,
|
61
|
+
"dependencies": {
|
62
|
+
"@types/domhandler": "^2.4.3",
|
63
|
+
"@types/domutils": "*",
|
64
|
+
"@types/node": "*",
|
65
|
+
"domhandler": "^2.4.0"
|
66
|
+
}
|
67
|
+
},
|
32
68
|
"node_modules/@types/jsdom": {
|
33
69
|
"version": "21.1.6",
|
34
70
|
"resolved": "https://registry.npmjs.org/@types/jsdom/-/jsdom-21.1.6.tgz",
|
@@ -59,6 +95,12 @@
|
|
59
95
|
"form-data": "^4.0.0"
|
60
96
|
}
|
61
97
|
},
|
98
|
+
"node_modules/@types/psl": {
|
99
|
+
"version": "1.1.3",
|
100
|
+
"resolved": "https://registry.npmjs.org/@types/psl/-/psl-1.1.3.tgz",
|
101
|
+
"integrity": "sha512-Iu174JHfLd7i/XkXY6VDrqSlPvTDQOtQI7wNAXKKOAADJ9TduRLkNdMgjGiMxSttUIZnomv81JAbAbC0DhggxA==",
|
102
|
+
"dev": true
|
103
|
+
},
|
62
104
|
"node_modules/@types/request": {
|
63
105
|
"version": "2.48.12",
|
64
106
|
"resolved": "https://registry.npmjs.org/@types/request/-/request-2.48.12.tgz",
|
@@ -118,6 +160,21 @@
|
|
118
160
|
"node": ">=0.4.0"
|
119
161
|
}
|
120
162
|
},
|
163
|
+
"node_modules/domelementtype": {
|
164
|
+
"version": "1.3.1",
|
165
|
+
"resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.1.tgz",
|
166
|
+
"integrity": "sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w==",
|
167
|
+
"dev": true
|
168
|
+
},
|
169
|
+
"node_modules/domhandler": {
|
170
|
+
"version": "2.4.2",
|
171
|
+
"resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.4.2.tgz",
|
172
|
+
"integrity": "sha512-JiK04h0Ht5u/80fdLMCEmV4zkNh2BcoMFBmZ/91WtYZ8qVXSKjiw7fXMgFPnHcSZgOo3XdinHvmnDUeMf5R4wA==",
|
173
|
+
"dev": true,
|
174
|
+
"dependencies": {
|
175
|
+
"domelementtype": "1"
|
176
|
+
}
|
177
|
+
},
|
121
178
|
"node_modules/entities": {
|
122
179
|
"version": "4.5.0",
|
123
180
|
"resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz",
|
@@ -1 +1 @@
|
|
1
|
-
{"private":true,"dependencies":{"types-registry":"^0.1.684"},"devDependencies":{"@types/cheerio":"^0.22.35","@types/jsdom":"^21.1.6","@types/node-fetch":"^2.6.9","@types/request":"^2.48.12"}}
|
1
|
+
{"private":true,"dependencies":{"types-registry":"^0.1.684"},"devDependencies":{"@types/cheerio":"^0.22.35","@types/cookie":"^0.6.0","@types/htmlparser2":"^3.10.7","@types/jsdom":"^21.1.6","@types/node-fetch":"^2.6.9","@types/psl":"^1.1.3","@types/request":"^2.48.12"}}
|
package/README.md
CHANGED
@@ -39,24 +39,20 @@ mainFB();
|
|
39
39
|
## Output Example Facebook
|
40
40
|
```
|
41
41
|
{
|
42
|
-
"
|
43
|
-
"
|
44
|
-
"
|
45
|
-
|
46
|
-
|
47
|
-
"
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
"url": "https://video-ord5-2.xx.fbcdn.net/v/t42.1790-2/419062132_3534798126761848_8448807795919179591_n.mp4?_nc_cat=107&ccb=1-7&_nc_sid=55d0d3&efg=eyJybHIiOjQ3NywicmxhIjo1MTIsInZlbmNvZGVfdGFnIjoic3ZlX3NkIiwidmlkZW9faWQiOjkzOTQ4MTcwMTEyOTkwNH0%3D&_nc_ohc=vI5kNS33k4QAb7dhRja&_nc_oc=AdhM3an5TpN_9b06ZljCno7EzpBpdkcMW1PYu-w-jJ0SmAFvqb4g65uuk1MiI0Y-C3E&rl=477&vabr=265&_nc_ht=video-ord5-2.xx&oh=00_AfASd5iHTKzDIRW_MQQZSqnL4qpbYVHV05PMdVM754yrAA&oe=662425C6&dl=1"
|
57
|
-
}
|
58
|
-
];
|
59
|
-
}
|
42
|
+
"metadata": {
|
43
|
+
"Author": "Mohammad Rahad",
|
44
|
+
"message": "any problem please contact me",
|
45
|
+
"Facebook": "https://www.facebook.com/md.rahad.hosain18"
|
46
|
+
},
|
47
|
+
"data": {
|
48
|
+
"msg": "success",
|
49
|
+
"duration_ms": null,
|
50
|
+
"title": "- কোনো একদিন আমাদের এভাবেই দেখা হয়ে যাবে..!🙂💔🥀",
|
51
|
+
"sd": "https://video.fbom44-1.fna.fbcdn.net/v/t42.1790-2/431379425_954861172931651_4682667443053324355_n.mp4?_nc_cat=106&ccb=1-7&_nc_sid=55d0d3&efg=eyJybHIiOjMwMCwicmxhIjo1MTIsInZlbmNvZGVfdGFnIjoic3ZlX3NkIiwidmlkZW9faWQiOjEwNTgzNTk1ODUzMzI0MjN9&_nc_ohc=xRFwXjptbtIAb6TzePA&rl=300&vabr=154&_nc_ht=video.fbom44-1.fna&oh=00_AfCf6cQ_d3JGn1sXUYJukIz7XbUbZ0xJl5ZVUI3bZRDspQ&oe=6627F022",
|
52
|
+
"hd": "https://video.fbom44-1.fna.fbcdn.net/o1/v/t2/f1/m69/GDxajRnFzdpNUeUAAKl31mS_l0lsbmdjAAAF.mp4?efg=eyJ2ZW5jb2RlX3RhZyI6Im9lcF9oZCJ9&_nc_ht=video.fbom44-1.fna.fbcdn.net&_nc_cat=103&strext=1&vs=5d543cf58e02b009&_nc_vs=HBksFQIYOnBhc3N0aHJvdWdoX2V2ZXJzdG9yZS9HRHhhalJuRnpkcE5VZVVBQUtsMzFtU19sMGxzYm1kakFBQUYVAALIAQAVAhg6cGFzc3Rocm91Z2hfZXZlcnN0b3JlL0dMajF0UmxQS2U1cU9CWU5BSHNxV1I1RHZvWUtidjRHQUFBRhUCAsgBAEsHiBJwcm9ncmVzc2l2ZV9yZWNpcGUBMQ1zdWJzYW1wbGVfZnBzABB2bWFmX2VuYWJsZV9uc3ViACBtZWFzdXJlX29yaWdpbmFsX3Jlc29sdXRpb25fc3NpbQAoY29tcHV0ZV9zc2ltX29ubHlfYXRfb3JpZ2luYWxfcmVzb2x1dGlvbgAddXNlX2xhbmN6b3NfZm9yX3ZxbV91cHNjYWxpbmcAEWRpc2FibGVfcG9zdF9wdnFzABUAJQAcjBdAAAAAAAAAABERAAAAJszG1NSpnOQCFQIoAkMzGAt2dHNfcHJldmlldxwXQFa90vGp%2B%2BcYIWRhc2hfZ2VuMmh3YmFzaWNfaHEyX2ZyYWdfMl92aWRlbxIAGBh2aWRlb3MudnRzLmNhbGxiYWNrLnByb2Q4ElZJREVPX1ZJRVdfUkVRVUVTVBsKiBVvZW1fdGFyZ2V0X2VuY29kZV90YWcGb2VwX2hkE29lbV9yZXF1ZXN0X3RpbWVfbXMBMAxvZW1fY2ZnX3J1bGUHdW5tdXRlZBNvZW1fcm9pX3JlYWNoX2NvdW50BjYzNTI5MRFvZW1faXNfZXhwZXJpbWVudAAMb2VtX3ZpZGVvX2lkEDEwNTgzNTk1ODUzMzI0MjMSb2VtX3ZpZGVvX2Fzc2V0X2lkDzMwOTkzMDY4NTA2NDE0NBVvZW1fdmlkZW9fcmVzb3VyY2VfaWQPNzgzMzM4OTA3MDEzNTQyHG9lbV9zb3VyY2VfdmlkZW9fZW5jb2RpbmdfaWQPOTU2NzU5MTAyNDY0MTEzDnZ0c19yZXF1ZXN0X2lkACUCHAAlvgEbB4gBcwQyMzc2AmNkCjIwMjQtMDMtMDUDcmNiBjYzNTIwMANhcHAURmFjZWJvb2sgZm9yIEFuZHJvaWQCY3QZQ09OVEFJTkVEX1BPU1RfQVRUQUNITUVOVBNvcmlnaW5hbF9kdXJhdGlvbl9zCTkwLjkyOTUwMQJ0cxVwcm9ncmVzc2l2ZV9lbmNvZGluZ3MA&ccb=9-4&oh=00_AfDtoun1NoOkFRJ_qdmNo0gSV7NCiQxzaWzjdEtvuQC0oQ&oe=6624219C&_nc_sid=1d576d&_nc_rid=009437937591417&_nc_store_type=1",
|
53
|
+
"thumbnail": "https://scontent.fbom44-1.fna.fbcdn.net/v/t15.5256-10/429254941_757978266008112_4390185325421785526_n.jpg?stp=dst-jpg_p960x960&_nc_cat=104&ccb=1-7&_nc_sid=5f2048&_nc_ohc=hFQ17MX-CXoAb7ThTIf&_nc_ht=scontent.fbom44-1.fna&oh=00_AfDjlCnQ_vcUslCKoefXW4FSDIY26mTwpcG-XLdHu13iFQ&oe=662804B4"
|
54
|
+
}
|
55
|
+
}
|
60
56
|
```
|
61
57
|
## Example (TikTok)
|
62
58
|
```js
|
@@ -218,6 +214,95 @@ main();
|
|
218
214
|
}
|
219
215
|
}
|
220
216
|
```
|
217
|
+
## Example (YouTube)
|
218
|
+
```js
|
219
|
+
const insta = require('rahad-media-downloader');
|
220
|
+
|
221
|
+
const yturl = 'https://youtu.be/keikiWq-a7Q?si=g3KdH-e9tiE_JK7Z';
|
222
|
+
|
223
|
+
async function main() {
|
224
|
+
try {
|
225
|
+
const result = await insta.rahadytdl(yturl);
|
226
|
+
console.log(result);
|
227
|
+
} catch (error) {
|
228
|
+
console.error('Error:', error.message);
|
229
|
+
}
|
230
|
+
}
|
231
|
+
|
232
|
+
main();
|
233
|
+
|
234
|
+
```
|
235
|
+
## Output Example (YouTube)
|
236
|
+
```
|
237
|
+
{
|
238
|
+
"metadata": {
|
239
|
+
"Author": "Mohammad Rahad",
|
240
|
+
"message": "any problem please contact me",
|
241
|
+
"Facebook": "https://www.facebook.com/md.rahad.hosain18"
|
242
|
+
},
|
243
|
+
"info": {
|
244
|
+
"status": "success",
|
245
|
+
"processingTime": "2.42s",
|
246
|
+
"title": "তুই হইলা সোনার পিঞ্জর ময়না {slowed+reverb} Tui Hoila Sonar Pinjar Mayana TikTok Viral Lofi Song 2024",
|
247
|
+
"duration": "0:6:6",
|
248
|
+
"thumbnailUrl": "https://i.ytimg.com/vi/keikiWq-a7Q/hqdefault.jpg?sqp=-oaymwEbCKgBEF5IVfKriqkDDggBFQAAiEIYAXABwAEG&rs=AOn4CLDXgnebD2rQzcAZ_cFqDrXa5tOy8A",
|
249
|
+
"uploadTime": "2024-03-28T02:00:36-07:00",
|
250
|
+
"channelName": "Lofi Editor Sayem",
|
251
|
+
"channelAvatar": "https://yt3.ggpht.com/Tg4r7bCp1lRcce3WEe0zQvaMRt7v1OLDGVJW8oVtJqZ2idmH8tsL-BpGv-4Ux9pi3VC49NwL=s48-c-k-c0x00ffffff-no-rj",
|
252
|
+
"channelCover": "Channel cover URL not available",
|
253
|
+
"viewCount": "1055493",
|
254
|
+
"likes": null,
|
255
|
+
"dislikes": null,
|
256
|
+
"keywords": [
|
257
|
+
"তুই হইলা সোনার পিঞ্জর ময়না slowed reverb",
|
258
|
+
"Tui Hoila Sonar Pinjar Mayana TikTok Viral Lofi Song 2024",
|
259
|
+
"sad Lofi Song",
|
260
|
+
"TikTok Viral Lofi Song",
|
261
|
+
"ma bapere lagai dibo mabapere lagai dibo Lofi Song",
|
262
|
+
"ma bapere lagai dibo Slowed Reverb",
|
263
|
+
"bain_duar_lofi",
|
264
|
+
"maa_bapere_lagai_dibo_lofi",
|
265
|
+
"tanding Song",
|
266
|
+
"টিকটক ভাইরাল গান",
|
267
|
+
"তুই হইলা সুনার",
|
268
|
+
"তুই হইলা সোনার পিঞ্জর ময়না Song"
|
269
|
+
],
|
270
|
+
"audioLink": "https://rr1---sn-cvh76nes.googlevideo.com/videoplayback?expire=1713539008&ei=YDMiZpigA5210-kP8P2y-Aw&ip=34.100.233.67&id=o-AMkL6kwiYVSNi0ME4DIBU1oVELLf_9DTZeeQE4edzCvq&itag=251&source=youtube&requiressl=yes&xpc=EgVo2aDSNQ%3D%3D&mh=jn&mm=31%2C29&mn=sn-cvh76nes%2Csn-cvh7knzk&ms=au%2Crdu&mv=u&mvi=1&pl=20&bui=AaUN6a0iq_zSuaDry-Fui2lH96g0ZMNcBnh5tovKOm04PB204vp161wNiepelq_8pnu6mm40rSVuM4kp&spc=UWF9f14wRIf-jcTrWzO-GLwEyc_SXWvvRifoIdqXhq0n4FnTAgwt2_N1-i-F&vprv=1&svpuc=1&mime=audio%2Fwebm&ns=bvkbP_tzkTxaY68STnE-MAYQ&gir=yes&clen=6047564&dur=365.301&lmt=1711925864592645&mt=1713516535&fvip=3&keepalive=yes&c=WEB&sefc=1&txp=5532434&n=KKMZ-edNUqEFRA&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cxpc%2Cbui%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Cns%2Cgir%2Cclen%2Cdur%2Clmt&sig=AJfQdSswRgIhALDRXJfTbREQAnJIi-4zy83Fu4qZHVwJoYTKie8i5kuLAiEAlRmYXflaGTwru-nNPGzbuC3o59s-CtYRxqAtvD8VdP8%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl&lsig=ALClDIEwRAIgarfmRa5QPBwD3mha-X0Kn1f3iO_kLXm5V_5cvEmdexwCIFksUWr2nrKDe42vpzOzGgkHxEumd1ZTcu5NwwIWedvj",
|
271
|
+
"videoLinks": {
|
272
|
+
"medium": "https://rr1---sn-cvh76nes.googlevideo.com/videoplayback?expire=1713539008&ei=YDMiZpigA5210-kP8P2y-Aw&ip=34.100.233.67&id=o-AMkL6kwiYVSNi0ME4DIBU1oVELLf_9DTZeeQE4edzCvq&itag=18&source=youtube&requiressl=yes&xpc=EgVo2aDSNQ%3D%3D&mh=jn&mm=31%2C29&mn=sn-cvh76nes%2Csn-cvh7knzk&ms=au%2Crdu&mv=u&mvi=1&pl=20&bui=AaUN6a2mzQzzj99HXjy3MvM3cvBClGeORjNFeQmFALnxHwclQQM6WculRDECZJGBf2WncNHAUxu0Wowc&spc=UWF9f14wRIf-jcTrWzO-GLwEyc_SXWvvRifoIdqXhq0n4FnTAgwt2_N1-i-F&vprv=1&svpuc=1&mime=video%2Fmp4&ns=qucPmBF3dgIXU00aJAj9YogQ&gir=yes&clen=29079037&ratebypass=yes&dur=365.342&lmt=1711928830254128&mt=1713516535&fvip=3&c=WEB&sefc=1&txp=5538434&n=_iGDCbs0DcAjEg&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cxpc%2Cbui%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Cns%2Cgir%2Cclen%2Cratebypass%2Cdur%2Clmt&sig=AJfQdSswRQIgSLDqEM80AbzNJCTxDsHw9iwcwSn1rtPMxFVKV9kfUOACIQDlATgbzbULeytkWEJXbdFVxp2iYIIoSZo52ckLOjpkkA%3D%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl&lsig=ALClDIEwRAIgarfmRa5QPBwD3mha-X0Kn1f3iO_kLXm5V_5cvEmdexwCIFksUWr2nrKDe42vpzOzGgkHxEumd1ZTcu5NwwIWedvj"
|
273
|
+
}
|
274
|
+
}
|
275
|
+
}
|
276
|
+
```
|
277
|
+
## Example (GDriveLink )
|
278
|
+
```js
|
279
|
+
const insta = require('rahad-media-downloader');
|
280
|
+
|
281
|
+
const drivelink = 'https://drive.google.com/file/d/1CUZIlfk1owwUElY55d6DVsdAHjfYvz4F/view?usp=drivesdk';
|
282
|
+
|
283
|
+
async function main() {
|
284
|
+
try {
|
285
|
+
const result = await insta.gdriveLink (drivelink);
|
286
|
+
console.log(result);
|
287
|
+
} catch (error) {
|
288
|
+
console.error('Error:', error.message);
|
289
|
+
}
|
290
|
+
}
|
291
|
+
|
292
|
+
main();
|
293
|
+
|
294
|
+
```
|
295
|
+
## Output Example (drivelink)
|
296
|
+
```
|
297
|
+
{
|
298
|
+
"metadata": {
|
299
|
+
"Author": "Mohammad Rahad",
|
300
|
+
"message": "any problem please contact me",
|
301
|
+
"Facebook": "https://www.facebook.com/md.rahad.hosain18"
|
302
|
+
},
|
303
|
+
"data": "https://drive.usercontent.google.com/download?id=1CUZIlfk1owwUElY55d6DVsdAHjfYvz4F&export=download"
|
304
|
+
}
|
305
|
+
```
|
221
306
|
# Installation
|
222
307
|
|
223
308
|
## You can install `rahad-media-downloader` using npm:
|