-
Notifications
You must be signed in to change notification settings - Fork 0
/
apiary.apib
1421 lines (908 loc) · 47.9 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
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
FORMAT: 1A
# Albireo HTTP API
This is Albireo project http API document. it contains end user and admin API for Client.
# Group Home API
API for querying bangumi and episode in end user client. Including List bangumi and episode, get detail of a bangumi
and episode by specifying id.
## my_bangumi [/api/home/my_bangumi{?status}]
### List My Bangumi [GET]
list all bangumi which is favorite by current user
+ Parameters
+ `status` (number, optional) - the favorite status, can be one of the following value: 1 (WISH), 2 (WATCHED), 3 (WATCHING), 4 (PAUSE), 5 (ABANDONED) and 0 (all of above)
+ Default: `3`
+ Response 200 (application/json)
+ Attributes
+ `data` (array[BangumiUnwatched]) - a list of bangumi which contains unwatched count
## on_air [/api/home/on_air]
### List All [GET]
List all bangumi which is currently on air, on air means current date is between air_date and the last episode airdate plus one week.
The order is descending order by air_date of bangumi
+ Response 200 (application/json)
+ Attributes
+ `data` (array[BangumiFavorite]) - a list of bangumi which is on air
## List bangumi [/api/home/bangumi{?page,count,sort_field,sort_order,name,type}]
+ Parameters
+ `page` (number, optional) - the page number start from 1.
+ Default: `1`
+ `count` (number, optional) - count per page, by provide count = -1, client can obtain all data.
+ Default: `10`
+ `sort_field` (string, optional) - the field name used for sort by.
+ Default: `air_date`
+ `sort_order` (string, optional) - the sort order which can be only two value: desc and asc.
+ Default: `desc`
+ `name` (string, optional) - the search term for filtering result. this string will be matched by name_cn, name and summary.
+ `type` (number, optional) - type of bangumi ,can be -1 (all), 2 (anime), 6 (tv drama).
+ Default: `-1`
## List All [GET]
List all bangumi base on the given query criteria.
+ Response 200 (application/json)
+ Attributes
+ total: `256` (number, required) - the total number of bangumi under given query criteria
+ data (array[BangumiFavorite]) - a list of bangumi which is a sub set of all bangumi under given query criteria. if count is -1, this list will contains all bangumi
### Get Bangumi Detail [GET /api/home/bangumi/{id}]
+ Parameters
+ id (string, required) - bangumi id
+ Response 200 (application/json)
+ Attributes
+ data (BangumiExtended) - the bangumi object contains the episodes list.
## Get Episode detail [/api/home/episode/{id}]
Get the episode by specific id
+ Parameters
+ id (string, required) - the episode id
### Get Episode [GET]
+ Response 200 (application/json)
+ Attributes (EpisodeExtended)
## Send Feedback [/api/home/feedback]
Send a feedback about current episode and video_file.
### send [POST]
+ Request (application/json)
+ Attributes
+ episode_id: `f0317eb2-d487-4e89-9e8d-9cccffd73e00` (string, required) - current episode id.
+ video_file_id: `fe4150ee-4b11-46e3-b0ef-31aa6bce1095` (string, required) - current played video_file id.
+ message: `问题: 有画面无声音,附加信息:xxx` (string, required) - additional description of feedback.
+ Response 200 (application/json)
{
"message": "ok",
"status": 0
}
## Announce [/api/home/announce]
retrieve current valid Announcements
### Get All Available [GET]
Will only get announcement which current time is between start_time and end_time
+ Response 200 (application/json)
+ Attributes
+ `data` (array[Announce]) - the announce list. you need present these announce according to their position property.
# Group Favorite And Watch History API
A set of APIs which allow end user to view and modify favorite status of a bangumi and record watch history of an episode.
## Favorite Bangumi [/api/watch/favorite/bangumi/{bangumi_id}]
Change the favorite status of a bangumi
+ Parameters
+ `bangumi_id`: `46a469ee-5041-4f7c-8bf3-43ea6166a728` (string, required)
### Change Bangumi Favorite Status [POST]
+ Request (application/json)
+ Attributes
+ status: `3` (number, required) - favorite status of the bangumi, can be one of the following value: 1 (WISH), 2 (WATCHED), 3 (WATCHING), 4 (PAUSE), 5 (ABANDONED)
+ Response 200 (application/json)
{
"message": "ok",
"status": 0
}
## Check favorite bangumi [/api/watch/favorite/check/{bangumi_id}]
check current bangumi, update the check_time of current favorite.
+ Parameters
+ `bangumi_id`: `46a469ee-5041-4f7c-8bf3-43ea6166a728` (string, required)
### Update check_time [PUT]
return a timestamp of the check_time in utc timezone
+ Response 200 (application/json)
{
"data": 1497574966172,
"status": 0
}
## Favorite Episode [/api/watch/favorite/episode/{episode_id}]
Change the favorite status of an episode, an episode favorite_status will affect my_bangumi API result if the bangumi of this episode is marked with 3 (WATCHING)
When episode is not favorite or favorite status is not 3 (WATCHING) or 2 (WATCHED) and episode status is 2 (DOWNLOADED), my_bangumi result will count this episode into unwatch_count.
+ Parameters
+ `episode_id`: `f0317eb2-d487-4e89-9e8d-9cccffd73e00` (string, required)
### Change Episode Favorite Status [POST]
+ Request (application/json)
+ Attributes
+ status: `3` (number, required) - favorite status of the episode, can be one of the following value: 1 (WISH), 2 (WATCHED), 3 (WATCHING), 4 (PAUSE), 5 (ABANDONED)
+ bangumi_id: `f0317eb2-d487-4e89-9e8d-9cccffd73e00` - id of bangumi which the episode belongs to.
+ Response 200 (application/json)
{
"message": "ok",
"status": 0
}
## Episode Hisotry [/api/watch/history/{episode_id}]
Add/update the watch history and progress. When this operation is success the favorite status of an episode is also changed depending on the watch progress.
If the watch progress is greater than a percentage which is controlled by client. a boolean field `is_finished` should be contained in request payload and set to true.
When is_finished is true, the favorite status of current episode will be changed to 2 (WATCHED), otherwise, the favorite status will be set to 3 (WATCHING)
+ Parameters
+ `episode_id`: `f0317eb2-d487-4e89-9e8d-9cccffd73e00` (string, required)
### Update/Add Watch History And Progress [POST]
+ Request (application/json)
+ Attributes
+ bangumi_id: `46a469ee-5041-4f7c-8bf3-43ea6166a728` (string, required) - id of bangumi which current episode belongs to.
+ last_watch_position: `3.0` (number, required) - a float value record the user watched position, it's the currentTime property of HTMLMediaElement, unit is second.
+ percentage: `0.5012` (number, required) - a float value which is the result of currentTime / duration.
+ is_finished: `false` (boolean, required) - This value indicates whether this episode is finished watching. Client should control the value on its own strategy. It's recommend to keep this value as true once the episode favorite status is changed to 2 (WATCHED).
+ Response 200 (application/json)
{
"message": "ok",
"status": 0
}
### Synchronize Episode History [POST /api/watch/history/synchronize]
Batch synchronize episode history to server. By comparing with last_watch_time between client and server.
a watch_progress record may be updated or untouched. if last_watch_time from client is later or equal than server,
server watch_progress record will be updated, otherwise the record from client will be dropped.
is_finished is only useful when the episode doesn't have a watch status or watch status isn't WATCHED.
**This API always return success even the operation actually failed.**
Note that the last_watch_time must be UTC time.
+ Request (application/json)
+ Attributes
+ records (array[WatchHistoryRecord]) - an array of watch history record to be synchronized.
+ Response 200 (application/json)
{
"message": "ok",
"status": 0
}
# Group Account API
A set of API related with login, register and user information
## Login [/api/user/login]
Login current user and create a session
### Login [POST]
+ Request (application/json)
+ Attributes
+ name: `john_doe` (string, required) - user name
+ password: `adfbasdf` (string, required)
+ remmember: `true` (boolean, required) - whether to store the user session for a long period (365 days), if this value is false, only store session for one month.
+ Response 200 (application/json)
+ Headers
set-cookie: session=c1234543-a419-4797-b3a1-b103f128b820.3oq6lYFBykUey9aPNm6D8RlXZ8Q; Expires=Sat, 10-Jun-2017 07:50:12 GMT; HttpOnly; Path=/
+ Body
{"msg": "OK"}
+ Response 400 (application/json)
{"message": "invalid parameter"}
+ Response 400 (application/json)
{"message": "invalid name or password"}
## Logout [/api/user/logout]
Logout the user session
## Logout [POST]
+ Response 200 (application/json)
{"msg": "OK"}
## Register User [/api/user/register]
register a new user using invite code, note that a newly registered user is not administrator
### Register [POST]
+ Request
+ Attributes
+ `name`: `john_doe` (string, required) - user name, must be unique
+ `password` (string, required)
+ `password_repeat` (string, required) - must equal to password
+ `email` (string, required)
+ `invite_code` (string, required)
+ Response 201 (application/json)
{"message": "ok"}
+ Response 400 (application/json)
{"message": "invalid invite code"}
+ Response 400 (application/json)
{"message": "duplicate name"}
+ Response 400 (application/json)
{"message": "password not match"}
+ Response 400 (application/json)
{"message": "invalid parameter"}
+ Response 400 (application/json)
{"message": "invalid email"}
## GET User Info [/api/user/info]
get user information, this api can be used for check session validation
### Get Info [GET]
+ Response 200 (application/json)
{
"data": {
"name": "john_doe",
"level": 0,
"email": "[email protected]",
"email_confirmed": True
}
}
+ Response 401 (application/json)
{
"message": "unauthorized access"
}
## Request Reset Password [/api/user/request-reset-pass]
used for users forgot their password, request a password reset
### Send Request [POST]
will send an email contains a link which includes a token to reset user password. email address must be a valid and confirmed email address
+ Request (application/json)
+ Attributes
+ `email`: `[email protected]` (string, required) - email address of user who want reset his/her password. must be valid and confirmed.
+ Response 200 (application/json)
{"message": "ok"}
+ Response 400 (application/json)
{"message": "invalid request"}
+ Response 400 (application/json)
{"message": "email does not exist"}
## Update Password [/api/user/update-pass]
Update user password
### Update Password [POST]
This operation will send a notification email to user. and logout current user.
+ Request (application/json)
+ Attributes
+ `password`: `asdf1234` (string, required) - current password
+ `new_password`: `123456abc` (string, required) - new password
+ `new_password_repeat`: `123456abc` (string, required)
+ Response 200
## User Email [/api/user/email]
Operations related with user email
### Update Email [POST /api/user/email]
A confirm email will be send to new email address, and a notification email will be sent to old email address.
+ Request (application/json)
+ Attributes
+ `email`: `[email protected]` (string, required)
+ Response 200 (application/json)
{"message": "ok"}
### Resend Confirm Email [POST /api/user/email/resend]
Resend a confirm email to current email address.
+ Response 200 (application/json)
{"message": "ok"}
### Confirm Email [POST /api/user/email/confirm]
Confirm email will set `email_confirmed` field to true.
+ Request (application/json)
+ Attributes
+ `token` (string, required) - token from confirm email link.
+ Response 200 (application/json)
{"message": "ok"}
## Reset Password [/api/user/reset-pass]
Reset a user password with new password and token. token can be acquired by using request-reset-pass API
### Reset Password [POST]
+ Request (application/json)
+ Attributes
+ `new_pass` (string, required)
+ `new_pass_repeat` (string, required) - must equal to password
+ `token` (string, required)
+ Response 200 (application/json)
{"message": "ok"}
+ Response 400 (application/json)
{"message": "invalid token"}
+ Response 400 (application/json)
{"message": "password not match"}
+ Response 400 (application/json)
{"message": "invalid parameter"}
# Group Admin API
A set of API for managing bangumi and episode, NOTE: ALL these api require user.level >= 2
## Bangumi [/api/admin/bangumi{?page,count,order_by,sort,name,type}]
Bangumi resource, include CRUD operations
### List Bangumi [GET]
List bangumi by filter criteria. support return all bangumi by passing count = -1
+ Parameters
+ `page`: `1` (number, optional) - specify page of result set
+ Default: `1`
+ `count`: `10` (number, optional) - result count per page. if pass -1, return all bangumi
+ Default: `10`
+ `order_by`: `update_time` (string, optional) - sorting field, result set will sorted by this field.
+ Default: `update_time`
+ `sort`: `desc` (string, optional) - sort order, can be `desc` or `asc`
+ Default: `desc`
+ `name` (string, optional) - search term for name, name_cn, summary field contain specific string.
+ `type` (number, optional) - type of bangumi, can be -1 (all), 2 (anime), 6 (tv drama).
+ Default: `-1`
+ Response 200 (application/json)
+ Attributes
+ data (array[Bangumi]) - result list of current page filtered by given criteria. if count is -1, this list will contain all bangumi in database.
+ total: 100 (number) - total number of matched result
### Add Bangumi [POST]
Add a bangumi
+ Request (application/json)
+ Attributes
+ `bgm_id`: `13131` (number) - the id of this bangumi in bgm.tv
+ `name`: `喜羊羊与灰太狼` (string) - the original name (usually the original language) of the bangumi
+ `name_cn`: `喜羊羊与灰太狼` (string) - the chinese translated name of the bangumi, can be null.
+ `summary`: `羊历3010年(故事中的虚构历法),一个绵羊群的先祖为了避开狼群的追杀而去到“青青草原”,并建立了一个有着坚固防御的小村。` (string) - description for bangumi, can be null
+ `image`: `http://lain.bgm.tv/pic/cover/l/05/2a/13131_1GmZy.jpg` (string) - the original image url from bgm.tv, this should not be used except the bangumi is not saved into database yet. A client should use cover property.
+ `eps_no_offset` (number) - A offset is used for adjust episode number matching issue. offset = <episode.episode_no> - <feed episode number>, can be null
+ `type`: `2` (number)
+ `air_date`: `2005-06-01` (string) - air date (aka on air starting date of bangumi)
+ `air_weekday`: `3` (number) - Which day of a week this bangumi is on air.
+ `eps`: `530` (number) - how many episodes the bangumi has
+ `episodes`
+ `bgm_eps_id`: `75724` (number)
+ `episode_no`: `1` (number)
+ `name`: `狼来了(上)` (string)
+ `name_cn`: `狼来了(上)` (string)
+ `duration`: `00:24:00` (string)
+ `airdate`: `2005-06-01` (string)
+ Response 200 (application/json)
+ Attributes
+ data
+ id: `46a469ee-5041-4f7c-8bf3-43ea6166a728` (string) - bangumi id of the newly added.
### Update Bangumi [PUT /api/admin/bangumi/{bangumi_id}]
Update a bangumi, this operation will not update all fields which client post. To learn which field is allowed to update,
see the source code.
Special Notice: when you try to update maintained_by, you should give a `user` object. if you want to reset to System, you should give a null value.
+ Parameters
+ `bangumi_id` (string, required)
+ Request (application/json)
+ Attributes (Bangumi)
+ Response 200 (application/json)
{"message": "ok"}
## Get Bangumi [GET /api/admin/bangumi/{bangumi_id}]
Get a bangumi detail with all episodes information
+ Parameters
+ bangumi_id (string, required)
+ Response 200 (application/json)
+ Attributes
+ data (BangumiExtended)
+ Response 404 (application/json)
{"message": "NOT FOUND"}
### Delete Bangumi [DELETE /api/admin/bangumi/{bangumi_id}]
Delete a bangumi, this operation will add a delete_mark field to bangumi, after a given delay (configured in config file), a task will
delete this bangumi. administrator can undo a delete before that time by just remove the delete_mark.
+ Parameters
+ `bangumi_id` (string, required)
+ Response 200 (application/json)
+ Attributes
+ data
+ `delete_delay` 10 (number) - after how long the bangumi will be deleted, unit is minute.
## Query From Bangumi.tv [/api/admin/query{?name,type,offset,count}]
Provide A bridge to get bangumi information from bangumi.tv.
### Search Bangumi [GET]
Search bangumi from bangumi.tv by giving a specific search term.
+ Parameters
+ `name` (string, optional) - search term to filter bangumi from bangumi.tv, if this value is null, undefined, a 404 is returned
+ `type` (number, optional) - type of bangumi, 2 is anime, 6 is tv series.
+ Default: `2`
+ `offset` (number, optional) - item offset in the result list returned by bangumi.tv. usually this value is used for supporting pagination. offset = (page - 1) * count.
+ Default: `0`
+ `count` (number, optional) - number of items per page
+ Default: `10`
+ Response 200 (application/json)
+ Attributes
+ data (array[BangumiRaw])
+ total (number)
### Get Bangumi Detail [GET /api/admin/query/{bgm_id}]
Get the bangumi detail information by bangumi.tv bgm_id
+ Parameters
+ `bgm_id`: `193042` (number, required)
+ Response 200 (application/json)
+ Attributes (BangumiRawLarge)
## Episode [/api/admin/episode{?page,count,order_by,sort,status}]
Episode resource, include CRUD operations
### List Episode [GET]
List All Episode
+ Parameters
+ page: `1` (number, optional)
+ Default: `1`
+ count: `10` (number, optional)
+ Default: `10`
+ `order_by`: `bangumi_id` (string, optional)
+ Default: `bangumi_id`
+ sort: `desc` (string, optional) - sort order can be `desc` or `asc`
+ Default: `desc`
+ status: `1` (number, optional) - filter by episode status
+ Response 200 (application/json)
+ Attributes
+ data (array[Episode]) - a list of current page of the result filtered by search criteria
+ total: `100` (number) - total number of result filtered by search criteria
### Add Episode [POST]
Add an episode, this episode must related with a bangumi
+ Request (application/json)
+ Attributes
+ `bangumi_id` (string, required)
+ `bgm_eps_id` (string, required)
+ `episode_no` (number, required)
+ `name` (string, required)
+ `name_cn` (string, optional)
+ `duration` (string, optional) - format is HH:mm:ss
+ `airdate` (string, optional) - format is YYYY-MM-DD
+ Response 200 (application/json)
+ Attributes
+ data
+ id (string) - the id of newly added episode
### Get Episode [GET /api/admin/episode/{episode_id}]
Get an episode detail
+ Parameters
+ `episode_id` (string, required)
+ Response 200 (application/json)
+ Attributes
+ data (Episode)
### Update Episode [PUT /api/admin/episode/{episode_id}]
Update an episode, only a few property will be updated, for more detail, read the source code.
+ Parameters
+ `episode_id` (string, required)
+ Request (application/json)
+ Attributes (Episode)
+ Response 200 (application/json)
{"msg": "ok"}
### Delete an episode [DELETE /api/admin/episode/{episode_id}]
Delete an episode. *In the previous version, this operation will only add an delete_mark property to episode as current time.*
*after a delay, task will run and delete this episode. user can undo the delete operation by remove the delete_mark before it is actually deleted.*
**In current version. This operation takes effective immediately.**
+ Parameters
+ `episode_id` (string, required)
+ Response 200 (application/json)
{"message": "ok"}
## Video File [/api/video-file{?episode_id}]
Video_file related operation, A video_file is an object which describe the video file property including url, resolution, duration, etc.
### List Video File [GET]
List all video files of specifial episode.
+ Parameters
+ `episode_id` (string, required)
+ Response 200 (application/json)
+ Attributes
+ data (array[VideoFile])
### Add Video File [POST]
Add a video_file to a special episode, this method is usually used for manually download video from a special magnet url
+ Request (application/json)
+ Attributes
+ `bangumi_id`: `46a469ee-5041-4f7c-8bf3-43ea6166a728` (string, required)
+ `episode_id`: `f0317eb2-d487-4e89-9e8d-9cccffd73e00` (string, required)
+ `status`: `3` (number, required) - can be 1 (download pending), 2 (downloading), 3 (downloaded)
+ `file_path`: `[DMG][Roku de Nashi Majutsu Koushi to Akashic Records][01][720P]` (string, optional)
+ `file_name` (string, optional) - name of actual file, can be null
+ `download_url`: `magnet:?xt=urn:btih:614691f99c5073fa83d5d89582ff11024e929448&dn=%E4%B8%96%E7%95%8C%E5%A5%87%E5%A6%99%E7%89%A9%E8%AF%AD.2017%E5%B9%B4%E6%98%A5%E5%AD%A3%E7%89%B9%E5%88%AB%E7%AF%87.mp4` (string, optional)
+ `resolution_w`: `1024` (number, optional)
+ `resolution_h`: `576` (number, optional)
+ `duration`: `6399040` (number, optional)
+ `label` (string, optional)
+ Response 200 (application/json)
+ Attributes
+ data: `fe4150ee-4b11-46e3-b0ef-31aa6bce1095` (string) - id of newly added video_file
### Update Video File [PUT /api/admin/video-file/{id}]
Update a video_file, not all property will be updated.
+ Parameters
+ id (string, required)
+ Request (application/json)
+ Attributes (VideoFile)
+ Response 200 (application/json)
{"msg": "OK"}
### Delete A Video File [DELETE /api/admin/video-file/{id}]
Delete a video_file, this operation is an instant operation and could not revert. Note that currently
delete a video_file won't remove the torrent session from deluge associated with its torrent id. But will
remove the file associated with file_path of this video_file.
+ Parameters
+ id (string, required)
+ Response 200 (application/json)
{"msg": "ok"}
# Group Feed API
This API is used for verify the search result for search term of some resource site. All of the API under this group are also required user.level >= 2
## dmhy [/api/feed/dmhy/{keywords}]
Get the feed result from dmhy. This API is unstable because it is a proxy API
+ Parameters
+ keywords (string, required) - the search term for dmhy
### Get Feed Result [GET]
+ Response 200 (application/json)
+ Attributes
+ data (array[FeedResult]) - the result of query, can be empty array if no result matched.
+ status: `0` (number)
## acg.rip [/api/feed/acg-rip/{keywords}]
Get the feed result from acg.rip. This API is unstable because it is a proxy API
+ Parameters
+ keywords (string, required) - the search term for dmhy
### Get Feed Result [GET]
+ Response 200 (application/json)
+ Attributes
+ data (array[FeedResult]) - the result of query, can be empty array if no result matched.
+ status: `0` (number)
## libyk [/api/feed/libyk-so{?q,t}]
Get the feed result from libyk.com, This API is unstable because it is a proxy API
+ Parameters
+ q (string, required) - the searchh term
+ t (string, required) - the source for search, can be `yyets`, `dmhy`, `tokyo`
### GET Feed Result [GET]
+ Response 200 (application/json)
+ Attributes
+ data (array[FeedResult]) - the result of query, can be empty array if no result matched.
+ status: `0` (number)
## Bangumi.moe Proxy [/api/feed/bangumi-moe]
Proxy for bangumi.moe API
### Proxy [POST]
Return response of this method can be any
+ Request (application/json)
+ Attributes
+ url (string, required) - target bangumi.moe url to reach
+ payload (object, required) - bangumi.moe request payload
+ method (string, optional) - bangumi.moe request method
+ Default: `POST`
+ Response 200 (application/json)
+ Attributes (object)
## Bangumi.moe Torrent Search [/api/feed/bangumi-moe/torrent/search]
Search torrents using tag_ids, for more detail, see https://github.com/BangumiMoe/rin-pr-apidoc/blob/master/DOC/api/torrent.md
### Search [POST]
+ Request (application/json)
+ Attributes
+ tag_id (array[string]) - tag id list
+ p (number, optional) - page
+ Response 200 (application)
+ Attributes
+ count (number)
+ page_count (number),
+ torrents (array[object]) - see rin-pr document
## Nyaa [/api/feed/nyaa]
Get the feed result from libyk.com, This API is unstable because it is a proxy API
### Get result [POST]
+ Request (application/json)
+ Attributes
+ qs (string, required) - querystring will directly used in url. should be f=<number>&c=1_<number>&q=<query>
+ Response 200 (application/json)
+ Attributes
+ data (array[FeedResult]) - the result of query, can be empty array if no result matched.
+ status: `0` (number)
# Group Task
This is a set of API that related to tasks. All APIs in this group require user.level >= 2
## Pending Delete Bangumi [/api/task/bangumi]
Operations related with pending delete bangumi.
### List Pending Delete Bangumi [GET]
+ Response 200 (application/json)
+ Attributes
+ data (array[BangumiPendingDelete]) - pending delete bangumi list
+ `delete_delay` (number) - the configured delete delay for bangumi
## Pending Delete Episode [/api/task/episode]
Operations related with pending delete episode
### List Pending Delete Episode [GET]
+ Response 200 (application/json)
+ Attributes
+ data (array[EpisodePendingDelete]) - pending delete episode list
+ `delete_delay` (number) - the configured delete delay for episode
## Task [/api/task/task]
Operations related with task
### List Tasks [GET]
+ Response 200 (application/json)
+ Attributes
+ data (array[Task]) - a list of tasks
## Restore Bangumi [/api/task/restore/bangumi/{id}]
Restore a pending delete bangumi, only available before bangumi is actually deleted.
+ Parameters
+ `id` (string, required) - bangumi id
### Restore [POST]
+ Response 200 (application/json)
{"msg": "ok"}
## Restore Episode [/api/task/restore/episode/{episode_id}]
Restore a pending delete episode, only available before episode is actually deleted.
+ Parameters
+ `episode_id` (string, required) - episode id
### Restore [POST]
+ Response 200 (application/json)
{"msg": "ok"}
# Group User Management
A set of API which used to management user and invite code. All APIs in this group require user.level >= 2.
## User [/api/user-manage{?name,count,offset,minlevel}]
User related operations
### List All User [GET]
+ Parameters
+ `count`: `10` (number, optional) - number of items per page.
+ Default: `10`
+ `offset`: `0` (number, optional) - start position off current page.
+ Default: `0`
+ `minlevel`: `0` (number, optional) - the minimun level of user.
+ Default: `0`
+ `query-field`: `name` (string, optional) - filter by particular field
+ `query-value`: `John Doe` (string, optional) - filter value used by query-field
+ Response 200 (application)
+ Attributes
+ `data` (array[User]) - list of user in current page
+ `total` (number) - total number under current search term.
### Promote A User [POST /api/user-manage/promote]
+ Request (application/json)
+ Attributes
+ `id`: `f0317eb3-d487-4e89-9e8d-9cf0ffd73e00` (string, required) - user id
+ `to_level`: `2` (number, required) - level to be promoted.
+ Response 200 (application/json)
{"msg": "OK"}
## Invite Code [/api/user-manage/invite{?num}]
Invite code related operations
### Create A New Invite Code [POST]
+ Parameters
+ `num`: `1` (number, optional) - how many invite codes to be generated.
+ Default: `1`
+ Response 200 (application/json)
+ Attributes
+ `data` (array[string]) - invite code list which are newly generated.
### List All Unused Invite Code [GET /api/user-manage/invite/unused]
List all unused invite code