This repository has been archived by the owner on Sep 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
/
index.d.ts
66 lines (62 loc) · 1.67 KB
/
index.d.ts
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
import { HttpsProxyAgent } from 'https-proxy-agent';
declare module "yt-comment-scraper" {
interface Image {
url: string
width: number
height: number
}
interface Comment {
commentId: string
authorId: string
author: string
authorThumb: Image[]
edited: boolean
text: string
likes: string
time: string
numReplies: number
isOwner: boolean
isHearted: boolean
isPinned: boolean
hasOwnerReplied: boolean
isMember: boolean
memberIconUrl: string | null
customEmojis: {
text: string
emojiThumbnails: Image[]
}[]
replyToken: string | null
}
interface CommentReply extends Comment {
hasOwnerReplied: false
isPinned: false
replyToken: null
}
interface CommentPayload {
videoId: string
sortByNewest?: boolean
continuation?: string
mustSetCookie?: boolean
httpsAgent?: HttpsProxyAgent
}
interface CommentRepliesPayload {
videoId: string
replyToken: string
mustSetCookie?: boolean
httpsAgent?: HttpsProxyAgent
}
interface CommentResponse {
total: number | null
comments: Comment[]
continuation: string | null
}
interface CommentReplyResponse {
comments: CommentReply[]
continuation: string | null
}
class CommentScraper {
static getComments(payload: CommentPayload): Promise<CommentResponse>
static getCommentReplies(payload: CommentRepliesPayload): Promise<CommentReplyResponse>
}
export = CommentScraper
}