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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
|
package com.pinapelz;
import com.pinapelz.datatypes.*;
import okhttp3.RequestBody;
import retrofit2.Call;
import retrofit2.http.*;
import java.util.List;
/**
* The interface Holodex service.
*/
public interface HolodexService {
/**
* /api/v2/live endpoint
*
* @param channel_id the YouTube channel id
* @param id the YouTube video id
* @param include the include parameters
* @param lang a comma separated String of languages (e.g "en,ja")
* @param limit the limit for the number of results
* @param maxUpcomingHours number of maximum hours to show upcoming videos
* @param mentioned_channel_id the mentioned channel id of a different channel (for collabs)
* @param offset the offset for the number of results
* @param order the order (asc, desc)
* @param org the organization of which to get videos for (e.g. "Hololive")
* @param paginated paginated field
* @param sort sort by returned field (e.g "start_scheduled")
* @param status filter by video status (e.g. "upcoming")
* @param topic filter by type of video (e.g "stream")
* @param type the type
* @return a list of SimpleVideo objects
*/
@GET("/api/v2/live")
Call<List<SimpleVideo>> getLiveVideos(
@Query("channel_id") String channel_id,
@Query("id") String id,
@Query("include") String include,
@Query("lang") String lang,
@Query("limit") Integer limit,
@Query("maxUpcomingHours") Integer maxUpcomingHours,
@Query("mentioned_channel_id") String mentioned_channel_id,
@Query("offset") Integer offset,
@Query("order") String order,
@Query("org") String org,
@Query("paginated") String paginated,
@Query("sort") String sort,
@Query("status") String status,
@Query("topic") String topic,
@Query("type") String type
);
/**
* /api/v2/video endpoint
*
* @param channel_id the YouTube channel id
* @param id the YouTube video id
* @param include the include parameters comma seperated
* @param lang a comma separated String of languages (e.g "en,ja")
* @param limit the limit for the number of results
* @param max_upcoming_hours number of maximum hours to show upcoming videos
* @param mentioned_channel_id the mentioned channel id of a different channel (for collabs)
* @param offset the offset for the number of results
* @param order the order (asc, desc)
* @param org the organization of which to get videos for (e.g. "Hololive")
* @param paginated paginated field
* @param sort sort by returned field (e.g "start_scheduled")
* @param status filter by video status (e.g. "upcoming")
* @param topic filter by type of video (e.g "stream")
* @param type the type
* @return a list of Video objects
*/
@GET("/api/v2/videos")
Call<List<Video>> getVideos(
@Query("channel_id") String channel_id,
@Query("id") String id,
@Query("include") String include,
@Query("lang") String lang,
@Query("limit") Integer limit,
@Query("max_upcoming_hours") Integer max_upcoming_hours,
@Query("mentioned_channel_id") String mentioned_channel_id,
@Query("offset") Integer offset,
@Query("order") String order,
@Query("org") String org,
@Query("paginated") String paginated,
@Query("sort") String sort,
@Query("status") String status,
@Query("topic") String topic,
@Query("type") String type
);
/**
* /api/v2/channels endpoint
*
* @param channelID the channel id
* @return the channel
*/
@GET("/api/v2/channels/{channelID}")
Call<Channel> getChannel(
@Path("channelID") String channelID
);
/**
* /api/v2/channels/{channelID}/{type} endpoint
*
* @param channelID the YouTube channel id
* @param type the type of video resource ("clips", "videos", "collabs")
* @param include the include parameters comma seperated
* @param lang a comma separated String of languages (e.g "en,ja")
* @param limit the limit for the number of results
* @param offset the offset for the number of results
* @param paginated paginated field
* @return list of Videos by channel id
*/
@GET("/api/v2/channels/{channelID}/{type}")
Call<List<Video>> getVideosByChannelId(
@Path("channelID") String channelID,
@Path("type") String type,
@Query("include") String include,
@Query("lang") String lang,
@Query("limit") Integer limit,
@Query("offset") Integer offset,
@Query("paginated") String paginated
);
/**
* /api/v2/users/live endpoint
*
* @param channels the channel ids in a comma separated String
* @return the videos from channels
*/
@GET("/api/v2/users/live")
Call<List<Video>> getVideosFromChannels(
@Query("channels") String channels
);
/**
* /api/v2/videos/{videoID} endpoint
*
* @param videoID the YouTube video id
* @param lang a comma separated String of languages (e.g "en,ja")
* @param c 1 will return timestamp comments for the video, 0 will not
* @return the video
*/
@GET("/api/v2/videos/{videoID}")
Call<Video> getVideo(
@Path("videoID") String videoID,
@Query("lang") String lang,
@Query("c") String c
);
/**
* /api/v2/channels endpoint
*
* @param limit the limit for the number of results
* @param offset the offset for the number of results
* @param type the type of channel (e.g "vtuber")
* @param lang a comma separated String of languages (e.g "en,ja")
* @param order ascending or descending order (e.g "asc")
* @param org filter by organization (e.g "Hololive")
* @param sort column in which data should be sorted (default is org)
* @return the channels
*/
@GET("/api/v2/channels")
Call<List<Channel>> getChannels(
@Query("limit") Integer limit,
@Query("offset") Integer offset,
@Query("type") String type,
@Query("lang") String lang,
@Query("order") String order,
@Query("org") String org,
@Query("sort") String sort
);
/**
* /api/v2/search/videoSearch endpoint
* @param videoSearchResult
* @return
*/
@POST("/api/v2/search/videoSearch")
@Paginated(false)
Call<List<SimpleVideo>> postVideoSearch(
@Body RequestBody videoSearchResult
);
@POST("/api/v2/search/videoSearch")
@Paginated(true)
Call<VideoSearchResult> postPaginatedVideoSearch(
@Body RequestBody videoSearchResult
);
/**
* /api/v2/search/channelSearch endpoint
* @param commentSearchResult
* @return
*/
@POST("/api/v2/search/commentSearch")
@Paginated(false)
Call<List<SimpleCommentVideo>> postCommentSearch(
@Body RequestBody commentSearchResult
);
@POST("/api/v2/search/commentSearch")
@Paginated(true)
Call<CommentSearchResult> postPaginatedCommentSearch(
@Body RequestBody commentSearchResult
);
}
|