forked from popcorn-official/popcorn-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
apiary.apib
481 lines (351 loc) · 18.6 KB
/
apiary.apib
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
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
FORMAT: 1A
HOST: https://tv-v2.api-fetch.website/
// TODO: make sure the documentation is correct.
# Popcorn API
Popcorn API is developed to make it easier for anyone to create their own version of [Popcorn Time](https://popcorntime.sh/).
# Data Structures
## Status
repo: (string, required)
server: (string, required)
status: (string, required)
totalAnimes: (number, required)
totalMovies: (number, required)
totalShows: (number, required)
updated: (number, required)
uptime: (number, required)
version: (string, required)
commit: (string, required)
## Movie
_id: (string, required)
imdb_id: (string, required)
title: (string, required)
year: (number, required)
slug: (string, optional)
synopsis: (string, required)
runtime: (number, required)
released: (number, required)
trailer: (string, required)
certification: (string, required)
torrents: (MovieLanguages, required)
genres: (array[string], required)
images: (Images, required)
rating: (Rating, required)
type: (string, required)
language: (string, optional)
## MovieLanguages
en: (MovieTorrents, optional)
es: (MovieTorrents, optional)
fr: (MovieTorrents, optional)
de: (MovieTorrents, optional)
nl: (MovieTorrents, optional)
## MovieTorrents
720p: (Torrent, optional)
1080p: (Torrent, optional)
## Show
_id: (string, required)
imdb_id: (string, required)
title: (string, required)
year: (number, required)
slug: (string, required)
synopsis: (string, optional)
runtime: (number, optional)
rating: (Rating, required)
images: (Images, required)
genres: (array[string], required)
type: (string, required)
tvdb_id: (string, required)
country: (string, optional)
network: (string, optional)
air_day: (string, optional)
air_time: (string, optional)
status: (string, optional)
num_seasons: (number, required)
last_updated: (number, optional)
latest_episode: (number, optional)
episodes: (array[Episode], optional)
## Rating
percentage: (number, required)
watching: (number, required)
votes: (number, required)
## Images
poster: (string, required)
fanart: (string, required)
banner: (string, required)
## Episode
tvdb_id: (number, required)
season: (number, required)
episode: (number, required)
title: (string, required)
overview: (string, required)
date_based: (boolean, required)
first_aired: (number, required)
torrents: (ShowTorrents, required)
## ShowTorrents
0: (Torrent, required)
480p: (Torrent, optional)
720p: (Torrent, optional)
1080p: (Torrent, optional)
## Torrent
provider: (string, required)
filesize: (string, optional)
size: (number, optional)
peers: (number, required)
seeds: (number, required)
url: (string, required)
# Group Status
## Status [/status]
### Get Status [GET]
Gives some basic information about the server on which the API is running on.
+ Response 200 (application/json; charset=utf-8)
+ Body
{
"repo": "https://github.com/popcorn-official/popcorn-api.git",
"server": "serv01",
"status": "Idle",
"totalAnimes": 623,
"totalMovies": 5581,
"totalShows": 1479,
"updated": 1470262496,
"uptime": 50529,
"version": "2.1.0",
"commit": "d8e360f"
}
+ Attributes (Status)
# Group Logs
## Error Logs [/logs/error]
### Get Error Logs [GET]
Display the error log. Each message will be in JSON format.
+ Response 200 (text/plain; charset=UTF-8)
+ Response 500 (application/json; charset=utf-8)
+ Body
{
"error": "Error: could not find file: './tmp/popcorn-api.log'"
}
+ Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"error": {
"type": "string"
}
}
}
# Group Export
## Export [/exports/{collection}]
### Export Collection [GET]
Download the contents a collection in a JSON file.
+ Parameters
+ collection (string, `anime`) - The name of the collection you want to download.
+ Values
+ `anime`
+ `movie`
+ `show`
+ Response 500 (application/json; charset=utf-8)
+ Body
{
"error": "Error: no such file found for './tmp/animes.json'"
}
{
"error": "Error: invalid is not a valid collection to export.'"
}
+ Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"error": {
"type": "string"
}
}
}
+ Response 200 (application/json)
# Group Anime
## Get Pages [/animes]
### Pages [GET]
Gives an array of the available pages for anime content.
+ Response 200 (application/json; charset=utf-8)
+ Body
["animes/1","animes/2","animes/3","animes/4","animes/5","animes/6","animes/7","animes/8","animes/9","animes/10"]
+ Attributes (array[string])
+ Response 204 (charset=utf-8)
## Get Page [/animes/{page}{?sort,order,genre,keywords}]
### Page [GET]
Gives an array of anime shows. The array has a has a maximum length of 50 anime shows per page.
+ Parameters
+ page (number, `1`) - The page of the content you want.
+ sort (string, `rating`) - Sort the list of content.
+ Values
+ `name`
+ `rating`
+ `released`
+ `trending`
+ `updated`
+ `year`
+ order (number, `-1`) - Order the list of content.
+ Values
+ `1`
+ `-1`
+ genre (string, `all`) - Filter on a genre.
+ keywords (string, `string`) - Search based on keywords.
+ Response 200 (application/json; charset=utf-8)
+ Body
[{"_id":"UniqueString1","imdb_id":"UniqueString1","title":"String","year":0,"slug":"String","synopsis":"String","runtime":0,"rating":{"percentage":0,"watching":0,"votes":0},"images":{"banner":"String","fanart":"String","poster":"String"},"genres":["String"],"type":"String","language":"String","released":0,"trailer":"String","certification":"String","torrents":{"en":{"1080p":{"provider":"String","filesize":"String","size":0,"peer":0,"seed":0,"url":"String"},"720p":{"provider":"String","filesize":"String","size":0,"peer":0,"seed":0,"url":"String"}}}},{"_id":"UniqueString2","imdb_id":"UniqueString2","title":"String","year":0,"slug":"String","synopsis":"String","runtime":0,"rating":{"percentage":0,"watching":0,"votes":0},"images":{"banner":"String","fanart":"String","poster":"String"},"genres":["String"],"type":"String","tvdb_id":"String","country":"String","network":"String","air_day":"String","air_time":"String","status":"String","num_seasons":1,"last_updated":0,"latest_episode":0,"episodes":[{"tvdb_id":0,"season":0,"episode":0,"title":"String","overview":"String","date_based":false,"first_aired":0,"torrents":{"0":{"provider":"String","peers":0,"seeds":0,"url":"String"},"480p":{"provider":"String","peers":0,"seeds":0,"url":"String"},"720p":{"provider":"String","peers":0,"seeds":0,"url":"String"},"1080p":{"provider":"String","peers":0,"seeds":0,"url":"String"}}}]}]
+ Attributes (array[Movie]) (array[Show])
+ Response 204 (charset=utf-8)
## Get Details [/anime/{imdb_id}]
### Details [GET]
Gives information about a single anime show based on the given id.
+ Parameters
+ imdb_id (string, `animeshow`) - The imdb id of the anime you want details on.
+ Response 200 (application/json; charset=utf-8)
+ Body
{"_id":"UniqueString1","imdb_id":"UniqueString1","title":"String","year":0,"slug":"String","synopsis":"String","runtime":0,"rating":{"percentage":0,"watching":0,"votes":0},"images":{"banner":"String","fanart":"String","poster":"String"},"genres":["String"],"type":"String","language":"String","released":0,"trailer":"String","certification":"String","torrents":{"en":{"1080p":{"provider":"String","filesize":"String","size":0,"peer":0,"seed":0,"url":"String"},"720p":{"provider":"String","filesize":"String","size":0,"peer":0,"seed":0,"url":"String"}}}}
{"_id":"UniqueString2","imdb_id":"UniqueString2","title":"String","year":0,"slug":"String","synopsis":"String","runtime":0,"rating":{"percentage":0,"watching":0,"votes":0},"images":{"banner":"String","fanart":"String","poster":"String"},"genres":["String"],"type":"String","tvdb_id":"String","country":"String","network":"String","air_day":"String","air_time":"String","status":"String","num_seasons":1,"last_updated":0,"latest_episode":0,"episodes":[{"tvdb_id":0,"season":0,"episode":0,"title":"String","overview":"String","date_based":false,"first_aired":0,"torrents":{"0":{"provider":"String","peers":0,"seeds":0,"url":"String"},"480p":{"provider":"String","peers":0,"seeds":0,"url":"String"},"720p":{"provider":"String","peers":0,"seeds":0,"url":"String"},"1080p":{"provider":"String","peers":0,"seeds":0,"url":"String"}}}]}
+ Attributes (Movie) (Show)
+ Response 204 (charset=utf-8)
## Get Random [/random/anime]
### Random [GET]
Gives a random anime from the database.
+ Response 200 (application/json; charset=utf-8)
+ Body
{"_id":"UniqueString1","imdb_id":"UniqueString1","title":"String","year":0,"slug":"String","synopsis":"String","runtime":0,"rating":{"percentage":0,"watching":0,"votes":0},"images":{"banner":"String","fanart":"String","poster":"String"},"genres":["String"],"type":"String","language":"String","released":0,"trailer":"String","certification":"String","torrents":{"en":{"1080p":{"provider":"String","filesize":"String","size":0,"peer":0,"seed":0,"url":"String"},"720p":{"provider":"String","filesize":"String","size":0,"peer":0,"seed":0,"url":"String"}}}}
{"_id":"UniqueString2","imdb_id":"UniqueString2","title":"String","year":0,"slug":"String","synopsis":"String","runtime":0,"rating":{"percentage":0,"watching":0,"votes":0},"images":{"banner":"String","fanart":"String","poster":"String"},"genres":["String"],"type":"String","tvdb_id":"String","country":"String","network":"String","air_day":"String","air_time":"String","status":"String","num_seasons":1,"last_updated":0,"latest_episode":0,"episodes":[{"tvdb_id":0,"season":0,"episode":0,"title":"String","overview":"String","date_based":false,"first_aired":0,"torrents":{"0":{"provider":"String","peers":0,"seeds":0,"url":"String"},"480p":{"provider":"String","peers":0,"seeds":0,"url":"String"},"720p":{"provider":"String","peers":0,"seeds":0,"url":"String"},"1080p":{"provider":"String","peers":0,"seeds":0,"url":"String"}}}]}
+ Attributes (Movie) (Show)
+ Response 204 (charset=utf-8)
# Group Movie
## Get Pages [/movies]
### Pages [GET]
Gives an array of the available pages for movie content.
+ Response 200 (application/json; charset=utf-8)
+ Body
["movies/1","movies/2","movies/3","movies/4","movies/5","movies/6","movies/7","movies/8","movies/9","movies/10"]
+ Attributes (array[string])
+ Response 204 (charset=utf-8)
## Get Page [/movies/{page}{?sort,order,genre,keywords}]
### Page [GET]
Gives an array of movies. The array has a has a maximum length of 50 movies per page.
+ Parameters
+ page (number, `1`) - The page of the content you want.
+ sort (string, `rating`) - Sort the list of content.
+ Values
+ `name`
+ `rating`
+ `released`
+ `trending`
+ `updated`
+ `year`
+ order (number, `-1`) - Order the list of content.
+ Values
+ `1`
+ `-1`
+ genre (string, `all`) - Filter on a genre.
+ keywords (string, `string`) - Search based on keywords.
+ Response 200 (application/json; charset=utf-8)
+ Body
[{"_id":"UniqueString1","imdb_id":"UniqueString1","title":"String","year":0,"slug":"String","synopsis":"String","runtime":0,"rating":{"percentage":0,"watching":0,"votes":0},"images":{"banner":"String","fanart":"String","poster":"String"},"genres":["String"],"type":"String","language":"String","released":0,"trailer":"String","certification":"String","torrents":{"en":{"1080p":{"provider":"String","filesize":"String","size":0,"peer":0,"seed":0,"url":"String"},"720p":{"provider":"String","filesize":"String","size":0,"peer":0,"seed":0,"url":"String"}}}}]
+ Attributes (array[Movie])
+ Response 204 (charset=utf-8)
## Get Details [/movie/{imdb_id}]
### Details [GET]
Gives information about a single movie based on the given imdb id.
+ Parameters
+ imdb_id (string, `movie`) - The imdb id of the movie you want details on.
+ Response 200 (application/json; charset=utf-8)
+ Body
{"_id":"UniqueString1","imdb_id":"UniqueString1","title":"String","year":0,"slug":"String","synopsis":"String","runtime":0,"rating":{"percentage":0,"watching":0,"votes":0},"images":{"banner":"String","fanart":"String","poster":"String"},"genres":["String"],"type":"String","language":"String","released":0,"trailer":"String","certification":"String","torrents":{"en":{"1080p":{"provider":"String","filesize":"String","size":0,"peer":0,"seed":0,"url":"String"},"720p":{"provider":"String","filesize":"String","size":0,"peer":0,"seed":0,"url":"String"}}}}
+ Attributes (Movie)
+ Response 204 (charset=utf-8)
## Get Random [/random/movie]
### Random [GET]
Gives a random movie from the database.
+ Response 200 (application/json; charset=utf-8)
+ Body
{"_id":"UniqueString1","imdb_id":"UniqueString1","title":"String","year":0,"slug":"String","synopsis":"String","runtime":0,"rating":{"percentage":0,"watching":0,"votes":0},"images":{"banner":"String","fanart":"String","poster":"String"},"genres":["String"],"type":"String","language":"String","released":0,"trailer":"String","certification":"String","torrents":{"en":{"1080p":{"provider":"String","filesize":"String","size":0,"peer":0,"seed":0,"url":"String"},"720p":{"provider":"String","filesize":"String","size":0,"peer":0,"seed":0,"url":"String"}}}}
+ Attributes (Movie)
+ Response 204 (charset=utf-8)
# Group Show
## Get Pages [/shows]
### Pages [GET]
Gives an array of the available pages for show content.
+ Response 200 (application/json; charset=utf-8)
+ Body
["shows/1","shows/2","shows/3","shows/4","shows/5","shows/6","shows/7","shows/8","shows/9","shows/10"]
+ Attributes (array[string])
+ Response 204 (charset=utf-8)
## Get Page [/shows/{page}{?sort,order,genre,keywords}]
### Page [GET]
Gives an array of shows. The array has a has a maximum length of 50 shows per page.
+ Parameters
+ page (number, `1`) - The page of the content you want.
+ sort (string, `rating`) - Sort the list of content.
+ Values
+ `name`
+ `rating`
+ `released`
+ `trending`
+ `updated`
+ `year`
+ order (number, `-1`) - Order the list of content.
+ Values
+ `1`
+ `-1`
+ genre (string, `all`) - Filter on a genre.
+ keywords (string, `string`) - Search based on keywords.
+ Response 200 (application/json; charset=utf-8)
+ Body
[{"_id":"UniqueString2","imdb_id":"UniqueString2","title":"String","year":0,"slug":"String","synopsis":"String","runtime":0,"rating":{"percentage":0,"watching":0,"votes":0},"images":{"banner":"String","fanart":"String","poster":"String"},"genres":["String"],"type":"String","tvdb_id":"String","country":"String","network":"String","air_day":"String","air_time":"String","status":"String","num_seasons":1,"last_updated":0,"latest_episode":0,"episodes":[{"tvdb_id":0,"season":0,"episode":0,"title":"String","overview":"String","date_based":false,"first_aired":0,"torrents":{"0":{"provider":"String","peers":0,"seeds":0,"url":"String"},"480p":{"provider":"String","peers":0,"seeds":0,"url":"String"},"720p":{"provider":"String","peers":0,"seeds":0,"url":"String"},"1080p":{"provider":"String","peers":0,"seeds":0,"url":"String"}}}]}]
+ Attributes (array[Show])
+ Response 204 (charset=utf-8)
## Get Details [/show/{imdb_id}]
### Details [GET]
Gives information about a single show based on the given imdb id.
+ Parameters
+ imdb_id (string, `show`) - The imdb id of the show you want details on.
+ Response 200 (application/json; charset=utf-8)
+ Body
{"_id":"UniqueString2","imdb_id":"UniqueString2","title":"String","year":0,"slug":"String","synopsis":"String","runtime":0,"rating":{"percentage":0,"watching":0,"votes":0},"images":{"banner":"String","fanart":"String","poster":"String"},"genres":["String"],"type":"String","tvdb_id":"String","country":"String","network":"String","air_day":"String","air_time":"String","status":"String","num_seasons":1,"last_updated":0,"latest_episode":0,"episodes":[{"tvdb_id":0,"season":0,"episode":0,"title":"String","overview":"String","date_based":false,"first_aired":0,"torrents":{"0":{"provider":"String","peers":0,"seeds":0,"url":"String"},"480p":{"provider":"String","peers":0,"seeds":0,"url":"String"},"720p":{"provider":"String","peers":0,"seeds":0,"url":"String"},"1080p":{"provider":"String","peers":0,"seeds":0,"url":"String"}}}]}
+ Attributes (Show)
+ Response 204 (charset=utf-8)
## Get Random [/random/show]
### Random [GET]
Gives a random show from the database.
+ Response 200 (application/json; charset=utf-8)
+ Body
{"_id":"UniqueString2","imdb_id":"UniqueString2","title":"String","year":0,"slug":"String","synopsis":"String","runtime":0,"rating":{"percentage":0,"watching":0,"votes":0},"images":{"banner":"String","fanart":"String","poster":"String"},"genres":["String"],"type":"String","tvdb_id":"String","country":"String","network":"String","air_day":"String","air_time":"String","status":"String","num_seasons":1,"last_updated":0,"latest_episode":0,"episodes":[{"tvdb_id":0,"season":0,"episode":0,"title":"String","overview":"String","date_based":false,"first_aired":0,"torrents":{"0":{"provider":"String","peers":0,"seeds":0,"url":"String"},"480p":{"provider":"String","peers":0,"seeds":0,"url":"String"},"720p":{"provider":"String","peers":0,"seeds":0,"url":"String"},"1080p":{"provider":"String","peers":0,"seeds":0,"url":"String"}}}]}
+ Attributes (Show)
+ Response 204 (charset=utf-8)
# Group Genres
## Genres
Popcorn API supports the following genres:
- action
- adventure
- animation
- comedy
- crime
- disaster
- documentary
- drama
- eastern
- family
- fan-film
- fantasy
- film-noir
- history
- holiday
- horror
- indie
- music
- mystery
- none
- road
- romance
- science-fiction
- short
- sports
- sporting-event
- suspense
- thriller
- tv-movie
- war
- western