aboutsummaryrefslogtreecommitdiff
path: root/config/sankakucomplex.zsh
blob: 7326034528a39e9b4559ced19980053a64b82362 (plain)
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
# Copyright (C) 2024-2026 Maria Lisina
# Copyright (C) 2024-2026 Danil Lisin
# SPDX-License-Identifier: Apache-2.0

ib_cname="sankakucomplex"

ib_header="Authorization: Bearer"
ib_expire=86400
ib_login_file="login"
ib_key_file="password"
ib_login_word="login"
ib_key_word="password"

case "${ib_board}" in
    (i)
        ib_name="Idol Complex"
        ib_config="idolcomplex"
        ib_api="https://i.sankakuapi.com"
        ib_auth="https://i.sankakuapi.com"
        ib_url="https://www.idolcomplex.com"

        ib_groups=(
            "tags[]|select(.type==1)|.tagName" Idol
            "tags[]|select(.type==2)|.tagName" Studio
            "tags[]|select(.type==3)|.tagName" Copyright
            "tags[]|select(.type==4)|.tagName" Character
            "tags[]|select(.type==6)|.tagName" Genre
            "tags[]|select(.type==5)|.tagName" Set
            "tags[]|select(.type==0)|.tagName" General
            "tags[]|select(.type==8)|.tagName" Medium
            "tags[]|select(.type==9)|.tagName" Meta
        )
    ;;
    (s)
        ib_name="Sankaku Channel"
        ib_config="sankakuchannel"
        ib_api="https://sankakuapi.com"
        ib_auth="https://sankakuapi.com"
        ib_url="https://www.sankakucomplex.com"

        ib_groups=(
            "tags[]|select(.type==1)|.tagName" Artist
            "tags[]|select(.type==2)|.tagName" Studio
            "tags[]|select(.type==3)|.tagName" Copyright
            "tags[]|select(.type==4)|.tagName" Character
            "tags[]|select(.type==5)|.tagName" Genre
            "tags[]|select(.type==0)|.tagName" General
            "tags[]|select(.type==8)|.tagName" Medium
            "tags[]|select(.type==9)|.tagName" Meta
        )
    ;;
esac

ib_ratings=(
    s safe
    q questionable
    e explicit
)

case "${ib_mode}" in
    (l)
        ib_data_url="${ib_api}/pools"
        ib_dlimit="limit"
        ib_dpage="page"
        ib_dquery="name"
        ib_iid="id"
        ib_icreated="created_at"
        ib_ipool="name"
        ib_icount="post_count"
        ib_idate="%Y-%m-%d %H:%M"
        ib_url="${ib_url}/books/"
    ;;
    (p)
        ib_data_url="${ib_api}/posts"
        ib_dlimit="limit"
        ib_dpage="page"
        ib_dquery="tags"
        ib_iid="id"
        ib_icreated="created_at.s"
        ib_isize="file_size"
        ib_ifile="file_url"
        ib_isample="sample_url"
        ib_ipreview="preview_url"
        ib_iwidth="width"
        ib_iheight="height"
        ib_irating="rating"
        ib_iparent="parent_id"
        ib_ichildren="has_children"
        ib_imd5="md5"
        ib_isource="deprecated"
        ib_itags="tags[].tagName"
        ib_url="${ib_url}/posts/"
    ;;
    (t)
        ib_data_url="${ib_api}/tags"
        ib_dlimit="limit"
        ib_dpage="page"
        ib_dquery="name"
        ib_iid="id"
        ib_itag="tagName"
        ib_icount="post_count"
        ib_url="${ib_url}/tags/"
    ;;
esac