-
Notifications
You must be signed in to change notification settings - Fork 1
/
api.yml
3871 lines (3871 loc) · 122 KB
/
api.yml
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
openapi: "3.1.0"
info:
title: EH Downloader API
version: "1.0"
description: EH Downloader API
license:
name: GPL-3.0
url: https://www.gnu.org/licenses/gpl-3.0.html
servers:
- url: "{host}{base}"
variables:
host:
default: https://eh.lifegpc.com
description: Hostname
base:
default: /api
description: Base URL
description: API Server
components:
schemas:
ApiResponse:
description: Api response
type: object
required: [ok, status]
properties:
ok:
type: boolean
status:
type: integer
ApiResponseEmpty:
description: Api response with a empty data
allOf:
- $ref: "#/components/schemas/ApiResponse"
- type: object
required: [data]
properties:
data:
type: object
example: { ok: true, status: 0, data: {} }
ApiResponseError:
description: Api response with a error
allOf:
- $ref: "#/components/schemas/ApiResponse"
- type: object
required: [error]
properties:
error:
type: string
ApiResponseTrue:
description: Api response with true
allOf:
- $ref: "#/components/schemas/ApiResponse"
- type: object
required: [data]
properties:
data:
type: boolean
enum: [true]
example: { ok: true, status: 0, data: true }
ClientConfigApiResult:
description: Api result for getClientConfig
type: object
allOf:
- $ref: "#/components/schemas/ApiResponse"
- type: object
required: [data]
properties:
data:
oneOf:
- type: array
title: ClientConfigNameList
description: The list of configuration's name
items:
type: string
- type: string
description: The data of configuration
ConfigOptional:
description: Configuration of server
type: object
properties:
cookies:
type: string
description: Cookies
db_path:
type: string
description: The folder where the database is stored
ua:
type: string
description: User Agent
ex:
type: boolean
description: Whether to use exhentai.org
base:
type: string
description: Download location
max_task_count:
type: integer
description: Maximum number of parallel tasks
mpv:
type: boolean
description: Fetch page data from Multi-Page Viewer
max_retry_count:
type: integer
description: Maximum retry count
max_download_img_count:
type: integer
description: Maximum number of parallel downloads of images
download_original_img:
type: boolean
description: Whether to download original images
port:
type: integer
description: Listening port
export_zip_jpn_title:
type: boolean
description: Whether to use japanese title first when exporting zip
hostname:
type: string
description: Listening host
meili_host:
type: string
description: Meilisearch server host
meili_search_api_key:
type: string
description: Meilisearch API key for searching
meili_update_api_key:
type: string
description: Meilisearch API key for updating gallery metadata
ffmpeg_path:
type: string
description: The path to the ffmpeg binary
thumbnail_method:
$ref: "#/components/schemas/ThumbnailMethod"
thumbnail_dir:
type: string
description: The folder used to store thumbnails
remove_previous_gallery:
type: boolean
description: Whether to remove old galleries which replaced by new ones
img_verify_secret:
type: string
description: The secret of image verify
meili_hosts:
type: object
additionalProperties:
type: string
description: Meilisearch server hostname for specific domains
cors_credentials_hosts:
type: array
items:
type: string
description: The URL origins which are allowed to send CORS requests with credentials
flutter_frontend:
type: string
description: The path of flutter frontend
fetch_timeout:
type: integer
description: Fetch timeout in milliseconds
download_timeout:
type: integer
description: Download timeout in milliseconds
ffprobe_path:
type: string
description: The path to the ffprobe binary
redirect_to_flutter:
type: boolean
description: Whether to redirect to Flutter frontend when accessing the root URL
download_timeout_check_interval:
type: integer
description: The interval of checking download timeout in milliseconds
eh_metadata_cache_time:
type: integer
description: The time to cache the metadata of the gallery from E-Hentai in hours
random_file_secret:
type: string
description: The secret of token to access random file without login
use_path_based_img_url:
type: boolean
description: Whether to put parameters to image URL path
check_file_hash:
type: boolean
description: Whether to verify file integrity when downloading or importing
import_method:
$ref: "#/components/schemas/ImportMethod"
max_import_img_count:
type: integer
description: Maximum number of images to be imported in parallel
enable_server_timing:
type: boolean
description: Whether to enable server time tracking
thumbnail_format:
$ref: "#/components/schemas/ThumbnailFormat"
Config:
allOf:
- $ref: "#/components/schemas/ConfigOptional"
- properties:
cookies:
type: boolean
description: True if Cookies is set
required:
- cookies
- ex
- base
- max_task_count
- mpv
- max_retry_count
- max_download_img_count
- download_original_img
- port
- export_zip_jpn_title
- hostname
- ffmpeg_path
- thumbnail_method
- thumbnail_dir
- remove_previous_gallery
- cors_credentials_hosts
- fetch_timeout
- download_timeout
- ffprobe_path
- redirect_to_flutter
- download_timeout_check_interval
- eh_metadata_cache_time
- use_path_based_img_url
- check_file_hash
- import_method
- max_import_img_count
- enable_server_timing
- thumbnail_format
ConfigUpdated:
description: result of updateConfig
type: object
properties:
is_unsafe:
type: boolean
description: True if some modification of configuration only works after server restart
required: [is_unsafe]
DefaultImportConfig:
description: Default configuration for import task
type: object
properties:
max_import_img_count:
type: integer
description: Maximum number of images to be imported in parallel
mpv:
type: boolean
description: Fetch page data from Multi-Page Viewer
method:
$ref: "#/components/schemas/ImportMethod"
remove_previous_gallery:
type: boolean
description: Whether to remove old galleries which replaced by new ones
DefaultImportConfigApiResult:
description: Api response for getDefaultImportConfig
allOf:
- $ref: "#/components/schemas/ApiResponse"
- type: object
required: [data]
properties:
data:
$ref: "#/components/schemas/DefaultImportConfig"
DownloadConfig:
description: Configuration for download task
type: object
properties:
max_download_img_count:
type: integer
description: Maximum number of parallel downloads of images
mpv:
type: boolean
description: Fetch page data from Multi-Page Viewer
download_original_img:
type: boolean
description: Whether to download original images
max_retry_count:
type: integer
description: Maximum retry count
remove_previous_gallery:
type: boolean
description: Whether to remove old galleries which replaced by new ones
replaced_gallery:
description: A list of old galleries which should be replaced by new one
type: array
items:
type: object
required: [gid, token]
properties:
gid:
type: integer
format: int64
description: Gallery id
token:
type: string
description: Gallery token
DownloadConfigApiResult:
description: Api response for getDefaultDownloadConfig
allOf:
- $ref: "#/components/schemas/ApiResponse"
- type: object
required: [data]
properties:
data:
$ref: "#/components/schemas/DownloadConfig"
EhFile:
description: Full data for File
allOf:
- $ref: '#/components/schemas/EhFileExtend'
- type: object
properties:
path:
type: string
description: Path to image file on server
required: [path]
EhFileApiResult:
description: Api response for uploadFile
allOf:
- $ref: "#/components/schemas/ApiResponse"
- type: object
required: [data]
properties:
data:
$ref: "#/components/schemas/EhFile"
EhFileBasic:
description: Basic data for file
type: object
required: [id, width, height, is_original]
properties:
id:
type: integer
description: File ID
width:
type: integer
description: Image width
height:
type: integer
description: Image height
is_original:
type: boolean
description: True if image is original
EhFileExtend:
description: Extended data for file
allOf:
- $ref: '#/components/schemas/EhFileBasic'
- type: object
properties:
token:
type: string
description: Page token
required: [token]
EhFileExtendApiResult:
description: Api response for getFile
allOf:
- $ref: "#/components/schemas/ApiResponse"
- type: object
required: [data]
properties:
data:
$ref: "#/components/schemas/EhFileExtend"
EhFileMeta:
description: Metadata for a image
allOf:
- $ref: '#/components/schemas/EhFileMetaOptinal'
- required: [token, is_nsfw, is_ad]
EhFileMetaApiResult:
description: Api response for getFilemeta
allOf:
- $ref: "#/components/schemas/ApiResponse"
- type: object
required: [data]
properties:
data:
$ref: "#/components/schemas/EhFileMeta"
EhFileMetaOptinal:
description: Metadata for a image
type: object
required: [token]
properties:
token:
type: string
description: Image(page) token
is_nsfw:
type: boolean
description: True if image is NSFW
is_ad:
type: boolean
description: True if image is advertisement
EhFiles:
description: List of files for tokens
type: object
additionalProperties:
type: array
items:
$ref: "#/components/schemas/EhFileBasic"
EhFilesApiResult:
description: Api response for getFiles
allOf:
- $ref: "#/components/schemas/ApiResponse"
- type: object
required: [data]
properties:
data:
$ref: "#/components/schemas/EhFiles"
EHImageLimit:
description: E-Hentai image limits
type: object
properties:
current:
type: integer
description: Current used
max:
type: integer
description: Maximum limit
EHImageLimitApiResult:
description: Api response for getEhImageLimit
allOf:
- $ref: "#/components/schemas/ApiResponse"
- type: object
required: [data]
properties:
data:
$ref: "#/components/schemas/EHImageLimit"
EHMetaInfo:
description: E-Hentai metadata information map
type: object
additionalProperties:
oneOf:
- allOf:
- $ref: "#/components/schemas/ApiResponse"
- type: object
required: [data]
properties:
data:
$ref: "#/components/schemas/GalleryMetadataSingle"
- $ref: "#/components/schemas/ApiResponseError"
EHMetaInfoApiResult:
description: Api response for getEhMetadata
allOf:
- $ref: "#/components/schemas/ApiResponse"
- type: object
required: [data]
properties:
data:
$ref: "#/components/schemas/EHMetaInfo"
ExportZipConfig:
description: Configuration for export as zip file task
type: object
properties:
output:
type: string
description: The path to output zip file
jpn_title:
type: boolean
description: Whether to use japanese title first
max_length:
type: integer
description: Maximum length of filenames in Zip files. 0 means disable
export_ad:
type: boolean
description: Export pages which marked as advertisements
ExportZipConfigApiResult:
description: Api response for getDefaultExportZipConfig
allOf:
- $ref: "#/components/schemas/ApiResponse"
- type: object
required: [data]
properties:
data:
$ref: "#/components/schemas/ExportZipConfig"
ExtendedPMeta:
description: Page metadata with extended information
type: object
required: [gid, index, token, name, width, height, is_nsfw, is_ad]
properties:
gid:
type: integer
format: int64
description: Gallery id
index:
type: integer
description: Page number in gallery
token:
type: string
description: Token for image
name:
type: string
description: Page name
width:
type: integer
description: Original image width
height:
type: integer
description: Original image height
is_nsfw:
type: boolean
description: True if image is NSFW
is_ad:
type: boolean
description: True if image is advertisement
FsFile:
description: Present a file/directory
type: object
required: [name, dir]
properties:
name:
type: string
description: File name
dir:
type: boolean
description: True if is a directory
FsFileList:
description: Present the list of file in a directory
type: object
properties:
current:
type: string
description: The path of the directory
list:
type: array
items:
$ref: '#/components/schemas/FsFile'
description: File list
FsFileListApiResult:
description: Api response for getFSList
allOf:
- $ref: "#/components/schemas/ApiResponse"
- type: object
required: [data]
properties:
data:
$ref: "#/components/schemas/FsFileList"
GalleryData:
description: Gallery data
type: object
required: [meta, tags, pages]
properties:
meta:
$ref: "#/components/schemas/GMeta"
tags:
type: array
description: Gallery tags
items:
$ref: "#/components/schemas/Tag"
pages:
type: array
description: Gallery pages
items:
$ref: "#/components/schemas/ExtendedPMeta"
GalleryDataApiResult:
description: Api response for getGallery
allOf:
- $ref: "#/components/schemas/ApiResponse"
- type: object
required: [data]
properties:
data:
$ref: "#/components/schemas/GalleryData"
GalleryList:
description: A list of galleries
type: array
items:
anyOf:
- $ref: "#/components/schemas/GMeta"
- $ref: "#/components/schemas/GMetaOptional"
GalleryListApiResult:
description: Api response for listGalleries
allOf:
- $ref: "#/components/schemas/ApiResponse"
- type: object
required: [data]
properties:
data:
$ref: "#/components/schemas/GalleryList"
GMeta:
description: Gallery metadata
allOf:
- $ref: "#/components/schemas/GMetaOptional"
- required:
- gid
- token
- title
- title_jpn
- category
- uploader
- posted
- filecount
- filesize
- expunged
- rating
GMetaInfos:
description: Galleries' metadata
additionalProperties:
oneOf:
- allOf:
- $ref: "#/components/schemas/ApiResponse"
- type: object
required: [data]
properties:
data:
$ref: "#/components/schemas/GMeta"
- $ref: "#/components/schemas/ApiResponseError"
GMetaInfosApiResult:
description: Api response for getGalleriesMeta
allOf:
- $ref: "#/components/schemas/ApiResponse"
- type: object
required: [data]
properties:
data:
$ref: '#/components/schemas/GMetaInfos'
GMetaOptional:
description: Gallery metadata
type: object
properties:
gid:
type: integer
format: int64
description: Gallery id
token:
type: string
description: Gallery token
title:
type: string
description: Title
title_jpn:
type: string
description: Japanese title
category:
type: string
description: Category
uploader:
type: string
description: Uploader's name
posted:
type: integer
format: int64
description: Posted epoch time
filecount:
type: integer
description: File count in gallery
filesize:
type: integer
format: int64
description: Total size of files
expunged:
type: boolean
description: True if gallery is not visible
rating:
type: number
description: Rating
parent_gid:
type: integer
format: int64
description: Parent gallery id
parent_token:
type: string
description: Parent gallery token
first_gid:
type: integer
format: int64
description: First gallery id
first_token:
type: string
description: First gallery token
GalleryMetadataSingle:
description: Gallery metadata from E-Hentai api
type: object
required:
- gid
- token
- archiver_key
- title
- title_jpn
- category
- thumb
- uploader
- posted
- filecount
- filesize
- expunged
- rating
- torrentcount
- torrents
- tags
properties:
gid:
type: integer
format: int64
description: Gallery id
token:
type: string
description: Gallery token
archiver_key:
type: string
title:
type: string
description: HTML Escaped title
title_jpn:
type: string
description: HTML Escaped japanese title
category:
type: string
description: Category
thumb:
type: string
description: Thumbnail URL
uploader:
type: string
description: HTML Escaped uploader name
posted:
type: string
description: Posted epoch time
filecount:
type: string
description: File count in gallery
filesize:
type: integer
format: int64
description: Total size of files
expunged:
type: boolean
description: True if gallery is not visible
rating:
type: number
description: Rating
torrentcount:
type: integer
description: Torrent count
torrents:
type: array
items:
$ref: "#/components/schemas/GalleryMetadataTorrentInfo"
description: Torrents
tags:
type: array
items:
type: string
description: List of tags
parent_gid:
type: integer
format: int64
description: Parent gallery id
parent_token:
type: string
description: Parent gallery token
first_gid:
type: integer
format: int64
description: First gallery id
first_token:
type: string
description: First gallery token
GalleryMetadataTorrentInfo:
description: Torrent information
type: object
required: [hash, added, name, tsize, fsize]
properties:
hash:
type: string
added:
type: string
name:
type: string
tsize:
type: string
fsize:
type: string
GallerySharedTokenInfo:
description: Shared token extra information for gallery
type: object
required: [gid]
properties:
gid:
type: integer
format: int64
description: Gallery id
ImportMethod:
description: import method
type: integer
oneOf:
- title: Copy
const: 0
- title: CopyThenDelete
const: 1
- title: Move
const: 2
- title: Keep
const: 3
SharedToken:
description: Shared token
type: object
required: [id, token, type, info]
properties:
id:
type: integer
description: Shared token id
token:
type: string
description: Token
expired:
type: string
format: date-time
type:
$ref: "#/components/schemas/SharedTokenType"
info:
description: Extra informations
oneOf:
- $ref: "#/components/schemas/GallerySharedTokenInfo"
SharedTokenApiResult:
description: Api response for getSharedToken
allOf:
- $ref: "#/components/schemas/ApiResponse"
- type: object
required: [data]
properties:
data:
$ref: '#/components/schemas/SharedToken'
SharedTokenList:
description: A list of shared token
items:
oneOf:
- $ref: "#/components/schemas/SharedTokenWithUrl"
SharedTokenListApiResult:
description: Api response for listSharedToken
allOf:
- $ref: "#/components/schemas/ApiResponse"
- type: object
required: [data]
properties:
data:
$ref: '#/components/schemas/SharedTokenList'
SharedTokenType:
description: Shared token type
type: integer
oneOf:
- title: Gallery
const: 0
SharedTokenWithUrl:
description: Shared token with shareable URL
type: object
required: [url, token]
properties:
url:
type: string
description: Shareable URL
token:
$ref: "#/components/schemas/SharedToken"
SharedTokenWithUrlApiResult:
description: Api response for updateSharedToken/createSharedToken
allOf:
- $ref: "#/components/schemas/ApiResponse"
- type: object
required: [data]
properties:
data:
$ref: '#/components/schemas/SharedTokenWithUrl'
StatusData:
description: Server's status
type: object
required:
- ffmpeg_api_enabled
- ffmpeg_binary_enabled
- ffprobe_binary_enabled
- meilisearch_enabled
- no_user
- is_docker
- libzip_enabled
properties:
ffmpeg_api_enabled:
type: boolean
description: FFMPEG Api thumbnail generate method is available.
ffmpeg_binary_enabled:
type: boolean
description: ffmpeg binary was found. FFMPEG Binary thumbnail generate method is available.
ffprobe_binary_enabled:
type: boolean
description: ffprobe binary was found.
meilisearch_enabled:
type: boolean
description: Meilisearch server is enabled.
meilisearch:
type: object
description: Meilisearch server's configuration. Authorization is required to get this configuration.
required: [host, key]
properties:
host:
type: string
description: Meilisearch server's host
key:
type: string
description: Meilisearch api key which used to search
no_user:
type: boolean
description: True if no any users on server
is_docker:
type: boolean
description: True if server is running in docker
libzip_enabled:
type: boolean
description: True if libzip extension was enabled
StatusDataApiResult:
description: Api response for getStatus
allOf:
- $ref: "#/components/schemas/ApiResponse"
- type: object
required: [data]
properties:
data:
$ref: '#/components/schemas/StatusData'
Tag:
description: Gallery Tag
type: object
required: [id, tag]
properties:
id:
type: integer
description: Tag id in database
tag:
type: string
description: Original tag name on E-Hentai
translated:
type: string
description: Chinese translation of tag
intro:
type: string
description: Chinese introduction of tag
TagList:
description: A list of gallery tags
type: array
items:
$ref: "#/components/schemas/Tag"
TagListApiResult:
description: Api response for getRowTags
allOf:
- $ref: "#/components/schemas/ApiResponse"
- type: object
required: [data]
properties:
data:
$ref: '#/components/schemas/TagList'
Tags:
description: Gallery tags
type: object
additionalProperties:
oneOf:
- allOf:
- $ref: "#/components/schemas/ApiResponse"
- type: object
required: [data]
properties:
data:
$ref: '#/components/schemas/Tag'
- $ref: "#/components/schemas/ApiResponseError"
TagsApiResult:
description: Api response for getTags
allOf:
- $ref: "#/components/schemas/ApiResponse"
- type: object
required: [data]
properties:
data:
$ref: '#/components/schemas/Tags'
Task:
description: Task
type: object
required: [id, type, gid, token, pid]
properties:
id:
type: integer
description: Task id
type:
$ref: '#/components/schemas/TaskType'
gid:
type: integer
format: int64
description: Gallery id
token:
type: string
description: Gallery token
pid:
type: integer
format: int64
description: Procress id
details:
type: string
description: Task configuration in JSON format
TaskApiResult:
description: Api response for createTask
allOf:
- $ref: "#/components/schemas/ApiResponse"
- type: object
required: [data]
properties:
data:
$ref: '#/components/schemas/Task'
TaskType:
description: Task type
type: integer
oneOf:
- title: Download
const: 0
- title: ExportZip