abot-scraper 1.1.2 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.MD +215 -70
- package/dist/index.cjs +575 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +123 -0
- package/dist/index.d.ts +123 -0
- package/dist/index.js +535 -0
- package/dist/index.js.map +1 -0
- package/license +21 -0
- package/package.json +66 -24
- package/types/index.d.ts +172 -0
- package/src/index.js +0 -7
- package/src/scraper/downloader.js +0 -215
- package/src/scraper/search.js +0 -144
- package/testing.js +0 -90
package/dist/index.d.cts
ADDED
@@ -0,0 +1,123 @@
|
|
1
|
+
interface ApiResponse<T = any> {
|
2
|
+
creator: string;
|
3
|
+
status: number | boolean;
|
4
|
+
result?: T;
|
5
|
+
msg?: string;
|
6
|
+
}
|
7
|
+
|
8
|
+
interface FacebookResult {
|
9
|
+
thumbnail: string;
|
10
|
+
videoUrl: string;
|
11
|
+
}
|
12
|
+
|
13
|
+
interface TikTokResult {
|
14
|
+
title: string;
|
15
|
+
video: string;
|
16
|
+
audio: string;
|
17
|
+
}
|
18
|
+
|
19
|
+
interface InstagramUserInfo {
|
20
|
+
username: string;
|
21
|
+
[key: string]: any;
|
22
|
+
}
|
23
|
+
|
24
|
+
interface InstagramStoriesResult {
|
25
|
+
user_info: InstagramUserInfo;
|
26
|
+
links: string[];
|
27
|
+
}
|
28
|
+
|
29
|
+
interface InstagramMediaItem {
|
30
|
+
type: "video" | "image";
|
31
|
+
url: string;
|
32
|
+
}
|
33
|
+
|
34
|
+
interface SfileSearchResult {
|
35
|
+
title: string;
|
36
|
+
size: string;
|
37
|
+
link: string;
|
38
|
+
}
|
39
|
+
|
40
|
+
interface YtPlayResult {
|
41
|
+
status: string;
|
42
|
+
title: string;
|
43
|
+
ftype: string;
|
44
|
+
thumb: string;
|
45
|
+
size_mp3: string;
|
46
|
+
link: string;
|
47
|
+
}
|
48
|
+
|
49
|
+
interface WallpaperResult {
|
50
|
+
title: string;
|
51
|
+
type: string;
|
52
|
+
source: string;
|
53
|
+
image: string[];
|
54
|
+
}
|
55
|
+
|
56
|
+
interface WikimediaResult {
|
57
|
+
title: string;
|
58
|
+
source: string;
|
59
|
+
image: string;
|
60
|
+
}
|
61
|
+
|
62
|
+
interface YtSearchResult {
|
63
|
+
title: string;
|
64
|
+
thumbnail: string;
|
65
|
+
url: string;
|
66
|
+
}
|
67
|
+
|
68
|
+
interface YoutubeResult {
|
69
|
+
title: string;
|
70
|
+
thumbnail: string;
|
71
|
+
downloadLinks: Record<string, string>;
|
72
|
+
mp3DownloadUrl: string;
|
73
|
+
}
|
74
|
+
|
75
|
+
interface YoutubeResultV2 {
|
76
|
+
title: string;
|
77
|
+
thumbnail: string | null;
|
78
|
+
downloadLinks: Record<string, string>;
|
79
|
+
video: string | null;
|
80
|
+
audio: string | null;
|
81
|
+
formats: any[];
|
82
|
+
}
|
83
|
+
|
84
|
+
interface SfileDownloadResult {
|
85
|
+
filename: string;
|
86
|
+
mimetype: string;
|
87
|
+
download: string;
|
88
|
+
}
|
89
|
+
|
90
|
+
declare global {
|
91
|
+
var creator: string;
|
92
|
+
}
|
93
|
+
declare class Downloader {
|
94
|
+
private generator;
|
95
|
+
constructor();
|
96
|
+
facebook(url: string): Promise<ApiResponse<FacebookResult>>;
|
97
|
+
tiktokDownloader(url: string): Promise<ApiResponse<TikTokResult>>;
|
98
|
+
igstory(username: string): Promise<ApiResponse<InstagramStoriesResult>>;
|
99
|
+
instagram(url: string): Promise<ApiResponse<InstagramMediaItem[]>>;
|
100
|
+
youtubeDownloader(url: string): Promise<ApiResponse<YoutubeResult>>;
|
101
|
+
youtubeDownloaderV2(url: string): Promise<ApiResponse<YoutubeResultV2>>;
|
102
|
+
sfileDownloader(url: string): Promise<ApiResponse<SfileDownloadResult>>;
|
103
|
+
}
|
104
|
+
|
105
|
+
declare global {
|
106
|
+
var creator: string;
|
107
|
+
}
|
108
|
+
declare class Search {
|
109
|
+
sfileSearch(query: string, page?: number): Promise<ApiResponse<SfileSearchResult[]>>;
|
110
|
+
ytSearch(query: string): Promise<ApiResponse<YtSearchResult[]>>;
|
111
|
+
ytPlay: (text: string) => Promise<ApiResponse<YtPlayResult>>;
|
112
|
+
wallpaper: (title: string, page?: string) => Promise<ApiResponse<WallpaperResult[]>>;
|
113
|
+
wikimedia: (title: string) => Promise<ApiResponse<WikimediaResult[]>>;
|
114
|
+
}
|
115
|
+
|
116
|
+
declare const downloader: Downloader;
|
117
|
+
declare const search: Search;
|
118
|
+
declare const _default: {
|
119
|
+
downloader: Downloader;
|
120
|
+
search: Search;
|
121
|
+
};
|
122
|
+
|
123
|
+
export { Downloader, Search, _default as default, downloader, search };
|
package/dist/index.d.ts
ADDED
@@ -0,0 +1,123 @@
|
|
1
|
+
interface ApiResponse<T = any> {
|
2
|
+
creator: string;
|
3
|
+
status: number | boolean;
|
4
|
+
result?: T;
|
5
|
+
msg?: string;
|
6
|
+
}
|
7
|
+
|
8
|
+
interface FacebookResult {
|
9
|
+
thumbnail: string;
|
10
|
+
videoUrl: string;
|
11
|
+
}
|
12
|
+
|
13
|
+
interface TikTokResult {
|
14
|
+
title: string;
|
15
|
+
video: string;
|
16
|
+
audio: string;
|
17
|
+
}
|
18
|
+
|
19
|
+
interface InstagramUserInfo {
|
20
|
+
username: string;
|
21
|
+
[key: string]: any;
|
22
|
+
}
|
23
|
+
|
24
|
+
interface InstagramStoriesResult {
|
25
|
+
user_info: InstagramUserInfo;
|
26
|
+
links: string[];
|
27
|
+
}
|
28
|
+
|
29
|
+
interface InstagramMediaItem {
|
30
|
+
type: "video" | "image";
|
31
|
+
url: string;
|
32
|
+
}
|
33
|
+
|
34
|
+
interface SfileSearchResult {
|
35
|
+
title: string;
|
36
|
+
size: string;
|
37
|
+
link: string;
|
38
|
+
}
|
39
|
+
|
40
|
+
interface YtPlayResult {
|
41
|
+
status: string;
|
42
|
+
title: string;
|
43
|
+
ftype: string;
|
44
|
+
thumb: string;
|
45
|
+
size_mp3: string;
|
46
|
+
link: string;
|
47
|
+
}
|
48
|
+
|
49
|
+
interface WallpaperResult {
|
50
|
+
title: string;
|
51
|
+
type: string;
|
52
|
+
source: string;
|
53
|
+
image: string[];
|
54
|
+
}
|
55
|
+
|
56
|
+
interface WikimediaResult {
|
57
|
+
title: string;
|
58
|
+
source: string;
|
59
|
+
image: string;
|
60
|
+
}
|
61
|
+
|
62
|
+
interface YtSearchResult {
|
63
|
+
title: string;
|
64
|
+
thumbnail: string;
|
65
|
+
url: string;
|
66
|
+
}
|
67
|
+
|
68
|
+
interface YoutubeResult {
|
69
|
+
title: string;
|
70
|
+
thumbnail: string;
|
71
|
+
downloadLinks: Record<string, string>;
|
72
|
+
mp3DownloadUrl: string;
|
73
|
+
}
|
74
|
+
|
75
|
+
interface YoutubeResultV2 {
|
76
|
+
title: string;
|
77
|
+
thumbnail: string | null;
|
78
|
+
downloadLinks: Record<string, string>;
|
79
|
+
video: string | null;
|
80
|
+
audio: string | null;
|
81
|
+
formats: any[];
|
82
|
+
}
|
83
|
+
|
84
|
+
interface SfileDownloadResult {
|
85
|
+
filename: string;
|
86
|
+
mimetype: string;
|
87
|
+
download: string;
|
88
|
+
}
|
89
|
+
|
90
|
+
declare global {
|
91
|
+
var creator: string;
|
92
|
+
}
|
93
|
+
declare class Downloader {
|
94
|
+
private generator;
|
95
|
+
constructor();
|
96
|
+
facebook(url: string): Promise<ApiResponse<FacebookResult>>;
|
97
|
+
tiktokDownloader(url: string): Promise<ApiResponse<TikTokResult>>;
|
98
|
+
igstory(username: string): Promise<ApiResponse<InstagramStoriesResult>>;
|
99
|
+
instagram(url: string): Promise<ApiResponse<InstagramMediaItem[]>>;
|
100
|
+
youtubeDownloader(url: string): Promise<ApiResponse<YoutubeResult>>;
|
101
|
+
youtubeDownloaderV2(url: string): Promise<ApiResponse<YoutubeResultV2>>;
|
102
|
+
sfileDownloader(url: string): Promise<ApiResponse<SfileDownloadResult>>;
|
103
|
+
}
|
104
|
+
|
105
|
+
declare global {
|
106
|
+
var creator: string;
|
107
|
+
}
|
108
|
+
declare class Search {
|
109
|
+
sfileSearch(query: string, page?: number): Promise<ApiResponse<SfileSearchResult[]>>;
|
110
|
+
ytSearch(query: string): Promise<ApiResponse<YtSearchResult[]>>;
|
111
|
+
ytPlay: (text: string) => Promise<ApiResponse<YtPlayResult>>;
|
112
|
+
wallpaper: (title: string, page?: string) => Promise<ApiResponse<WallpaperResult[]>>;
|
113
|
+
wikimedia: (title: string) => Promise<ApiResponse<WikimediaResult[]>>;
|
114
|
+
}
|
115
|
+
|
116
|
+
declare const downloader: Downloader;
|
117
|
+
declare const search: Search;
|
118
|
+
declare const _default: {
|
119
|
+
downloader: Downloader;
|
120
|
+
search: Search;
|
121
|
+
};
|
122
|
+
|
123
|
+
export { Downloader, Search, _default as default, downloader, search };
|