Compare commits
1086 Commits
071f4f0911
...
fe5534b006
| Author | SHA1 | Date |
|---|---|---|
|
|
fe5534b006 | 8 months ago |
|
|
6ca07aeff7 | 8 months ago |
|
|
19567f9642 | 8 months ago |
|
|
4a854c7a23 | 8 months ago |
|
|
312b617b95 | 8 months ago |
|
|
0a0a869e88 | 8 months ago |
|
|
8573921243 | 8 months ago |
|
|
b8d3124227 | 8 months ago |
|
|
14e23694fd | 8 months ago |
|
|
7e25002dba | 8 months ago |
|
|
a94d9bf8b8 | 8 months ago |
|
|
7430c7386e | 8 months ago |
|
|
5f99e694c8 | 8 months ago |
|
|
25b23854d8 | 8 months ago |
|
|
45d39fe94d | 8 months ago |
|
|
21b63c1d77 | 8 months ago |
|
|
f64ce0f4a2 | 8 months ago |
|
|
b3e7d8e8d5 | 8 months ago |
|
|
8a147dbdd3 | 8 months ago |
|
|
5a039acf82 | 8 months ago |
|
|
e9469ae0e0 | 8 months ago |
|
|
48cfc3347b | 8 months ago |
|
|
1566b807b7 | 8 months ago |
|
|
8bed45dd2f | 8 months ago |
|
|
36c3a88d63 | 8 months ago |
|
|
16f5129b69 | 8 months ago |
|
|
674290d029 | 8 months ago |
|
|
6cb6873fcb | 8 months ago |
|
|
705a684cc2 | 8 months ago |
|
|
de76ccf753 | 8 months ago |
|
|
cbd74dd7df | 8 months ago |
|
|
7f39798a8c | 9 months ago |
|
|
31999d97a0 | 9 months ago |
|
|
fd0df2414e | 9 months ago |
|
|
a93140fc36 | 9 months ago |
|
|
7c264b6af7 | 9 months ago |
|
|
134656b835 | 9 months ago |
|
|
8964bb1584 | 9 months ago |
|
|
8bee71342b | 9 months ago |
|
|
a4824a3582 | 9 months ago |
|
|
6fb4cc608c | 9 months ago |
|
|
12aa4479cd | 9 months ago |
|
|
bfdb10d002 | 9 months ago |
|
|
f61f5329e3 | 9 months ago |
|
|
0477fe0659 | 9 months ago |
|
|
6b3329436f | 9 months ago |
|
|
35fd5042a7 | 9 months ago |
|
|
d366628a20 | 9 months ago |
|
|
5483453f35 | 9 months ago |
|
|
02ac1cb896 | 9 months ago |
|
|
1563783afe | 9 months ago |
|
|
f5436977a9 | 9 months ago |
|
|
b58cf32b7a | 9 months ago |
|
|
38025a6b35 | 9 months ago |
|
|
96a2d9e0ac | 9 months ago |
|
|
c9ebbfa1bf | 9 months ago |
|
|
91ec95448c | 9 months ago |
|
|
b5512e7574 | 9 months ago |
|
|
8bc7480d84 | 9 months ago |
|
|
db9a7161f4 | 9 months ago |
|
|
74d0951d3d | 9 months ago |
|
|
91d5eff20a | 9 months ago |
|
|
54d6b2a2bb | 9 months ago |
|
|
66cd27a673 | 9 months ago |
|
|
137490001a | 9 months ago |
|
|
c85dac5e0e | 9 months ago |
|
|
9a9102fa33 | 9 months ago |
|
|
0d31adb20b | 9 months ago |
|
|
df7f2d1a89 | 9 months ago |
|
|
eaca421132 | 9 months ago |
|
|
5f1f2df7f0 | 9 months ago |
|
|
ed21a5b397 | 9 months ago |
|
|
39703e3ebb | 9 months ago |
|
|
14cff0d651 | 9 months ago |
|
|
af89f42251 | 9 months ago |
|
|
036ce155ae | 9 months ago |
|
|
177d014b13 | 9 months ago |
|
|
7c74ff6177 | 9 months ago |
|
|
b139586df5 | 9 months ago |
|
|
15c7f97432 | 9 months ago |
|
|
f22c8f9e7c | 9 months ago |
|
|
b24baf7d93 | 9 months ago |
|
|
98e0f6cd6c | 9 months ago |
|
|
e7316b5cd0 | 9 months ago |
|
|
33a0a68ac7 | 9 months ago |
|
|
a83baf4c12 | 9 months ago |
|
|
307f2090f6 | 9 months ago |
|
|
e73d636979 | 9 months ago |
|
|
77fb7270ce | 9 months ago |
|
|
9d35f26252 | 9 months ago |
|
|
4eeb879451 | 9 months ago |
|
|
06aa701ab1 | 9 months ago |
|
|
3c55b68beb | 9 months ago |
|
|
63f37d159a | 9 months ago |
|
|
cb74c43f71 | 9 months ago |
|
|
798b7570fe | 9 months ago |
|
|
9197b82e0d | 9 months ago |
|
|
ad45480439 | 9 months ago |
|
|
9493ff1630 | 9 months ago |
|
|
8ee46ad2d1 | 9 months ago |
|
|
ba1b35522c | 9 months ago |
|
|
41c37c025a | 9 months ago |
|
|
9995657da5 | 9 months ago |
|
|
1569275cd4 | 9 months ago |
|
|
352d998680 | 9 months ago |
|
|
d0b2002a1b | 9 months ago |
|
|
5962efb7df | 9 months ago |
|
|
8b18d1f0f8 | 10 months ago |
|
|
97ca214815 | 10 months ago |
|
|
5d9b56296b | 10 months ago |
|
|
66f25c30fc | 10 months ago |
|
|
fd197de86a | 10 months ago |
|
|
5f7478b33c | 10 months ago |
|
|
b058477b67 | 10 months ago |
|
|
149d9e5a81 | 10 months ago |
|
|
6420def95a | 10 months ago |
|
|
5dae26ce0b | 10 months ago |
|
|
b5fddadb18 | 10 months ago |
|
|
613d1cd1a1 | 10 months ago |
|
|
a6a72064bb | 10 months ago |
|
|
73c0a4f606 | 10 months ago |
|
|
1d2ee20d17 | 10 months ago |
|
|
67b556c2eb | 10 months ago |
|
|
3962c87e1d | 10 months ago |
|
|
e6ca455254 | 10 months ago |
|
|
d481ff416f | 10 months ago |
|
|
b0236e492d | 10 months ago |
|
|
497321bfa8 | 10 months ago |
|
|
eff26f6303 | 10 months ago |
|
|
b5bd5b8cdf | 10 months ago |
|
|
4cc15daba3 | 10 months ago |
|
|
248d51321a | 10 months ago |
|
|
7cb9a264de | 10 months ago |
|
|
b58e9ff328 | 10 months ago |
|
|
958e0bed5c | 10 months ago |
|
|
e8d4143d72 | 10 months ago |
|
|
079b2346f1 | 10 months ago |
|
|
553615b3ff | 10 months ago |
|
|
f8992457dc | 10 months ago |
|
|
06a9209b9e | 10 months ago |
|
|
4c0b873013 | 10 months ago |
|
|
dba7f46f73 | 10 months ago |
|
|
8665186426 | 10 months ago |
|
|
b5c6a94311 | 10 months ago |
|
|
1540021f6f | 10 months ago |
|
|
0e1247476e | 10 months ago |
|
|
bf83909349 | 10 months ago |
|
|
e398a01f14 | 10 months ago |
|
|
0e77938ade | 10 months ago |
|
|
a4a9a1cf67 | 10 months ago |
|
|
3f9544fdb8 | 10 months ago |
|
|
bd30fc35a1 | 11 months ago |
|
|
b6f82cc282 | 11 months ago |
|
|
9222079e98 | 11 months ago |
|
|
49158b99d5 | 11 months ago |
|
|
3fe61a09b7 | 11 months ago |
|
|
b82ad1356e | 11 months ago |
|
|
b825d06b22 | 11 months ago |
|
|
28f5856f9e | 11 months ago |
|
|
19751674ee | 11 months ago |
|
|
a78afba15e | 11 months ago |
|
|
0e946cf84c | 11 months ago |
|
|
6cd29603ac | 11 months ago |
|
|
d94cf53624 | 11 months ago |
|
|
c81628c027 | 11 months ago |
|
|
bcde8ef2a2 | 11 months ago |
|
|
66df6caa67 | 11 months ago |
|
|
08e53b2f5f | 11 months ago |
|
|
7c83730ad0 | 11 months ago |
|
|
d2a026c054 | 11 months ago |
|
|
faf8f6ffd7 | 11 months ago |
|
|
6c372548db | 11 months ago |
|
|
0029697350 | 11 months ago |
|
|
bdcf27b955 | 11 months ago |
|
|
bb7ac26c0c | 11 months ago |
|
|
7b42317996 | 11 months ago |
|
|
103b0e7eb6 | 11 months ago |
|
|
fa80598e7c | 11 months ago |
|
|
3cb5367028 | 11 months ago |
|
|
9417d1f973 | 11 months ago |
|
|
173d30737b | 11 months ago |
|
|
0db45877b7 | 11 months ago |
|
|
e7fac812a7 | 11 months ago |
|
|
ab26e6b3d0 | 11 months ago |
|
|
baafc29967 | 11 months ago |
|
|
b0bd3e99a4 | 11 months ago |
|
|
6bf377a654 | 11 months ago |
|
|
3d78b9003d | 11 months ago |
|
|
f57722ec54 | 11 months ago |
|
|
9558a34b00 | 11 months ago |
|
|
522e3af41d | 11 months ago |
|
|
7b1a0b8d0d | 11 months ago |
|
|
5856681753 | 11 months ago |
|
|
f066be47fe | 11 months ago |
|
|
884142a15e | 11 months ago |
|
|
d7267b20fd | 11 months ago |
|
|
0537cdd533 | 11 months ago |
|
|
c5f939df70 | 11 months ago |
|
|
6854164e5a | 11 months ago |
|
|
1e942c650b | 11 months ago |
|
|
30a06b67d8 | 11 months ago |
|
|
34a1dabae4 | 11 months ago |
|
|
23227a0427 | 11 months ago |
|
|
02d1aef77c | 11 months ago |
|
|
39ebdacef9 | 11 months ago |
|
|
276349e23c | 12 months ago |
|
|
0507ed8d59 | 12 months ago |
|
|
2f8a0fe775 | 12 months ago |
|
|
aab7e9360a | 12 months ago |
|
|
9db443f7f7 | 12 months ago |
|
|
70ce9eb008 | 12 months ago |
|
|
a58947376c | 12 months ago |
|
|
cbb70f94dd | 12 months ago |
|
|
9408b9ba1b | 12 months ago |
|
|
409828d22f | 12 months ago |
|
|
c9d32a804c | 12 months ago |
|
|
a65cbf4981 | 12 months ago |
|
|
e325063260 | 12 months ago |
|
|
cf0177364c | 12 months ago |
|
|
8eaad2270b | 12 months ago |
|
|
362f9c6786 | 12 months ago |
|
|
3047949b22 | 12 months ago |
|
|
8d7c81c8ef | 12 months ago |
|
|
7d6e12d1fc | 12 months ago |
|
|
7a0f1af06a | 12 months ago |
|
|
21aaa23586 | 12 months ago |
|
|
95fcbd44fd | 12 months ago |
|
|
cc98931147 | 12 months ago |
|
|
8f61beadb2 | 12 months ago |
|
|
6d404c6997 | 12 months ago |
|
|
27060cfef0 | 12 months ago |
|
|
ca3d8f555a | 12 months ago |
|
|
7ea59a7bf1 | 12 months ago |
|
|
cea4db9619 | 12 months ago |
|
|
e7c3168099 | 12 months ago |
|
|
b165a0d611 | 1 year ago |
|
|
43e6c7c86f | 1 year ago |
|
|
346828402b | 1 year ago |
|
|
01d67eca2e | 1 year ago |
|
|
4445b666aa | 1 year ago |
|
|
adf0b4e397 | 1 year ago |
|
|
e797cabd88 | 1 year ago |
|
|
0c32b56378 | 1 year ago |
|
|
5c9c2c3a7a | 1 year ago |
|
|
7cd7180adb | 1 year ago |
|
|
4b6b585801 | 1 year ago |
|
|
1cf2153df0 | 1 year ago |
|
|
6ed104aeca | 1 year ago |
|
|
9ba1629065 | 1 year ago |
|
|
669709dfbb | 1 year ago |
|
|
b5cb310aab | 1 year ago |
|
|
50771771a8 | 1 year ago |
|
|
dce24e2005 | 1 year ago |
|
|
d3a61f6556 | 1 year ago |
|
|
8cdd7effe5 | 1 year ago |
|
|
e389b01d35 | 1 year ago |
|
|
2c9632e3e5 | 1 year ago |
|
|
2fff92b023 | 1 year ago |
|
|
c949b95dab | 1 year ago |
|
|
da145c7f41 | 1 year ago |
|
|
16b8bf9328 | 1 year ago |
|
|
f076c8095a | 1 year ago |
|
|
d2b2578a3a | 1 year ago |
|
|
b24741678c | 1 year ago |
|
|
fecb1db3be | 1 year ago |
|
|
6418422157 | 1 year ago |
|
|
7718ff28e7 | 1 year ago |
|
|
3771b8d26b | 1 year ago |
|
|
c1357b46fb | 1 year ago |
|
|
6c9f6eaae5 | 1 year ago |
|
|
309b6405f9 | 1 year ago |
|
|
9058ead462 | 1 year ago |
|
|
162436c913 | 1 year ago |
|
|
876f3a3d3a | 1 year ago |
|
|
02acc7e9d4 | 1 year ago |
|
|
e874837efb | 1 year ago |
|
|
c294f5bb61 | 1 year ago |
|
|
826c948260 | 1 year ago |
|
|
a5c70f0b51 | 1 year ago |
|
|
c2f9c18e29 | 1 year ago |
|
|
91cd239c97 | 1 year ago |
|
|
4d255d0d53 | 1 year ago |
|
|
d5a1e1a52f | 1 year ago |
|
|
9abc80880f | 1 year ago |
|
|
8d91adbd6e | 1 year ago |
|
|
20a24db949 | 1 year ago |
|
|
b837659408 | 1 year ago |
|
|
696e0bc8f6 | 1 year ago |
|
|
2ec2484982 | 1 year ago |
|
|
738e2649d6 | 1 year ago |
|
|
8e9da4e39f | 1 year ago |
|
|
da3a9a7d9b | 1 year ago |
|
|
8f9c0d93f6 | 1 year ago |
|
|
8bb0c4f4f1 | 1 year ago |
|
|
dbb04d2051 | 1 year ago |
|
|
84562d7b36 | 1 year ago |
|
|
29327dafd0 | 1 year ago |
|
|
c0d12b0c83 | 1 year ago |
|
|
a0041f3c93 | 1 year ago |
|
|
2175e91db7 | 1 year ago |
|
|
5fa7590550 | 1 year ago |
|
|
f3ae64ed1f | 1 year ago |
|
|
cc437b8cd4 | 1 year ago |
|
|
db0782c61a | 1 year ago |
|
|
bbf059ff35 | 1 year ago |
|
|
bebc615376 | 1 year ago |
|
|
77616a5404 | 1 year ago |
|
|
45584f2eea | 1 year ago |
|
|
1c3e59f9f0 | 1 year ago |
|
|
a88de5b1b6 | 1 year ago |
|
|
91977ba025 | 1 year ago |
|
|
5420290564 | 1 year ago |
|
|
98c21db8da | 1 year ago |
|
|
23953cae11 | 1 year ago |
|
|
9cd310ba51 | 1 year ago |
|
|
51311a17fb | 1 year ago |
|
|
6799d79754 | 1 year ago |
|
|
e429cdd811 | 1 year ago |
|
|
2e5ce98bac | 1 year ago |
|
|
68c3a7148f | 1 year ago |
|
|
2a1c5bc6da | 1 year ago |
|
|
6fd18543ef | 1 year ago |
|
|
ae76631aaf | 1 year ago |
|
|
ca59e8e577 | 1 year ago |
|
|
3648b36d16 | 1 year ago |
|
|
439b7862a3 | 1 year ago |
|
|
f4b975c865 | 1 year ago |
|
|
da02a82d74 | 1 year ago |
|
|
0d5498e60d | 1 year ago |
|
|
0847baf17b | 1 year ago |
|
|
adf5794ad3 | 1 year ago |
|
|
cfeea09a05 | 1 year ago |
|
|
e9bcb1abed | 1 year ago |
|
|
35cf827c90 | 1 year ago |
|
|
a10c34115b | 1 year ago |
|
|
2f4e93e391 | 1 year ago |
|
|
6ed42bc28b | 1 year ago |
|
|
dc7c859344 | 1 year ago |
|
|
a82e41aabb | 1 year ago |
|
|
3c62f4280f | 1 year ago |
|
|
f806cdd118 | 1 year ago |
|
|
224c8a6c53 | 1 year ago |
|
|
408be7fa3c | 1 year ago |
|
|
a02b001768 | 1 year ago |
|
|
5edbdf801a | 1 year ago |
|
|
cc3701250a | 1 year ago |
|
|
e94d434f92 | 1 year ago |
|
|
4d3adaa143 | 1 year ago |
|
|
36eecf781f | 1 year ago |
|
|
76f44c98be | 1 year ago |
|
|
d660d9a30f | 1 year ago |
|
|
8326ee8c29 | 1 year ago |
|
|
690a004de6 | 1 year ago |
|
|
98c6454eba | 1 year ago |
|
|
8e42ef1229 | 1 year ago |
|
|
02359a2630 | 1 year ago |
|
|
158f6f4232 | 1 year ago |
|
|
77de194b83 | 1 year ago |
|
|
85cd13c8b2 | 1 year ago |
|
|
bfbd01b1c2 | 1 year ago |
|
|
e83636edc0 | 1 year ago |
|
|
63dc67b6fd | 1 year ago |
|
|
b0de4c3b66 | 1 year ago |
|
|
d5a4cf68c6 | 1 year ago |
|
|
288d6e0b8f | 1 year ago |
|
|
aa98db9ac6 | 1 year ago |
|
|
c19e1fd5e5 | 1 year ago |
|
|
ef10e3cafc | 1 year ago |
|
|
400c423dde | 1 year ago |
|
|
85ba4fa0de | 1 year ago |
|
|
8cb913d538 | 1 year ago |
|
|
2128bbe1b6 | 1 year ago |
|
|
4df07a50fb | 1 year ago |
|
|
8fa63bca64 | 1 year ago |
|
|
e191e0c9c1 | 1 year ago |
|
|
5970509886 | 1 year ago |
|
|
b2c7d1028c | 1 year ago |
|
|
377606d1aa | 1 year ago |
|
|
688bfdaa82 | 1 year ago |
|
|
bc60629e66 | 1 year ago |
|
|
f3372751d1 | 1 year ago |
|
|
77a5216ebf | 1 year ago |
|
|
7ced91beea | 1 year ago |
|
|
41f5cee6c6 | 1 year ago |
|
|
ba5086c409 | 1 year ago |
|
|
531145c7f9 | 1 year ago |
|
|
f26fecb714 | 1 year ago |
|
|
dd7568659f | 1 year ago |
|
|
843d1f1bea | 1 year ago |
|
|
29263ff59b | 1 year ago |
|
|
3b91a3883e | 1 year ago |
|
|
ddb9b13df7 | 1 year ago |
|
|
ed578e5bff | 1 year ago |
|
|
cdbb004ca1 | 1 year ago |
|
|
f6145bc412 | 1 year ago |
|
|
86e7c21e4d | 1 year ago |
|
|
76638c6aab | 1 year ago |
|
|
3a950f401b | 1 year ago |
|
|
eeba47ea03 | 1 year ago |
|
|
762f5cbec2 | 1 year ago |
|
|
5b6c9be6d6 | 1 year ago |
|
|
f681ed270b | 1 year ago |
|
|
a0168a7d49 | 1 year ago |
|
|
47263e641e | 1 year ago |
|
|
70c78f1cab | 1 year ago |
|
|
e7cb83f7b1 | 1 year ago |
|
|
0212e1e18f | 1 year ago |
|
|
265c411df2 | 1 year ago |
|
|
69a14b6fc5 | 1 year ago |
|
|
168446e6d5 | 1 year ago |
|
|
23af28f4dd | 1 year ago |
|
|
ac80384ba1 | 1 year ago |
|
|
c4be0b58ca | 1 year ago |
|
|
023d13e44b | 1 year ago |
|
|
f4909ade09 | 1 year ago |
|
|
26fb2b9dcb | 1 year ago |
|
|
44c2ebd4a5 | 1 year ago |
|
|
47874032a3 | 1 year ago |
|
|
6dfa5ad1c2 | 1 year ago |
|
|
111ad58b57 | 1 year ago |
|
|
f1086c93f7 | 1 year ago |
|
|
5e27a59414 | 1 year ago |
|
|
cece556669 | 1 year ago |
|
|
9252da8004 | 1 year ago |
|
|
a9fdfee7ad | 1 year ago |
|
|
6904aecea3 | 1 year ago |
|
|
b516632731 | 1 year ago |
|
|
87ad5d0c3a | 1 year ago |
|
|
b95bb46d00 | 1 year ago |
|
|
60c91f9cc4 | 1 year ago |
|
|
20ce9cb8d9 | 1 year ago |
|
|
a2625410f9 | 1 year ago |
|
|
e2697012ea | 1 year ago |
|
|
f28cd3aad9 | 1 year ago |
|
|
fd82a54d63 | 1 year ago |
|
|
d95d26a280 | 1 year ago |
|
|
33310bdc42 | 1 year ago |
|
|
6281d770c1 | 1 year ago |
|
|
c37f3bdad7 | 1 year ago |
|
|
5630ca5982 | 1 year ago |
|
|
ceb75d98d0 | 1 year ago |
|
|
75ad3b5657 | 1 year ago |
|
|
5adf27eab1 | 1 year ago |
|
|
18fbbed723 | 1 year ago |
|
|
201bbf755d | 1 year ago |
|
|
b9fe35b8c3 | 1 year ago |
|
|
fd0787152e | 1 year ago |
|
|
29cf04c804 | 1 year ago |
|
|
a4827d1b7d | 1 year ago |
|
|
f107e11528 | 1 year ago |
|
|
52b6f75dd0 | 1 year ago |
|
|
fd719221ed | 1 year ago |
|
|
a2c04fa954 | 1 year ago |
|
|
6db5ac5f26 | 1 year ago |
|
|
cedce23cf5 | 1 year ago |
|
|
645816f614 | 1 year ago |
|
|
00a769bfd5 | 1 year ago |
|
|
0fe5133992 | 1 year ago |
|
|
2994f5936e | 1 year ago |
|
|
e8a96fa0ad | 1 year ago |
|
|
8c8cf5dcd9 | 1 year ago |
|
|
19ff5db70d | 1 year ago |
|
|
c7b689842e | 1 year ago |
|
|
df03c65d5a | 1 year ago |
|
|
4a88a93e8d | 1 year ago |
|
|
950b9e5510 | 1 year ago |
|
|
70230de8e1 | 1 year ago |
|
|
c0ea9cadd7 | 1 year ago |
|
|
8c966c3e23 | 1 year ago |
|
|
9f87e77ede | 1 year ago |
|
|
6165c9b7cf | 1 year ago |
|
|
88ea5215c0 | 1 year ago |
|
|
522b3d53cc | 1 year ago |
|
|
9a1d37166a | 1 year ago |
|
|
07ae87f72b | 1 year ago |
|
|
a16a202800 | 1 year ago |
|
|
09ff9c0a7d | 1 year ago |
|
|
8c4a93d1dc | 1 year ago |
|
|
2da8a4af84 | 1 year ago |
|
|
7d5f0d3187 | 1 year ago |
|
|
a65c1810a2 | 1 year ago |
|
|
09b7d27b40 | 1 year ago |
|
|
e1175d01cc | 1 year ago |
|
|
51fe77ff33 | 1 year ago |
|
|
c540266e48 | 1 year ago |
|
|
198e859850 | 1 year ago |
|
|
87944719a5 | 1 year ago |
|
|
6b44656819 | 1 year ago |
|
|
35334e82ae | 1 year ago |
|
|
32e7b7184f | 1 year ago |
|
|
4098183be7 | 1 year ago |
|
|
e25b03b68f | 1 year ago |
|
|
7076b2d443 | 1 year ago |
|
|
1933200372 | 1 year ago |
|
|
0359afe574 | 1 year ago |
|
|
cd8282bbe0 | 1 year ago |
|
|
8350b3c70e | 1 year ago |
|
|
8488d80c6f | 1 year ago |
|
|
affd4646af | 1 year ago |
|
|
9853638c6b | 1 year ago |
|
|
faf2f2a312 | 1 year ago |
|
|
4adf485208 | 1 year ago |
|
|
eaab76aa9e | 1 year ago |
|
|
2ca740a85d | 1 year ago |
|
|
569aa73cd4 | 1 year ago |
|
|
d3858ff5ff | 1 year ago |
|
|
2760dc8a76 | 1 year ago |
|
|
c1990dde75 | 1 year ago |
|
|
af5b62b8fd | 1 year ago |
|
|
fcd6e92dba | 1 year ago |
|
|
dad098ff34 | 1 year ago |
|
|
aa9a499a09 | 1 year ago |
|
|
f10e6f021c | 1 year ago |
|
|
09596331fd | 1 year ago |
|
|
c8f9962def | 1 year ago |
|
|
e91e8fcccb | 1 year ago |
|
|
a702f1f7ef | 1 year ago |
|
|
9654a68dad | 1 year ago |
|
|
a2f18e2284 | 1 year ago |
|
|
fceb927bce | 1 year ago |
|
|
f192c1716d | 1 year ago |
|
|
f2960c2229 | 1 year ago |
|
|
552a68c1d4 | 1 year ago |
|
|
e5f277c957 | 1 year ago |
|
|
ff05dd7694 | 1 year ago |
|
|
7c604647bf | 1 year ago |
|
|
0fd0c38971 | 1 year ago |
|
|
a454613ce8 | 1 year ago |
|
|
73dd8c4688 | 1 year ago |
|
|
1a07cfc144 | 1 year ago |
|
|
715fe9e645 | 1 year ago |
|
|
6316ac055c | 1 year ago |
|
|
ff64db7a7c | 1 year ago |
|
|
d5a299d7ff | 1 year ago |
|
|
0e3c3f89d0 | 1 year ago |
|
|
234e23b7a5 | 1 year ago |
|
|
69093b8214 | 1 year ago |
|
|
708d7908aa | 1 year ago |
|
|
b08051789d | 1 year ago |
|
|
794a737b6d | 1 year ago |
|
|
b1ef29fadf | 1 year ago |
|
|
0475fc81ed | 1 year ago |
|
|
6aefb603ae | 1 year ago |
|
|
92bdefcf9d | 1 year ago |
|
|
576de54ef8 | 1 year ago |
|
|
319225d645 | 1 year ago |
|
|
9addea65d6 | 1 year ago |
|
|
95c43a06d5 | 1 year ago |
|
|
72c7317672 | 1 year ago |
|
|
1cec3e5436 | 1 year ago |
|
|
6c18056cef | 1 year ago |
|
|
f4b678083d | 1 year ago |
|
|
50eb6f7b7e | 1 year ago |
|
|
0b6af2549f | 1 year ago |
|
|
f229d95469 | 1 year ago |
|
|
7ba725de6d | 1 year ago |
|
|
677fd51e91 | 1 year ago |
|
|
45b843fadc | 1 year ago |
|
|
9ec62f0be0 | 1 year ago |
|
|
9baba17692 | 1 year ago |
|
|
d86d0a5d5b | 1 year ago |
|
|
543e8e3267 | 1 year ago |
|
|
267dcf8fa7 | 1 year ago |
|
|
fec4594480 | 1 year ago |
|
|
f669df2ff5 | 1 year ago |
|
|
9dfa652125 | 1 year ago |
|
|
87f1cd8cdc | 1 year ago |
|
|
f30f8ee563 | 1 year ago |
|
|
64eceba9fa | 1 year ago |
|
|
58e09bdaba | 1 year ago |
|
|
d4e9040ccf | 1 year ago |
|
|
653894cb82 | 1 year ago |
|
|
581cb0c1fe | 1 year ago |
|
|
4e545ca7af | 1 year ago |
|
|
b4050e0335 | 1 year ago |
|
|
1cecd1fe94 | 1 year ago |
|
|
51ed1b2db8 | 1 year ago |
|
|
3e4d712dca | 1 year ago |
|
|
d284b647ab | 1 year ago |
|
|
3bcd05fc5f | 1 year ago |
|
|
b0a1cc48a6 | 1 year ago |
|
|
2eba38b289 | 1 year ago |
|
|
8481fadbd0 | 1 year ago |
|
|
6abcdd8d4b | 1 year ago |
|
|
5df1445e29 | 1 year ago |
|
|
a94adf4d90 | 1 year ago |
|
|
f21aa282dd | 1 year ago |
|
|
8ce6694232 | 1 year ago |
|
|
d8bd51e17e | 1 year ago |
|
|
b1b04d2953 | 1 year ago |
|
|
8852020ca8 | 1 year ago |
|
|
deb4f763d0 | 1 year ago |
|
|
58593de53d | 1 year ago |
|
|
040be87a54 | 1 year ago |
|
|
1703ac39d5 | 1 year ago |
|
|
839869061e | 1 year ago |
|
|
764c65563b | 1 year ago |
|
|
2550b9cac1 | 1 year ago |
|
|
04225170d3 | 1 year ago |
|
|
326a3f78b2 | 1 year ago |
|
|
f86d31f811 | 1 year ago |
|
|
10dac6c0d4 | 1 year ago |
|
|
fece09b781 | 1 year ago |
|
|
6b1fb90584 | 1 year ago |
|
|
5055cfddbd | 1 year ago |
|
|
878d20e612 | 1 year ago |
|
|
336f64712d | 1 year ago |
|
|
56989c6b2f | 1 year ago |
|
|
7b1d3dcd46 | 1 year ago |
|
|
f1e66daf06 | 1 year ago |
|
|
ca087290b9 | 1 year ago |
|
|
883886bc32 | 1 year ago |
|
|
9e60253eb1 | 1 year ago |
|
|
dba85f2bff | 1 year ago |
|
|
e5b852793e | 1 year ago |
|
|
d4cbd86b96 | 1 year ago |
|
|
8d82bacaa3 | 1 year ago |
|
|
4af760c172 | 1 year ago |
|
|
7747bc53b1 | 1 year ago |
|
|
0456a92f15 | 1 year ago |
|
|
677afa9a41 | 1 year ago |
|
|
ebcce4f2ec | 1 year ago |
|
|
91e53e4872 | 1 year ago |
|
|
8bc51b3b79 | 1 year ago |
|
|
733d3ca69f | 1 year ago |
|
|
4a2e465e5d | 1 year ago |
|
|
7ed3c5a175 | 1 year ago |
|
|
8567cedf0a | 1 year ago |
|
|
e02b563bf4 | 1 year ago |
|
|
27d2814ef9 | 1 year ago |
|
|
de95fa2e3e | 1 year ago |
|
|
5a4f9d8914 | 1 year ago |
|
|
23271c4623 | 1 year ago |
|
|
f3d14e101c | 1 year ago |
|
|
275d7f5419 | 1 year ago |
|
|
ac163085e1 | 1 year ago |
|
|
8b4bac3cc2 | 1 year ago |
|
|
35f4db7905 | 1 year ago |
|
|
08b1241a68 | 1 year ago |
|
|
3ffcefaa1b | 1 year ago |
|
|
3b173dc6fc | 1 year ago |
|
|
60f1fb1f70 | 1 year ago |
|
|
f610ae6412 | 1 year ago |
|
|
f80b586081 | 2 years ago |
|
|
7999064dd4 | 2 years ago |
|
|
8c387e7983 | 2 years ago |
|
|
1d29cacf04 | 2 years ago |
|
|
ce4b4d06d0 | 2 years ago |
|
|
79e1d59482 | 2 years ago |
|
|
47e1c0fa89 | 2 years ago |
|
|
3ec23a56ab | 2 years ago |
|
|
a01493e071 | 2 years ago |
|
|
16052210c1 | 2 years ago |
|
|
7dd9658864 | 2 years ago |
|
|
f794f411b7 | 2 years ago |
|
|
94fbbad6f3 | 2 years ago |
|
|
4c5ed57958 | 2 years ago |
|
|
3d5cc5ceff | 2 years ago |
|
|
c506153737 | 2 years ago |
|
|
95ee8a4a16 | 2 years ago |
|
|
3f7b0695f4 | 2 years ago |
|
|
b3bb0939de | 2 years ago |
|
|
08fe54c36d | 2 years ago |
|
|
166c5be5d6 | 2 years ago |
|
|
7ce2a97c1f | 2 years ago |
|
|
b23e241973 | 2 years ago |
|
|
b8b54b7139 | 2 years ago |
|
|
5853e54684 | 2 years ago |
|
|
32e3b07e5d | 2 years ago |
|
|
3b99676e7a | 2 years ago |
|
|
3c829302c7 | 2 years ago |
|
|
b579b01db5 | 2 years ago |
|
|
7db798c420 | 2 years ago |
|
|
77ed11b58e | 2 years ago |
|
|
3ae6ffb8d0 | 2 years ago |
|
|
0e5e4d57c5 | 2 years ago |
|
|
d8cb38a9be | 2 years ago |
|
|
07b0a2da9e | 2 years ago |
|
|
1d040e8291 | 2 years ago |
|
|
797a91a037 | 2 years ago |
|
|
9c0b57835f | 2 years ago |
|
|
72564f5449 | 2 years ago |
|
|
cc18692538 | 2 years ago |
|
|
3e102e9d69 | 2 years ago |
|
|
b9b53bcc91 | 2 years ago |
|
|
00ef8e5cdf | 2 years ago |
|
|
a738591dd0 | 2 years ago |
|
|
85771bcd89 | 2 years ago |
|
|
0150ede4cb | 2 years ago |
|
|
1406165789 | 2 years ago |
|
|
a62eadb581 | 2 years ago |
|
|
197b148fca | 2 years ago |
|
|
fd4a1cda2d | 2 years ago |
|
|
108920c4fd | 2 years ago |
|
|
49c7702707 | 2 years ago |
|
|
15361654b7 | 2 years ago |
|
|
c2b64d40d1 | 2 years ago |
|
|
ce9404da84 | 2 years ago |
|
|
5c55d65eb3 | 2 years ago |
|
|
6f9180545b | 2 years ago |
|
|
e966aa07cd | 2 years ago |
|
|
102993cb10 | 2 years ago |
|
|
d0627b83d0 | 2 years ago |
|
|
a6602a0f5a | 2 years ago |
|
|
55b9a72795 | 2 years ago |
|
|
d4f0c9d116 | 2 years ago |
|
|
bbb3184454 | 2 years ago |
|
|
7d81e68757 | 2 years ago |
|
|
487388c950 | 2 years ago |
|
|
9d507eb10c | 2 years ago |
|
|
cf9b19ffa7 | 2 years ago |
|
|
9591269a68 | 2 years ago |
|
|
27fe426213 | 2 years ago |
|
|
b23d899f5e | 2 years ago |
|
|
8bf0c03fe2 | 2 years ago |
|
|
1ebb298cd7 | 2 years ago |
|
|
9f588ab9fd | 2 years ago |
|
|
91a1198900 | 2 years ago |
|
|
321ac087dc | 2 years ago |
|
|
5d81c030b5 | 2 years ago |
|
|
e798bc7787 | 2 years ago |
|
|
057b053d58 | 2 years ago |
|
|
e9a9ef6b95 | 2 years ago |
|
|
bd7062a479 | 2 years ago |
|
|
a659068ef3 | 2 years ago |
|
|
6f7e1fcfb2 | 2 years ago |
|
|
eff26c8889 | 2 years ago |
|
|
037059d0e6 | 2 years ago |
|
|
9b78a3ecf2 | 2 years ago |
|
|
4df8311e18 | 2 years ago |
|
|
645006fde8 | 2 years ago |
|
|
95bbfefe90 | 2 years ago |
|
|
3181a5860b | 2 years ago |
|
|
39c83444b7 | 2 years ago |
|
|
7356d2036d | 2 years ago |
|
|
a8df8665ae | 2 years ago |
|
|
6355252699 | 2 years ago |
|
|
6ec65e4aa4 | 2 years ago |
|
|
f58bb421e5 | 2 years ago |
|
|
38ecde185a | 2 years ago |
|
|
e3924d5b06 | 2 years ago |
|
|
c1a7fc2624 | 2 years ago |
|
|
818d14fdbb | 2 years ago |
|
|
e93a6865e7 | 2 years ago |
|
|
c6325eef50 | 2 years ago |
|
|
06d6653c78 | 2 years ago |
|
|
aac722909b | 2 years ago |
|
|
78d64713a2 | 2 years ago |
|
|
7d71421c30 | 2 years ago |
|
|
7a571e596d | 2 years ago |
|
|
1718a034ee | 2 years ago |
|
|
5443daabb6 | 2 years ago |
|
|
de4f8ef2f9 | 2 years ago |
|
|
b9fb4a5e93 | 2 years ago |
|
|
3cdd391410 | 2 years ago |
|
|
ad77e8afa4 | 2 years ago |
|
|
c85d17d60d | 2 years ago |
|
|
955c75a99f | 2 years ago |
|
|
d32d1f5044 | 2 years ago |
|
|
091c5247d5 | 2 years ago |
|
|
c593798d83 | 2 years ago |
|
|
edac81f51a | 2 years ago |
|
|
8da3b4b7ac | 2 years ago |
|
|
844e5fdb50 | 2 years ago |
|
|
3f502de1f7 | 2 years ago |
|
|
6532f392b5 | 2 years ago |
|
|
9f340b2dfb | 2 years ago |
|
|
30d34de653 | 2 years ago |
|
|
52329e658f | 2 years ago |
|
|
1c0df02c56 | 2 years ago |
|
|
2061a971b8 | 2 years ago |
|
|
cc62981f12 | 2 years ago |
|
|
613623fa53 | 2 years ago |
|
|
fffdbfdbee | 2 years ago |
|
|
a55a4720fe | 2 years ago |
|
|
42f2813e44 | 2 years ago |
|
|
c58d35288b | 2 years ago |
|
|
f410df40f1 | 2 years ago |
|
|
7e95949ab7 | 2 years ago |
|
|
7c4c3a3c97 | 2 years ago |
|
|
7f25c5f82d | 2 years ago |
|
|
f1939391e8 | 2 years ago |
|
|
d1f9b0d829 | 2 years ago |
|
|
f2354957e6 | 2 years ago |
|
|
600eab20a1 | 2 years ago |
|
|
336c4a4d49 | 2 years ago |
|
|
a1e47edfb2 | 2 years ago |
|
|
5269659c73 | 2 years ago |
|
|
ab1b549a64 | 2 years ago |
|
|
2867dffc5a | 2 years ago |
|
|
6d972a13fe | 2 years ago |
|
|
3918bfafdf | 2 years ago |
|
|
1c15e569bf | 2 years ago |
|
|
5030548500 | 2 years ago |
|
|
c5d3a7b0c1 | 2 years ago |
|
|
75c46130ed | 2 years ago |
|
|
62c17155ca | 2 years ago |
|
|
3a52062ce4 | 2 years ago |
|
|
74ccbdcaee | 2 years ago |
|
|
fbd610349a | 2 years ago |
|
|
8af75d8c6a | 2 years ago |
|
|
0bafd117ff | 2 years ago |
|
|
ae9a7c6090 | 2 years ago |
|
|
481ad02e01 | 2 years ago |
|
|
9042074c50 | 2 years ago |
|
|
821e51ff7d | 2 years ago |
|
|
0f4808f5b5 | 2 years ago |
|
|
aba8a80d8f | 2 years ago |
|
|
2b0edfde60 | 2 years ago |
|
|
01a496768a | 2 years ago |
|
|
82a57cb3c8 | 2 years ago |
|
|
27c07d86bc | 2 years ago |
|
|
e916f2a66e | 2 years ago |
|
|
494ecdfec8 | 2 years ago |
|
|
8a3c0e02f6 | 2 years ago |
|
|
37428bf9c0 | 2 years ago |
|
|
62b4a21cef | 2 years ago |
|
|
b566e4e7e4 | 2 years ago |
|
|
4ff2061bb7 | 2 years ago |
|
|
03d7e138e9 | 2 years ago |
|
|
0540da57e6 | 2 years ago |
|
|
e0e9d25a4f | 2 years ago |
|
|
fd7684866e | 2 years ago |
|
|
7c8b427d2a | 2 years ago |
|
|
4fcc68d149 | 2 years ago |
|
|
ad726a3fd7 | 2 years ago |
|
|
f167a8c8f6 | 2 years ago |
|
|
b404b44008 | 2 years ago |
|
|
c6dc51bb5d | 2 years ago |
|
|
69ee6be246 | 2 years ago |
|
|
e08fab2938 | 2 years ago |
|
|
5db275bce2 | 2 years ago |
|
|
9c05e3f8e8 | 2 years ago |
|
|
ac2c9b8621 | 2 years ago |
|
|
02852ac4e7 | 2 years ago |
|
|
1163541ac5 | 2 years ago |
|
|
2da0c17fe2 | 2 years ago |
|
|
7528480f54 | 2 years ago |
|
|
a45a270479 | 2 years ago |
|
|
380804361b | 2 years ago |
|
|
e072ee8b44 | 2 years ago |
|
|
d812644e61 | 2 years ago |
|
|
71deb11e1f | 2 years ago |
|
|
2e138da3d5 | 2 years ago |
|
|
939b6b1e46 | 2 years ago |
|
|
d937c7e6ab | 2 years ago |
|
|
f91ff0b9d0 | 2 years ago |
|
|
98cbee11b9 | 2 years ago |
|
|
7f0431d493 | 2 years ago |
|
|
3227c53699 | 2 years ago |
|
|
2ee8784d7d | 2 years ago |
|
|
0fac0f450c | 2 years ago |
|
|
b4fb202db4 | 2 years ago |
|
|
93ba163ea2 | 2 years ago |
|
|
bd3ff20146 | 2 years ago |
|
|
b3a0b97f0e | 2 years ago |
|
|
ca212ca692 | 2 years ago |
|
|
3b809202b3 | 2 years ago |
|
|
9858419586 | 2 years ago |
|
|
1f7fe2aed3 | 2 years ago |
|
|
71affd155c | 2 years ago |
|
|
a54f030c4e | 2 years ago |
|
|
3b5a018f8c | 2 years ago |
|
|
8d5fc945d4 | 2 years ago |
|
|
50194df24d | 2 years ago |
|
|
5f771973a8 | 2 years ago |
|
|
4fcfbb374f | 2 years ago |
|
|
853c21e49f | 2 years ago |
|
|
3efb5d8520 | 2 years ago |
|
|
e74985d870 | 2 years ago |
|
|
32eab42c26 | 2 years ago |
|
|
0d3d8232f9 | 2 years ago |
|
|
fd3dc389df | 2 years ago |
|
|
2d274f37ee | 2 years ago |
|
|
d1a12df18f | 2 years ago |
|
|
017a9a58a3 | 2 years ago |
|
|
e33c57f51b | 2 years ago |
|
|
da041df054 | 2 years ago |
|
|
99b57e1297 | 2 years ago |
|
|
6ce8a22514 | 2 years ago |
|
|
a9fc534ea7 | 2 years ago |
|
|
6e04fa1251 | 2 years ago |
|
|
8f851282b4 | 2 years ago |
|
|
d774935a6a | 2 years ago |
|
|
712d42b328 | 2 years ago |
|
|
f66aab03f2 | 2 years ago |
|
|
53ca9c9677 | 2 years ago |
|
|
7bcc624a74 | 2 years ago |
|
|
fa2d73348e | 2 years ago |
|
|
26c3edbc17 | 2 years ago |
|
|
b9d89edfc2 | 2 years ago |
|
|
7ccc6438d5 | 2 years ago |
|
|
cd9f65596b | 2 years ago |
|
|
5404743f17 | 2 years ago |
|
|
c0296d0882 | 2 years ago |
|
|
dec07bd27d | 2 years ago |
|
|
1be1e9843d | 2 years ago |
|
|
5b5afcfe4c | 2 years ago |
|
|
4f5dc9ffad | 2 years ago |
|
|
9c5b00ecf0 | 2 years ago |
|
|
048ba99323 | 2 years ago |
|
|
35bdc15aa9 | 2 years ago |
|
|
b06288e7eb | 2 years ago |
|
|
426c7ad708 | 2 years ago |
|
|
fadf8861e7 | 2 years ago |
|
|
dceedf019a | 2 years ago |
|
|
f49ddf7437 | 2 years ago |
|
|
33a3c8350d | 2 years ago |
|
|
052fa146d2 | 2 years ago |
|
|
1c85782690 | 2 years ago |
|
|
cf5abdf7d3 | 2 years ago |
|
|
df562bedbb | 2 years ago |
|
|
11c1eafa0d | 2 years ago |
|
|
cc8369e02a | 2 years ago |
|
|
cd468df9ad | 2 years ago |
|
|
64666e42e8 | 2 years ago |
|
|
ad7c953d29 | 2 years ago |
|
|
b345efe2d1 | 2 years ago |
|
|
74b8aaa94e | 2 years ago |
|
|
1ace1ba3ec | 2 years ago |
|
|
b822574b70 | 2 years ago |
|
|
466ca0f0e9 | 2 years ago |
|
|
0bcac0c639 | 2 years ago |
|
|
7433fb8fa0 | 2 years ago |
|
|
b1ac1cf238 | 2 years ago |
|
|
a88a861d82 | 2 years ago |
|
|
41ced8edee | 2 years ago |
|
|
0f73f74539 | 2 years ago |
|
|
bb9902e3b2 | 2 years ago |
|
|
c03b0fc981 | 2 years ago |
|
|
e8733f15e4 | 2 years ago |
|
|
26519c71a6 | 2 years ago |
|
|
f923acc5a7 | 2 years ago |
|
|
55b9b6aac4 | 2 years ago |
|
|
52db07a33b | 2 years ago |
|
|
7ed8c9f787 | 2 years ago |
|
|
cc12b193d3 | 2 years ago |
|
|
4d9c51bcd9 | 2 years ago |
|
|
7de48393b6 | 2 years ago |
|
|
283aa92fd5 | 2 years ago |
|
|
9d0393ca72 | 2 years ago |
|
|
c5fc7f76d3 | 2 years ago |
|
|
6b6325895b | 2 years ago |
|
|
39e9f5a2ff | 2 years ago |
|
|
204223e2a8 | 2 years ago |
|
|
b39abcc4a0 | 2 years ago |
|
|
f49e9fa66b | 2 years ago |
|
|
56fd22b43f | 2 years ago |
|
|
0b2bf607f7 | 2 years ago |
|
|
3ff9e69585 | 2 years ago |
|
|
9ceb90204c | 2 years ago |
|
|
ab3c4b2b2d | 2 years ago |
|
|
060ca4b7ef | 2 years ago |
|
|
a7a29ef029 | 2 years ago |
|
|
e7826c2570 | 2 years ago |
|
|
77a733a062 | 2 years ago |
|
|
96bd99650f | 2 years ago |
|
|
2d1899f1f2 | 2 years ago |
|
|
42b1740b0f | 2 years ago |
|
|
fbf613c4e6 | 2 years ago |
|
|
bf18070bc1 | 2 years ago |
|
|
c9c41fdd33 | 2 years ago |
|
|
949d822385 | 2 years ago |
|
|
83b8f28055 | 2 years ago |
|
|
c602d817d9 | 2 years ago |
|
|
a50b217b6f | 2 years ago |
|
|
23c031780f | 2 years ago |
|
|
e3b50d5dfa | 2 years ago |
|
|
9b1bee567f | 2 years ago |
|
|
3534973357 | 2 years ago |
|
|
c4c4bdd547 | 2 years ago |
|
|
528fadceb8 | 2 years ago |
|
|
e15aecaa52 | 2 years ago |
|
|
62e635ebe5 | 2 years ago |
|
|
be846b43ae | 2 years ago |
|
|
7bfe168eee | 2 years ago |
|
|
e8d4a91ad7 | 2 years ago |
|
|
bc1804c030 | 2 years ago |
|
|
d18c9fe0da | 2 years ago |
|
|
a7ea87dd8c | 2 years ago |
|
|
e3a0ab8513 | 2 years ago |
|
|
3a77144a5e | 2 years ago |
|
|
69e311829b | 2 years ago |
|
|
b1effdb7c7 | 2 years ago |
|
|
124537eb18 | 2 years ago |
|
|
b81924b144 | 2 years ago |
|
|
dd18605678 | 2 years ago |
|
|
6bce31d43f | 2 years ago |
|
|
0da5b47ce5 | 2 years ago |
|
|
d0d891b112 | 2 years ago |
|
|
2292c392e9 | 2 years ago |
|
|
cc35aa6bc3 | 2 years ago |
|
|
9e4a124a58 | 2 years ago |
|
|
d63afb0917 | 2 years ago |
|
|
80a3f61a1f | 2 years ago |
|
|
303c817d2d | 2 years ago |
|
|
d9cf94c6b5 | 2 years ago |
|
|
d72414d531 | 2 years ago |
|
|
26be293f24 | 2 years ago |
|
|
36b8633c1e | 2 years ago |
|
|
6bdbf2c65e | 2 years ago |
|
|
80ec615548 | 2 years ago |
|
|
ffc45ff79b | 2 years ago |
|
|
48cb28d9f8 | 2 years ago |
|
|
51da0b62c1 | 2 years ago |
|
|
e391ed52f3 | 2 years ago |
|
|
a5e6e4255d | 2 years ago |
|
|
590e7e3ba3 | 2 years ago |
|
|
d218ad5a67 | 2 years ago |
|
|
350bc0ad58 | 2 years ago |
|
|
a0f9bc032d | 2 years ago |
|
|
4edcd70871 | 2 years ago |
|
|
90c0bf46f4 | 2 years ago |
|
|
9d4fc1980f | 2 years ago |
|
|
332524f1f3 | 2 years ago |
|
|
078b59b1e2 | 2 years ago |
|
|
0551ed5f0b | 2 years ago |
|
|
915d4093b9 | 2 years ago |
|
|
952e9c39ac | 2 years ago |
|
|
3e32a6280a | 2 years ago |
|
|
288b67e250 | 2 years ago |
|
|
7d2f5696f5 | 2 years ago |
|
|
8c3fec0933 | 2 years ago |
|
|
33b00fe65f | 2 years ago |
|
|
f0f50a37b5 | 2 years ago |
|
|
c2b2148190 | 2 years ago |
|
|
f22362dc53 | 2 years ago |
|
|
68cc1d4c4f | 2 years ago |
|
|
0f84ef1e58 | 2 years ago |
|
|
a245574dee | 2 years ago |
|
|
fd90970173 | 2 years ago |
|
|
75a55e4748 | 2 years ago |
|
|
bbd4867830 | 2 years ago |
|
|
3463c8a49e | 2 years ago |
|
|
7829a2ad3b | 2 years ago |
|
|
fb387dbcd9 | 2 years ago |
|
|
cd0b3cd1dc | 2 years ago |
|
|
fe500a27c0 | 2 years ago |
|
|
da860bc250 | 2 years ago |
|
|
e3a8eeb647 | 2 years ago |
|
|
6dbc709f98 | 2 years ago |
|
|
49ca54d68a | 2 years ago |
|
|
e81b8127af | 2 years ago |
|
|
d1b490ed98 | 2 years ago |
|
|
893ed6afd2 | 2 years ago |
|
|
9df2cf5bd7 | 2 years ago |
|
|
b5ceaf4e65 | 2 years ago |
|
|
44ea9fe709 | 2 years ago |
|
|
8174229d28 | 2 years ago |
|
|
f628ed2e1b | 2 years ago |
|
|
c90a0a77bc | 2 years ago |
|
|
10b3f2e65b | 2 years ago |
|
|
9821e93d25 | 2 years ago |
|
|
6c16c9c55f | 2 years ago |
|
|
ab679bccc6 | 2 years ago |
|
|
6fcf3785ef | 2 years ago |
|
|
e605b325c7 | 2 years ago |
|
|
a714d0927e | 2 years ago |
|
|
fe1ef89d30 | 2 years ago |
|
|
639895f511 | 2 years ago |
|
|
4fdc02de35 | 2 years ago |
|
|
103ef11f3d | 2 years ago |
|
|
69e7efe6d1 | 2 years ago |
|
|
83e971d85b | 2 years ago |
|
|
fec60955ed | 2 years ago |
|
|
c5b980a406 | 2 years ago |
|
|
99483268d6 | 2 years ago |
|
|
67fef2cc1c | 2 years ago |
|
|
f450111c1c | 2 years ago |
|
|
718e7eab82 | 2 years ago |
|
|
eb031b00ab | 2 years ago |
|
|
a10c1101ab | 2 years ago |
|
|
9c0c20f86b | 2 years ago |
|
|
c6d1f1b525 | 2 years ago |
|
|
9a84791f5c | 2 years ago |
|
|
14fc02cb23 | 2 years ago |
|
|
39ae6a406c | 2 years ago |
|
|
ba8682f79e | 2 years ago |
|
|
986e4d8fcc | 2 years ago |
|
|
016ced24e0 | 2 years ago |
|
|
b60b2d8355 | 2 years ago |
|
|
f733b85878 | 2 years ago |
|
|
1926a73dee | 2 years ago |
|
|
f39a9f191a | 2 years ago |
|
|
6d8d757798 | 2 years ago |
|
|
81975977ad | 2 years ago |
@ -1,30 +1,31 @@
|
||||
name: ⭐ Feature request
|
||||
description: Suggest a feature to improve a source
|
||||
labels: [feature request]
|
||||
labels: [ feature request ]
|
||||
body:
|
||||
|
||||
- type: textarea
|
||||
id: feature-description
|
||||
attributes:
|
||||
label: Describe your suggested feature
|
||||
description: How can an existing source be improved?
|
||||
placeholder: |
|
||||
Example:
|
||||
"It should work like this..."
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: feature-description
|
||||
attributes:
|
||||
label: Describe your suggested feature
|
||||
description: How can an existing source be improved?
|
||||
placeholder: |
|
||||
Example:
|
||||
"It should work like this..."
|
||||
Please use English language
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: other-details
|
||||
attributes:
|
||||
label: Other details
|
||||
placeholder: |
|
||||
Additional details and attachments.
|
||||
- type: textarea
|
||||
id: other-details
|
||||
attributes:
|
||||
label: Other details
|
||||
placeholder: |
|
||||
Additional details and attachments.
|
||||
|
||||
- type: checkboxes
|
||||
id: acknowledgements
|
||||
attributes:
|
||||
label: Acknowledgements
|
||||
options:
|
||||
- label: I have searched the existing issues and this is a new ticket, **NOT** a duplicate or related to another open issue.
|
||||
required: true
|
||||
- type: checkboxes
|
||||
id: acknowledgements
|
||||
attributes:
|
||||
label: Acknowledgements
|
||||
options:
|
||||
- label: I have searched the existing issues and this is a new ticket, **NOT** a duplicate or related to another open issue.
|
||||
required: true
|
||||
|
||||
@ -1,33 +1,31 @@
|
||||
name: 🗑 Source removal request
|
||||
description: Scanlators can request their site to be removed
|
||||
labels: [source removal]
|
||||
labels: [ source removal ]
|
||||
body:
|
||||
|
||||
- type: input
|
||||
id: link
|
||||
attributes:
|
||||
label: Source link
|
||||
placeholder: |
|
||||
Example: "https://example.org"
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
id: link
|
||||
attributes:
|
||||
label: Source link
|
||||
placeholder: |
|
||||
Example: "https://example.org"
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: other-details
|
||||
attributes:
|
||||
label: Other details
|
||||
placeholder: |
|
||||
Additional details and attachments.
|
||||
- type: textarea
|
||||
id: other-details
|
||||
attributes:
|
||||
label: Other details (reason for removal, etc)
|
||||
placeholder: |
|
||||
Additional details and attachments.
|
||||
|
||||
- type: checkboxes
|
||||
id: requirements
|
||||
attributes:
|
||||
label: Requirements
|
||||
description: Your request will be denied if you don't meet these requirements.
|
||||
options:
|
||||
- label: Proof of ownership/intent to remove sent to a Kotatsu Discord server mod via DM
|
||||
required: true
|
||||
- label: Site only hosts content scanlated by the group and not stolen from other scanlators or official releases (i.e., not an aggregator site)
|
||||
required: true
|
||||
- label: Site is not infested with user-hostile features (e.g., invasive or malicious ads)
|
||||
required: true
|
||||
- type: checkboxes
|
||||
id: requirements
|
||||
attributes:
|
||||
label: Requirements
|
||||
description: Your request will be denied if you don't meet these requirements.
|
||||
options:
|
||||
- label: Proof of ownership of the website is sent to a Kotatsu [Discord server](https://discord.gg/NNJ5RgVBC5) or [Telegram community](https://t.me/kotatsuapp)
|
||||
required: true
|
||||
- label: Site only hosts content scanlated by the group and not stolen from other scanlators or official releases (i.e., not an aggregator site)
|
||||
required: true
|
||||
|
||||
@ -0,0 +1 @@
|
||||
total: 1251
|
||||
@ -0,0 +1,27 @@
|
||||
name: Check & Test latest parsers
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
check-and-build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository 🌏
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||
|
||||
- name: Set up enviroment 🔧
|
||||
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
|
||||
with:
|
||||
java-version: '17'
|
||||
distribution: 'temurin'
|
||||
|
||||
- name: Set up Gradle 📦
|
||||
uses: gradle/actions/setup-gradle@017a9effdb900e5b5b2fddfb590a105619dca3c3 # v4.4.2
|
||||
with:
|
||||
cache-read-only: true
|
||||
|
||||
- name: Compile parsers 🚀
|
||||
run: ./gradlew compileKotlin
|
||||
@ -1,3 +1,8 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# GitHub Copilot persisted chat sessions
|
||||
/copilot/chatSessions
|
||||
|
||||
.name
|
||||
deviceManager.xml
|
||||
|
||||
@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="KotlinJpsPluginSettings">
|
||||
<option name="version" value="1.9.22" />
|
||||
</component>
|
||||
</project>
|
||||
@ -1,72 +0,0 @@
|
||||
import tasks.ReportGenerateTask
|
||||
|
||||
plugins {
|
||||
id 'java-library'
|
||||
id 'org.jetbrains.kotlin.jvm' version '1.9.22'
|
||||
id 'com.google.devtools.ksp' version '1.9.22-1.0.17'
|
||||
id 'maven-publish'
|
||||
}
|
||||
|
||||
group = 'org.koitharu'
|
||||
version = '1.0'
|
||||
|
||||
test {
|
||||
useJUnitPlatform()
|
||||
}
|
||||
|
||||
compileKotlin {
|
||||
kotlinOptions {
|
||||
freeCompilerArgs += [
|
||||
'-opt-in=kotlin.RequiresOptIn',
|
||||
'-opt-in=kotlin.contracts.ExperimentalContracts',
|
||||
'-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi',
|
||||
'-opt-in=org.koitharu.kotatsu.parsers.InternalParsersApi',
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
compileTestKotlin {
|
||||
kotlinOptions {
|
||||
freeCompilerArgs += [
|
||||
'-opt-in=kotlin.RequiresOptIn',
|
||||
'-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi',
|
||||
'-opt-in=org.koitharu.kotatsu.parsers.InternalParsersApi',
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
kotlin {
|
||||
jvmToolchain(8)
|
||||
sourceSets {
|
||||
main.kotlin.srcDirs += 'build/generated/ksp/main/kotlin'
|
||||
}
|
||||
}
|
||||
|
||||
afterEvaluate {
|
||||
publishing {
|
||||
publications {
|
||||
mavenJava(MavenPublication) {
|
||||
from components.java
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3'
|
||||
implementation 'com.squareup.okhttp3:okhttp:4.12.0'
|
||||
implementation 'com.squareup.okio:okio:3.7.0'
|
||||
api 'org.jsoup:jsoup:1.17.2'
|
||||
implementation 'org.json:json:20231013'
|
||||
implementation 'androidx.collection:collection:1.4.0'
|
||||
|
||||
ksp project(':kotatsu-parsers-ksp')
|
||||
|
||||
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.1'
|
||||
testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.10.1'
|
||||
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.10.1'
|
||||
testImplementation 'org.jetbrains.kotlinx:kotlinx-coroutines-test:1.7.3'
|
||||
testImplementation 'io.webfolder:quickjs:1.1.0'
|
||||
}
|
||||
|
||||
tasks.register('generateTestsReport', ReportGenerateTask)
|
||||
@ -0,0 +1,63 @@
|
||||
import tasks.ReportGenerateTask
|
||||
|
||||
plugins {
|
||||
`java-library`
|
||||
`maven-publish`
|
||||
alias(libs.plugins.kotlin.jvm)
|
||||
alias(libs.plugins.ksp)
|
||||
}
|
||||
|
||||
group = "org.koitharu"
|
||||
version = "1.0"
|
||||
|
||||
tasks.test {
|
||||
useJUnitPlatform()
|
||||
}
|
||||
|
||||
ksp {
|
||||
arg("summaryOutputDir", "${projectDir}/.github")
|
||||
}
|
||||
|
||||
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
|
||||
compilerOptions {
|
||||
freeCompilerArgs.addAll(
|
||||
"-opt-in=kotlin.RequiresOptIn",
|
||||
"-opt-in=kotlin.contracts.ExperimentalContracts",
|
||||
"-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi",
|
||||
"-opt-in=org.koitharu.kotatsu.parsers.InternalParsersApi",
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
kotlin {
|
||||
jvmToolchain(8)
|
||||
explicitApiWarning()
|
||||
sourceSets["main"].kotlin.srcDirs("build/generated/ksp/main/kotlin")
|
||||
}
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
create<MavenPublication>("mavenJava") {
|
||||
from(components["java"])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(libs.kotlinx.coroutines.core)
|
||||
implementation(libs.okhttp)
|
||||
implementation(libs.okio)
|
||||
implementation(libs.json)
|
||||
implementation(libs.androidx.collection)
|
||||
api(libs.jsoup)
|
||||
|
||||
ksp(project(":kotatsu-parsers-ksp"))
|
||||
|
||||
testImplementation(libs.junit.api)
|
||||
testImplementation(libs.junit.engine)
|
||||
testImplementation(libs.junit.params)
|
||||
testImplementation(libs.kotlinx.coroutines.test)
|
||||
testImplementation(libs.quickjs)
|
||||
}
|
||||
|
||||
tasks.register<ReportGenerateTask>("generateTestsReport")
|
||||
@ -1,18 +0,0 @@
|
||||
plugins {
|
||||
id 'org.jetbrains.kotlin.jvm' version '1.9.22'
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
kotlin {
|
||||
jvmToolchain(8)
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation gradleApi()
|
||||
implementation 'org.simpleframework:simple-xml:2.7.1'
|
||||
implementation 'com.soywiz.korlibs.korte:korte-jvm:4.0.10'
|
||||
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3'
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
plugins {
|
||||
kotlin("jvm") version "2.2.10"
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
kotlin {
|
||||
jvmToolchain(8)
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(gradleApi())
|
||||
implementation("org.simpleframework:simple-xml:2.7.1")
|
||||
implementation("com.soywiz.korlibs.korte:korte-jvm:4.0.10")
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.10.2")
|
||||
}
|
||||
@ -1,5 +1,6 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
|
||||
distributionSha256Sum=bd71102213493060956ec229d946beee57158dbd89d0e62b91bca0fa2c5f3531
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
||||
@ -0,0 +1,804 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<gaphor xmlns="https://gaphor.org/model" xmlns:Core="https://gaphor.org/modelinglanguage/Core" xmlns:UML="https://gaphor.org/modelinglanguage/UML" xmlns:general="https://gaphor.org/modelinglanguage/general" version="4" gaphor-version="3.1.0">
|
||||
<model>
|
||||
<Core:StyleSheet id="58d6989a-66f8-11ec-b4c8-0456e5e540ed"/>
|
||||
<UML:Package id="58d6c2e8-66f8-11ec-b4c8-0456e5e540ed">
|
||||
<name>
|
||||
<val>Новая модель</val>
|
||||
</name>
|
||||
<ownedDiagram>
|
||||
<reflist>
|
||||
<ref refid="58d6c536-66f8-11ec-b4c8-0456e5e540ed"/>
|
||||
</reflist>
|
||||
</ownedDiagram>
|
||||
<ownedType>
|
||||
<reflist>
|
||||
<ref refid="0b54a350-f59d-11ef-bfb1-4cbb5880a0b8"/>
|
||||
<ref refid="a300f58a-f5bd-11ef-9ec2-4cbb5880a0b8"/>
|
||||
<ref refid="ad4c68d0-f5bd-11ef-9ec2-4cbb5880a0b8"/>
|
||||
<ref refid="198a3108-f5be-11ef-9ec2-4cbb5880a0b8"/>
|
||||
<ref refid="32081654-f5bf-11ef-9ec2-4cbb5880a0b8"/>
|
||||
</reflist>
|
||||
</ownedType>
|
||||
<packagedElement>
|
||||
<reflist>
|
||||
<ref refid="0b54a350-f59d-11ef-bfb1-4cbb5880a0b8"/>
|
||||
<ref refid="a300f58a-f5bd-11ef-9ec2-4cbb5880a0b8"/>
|
||||
<ref refid="ad4c68d0-f5bd-11ef-9ec2-4cbb5880a0b8"/>
|
||||
<ref refid="198a3108-f5be-11ef-9ec2-4cbb5880a0b8"/>
|
||||
<ref refid="32081654-f5bf-11ef-9ec2-4cbb5880a0b8"/>
|
||||
<ref refid="25a17c58-f5be-11ef-9ec2-4cbb5880a0b8"/>
|
||||
<ref refid="41318a02-f5bf-11ef-9ec2-4cbb5880a0b8"/>
|
||||
</reflist>
|
||||
</packagedElement>
|
||||
</UML:Package>
|
||||
<UML:Diagram id="58d6c536-66f8-11ec-b4c8-0456e5e540ed">
|
||||
<element>
|
||||
<ref refid="58d6c2e8-66f8-11ec-b4c8-0456e5e540ed"/>
|
||||
</element>
|
||||
<name>
|
||||
<val>Новая диаграмма</val>
|
||||
</name>
|
||||
<ownedPresentation>
|
||||
<reflist>
|
||||
<ref refid="0b54edc4-f59d-11ef-bfb1-4cbb5880a0b8"/>
|
||||
<ref refid="a3018fc2-f5bd-11ef-9ec2-4cbb5880a0b8"/>
|
||||
<ref refid="ad4d2aae-f5bd-11ef-9ec2-4cbb5880a0b8"/>
|
||||
<ref refid="198aace6-f5be-11ef-9ec2-4cbb5880a0b8"/>
|
||||
<ref refid="320868c0-f5bf-11ef-9ec2-4cbb5880a0b8"/>
|
||||
<ref refid="b760bcd4-f5bf-11ef-9ec2-4cbb5880a0b8"/>
|
||||
<ref refid="bff32eae-f5bf-11ef-9ec2-4cbb5880a0b8"/>
|
||||
<ref refid="d5113ca4-f5bf-11ef-9ec2-4cbb5880a0b8"/>
|
||||
<ref refid="e8042ad8-f5bf-11ef-9ec2-4cbb5880a0b8"/>
|
||||
<ref refid="531831f2-f5c0-11ef-9ec2-4cbb5880a0b8"/>
|
||||
<ref refid="5ccae8d4-f5c0-11ef-9ec2-4cbb5880a0b8"/>
|
||||
<ref refid="b6e0240e-f5bd-11ef-9ec2-4cbb5880a0b8"/>
|
||||
<ref refid="254e40f6-f5be-11ef-9ec2-4cbb5880a0b8"/>
|
||||
<ref refid="2bb6e87a-f5bf-11ef-9ec2-4cbb5880a0b8"/>
|
||||
<ref refid="40e36d2c-f5bf-11ef-9ec2-4cbb5880a0b8"/>
|
||||
<ref refid="bcc07c64-f5bf-11ef-9ec2-4cbb5880a0b8"/>
|
||||
<ref refid="f6b48e4c-f5bf-11ef-9ec2-4cbb5880a0b8"/>
|
||||
<ref refid="f89ba010-f5bf-11ef-9ec2-4cbb5880a0b8"/>
|
||||
<ref refid="fabe0540-f5bf-11ef-9ec2-4cbb5880a0b8"/>
|
||||
<ref refid="6f993af6-f5c0-11ef-9ec2-4cbb5880a0b8"/>
|
||||
</reflist>
|
||||
</ownedPresentation>
|
||||
</UML:Diagram>
|
||||
<UML:Class id="0b54a350-f59d-11ef-bfb1-4cbb5880a0b8">
|
||||
<clientDependency>
|
||||
<reflist>
|
||||
<ref refid="25a17c58-f5be-11ef-9ec2-4cbb5880a0b8"/>
|
||||
</reflist>
|
||||
</clientDependency>
|
||||
<comment>
|
||||
<reflist>
|
||||
<ref refid="bff31afe-f5bf-11ef-9ec2-4cbb5880a0b8"/>
|
||||
</reflist>
|
||||
</comment>
|
||||
<isAbstract>
|
||||
<val>1</val>
|
||||
</isAbstract>
|
||||
<name>
|
||||
<val>AbstractMangaParser</val>
|
||||
</name>
|
||||
<owningPackage>
|
||||
<ref refid="58d6c2e8-66f8-11ec-b4c8-0456e5e540ed"/>
|
||||
</owningPackage>
|
||||
<package>
|
||||
<ref refid="58d6c2e8-66f8-11ec-b4c8-0456e5e540ed"/>
|
||||
</package>
|
||||
<presentation>
|
||||
<reflist>
|
||||
<ref refid="0b54edc4-f59d-11ef-bfb1-4cbb5880a0b8"/>
|
||||
</reflist>
|
||||
</presentation>
|
||||
<specialization>
|
||||
<reflist>
|
||||
<ref refid="b969dac6-f5bd-11ef-9ec2-4cbb5880a0b8"/>
|
||||
<ref refid="2c236356-f5bf-11ef-9ec2-4cbb5880a0b8"/>
|
||||
</reflist>
|
||||
</specialization>
|
||||
</UML:Class>
|
||||
<UML:ClassItem id="0b54edc4-f59d-11ef-bfb1-4cbb5880a0b8">
|
||||
<matrix>
|
||||
<val>(1.0, 0.0, 0.0, 1.0, 405.16796875, 388.8671875)</val>
|
||||
</matrix>
|
||||
<top-left>
|
||||
<val>(0.0, 0.0)</val>
|
||||
</top-left>
|
||||
<width>
|
||||
<val>158.0</val>
|
||||
</width>
|
||||
<height>
|
||||
<val>60.0</val>
|
||||
</height>
|
||||
<diagram>
|
||||
<ref refid="58d6c536-66f8-11ec-b4c8-0456e5e540ed"/>
|
||||
</diagram>
|
||||
<show_attributes>
|
||||
<val>0</val>
|
||||
</show_attributes>
|
||||
<show_operations>
|
||||
<val>0</val>
|
||||
</show_operations>
|
||||
<subject>
|
||||
<ref refid="0b54a350-f59d-11ef-bfb1-4cbb5880a0b8"/>
|
||||
</subject>
|
||||
</UML:ClassItem>
|
||||
<UML:Class id="a300f58a-f5bd-11ef-9ec2-4cbb5880a0b8">
|
||||
<comment>
|
||||
<reflist>
|
||||
<ref refid="d5112a70-f5bf-11ef-9ec2-4cbb5880a0b8"/>
|
||||
</reflist>
|
||||
</comment>
|
||||
<generalization>
|
||||
<reflist>
|
||||
<ref refid="b969dac6-f5bd-11ef-9ec2-4cbb5880a0b8"/>
|
||||
</reflist>
|
||||
</generalization>
|
||||
<isAbstract>
|
||||
<val>1</val>
|
||||
</isAbstract>
|
||||
<name>
|
||||
<val>PagedMangaParser</val>
|
||||
</name>
|
||||
<owningPackage>
|
||||
<ref refid="58d6c2e8-66f8-11ec-b4c8-0456e5e540ed"/>
|
||||
</owningPackage>
|
||||
<package>
|
||||
<ref refid="58d6c2e8-66f8-11ec-b4c8-0456e5e540ed"/>
|
||||
</package>
|
||||
<presentation>
|
||||
<reflist>
|
||||
<ref refid="a3018fc2-f5bd-11ef-9ec2-4cbb5880a0b8"/>
|
||||
</reflist>
|
||||
</presentation>
|
||||
</UML:Class>
|
||||
<UML:ClassItem id="a3018fc2-f5bd-11ef-9ec2-4cbb5880a0b8">
|
||||
<matrix>
|
||||
<val>(1.0, 0.0, 0.0, 1.0, 476.3368367667698, 525.76953125)</val>
|
||||
</matrix>
|
||||
<top-left>
|
||||
<val>(0.0, 0.0)</val>
|
||||
</top-left>
|
||||
<width>
|
||||
<val>142.0</val>
|
||||
</width>
|
||||
<height>
|
||||
<val>60.0</val>
|
||||
</height>
|
||||
<diagram>
|
||||
<ref refid="58d6c536-66f8-11ec-b4c8-0456e5e540ed"/>
|
||||
</diagram>
|
||||
<show_attributes>
|
||||
<val>0</val>
|
||||
</show_attributes>
|
||||
<show_operations>
|
||||
<val>0</val>
|
||||
</show_operations>
|
||||
<subject>
|
||||
<ref refid="a300f58a-f5bd-11ef-9ec2-4cbb5880a0b8"/>
|
||||
</subject>
|
||||
</UML:ClassItem>
|
||||
<UML:Class id="ad4c68d0-f5bd-11ef-9ec2-4cbb5880a0b8">
|
||||
<comment>
|
||||
<reflist>
|
||||
<ref refid="e80418f4-f5bf-11ef-9ec2-4cbb5880a0b8"/>
|
||||
</reflist>
|
||||
</comment>
|
||||
<generalization>
|
||||
<reflist>
|
||||
<ref refid="2c236356-f5bf-11ef-9ec2-4cbb5880a0b8"/>
|
||||
</reflist>
|
||||
</generalization>
|
||||
<isAbstract>
|
||||
<val>1</val>
|
||||
</isAbstract>
|
||||
<name>
|
||||
<val>SinglePageMangaParser</val>
|
||||
</name>
|
||||
<owningPackage>
|
||||
<ref refid="58d6c2e8-66f8-11ec-b4c8-0456e5e540ed"/>
|
||||
</owningPackage>
|
||||
<package>
|
||||
<ref refid="58d6c2e8-66f8-11ec-b4c8-0456e5e540ed"/>
|
||||
</package>
|
||||
<presentation>
|
||||
<reflist>
|
||||
<ref refid="ad4d2aae-f5bd-11ef-9ec2-4cbb5880a0b8"/>
|
||||
</reflist>
|
||||
</presentation>
|
||||
</UML:Class>
|
||||
<UML:ClassItem id="ad4d2aae-f5bd-11ef-9ec2-4cbb5880a0b8">
|
||||
<matrix>
|
||||
<val>(1.0, 0.0, 0.0, 1.0, 405.16796875, 627.46875)</val>
|
||||
</matrix>
|
||||
<top-left>
|
||||
<val>(0.0, 0.0)</val>
|
||||
</top-left>
|
||||
<width>
|
||||
<val>175.0</val>
|
||||
</width>
|
||||
<height>
|
||||
<val>60.0</val>
|
||||
</height>
|
||||
<diagram>
|
||||
<ref refid="58d6c536-66f8-11ec-b4c8-0456e5e540ed"/>
|
||||
</diagram>
|
||||
<show_attributes>
|
||||
<val>0</val>
|
||||
</show_attributes>
|
||||
<show_operations>
|
||||
<val>0</val>
|
||||
</show_operations>
|
||||
<subject>
|
||||
<ref refid="ad4c68d0-f5bd-11ef-9ec2-4cbb5880a0b8"/>
|
||||
</subject>
|
||||
</UML:ClassItem>
|
||||
<UML:GeneralizationItem id="b6e0240e-f5bd-11ef-9ec2-4cbb5880a0b8">
|
||||
<diagram>
|
||||
<ref refid="58d6c536-66f8-11ec-b4c8-0456e5e540ed"/>
|
||||
</diagram>
|
||||
<horizontal>
|
||||
<val>False</val>
|
||||
</horizontal>
|
||||
<orthogonal>
|
||||
<val>False</val>
|
||||
</orthogonal>
|
||||
<subject>
|
||||
<ref refid="b969dac6-f5bd-11ef-9ec2-4cbb5880a0b8"/>
|
||||
</subject>
|
||||
<matrix>
|
||||
<val>(1.0, 0.0, 0.0, 1.0, 499.2109069824219, 463.45703125)</val>
|
||||
</matrix>
|
||||
<points>
|
||||
<val>[(28.486861756586336, 62.3125), (25.111328125, -14.58984375)]</val>
|
||||
</points>
|
||||
<head-connection>
|
||||
<ref refid="a3018fc2-f5bd-11ef-9ec2-4cbb5880a0b8"/>
|
||||
</head-connection>
|
||||
<tail-connection>
|
||||
<ref refid="0b54edc4-f59d-11ef-bfb1-4cbb5880a0b8"/>
|
||||
</tail-connection>
|
||||
</UML:GeneralizationItem>
|
||||
<UML:Generalization id="b969dac6-f5bd-11ef-9ec2-4cbb5880a0b8">
|
||||
<general>
|
||||
<ref refid="0b54a350-f59d-11ef-bfb1-4cbb5880a0b8"/>
|
||||
</general>
|
||||
<presentation>
|
||||
<reflist>
|
||||
<ref refid="b6e0240e-f5bd-11ef-9ec2-4cbb5880a0b8"/>
|
||||
</reflist>
|
||||
</presentation>
|
||||
<specific>
|
||||
<ref refid="a300f58a-f5bd-11ef-9ec2-4cbb5880a0b8"/>
|
||||
</specific>
|
||||
</UML:Generalization>
|
||||
<UML:Interface id="198a3108-f5be-11ef-9ec2-4cbb5880a0b8">
|
||||
<name>
|
||||
<val>MangaParser</val>
|
||||
</name>
|
||||
<owningPackage>
|
||||
<ref refid="58d6c2e8-66f8-11ec-b4c8-0456e5e540ed"/>
|
||||
</owningPackage>
|
||||
<package>
|
||||
<ref refid="58d6c2e8-66f8-11ec-b4c8-0456e5e540ed"/>
|
||||
</package>
|
||||
<presentation>
|
||||
<reflist>
|
||||
<ref refid="198aace6-f5be-11ef-9ec2-4cbb5880a0b8"/>
|
||||
</reflist>
|
||||
</presentation>
|
||||
<supplierDependency>
|
||||
<reflist>
|
||||
<ref refid="25a17c58-f5be-11ef-9ec2-4cbb5880a0b8"/>
|
||||
<ref refid="41318a02-f5bf-11ef-9ec2-4cbb5880a0b8"/>
|
||||
</reflist>
|
||||
</supplierDependency>
|
||||
</UML:Interface>
|
||||
<UML:InterfaceItem id="198aace6-f5be-11ef-9ec2-4cbb5880a0b8">
|
||||
<matrix>
|
||||
<val>(1.0, 0.0, 0.0, 1.0, 278.00391387939453, 232.92578125)</val>
|
||||
</matrix>
|
||||
<top-left>
|
||||
<val>(0.0, 0.0)</val>
|
||||
</top-left>
|
||||
<width>
|
||||
<val>105.0</val>
|
||||
</width>
|
||||
<height>
|
||||
<val>80.0</val>
|
||||
</height>
|
||||
<diagram>
|
||||
<ref refid="58d6c536-66f8-11ec-b4c8-0456e5e540ed"/>
|
||||
</diagram>
|
||||
<show_attributes>
|
||||
<val>0</val>
|
||||
</show_attributes>
|
||||
<show_operations>
|
||||
<val>0</val>
|
||||
</show_operations>
|
||||
<subject>
|
||||
<ref refid="198a3108-f5be-11ef-9ec2-4cbb5880a0b8"/>
|
||||
</subject>
|
||||
<folded>
|
||||
<val>0</val>
|
||||
</folded>
|
||||
</UML:InterfaceItem>
|
||||
<UML:InterfaceRealizationItem id="254e40f6-f5be-11ef-9ec2-4cbb5880a0b8">
|
||||
<diagram>
|
||||
<ref refid="58d6c536-66f8-11ec-b4c8-0456e5e540ed"/>
|
||||
</diagram>
|
||||
<horizontal>
|
||||
<val>False</val>
|
||||
</horizontal>
|
||||
<orthogonal>
|
||||
<val>False</val>
|
||||
</orthogonal>
|
||||
<subject>
|
||||
<ref refid="25a17c58-f5be-11ef-9ec2-4cbb5880a0b8"/>
|
||||
</subject>
|
||||
<matrix>
|
||||
<val>(1.0, 0.0, 0.0, 1.0, 306.1445007324219, 270.0625)</val>
|
||||
</matrix>
|
||||
<points>
|
||||
<val>[(55.866059373910275, 42.86328125), (164.5765002560883, 118.8046875)]</val>
|
||||
</points>
|
||||
<head-connection>
|
||||
<ref refid="198aace6-f5be-11ef-9ec2-4cbb5880a0b8"/>
|
||||
</head-connection>
|
||||
<tail-connection>
|
||||
<ref refid="0b54edc4-f59d-11ef-bfb1-4cbb5880a0b8"/>
|
||||
</tail-connection>
|
||||
</UML:InterfaceRealizationItem>
|
||||
<UML:InterfaceRealization id="25a17c58-f5be-11ef-9ec2-4cbb5880a0b8">
|
||||
<client>
|
||||
<reflist>
|
||||
<ref refid="0b54a350-f59d-11ef-bfb1-4cbb5880a0b8"/>
|
||||
</reflist>
|
||||
</client>
|
||||
<owningPackage>
|
||||
<ref refid="58d6c2e8-66f8-11ec-b4c8-0456e5e540ed"/>
|
||||
</owningPackage>
|
||||
<presentation>
|
||||
<reflist>
|
||||
<ref refid="254e40f6-f5be-11ef-9ec2-4cbb5880a0b8"/>
|
||||
</reflist>
|
||||
</presentation>
|
||||
<supplier>
|
||||
<reflist>
|
||||
<ref refid="198a3108-f5be-11ef-9ec2-4cbb5880a0b8"/>
|
||||
</reflist>
|
||||
</supplier>
|
||||
</UML:InterfaceRealization>
|
||||
<UML:GeneralizationItem id="2bb6e87a-f5bf-11ef-9ec2-4cbb5880a0b8">
|
||||
<diagram>
|
||||
<ref refid="58d6c536-66f8-11ec-b4c8-0456e5e540ed"/>
|
||||
</diagram>
|
||||
<horizontal>
|
||||
<val>False</val>
|
||||
</horizontal>
|
||||
<orthogonal>
|
||||
<val>False</val>
|
||||
</orthogonal>
|
||||
<subject>
|
||||
<ref refid="2c236356-f5bf-11ef-9ec2-4cbb5880a0b8"/>
|
||||
</subject>
|
||||
<matrix>
|
||||
<val>(1.0, 0.0, 0.0, 1.0, 436.2929382324219, 439.1913757324219)</val>
|
||||
</matrix>
|
||||
<points>
|
||||
<val>[(20.37646032737257, 188.27737426757812), (18.488327026367188, 9.675811767578125)]</val>
|
||||
</points>
|
||||
<head-connection>
|
||||
<ref refid="ad4d2aae-f5bd-11ef-9ec2-4cbb5880a0b8"/>
|
||||
</head-connection>
|
||||
<tail-connection>
|
||||
<ref refid="0b54edc4-f59d-11ef-bfb1-4cbb5880a0b8"/>
|
||||
</tail-connection>
|
||||
</UML:GeneralizationItem>
|
||||
<UML:Generalization id="2c236356-f5bf-11ef-9ec2-4cbb5880a0b8">
|
||||
<general>
|
||||
<ref refid="0b54a350-f59d-11ef-bfb1-4cbb5880a0b8"/>
|
||||
</general>
|
||||
<presentation>
|
||||
<reflist>
|
||||
<ref refid="2bb6e87a-f5bf-11ef-9ec2-4cbb5880a0b8"/>
|
||||
</reflist>
|
||||
</presentation>
|
||||
<specific>
|
||||
<ref refid="ad4c68d0-f5bd-11ef-9ec2-4cbb5880a0b8"/>
|
||||
</specific>
|
||||
</UML:Generalization>
|
||||
<UML:Class id="32081654-f5bf-11ef-9ec2-4cbb5880a0b8">
|
||||
<clientDependency>
|
||||
<reflist>
|
||||
<ref refid="41318a02-f5bf-11ef-9ec2-4cbb5880a0b8"/>
|
||||
</reflist>
|
||||
</clientDependency>
|
||||
<name>
|
||||
<val>MangaParserWrapper</val>
|
||||
</name>
|
||||
<note>
|
||||
<val></val>
|
||||
</note>
|
||||
<owningPackage>
|
||||
<ref refid="58d6c2e8-66f8-11ec-b4c8-0456e5e540ed"/>
|
||||
</owningPackage>
|
||||
<package>
|
||||
<ref refid="58d6c2e8-66f8-11ec-b4c8-0456e5e540ed"/>
|
||||
</package>
|
||||
<presentation>
|
||||
<reflist>
|
||||
<ref refid="320868c0-f5bf-11ef-9ec2-4cbb5880a0b8"/>
|
||||
</reflist>
|
||||
</presentation>
|
||||
</UML:Class>
|
||||
<UML:ClassItem id="320868c0-f5bf-11ef-9ec2-4cbb5880a0b8">
|
||||
<matrix>
|
||||
<val>(1.0, 0.0, 0.0, 1.0, 128.5008992667698, 410.48990205860804)</val>
|
||||
</matrix>
|
||||
<top-left>
|
||||
<val>(0.0, 0.0)</val>
|
||||
</top-left>
|
||||
<width>
|
||||
<val>158.0</val>
|
||||
</width>
|
||||
<height>
|
||||
<val>60.0</val>
|
||||
</height>
|
||||
<diagram>
|
||||
<ref refid="58d6c536-66f8-11ec-b4c8-0456e5e540ed"/>
|
||||
</diagram>
|
||||
<show_attributes>
|
||||
<val>0</val>
|
||||
</show_attributes>
|
||||
<show_operations>
|
||||
<val>0</val>
|
||||
</show_operations>
|
||||
<subject>
|
||||
<ref refid="32081654-f5bf-11ef-9ec2-4cbb5880a0b8"/>
|
||||
</subject>
|
||||
</UML:ClassItem>
|
||||
<UML:InterfaceRealizationItem id="40e36d2c-f5bf-11ef-9ec2-4cbb5880a0b8">
|
||||
<diagram>
|
||||
<ref refid="58d6c536-66f8-11ec-b4c8-0456e5e540ed"/>
|
||||
</diagram>
|
||||
<horizontal>
|
||||
<val>False</val>
|
||||
</horizontal>
|
||||
<orthogonal>
|
||||
<val>False</val>
|
||||
</orthogonal>
|
||||
<subject>
|
||||
<ref refid="41318a02-f5bf-11ef-9ec2-4cbb5880a0b8"/>
|
||||
</subject>
|
||||
<matrix>
|
||||
<val>(1.0, 0.0, 0.0, 1.0, 306.0585632324219, 249.69920349121094)</val>
|
||||
</matrix>
|
||||
<points>
|
||||
<val>[(11.759223915218172, 63.22657775878906), (-98.55766396565207, 160.7906985673971)]</val>
|
||||
</points>
|
||||
<head-connection>
|
||||
<ref refid="198aace6-f5be-11ef-9ec2-4cbb5880a0b8"/>
|
||||
</head-connection>
|
||||
<tail-connection>
|
||||
<ref refid="320868c0-f5bf-11ef-9ec2-4cbb5880a0b8"/>
|
||||
</tail-connection>
|
||||
</UML:InterfaceRealizationItem>
|
||||
<UML:InterfaceRealization id="41318a02-f5bf-11ef-9ec2-4cbb5880a0b8">
|
||||
<client>
|
||||
<reflist>
|
||||
<ref refid="32081654-f5bf-11ef-9ec2-4cbb5880a0b8"/>
|
||||
</reflist>
|
||||
</client>
|
||||
<owningPackage>
|
||||
<ref refid="58d6c2e8-66f8-11ec-b4c8-0456e5e540ed"/>
|
||||
</owningPackage>
|
||||
<presentation>
|
||||
<reflist>
|
||||
<ref refid="40e36d2c-f5bf-11ef-9ec2-4cbb5880a0b8"/>
|
||||
</reflist>
|
||||
</presentation>
|
||||
<supplier>
|
||||
<reflist>
|
||||
<ref refid="198a3108-f5be-11ef-9ec2-4cbb5880a0b8"/>
|
||||
</reflist>
|
||||
</supplier>
|
||||
</UML:InterfaceRealization>
|
||||
<UML:Comment id="b760ac44-f5bf-11ef-9ec2-4cbb5880a0b8">
|
||||
<body>
|
||||
<val>Used for providing external api. Do not use this class directly</val>
|
||||
</body>
|
||||
<presentation>
|
||||
<reflist>
|
||||
<ref refid="b760bcd4-f5bf-11ef-9ec2-4cbb5880a0b8"/>
|
||||
</reflist>
|
||||
</presentation>
|
||||
</UML:Comment>
|
||||
<UML:CommentItem id="b760bcd4-f5bf-11ef-9ec2-4cbb5880a0b8">
|
||||
<matrix>
|
||||
<val>(1.0, 0.0, 0.0, 1.0, 108.0561294327963, 550.1347579956054)</val>
|
||||
</matrix>
|
||||
<top-left>
|
||||
<val>(0.0, 0.0)</val>
|
||||
</top-left>
|
||||
<width>
|
||||
<val>183.21868896484375</val>
|
||||
</width>
|
||||
<height>
|
||||
<val>91.23829650878906</val>
|
||||
</height>
|
||||
<diagram>
|
||||
<ref refid="58d6c536-66f8-11ec-b4c8-0456e5e540ed"/>
|
||||
</diagram>
|
||||
<subject>
|
||||
<ref refid="b760ac44-f5bf-11ef-9ec2-4cbb5880a0b8"/>
|
||||
</subject>
|
||||
</UML:CommentItem>
|
||||
<UML:CommentLineItem id="bcc07c64-f5bf-11ef-9ec2-4cbb5880a0b8">
|
||||
<diagram>
|
||||
<ref refid="58d6c536-66f8-11ec-b4c8-0456e5e540ed"/>
|
||||
</diagram>
|
||||
<horizontal>
|
||||
<val>False</val>
|
||||
</horizontal>
|
||||
<orthogonal>
|
||||
<val>False</val>
|
||||
</orthogonal>
|
||||
<matrix>
|
||||
<val>(1.0, 0.0, 0.0, 1.0, 549.205520203852, 278.05499559311954)</val>
|
||||
</matrix>
|
||||
<points>
|
||||
<val>[(-349.5400462886338, 192.4349064654885), (-349.5400462886338, 272.0797624024858)]</val>
|
||||
</points>
|
||||
<tail-connection>
|
||||
<ref refid="b760bcd4-f5bf-11ef-9ec2-4cbb5880a0b8"/>
|
||||
</tail-connection>
|
||||
</UML:CommentLineItem>
|
||||
<UML:Comment id="bff31afe-f5bf-11ef-9ec2-4cbb5880a0b8">
|
||||
<annotatedElement>
|
||||
<reflist>
|
||||
<ref refid="0b54a350-f59d-11ef-bfb1-4cbb5880a0b8"/>
|
||||
</reflist>
|
||||
</annotatedElement>
|
||||
<body>
|
||||
<val>Extend this class if your manga source provides standard limit-offset based lists (get manga list by offset)</val>
|
||||
</body>
|
||||
<presentation>
|
||||
<reflist>
|
||||
<ref refid="bff32eae-f5bf-11ef-9ec2-4cbb5880a0b8"/>
|
||||
</reflist>
|
||||
</presentation>
|
||||
</UML:Comment>
|
||||
<UML:CommentItem id="bff32eae-f5bf-11ef-9ec2-4cbb5880a0b8">
|
||||
<matrix>
|
||||
<val>(1.0, 0.0, 0.0, 1.0, 673.0610499890082, 367.0515553989646)</val>
|
||||
</matrix>
|
||||
<top-left>
|
||||
<val>(0.0, 0.0)</val>
|
||||
</top-left>
|
||||
<width>
|
||||
<val>228.8028016098773</val>
|
||||
</width>
|
||||
<height>
|
||||
<val>88.0</val>
|
||||
</height>
|
||||
<diagram>
|
||||
<ref refid="58d6c536-66f8-11ec-b4c8-0456e5e540ed"/>
|
||||
</diagram>
|
||||
<subject>
|
||||
<ref refid="bff31afe-f5bf-11ef-9ec2-4cbb5880a0b8"/>
|
||||
</subject>
|
||||
</UML:CommentItem>
|
||||
<UML:Comment id="d5112a70-f5bf-11ef-9ec2-4cbb5880a0b8">
|
||||
<annotatedElement>
|
||||
<reflist>
|
||||
<ref refid="a300f58a-f5bd-11ef-9ec2-4cbb5880a0b8"/>
|
||||
</reflist>
|
||||
</annotatedElement>
|
||||
<body>
|
||||
<val>Extend this class if your manga source provides paged-based lists (get manga list by page number)</val>
|
||||
</body>
|
||||
<presentation>
|
||||
<reflist>
|
||||
<ref refid="d5113ca4-f5bf-11ef-9ec2-4cbb5880a0b8"/>
|
||||
</reflist>
|
||||
</presentation>
|
||||
</UML:Comment>
|
||||
<UML:CommentItem id="d5113ca4-f5bf-11ef-9ec2-4cbb5880a0b8">
|
||||
<matrix>
|
||||
<val>(1.0, 0.0, 0.0, 1.0, 666.7924311664914, 507.7539062499999)</val>
|
||||
</matrix>
|
||||
<top-left>
|
||||
<val>(0.0, 0.0)</val>
|
||||
</top-left>
|
||||
<width>
|
||||
<val>214.34368896484375</val>
|
||||
</width>
|
||||
<height>
|
||||
<val>88.0</val>
|
||||
</height>
|
||||
<diagram>
|
||||
<ref refid="58d6c536-66f8-11ec-b4c8-0456e5e540ed"/>
|
||||
</diagram>
|
||||
<subject>
|
||||
<ref refid="d5112a70-f5bf-11ef-9ec2-4cbb5880a0b8"/>
|
||||
</subject>
|
||||
</UML:CommentItem>
|
||||
<UML:Comment id="e80418f4-f5bf-11ef-9ec2-4cbb5880a0b8">
|
||||
<annotatedElement>
|
||||
<reflist>
|
||||
<ref refid="ad4c68d0-f5bd-11ef-9ec2-4cbb5880a0b8"/>
|
||||
</reflist>
|
||||
</annotatedElement>
|
||||
<body>
|
||||
<val>Extend this class if your manga source does not provide pagination (all manga provided in one list)</val>
|
||||
</body>
|
||||
<presentation>
|
||||
<reflist>
|
||||
<ref refid="e8042ad8-f5bf-11ef-9ec2-4cbb5880a0b8"/>
|
||||
</reflist>
|
||||
</presentation>
|
||||
</UML:Comment>
|
||||
<UML:CommentItem id="e8042ad8-f5bf-11ef-9ec2-4cbb5880a0b8">
|
||||
<matrix>
|
||||
<val>(1.0, 0.0, 0.0, 1.0, 666.7924311664914, 560.9671898788581)</val>
|
||||
</matrix>
|
||||
<top-left>
|
||||
<val>(0.0, 58.00435704705592)</val>
|
||||
</top-left>
|
||||
<width>
|
||||
<val>263.9307954323941</val>
|
||||
</width>
|
||||
<height>
|
||||
<val>78.01706672440287</val>
|
||||
</height>
|
||||
<diagram>
|
||||
<ref refid="58d6c536-66f8-11ec-b4c8-0456e5e540ed"/>
|
||||
</diagram>
|
||||
<subject>
|
||||
<ref refid="e80418f4-f5bf-11ef-9ec2-4cbb5880a0b8"/>
|
||||
</subject>
|
||||
</UML:CommentItem>
|
||||
<UML:CommentLineItem id="f6b48e4c-f5bf-11ef-9ec2-4cbb5880a0b8">
|
||||
<diagram>
|
||||
<ref refid="58d6c536-66f8-11ec-b4c8-0456e5e540ed"/>
|
||||
</diagram>
|
||||
<horizontal>
|
||||
<val>False</val>
|
||||
</horizontal>
|
||||
<orthogonal>
|
||||
<val>False</val>
|
||||
</orthogonal>
|
||||
<matrix>
|
||||
<val>(1.0, 0.0, 0.0, 1.0, 561.8951626340418, 549.6101338901756)</val>
|
||||
</matrix>
|
||||
<points>
|
||||
<val>[(56.44167413272805, 7.038279316310902), (104.89726853244963, 8.304008355003589)]</val>
|
||||
</points>
|
||||
<head-connection>
|
||||
<ref refid="a3018fc2-f5bd-11ef-9ec2-4cbb5880a0b8"/>
|
||||
</head-connection>
|
||||
<tail-connection>
|
||||
<ref refid="d5113ca4-f5bf-11ef-9ec2-4cbb5880a0b8"/>
|
||||
</tail-connection>
|
||||
</UML:CommentLineItem>
|
||||
<UML:CommentLineItem id="f89ba010-f5bf-11ef-9ec2-4cbb5880a0b8">
|
||||
<diagram>
|
||||
<ref refid="58d6c536-66f8-11ec-b4c8-0456e5e540ed"/>
|
||||
</diagram>
|
||||
<horizontal>
|
||||
<val>False</val>
|
||||
</horizontal>
|
||||
<orthogonal>
|
||||
<val>False</val>
|
||||
</orthogonal>
|
||||
<matrix>
|
||||
<val>(1.0, 0.0, 0.0, 1.0, 559.3873501340418, 413.0007588901755)</val>
|
||||
</matrix>
|
||||
<points>
|
||||
<val>[(3.7806186159582467, 0.0), (113.67369985496646, 1.6012844908540842)]</val>
|
||||
</points>
|
||||
<head-connection>
|
||||
<ref refid="0b54edc4-f59d-11ef-bfb1-4cbb5880a0b8"/>
|
||||
</head-connection>
|
||||
<tail-connection>
|
||||
<ref refid="bff32eae-f5bf-11ef-9ec2-4cbb5880a0b8"/>
|
||||
</tail-connection>
|
||||
</UML:CommentLineItem>
|
||||
<UML:CommentLineItem id="fabe0540-f5bf-11ef-9ec2-4cbb5880a0b8">
|
||||
<diagram>
|
||||
<ref refid="58d6c536-66f8-11ec-b4c8-0456e5e540ed"/>
|
||||
</diagram>
|
||||
<horizontal>
|
||||
<val>False</val>
|
||||
</horizontal>
|
||||
<orthogonal>
|
||||
<val>False</val>
|
||||
</orthogonal>
|
||||
<matrix>
|
||||
<val>(1.0, 0.0, 0.0, 1.0, 522.3600063840418, 652.6882588901756)</val>
|
||||
</matrix>
|
||||
<points>
|
||||
<val>[(57.80796236595825, 5.29182139794003), (144.43242478244963, 5.657840086725969)]</val>
|
||||
</points>
|
||||
<head-connection>
|
||||
<ref refid="ad4d2aae-f5bd-11ef-9ec2-4cbb5880a0b8"/>
|
||||
</head-connection>
|
||||
<tail-connection>
|
||||
<ref refid="e8042ad8-f5bf-11ef-9ec2-4cbb5880a0b8"/>
|
||||
</tail-connection>
|
||||
</UML:CommentLineItem>
|
||||
<general:Box id="531831f2-f5c0-11ef-9ec2-4cbb5880a0b8">
|
||||
<matrix>
|
||||
<val>(1.0, 0.0, 0.0, 1.0, 375.05802564891326, 349.05453145170736)</val>
|
||||
</matrix>
|
||||
<top-left>
|
||||
<val>(0.0, 3.15625)</val>
|
||||
</top-left>
|
||||
<width>
|
||||
<val>590.6594026101285</val>
|
||||
</width>
|
||||
<height>
|
||||
<val>368.44140625</val>
|
||||
</height>
|
||||
<diagram>
|
||||
<ref refid="58d6c536-66f8-11ec-b4c8-0456e5e540ed"/>
|
||||
</diagram>
|
||||
</general:Box>
|
||||
<UML:Comment id="5ccad4ca-f5c0-11ef-9ec2-4cbb5880a0b8">
|
||||
<body>
|
||||
<val>To create your own parser you have to extends one of these classes</val>
|
||||
</body>
|
||||
<presentation>
|
||||
<reflist>
|
||||
<ref refid="5ccae8d4-f5c0-11ef-9ec2-4cbb5880a0b8"/>
|
||||
</reflist>
|
||||
</presentation>
|
||||
</UML:Comment>
|
||||
<UML:CommentItem id="5ccae8d4-f5c0-11ef-9ec2-4cbb5880a0b8">
|
||||
<matrix>
|
||||
<val>(1.0, 0.0, 0.0, 1.0, 756.725301794198, 225.57697659840966)</val>
|
||||
</matrix>
|
||||
<top-left>
|
||||
<val>(0.0, 0.0)</val>
|
||||
</top-left>
|
||||
<width>
|
||||
<val>208.99212646484375</val>
|
||||
</width>
|
||||
<height>
|
||||
<val>73.47482464883183</val>
|
||||
</height>
|
||||
<diagram>
|
||||
<ref refid="58d6c536-66f8-11ec-b4c8-0456e5e540ed"/>
|
||||
</diagram>
|
||||
<subject>
|
||||
<ref refid="5ccad4ca-f5c0-11ef-9ec2-4cbb5880a0b8"/>
|
||||
</subject>
|
||||
</UML:CommentItem>
|
||||
<UML:CommentLineItem id="6f993af6-f5c0-11ef-9ec2-4cbb5880a0b8">
|
||||
<diagram>
|
||||
<ref refid="58d6c536-66f8-11ec-b4c8-0456e5e540ed"/>
|
||||
</diagram>
|
||||
<horizontal>
|
||||
<val>False</val>
|
||||
</horizontal>
|
||||
<orthogonal>
|
||||
<val>False</val>
|
||||
</orthogonal>
|
||||
<matrix>
|
||||
<val>(1.0, 0.0, 0.0, 1.0, 943.6141683885666, 419.2772168262177)</val>
|
||||
</matrix>
|
||||
<points>
|
||||
<val>[(-27.404961772030788, -67.06643537451032), (-27.404961772030788, -120.2254155789762)]</val>
|
||||
</points>
|
||||
<head-connection>
|
||||
<ref refid="531831f2-f5c0-11ef-9ec2-4cbb5880a0b8"/>
|
||||
</head-connection>
|
||||
<tail-connection>
|
||||
<ref refid="5ccae8d4-f5c0-11ef-9ec2-4cbb5880a0b8"/>
|
||||
</tail-connection>
|
||||
</UML:CommentLineItem>
|
||||
</model>
|
||||
</gaphor>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 41 KiB |
@ -1,2 +1,9 @@
|
||||
# Following this blog:
|
||||
# https://proandroiddev.com/how-we-reduced-our-gradle-build-times-by-over-80-51f2b6d6b05b
|
||||
kotlin.code.style=official
|
||||
org.gradle.jvmargs=-Xmx4g -XX:MaxMetaspaceSize=4096m
|
||||
org.gradle.jvmargs=-Xmx4g -XX:MaxMetaspaceSize=4096m -XX:+UseParallelGC
|
||||
org.gradle.vfs.watch=true
|
||||
org.gradle.configureondemand=true
|
||||
org.gradle.parallel=true
|
||||
org.gradle.caching=true
|
||||
org.gradle.unsafe.configuration-cache=true
|
||||
@ -0,0 +1,29 @@
|
||||
[versions]
|
||||
kotlin = "2.2.10"
|
||||
ksp = "2.2.10-2.0.2"
|
||||
coroutines = "1.10.2"
|
||||
junit = "5.10.1"
|
||||
okhttp = "5.1.0"
|
||||
okio = "3.16.0"
|
||||
json = "20240303"
|
||||
androidx-collection = "1.5.0"
|
||||
jsoup = "1.21.2"
|
||||
quickjs = "1.1.0"
|
||||
|
||||
[plugins]
|
||||
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
|
||||
ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" }
|
||||
|
||||
[libraries]
|
||||
ksp-symbol-processing-api = { module = "com.google.devtools.ksp:symbol-processing-api", version.ref = "ksp" }
|
||||
kotlinx-coroutines-core = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-core", version.ref = "coroutines" }
|
||||
kotlinx-coroutines-test = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-test", version.ref = "coroutines" }
|
||||
junit-api = { group = "org.junit.jupiter", name = "junit-jupiter-api", version.ref = "junit" }
|
||||
junit-engine = { group = "org.junit.jupiter", name = "junit-jupiter-engine", version.ref = "junit" }
|
||||
junit-params = { group = "org.junit.jupiter", name = "junit-jupiter-params", version.ref = "junit" }
|
||||
okhttp = { module = "com.squareup.okhttp3:okhttp", version.ref = "okhttp" }
|
||||
okio = { module = "com.squareup.okio:okio", version.ref = "okio" }
|
||||
json = { module = "org.json:json", version.ref = "json" }
|
||||
androidx-collection = { module = "androidx.collection:collection", version.ref = "androidx-collection" }
|
||||
jsoup = { module = "org.jsoup:jsoup", version.ref = "jsoup" }
|
||||
quickjs = { module = "io.webfolder:quickjs", version.ref = "quickjs" }
|
||||
@ -1,5 +1,7 @@
|
||||
#Wed Aug 27 01:56:37 ICT 2025
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
|
||||
distributionSha256Sum=bd71102213493060956ec229d946beee57158dbd89d0e62b91bca0fa2c5f3531
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
||||
@ -1,11 +0,0 @@
|
||||
plugins {
|
||||
id 'org.jetbrains.kotlin.jvm'
|
||||
}
|
||||
|
||||
kotlin {
|
||||
jvmToolchain(8)
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'com.google.devtools.ksp:symbol-processing-api:1.9.22-1.0.17'
|
||||
}
|
||||
@ -0,0 +1,11 @@
|
||||
plugins {
|
||||
alias(libs.plugins.kotlin.jvm)
|
||||
}
|
||||
|
||||
kotlin {
|
||||
jvmToolchain(8)
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(libs.ksp.symbol.processing.api)
|
||||
}
|
||||
@ -1,19 +0,0 @@
|
||||
pluginManagement {
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
gradlePluginPortal()
|
||||
}
|
||||
}
|
||||
|
||||
dependencyResolutionManagement {
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
gradlePluginPortal()
|
||||
}
|
||||
}
|
||||
|
||||
rootProject.name = 'kotatsu-parsers'
|
||||
include 'kotatsu-parsers-ksp'
|
||||
|
||||
@ -0,0 +1,18 @@
|
||||
pluginManagement {
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
gradlePluginPortal()
|
||||
}
|
||||
}
|
||||
|
||||
dependencyResolutionManagement {
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
gradlePluginPortal()
|
||||
}
|
||||
}
|
||||
|
||||
rootProject.name = "kotatsu-parsers"
|
||||
include("kotatsu-parsers-ksp")
|
||||
@ -0,0 +1,14 @@
|
||||
package org.koitharu.kotatsu.parsers
|
||||
|
||||
/**
|
||||
* Annotate [MangaParser] implementation to mark this parser as broken instead of removing it
|
||||
*/
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
@Retention(AnnotationRetention.SOURCE)
|
||||
internal annotation class Broken(
|
||||
|
||||
/**
|
||||
* Reason why this parser is broken
|
||||
*/
|
||||
val message: String = "",
|
||||
)
|
||||
@ -1,14 +1,18 @@
|
||||
package org.koitharu.kotatsu.parsers
|
||||
|
||||
object ErrorMessages {
|
||||
public object ErrorMessages {
|
||||
|
||||
const val FILTER_MULTIPLE_STATES_NOT_SUPPORTED = "Multiple states are not supported by this source"
|
||||
const val FILTER_MULTIPLE_GENRES_NOT_SUPPORTED = "Multiple genres are not supported by this source"
|
||||
const val FILTER_MULTIPLE_CONTENT_RATING_NOT_SUPPORTED =
|
||||
"Multiple Content Rating are not supported by this source"
|
||||
const val FILTER_BOTH_LOCALE_GENRES_NOT_SUPPORTED =
|
||||
"Filtering by both genres and locale is not supported by this source"
|
||||
const val FILTER_BOTH_STATES_GENRES_NOT_SUPPORTED =
|
||||
"Filtering by both genres and states is not supported by this source"
|
||||
const val SEARCH_NOT_SUPPORTED = "Search is not supported by this source"
|
||||
public const val FILTER_MULTIPLE_STATES_NOT_SUPPORTED: String = "Multiple states are not supported by this source"
|
||||
public const val FILTER_MULTIPLE_GENRES_NOT_SUPPORTED: String = "Multiple genres are not supported by this source"
|
||||
public const val FILTER_MULTIPLE_CONTENT_RATING_NOT_SUPPORTED: String =
|
||||
"Multiple Content ratings are not supported by this source"
|
||||
public const val FILTER_MULTIPLE_CONTENT_TYPES_NOT_SUPPORTED: String =
|
||||
"Multiple Content types are not supported by this source"
|
||||
public const val FILTER_MULTIPLE_DEMOGRAPHICS_NOT_SUPPORTED: String =
|
||||
"Multiple Demographics are not supported by this source"
|
||||
public const val FILTER_BOTH_LOCALE_GENRES_NOT_SUPPORTED: String =
|
||||
"Filtering by both genres and locale is not supported by this source"
|
||||
public const val FILTER_BOTH_STATES_GENRES_NOT_SUPPORTED: String =
|
||||
"Filtering by both genres and states is not supported by this source"
|
||||
public const val SEARCH_NOT_SUPPORTED: String = "Search is not supported by this source"
|
||||
}
|
||||
|
||||
@ -1,32 +1,78 @@
|
||||
package org.koitharu.kotatsu.parsers
|
||||
|
||||
import okhttp3.CookieJar
|
||||
import okhttp3.HttpUrl
|
||||
import okhttp3.HttpUrl.Companion.toHttpUrl
|
||||
import okhttp3.OkHttpClient
|
||||
import okhttp3.Response
|
||||
import org.koitharu.kotatsu.parsers.bitmap.Bitmap
|
||||
import org.koitharu.kotatsu.parsers.config.MangaSourceConfig
|
||||
import org.koitharu.kotatsu.parsers.model.MangaParserSource
|
||||
import org.koitharu.kotatsu.parsers.model.MangaSource
|
||||
import org.koitharu.kotatsu.parsers.util.LinkResolver
|
||||
import java.util.*
|
||||
|
||||
abstract class MangaLoaderContext {
|
||||
public abstract class MangaLoaderContext {
|
||||
|
||||
abstract val httpClient: OkHttpClient
|
||||
public abstract val httpClient: OkHttpClient
|
||||
|
||||
abstract val cookieJar: CookieJar
|
||||
public abstract val cookieJar: CookieJar
|
||||
|
||||
@Suppress("DEPRECATION")
|
||||
fun newParserInstance(source: MangaSource): MangaParser = source.newParser(this)
|
||||
public fun newParserInstance(source: MangaParserSource): MangaParser = source.newParser(this)
|
||||
|
||||
open fun encodeBase64(data: ByteArray): String = Base64.getEncoder().encodeToString(data)
|
||||
public fun newLinkResolver(link: HttpUrl): LinkResolver = LinkResolver(this, link)
|
||||
|
||||
open fun decodeBase64(data: String): ByteArray = Base64.getDecoder().decode(data)
|
||||
public fun newLinkResolver(link: String): LinkResolver = newLinkResolver(link.toHttpUrl())
|
||||
|
||||
open fun getPreferredLocales(): List<Locale> = listOf(Locale.getDefault())
|
||||
public open fun encodeBase64(data: ByteArray): String = Base64.getEncoder().encodeToString(data)
|
||||
|
||||
public open fun decodeBase64(data: String): ByteArray = Base64.getDecoder().decode(data)
|
||||
|
||||
public open fun getPreferredLocales(): List<Locale> = listOf(Locale.getDefault())
|
||||
|
||||
/**
|
||||
* Execute JavaScript code and return result
|
||||
* @param script JavaScript source code
|
||||
* @return execution result as string, may be null
|
||||
*/
|
||||
abstract suspend fun evaluateJs(script: String): String?
|
||||
@Deprecated("Provide a base url")
|
||||
public abstract suspend fun evaluateJs(script: String): String?
|
||||
|
||||
/**
|
||||
* Execute JavaScript code and return result
|
||||
* @param script JavaScript source code
|
||||
* @param baseUrl url of page script will be executed in context of
|
||||
* @return execution result as string, may be null
|
||||
*/
|
||||
public abstract suspend fun evaluateJs(baseUrl: String, script: String): String?
|
||||
|
||||
/**
|
||||
* Open [url] in browser for some external action (e.g. captcha solving or non cookie-based authorization)
|
||||
*/
|
||||
public open fun requestBrowserAction(parser: MangaParser, url: String): Nothing {
|
||||
throw UnsupportedOperationException("Browser is not available")
|
||||
}
|
||||
|
||||
public abstract fun getConfig(source: MangaSource): MangaSourceConfig
|
||||
|
||||
abstract fun getConfig(source: MangaSource): MangaSourceConfig
|
||||
public abstract fun getDefaultUserAgent(): String
|
||||
|
||||
/**
|
||||
* Helper function to be used in an interceptor
|
||||
* to descramble images
|
||||
* @param response Image response
|
||||
* @param redraw lambda function to implement descrambling logic
|
||||
*/
|
||||
public abstract fun redrawImageResponse(
|
||||
response: Response,
|
||||
redraw: (image: Bitmap) -> Bitmap,
|
||||
): Response
|
||||
|
||||
/**
|
||||
* create a new empty Bitmap with given dimensions
|
||||
*/
|
||||
public abstract fun createBitmap(
|
||||
width: Int,
|
||||
height: Int,
|
||||
): Bitmap
|
||||
}
|
||||
|
||||
@ -1,253 +1,88 @@
|
||||
package org.koitharu.kotatsu.parsers
|
||||
|
||||
import androidx.annotation.CallSuper
|
||||
import androidx.annotation.VisibleForTesting
|
||||
import okhttp3.Headers
|
||||
import okhttp3.HttpUrl
|
||||
import okhttp3.Interceptor
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.config.MangaSourceConfig
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.network.OkHttpWebClient
|
||||
import org.koitharu.kotatsu.parsers.network.UserAgents
|
||||
import org.koitharu.kotatsu.parsers.network.WebClient
|
||||
import org.koitharu.kotatsu.parsers.util.FaviconParser
|
||||
import org.koitharu.kotatsu.parsers.util.RelatedMangaFinder
|
||||
import org.koitharu.kotatsu.parsers.util.domain
|
||||
import org.koitharu.kotatsu.parsers.util.toAbsoluteUrl
|
||||
import org.koitharu.kotatsu.parsers.model.search.MangaSearchQuery
|
||||
import org.koitharu.kotatsu.parsers.model.search.MangaSearchQueryCapabilities
|
||||
import org.koitharu.kotatsu.parsers.util.LinkResolver
|
||||
import org.koitharu.kotatsu.parsers.util.convertToMangaSearchQuery
|
||||
import org.koitharu.kotatsu.parsers.util.toMangaListFilterCapabilities
|
||||
import java.util.*
|
||||
|
||||
abstract class MangaParser @InternalParsersApi constructor(
|
||||
@property:InternalParsersApi val context: MangaLoaderContext,
|
||||
val source: MangaSource,
|
||||
) {
|
||||
public interface MangaParser : Interceptor {
|
||||
|
||||
/**
|
||||
* Supported [SortOrder] variants. Must not be empty.
|
||||
*
|
||||
* For better performance use [EnumSet] for more than one item.
|
||||
*/
|
||||
abstract val availableSortOrders: Set<SortOrder>
|
||||
public val source: MangaParserSource
|
||||
|
||||
/**
|
||||
* Supported [MangaState] variants for filtering. May be empty.
|
||||
* Supported [SortOrder] variants. Must not be empty.
|
||||
*
|
||||
* For better performance use [EnumSet] for more than one item.
|
||||
*/
|
||||
open val availableStates: Set<MangaState>
|
||||
get() = emptySet()
|
||||
|
||||
|
||||
open val availableContentRating: Set<ContentRating>
|
||||
get() = emptySet()
|
||||
|
||||
/**
|
||||
* Whether parser supports filtering by more than one tag
|
||||
*/
|
||||
open val isMultipleTagsSupported: Boolean = true
|
||||
|
||||
/**
|
||||
* Whether parser supports tagsExclude field in filter
|
||||
*/
|
||||
open val isTagsExclusionSupported: Boolean = false
|
||||
|
||||
/**
|
||||
* Whether parser supports searching by string query using [MangaListFilter.Search]
|
||||
*/
|
||||
open val isSearchSupported: Boolean = true
|
||||
public val availableSortOrders: Set<SortOrder>
|
||||
|
||||
@Deprecated(
|
||||
message = "Use availableSortOrders instead",
|
||||
replaceWith = ReplaceWith("availableSortOrders"),
|
||||
)
|
||||
open val sortOrders: Set<SortOrder>
|
||||
get() = availableSortOrders
|
||||
@Deprecated("Too complex. Use filterCapabilities instead")
|
||||
public val searchQueryCapabilities: MangaSearchQueryCapabilities
|
||||
|
||||
val config by lazy { context.getConfig(source) }
|
||||
public val filterCapabilities: MangaListFilterCapabilities
|
||||
|
||||
open val sourceLocale: Locale
|
||||
get() = source.locale?.let { Locale(it) } ?: Locale.ROOT
|
||||
public val config: MangaSourceConfig
|
||||
|
||||
val isNsfwSource = source.contentType == ContentType.HENTAI
|
||||
public val authorizationProvider: MangaParserAuthProvider?
|
||||
get() = this as? MangaParserAuthProvider
|
||||
|
||||
/**
|
||||
* Provide default domain and available alternatives, if any.
|
||||
*
|
||||
* Never hardcode domain in requests, use [domain] instead.
|
||||
*/
|
||||
@InternalParsersApi
|
||||
abstract val configKeyDomain: ConfigKey.Domain
|
||||
|
||||
open val headers: Headers = Headers.Builder()
|
||||
.add("User-Agent", UserAgents.CHROME_MOBILE)
|
||||
.build()
|
||||
|
||||
/**
|
||||
* Used as fallback if value of `sortOrder` passed to [getList] is null
|
||||
*/
|
||||
@VisibleForTesting(otherwise = VisibleForTesting.PROTECTED)
|
||||
open val defaultSortOrder: SortOrder
|
||||
get() {
|
||||
val supported = availableSortOrders
|
||||
return SortOrder.entries.first { it in supported }
|
||||
}
|
||||
|
||||
@JvmField
|
||||
protected val webClient: WebClient = OkHttpWebClient(context.httpClient, source)
|
||||
public val configKeyDomain: ConfigKey.Domain
|
||||
|
||||
/**
|
||||
* Parse list of manga by specified criteria
|
||||
*
|
||||
* @param offset starting from 0 and used for pagination.
|
||||
* Note than passed value may not be divisible by internal page size, so you should adjust it manually.
|
||||
* @param query search query, may be null or empty if no search needed
|
||||
* @param tags genres for filtering, values from [getAvailableTags] and [Manga.tags]. May be null or empty
|
||||
* @param sortOrder one of [availableSortOrders] or null for default value
|
||||
*/
|
||||
@JvmSynthetic
|
||||
@InternalParsersApi
|
||||
@Deprecated(
|
||||
"Use getList with filter instead",
|
||||
replaceWith = ReplaceWith("getList(offset, filter)"),
|
||||
)
|
||||
open suspend fun getList(
|
||||
offset: Int,
|
||||
query: String?,
|
||||
tags: Set<MangaTag>?,
|
||||
tagsExclude: Set<MangaTag>?,
|
||||
sortOrder: SortOrder,
|
||||
): List<Manga> = throw NotImplementedError("Please implement getList(offset, filter) instead")
|
||||
public val domain: String
|
||||
|
||||
/**
|
||||
* Parse list of manga with search by text query
|
||||
*
|
||||
* @param offset starting from 0 and used for pagination.
|
||||
* @param query search query
|
||||
*/
|
||||
@Deprecated(
|
||||
"Use getList with filter instead",
|
||||
ReplaceWith(
|
||||
"getList(offset, MangaListFilter.Search(query))",
|
||||
"org.koitharu.kotatsu.parsers.model.MangaListFilter",
|
||||
),
|
||||
)
|
||||
open suspend fun getList(offset: Int, query: String): List<Manga> {
|
||||
return getList(offset, MangaListFilter.Search(query))
|
||||
}
|
||||
@Deprecated("Too complex. Use getList with filter instead")
|
||||
public suspend fun getList(query: MangaSearchQuery): List<Manga>
|
||||
|
||||
/**
|
||||
* Parse list of manga by specified criteria
|
||||
*
|
||||
* @param offset starting from 0 and used for pagination.
|
||||
* Note than passed value may not be divisible by internal page size, so you should adjust it manually.
|
||||
* @param tags genres for filtering, values from [getAvailableTags] and [Manga.tags]. May be null or empty
|
||||
* @param sortOrder one of [availableSortOrders] or null for default value
|
||||
*/
|
||||
@Deprecated(
|
||||
"Use getList with filter instead",
|
||||
ReplaceWith(
|
||||
"getList(offset, MangaListFilter.Advanced(sortOrder, tags, null, emptySet()))",
|
||||
"org.koitharu.kotatsu.parsers.model.MangaListFilter",
|
||||
),
|
||||
)
|
||||
open suspend fun getList(
|
||||
offset: Int,
|
||||
tags: Set<MangaTag>?,
|
||||
tagsExclude: Set<MangaTag>?,
|
||||
sortOrder: SortOrder?,
|
||||
): List<Manga> {
|
||||
return getList(
|
||||
offset,
|
||||
MangaListFilter.Advanced(
|
||||
sortOrder = sortOrder ?: defaultSortOrder,
|
||||
tags = tags.orEmpty(),
|
||||
tagsExclude = tagsExclude.orEmpty(),
|
||||
locale = null,
|
||||
states = emptySet(),
|
||||
contentRating = emptySet(),
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
@Suppress("DEPRECATION")
|
||||
open suspend fun getList(offset: Int, filter: MangaListFilter?): List<Manga> {
|
||||
return when (filter) {
|
||||
is MangaListFilter.Advanced -> getList(
|
||||
offset = offset,
|
||||
query = null,
|
||||
tags = filter.tags,
|
||||
tagsExclude = filter.tagsExclude,
|
||||
sortOrder = filter.sortOrder,
|
||||
)
|
||||
|
||||
is MangaListFilter.Search -> getList(
|
||||
offset = offset,
|
||||
query = filter.query,
|
||||
tags = null,
|
||||
tagsExclude = null,
|
||||
sortOrder = defaultSortOrder,
|
||||
)
|
||||
|
||||
null -> getList(
|
||||
offset = offset,
|
||||
query = null,
|
||||
tags = null,
|
||||
tagsExclude = null,
|
||||
sortOrder = defaultSortOrder,
|
||||
)
|
||||
}
|
||||
}
|
||||
public suspend fun getList(offset: Int, order: SortOrder, filter: MangaListFilter): List<Manga>
|
||||
|
||||
/**
|
||||
* Parse details for [Manga]: chapters list, description, large cover, etc.
|
||||
* Must return the same manga, may change any fields excepts id, url and source
|
||||
* @see Manga.copy
|
||||
*/
|
||||
abstract suspend fun getDetails(manga: Manga): Manga
|
||||
public suspend fun getDetails(manga: Manga): Manga
|
||||
|
||||
/**
|
||||
* Parse pages list for specified chapter.
|
||||
* @see MangaPage for details
|
||||
*/
|
||||
abstract suspend fun getPages(chapter: MangaChapter): List<MangaPage>
|
||||
public suspend fun getPages(chapter: MangaChapter): List<MangaPage>
|
||||
|
||||
/**
|
||||
* Fetch direct link to the page image.
|
||||
*/
|
||||
open suspend fun getPageUrl(page: MangaPage): String = page.url.toAbsoluteUrl(domain)
|
||||
public suspend fun getPageUrl(page: MangaPage): String
|
||||
|
||||
/**
|
||||
* Fetch available tags (genres) for source
|
||||
*/
|
||||
abstract suspend fun getAvailableTags(): Set<MangaTag>
|
||||
public suspend fun getFilterOptions(): MangaListFilterOptions
|
||||
|
||||
/**
|
||||
* Fetch available locales for multilingual sources
|
||||
* Parse favicons from the main page of the source`s website
|
||||
*/
|
||||
open suspend fun getAvailableLocales(): Set<Locale> = emptySet()
|
||||
public suspend fun getFavicons(): Favicons
|
||||
|
||||
public fun onCreateConfig(keys: MutableCollection<ConfigKey<*>>)
|
||||
|
||||
public suspend fun getRelatedManga(seed: Manga): List<Manga>
|
||||
|
||||
@Deprecated(
|
||||
message = "Use getAvailableTags instead",
|
||||
replaceWith = ReplaceWith("getAvailableTags()"),
|
||||
)
|
||||
suspend fun getTags(): Set<MangaTag> = getAvailableTags()
|
||||
public fun getRequestHeaders(): Headers
|
||||
|
||||
/**
|
||||
* Parse favicons from the main page of the source`s website
|
||||
* Return [Manga] object by web link to it
|
||||
* @see [Manga.publicUrl]
|
||||
*/
|
||||
open suspend fun getFavicons(): Favicons {
|
||||
return FaviconParser(webClient, domain).parseFavicons()
|
||||
}
|
||||
|
||||
@CallSuper
|
||||
open fun onCreateConfig(keys: MutableCollection<ConfigKey<*>>) {
|
||||
keys.add(configKeyDomain)
|
||||
}
|
||||
|
||||
open suspend fun getRelatedManga(seed: Manga): List<Manga> {
|
||||
return RelatedMangaFinder(listOf(this)).invoke(seed)
|
||||
}
|
||||
|
||||
protected fun getParser(source: MangaSource) = if (this.source == source) {
|
||||
this
|
||||
} else {
|
||||
context.newParserInstance(source)
|
||||
}
|
||||
@InternalParsersApi
|
||||
public suspend fun resolveLink(resolver: LinkResolver, link: HttpUrl): Manga?
|
||||
}
|
||||
|
||||
@ -1,89 +0,0 @@
|
||||
package org.koitharu.kotatsu.parsers
|
||||
|
||||
import androidx.annotation.RestrictTo
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.util.Paginator
|
||||
|
||||
@InternalParsersApi
|
||||
abstract class PagedMangaParser(
|
||||
context: MangaLoaderContext,
|
||||
source: MangaSource,
|
||||
@RestrictTo(RestrictTo.Scope.TESTS) @JvmField internal val pageSize: Int,
|
||||
searchPageSize: Int = pageSize,
|
||||
) : MangaParser(context, source) {
|
||||
|
||||
@JvmField
|
||||
protected val paginator = Paginator(pageSize)
|
||||
|
||||
@JvmField
|
||||
protected val searchPaginator = Paginator(searchPageSize)
|
||||
|
||||
final override suspend fun getList(offset: Int, filter: MangaListFilter?): List<Manga> {
|
||||
return getList(
|
||||
paginator = if (filter is MangaListFilter.Search) {
|
||||
searchPaginator
|
||||
} else {
|
||||
paginator
|
||||
},
|
||||
offset = offset,
|
||||
filter = filter,
|
||||
)
|
||||
}
|
||||
|
||||
@InternalParsersApi
|
||||
@Deprecated("You should use getListPage for PagedMangaParser", level = DeprecationLevel.HIDDEN)
|
||||
final override suspend fun getList(
|
||||
offset: Int,
|
||||
query: String?,
|
||||
tags: Set<MangaTag>?,
|
||||
tagsExclude: Set<MangaTag>?,
|
||||
sortOrder: SortOrder,
|
||||
): List<Manga> = throw UnsupportedOperationException("You should use getListPage for PagedMangaParser")
|
||||
|
||||
open suspend fun getListPage(
|
||||
page: Int,
|
||||
query: String?,
|
||||
tags: Set<MangaTag>?,
|
||||
tagsExclude: Set<MangaTag>?,
|
||||
sortOrder: SortOrder,
|
||||
): List<Manga> = throw NotImplementedError("Please implement getListPage(page, filter) instead")
|
||||
|
||||
open suspend fun getListPage(page: Int, filter: MangaListFilter?): List<Manga> {
|
||||
return when (filter) {
|
||||
is MangaListFilter.Advanced -> getListPage(
|
||||
page = page,
|
||||
query = null,
|
||||
tags = filter.tags,
|
||||
tagsExclude = filter.tagsExclude,
|
||||
sortOrder = filter.sortOrder,
|
||||
)
|
||||
|
||||
is MangaListFilter.Search -> getListPage(
|
||||
page = page,
|
||||
query = filter.query,
|
||||
tags = null,
|
||||
tagsExclude = null,
|
||||
sortOrder = defaultSortOrder,
|
||||
)
|
||||
|
||||
null -> getListPage(
|
||||
page = page,
|
||||
query = null,
|
||||
tags = null,
|
||||
tagsExclude = null,
|
||||
sortOrder = defaultSortOrder,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
private suspend fun getList(
|
||||
paginator: Paginator,
|
||||
offset: Int,
|
||||
filter: MangaListFilter?,
|
||||
): List<Manga> {
|
||||
val page = paginator.getPage(offset)
|
||||
val list = getListPage(page, filter)
|
||||
paginator.onListReceived(offset, page, list.size)
|
||||
return list
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,9 @@
|
||||
package org.koitharu.kotatsu.parsers.bitmap
|
||||
|
||||
public interface Bitmap {
|
||||
|
||||
public val width: Int
|
||||
public val height: Int
|
||||
|
||||
public fun drawBitmap(sourceBitmap: Bitmap, src: Rect, dst: Rect)
|
||||
}
|
||||
@ -0,0 +1,15 @@
|
||||
package org.koitharu.kotatsu.parsers.bitmap
|
||||
|
||||
public data class Rect(
|
||||
val left: Int = 0,
|
||||
val top: Int = 0,
|
||||
val right: Int = 0,
|
||||
val bottom: Int = 0,
|
||||
) {
|
||||
|
||||
val width: Int
|
||||
get() = right - left
|
||||
|
||||
val height: Int
|
||||
get() = bottom - top
|
||||
}
|
||||
@ -1,6 +1,6 @@
|
||||
package org.koitharu.kotatsu.parsers.config
|
||||
|
||||
interface MangaSourceConfig {
|
||||
public interface MangaSourceConfig {
|
||||
|
||||
operator fun <T> get(key: ConfigKey<T>): T
|
||||
}
|
||||
public operator fun <T> get(key: ConfigKey<T>): T
|
||||
}
|
||||
|
||||
@ -0,0 +1,105 @@
|
||||
package org.koitharu.kotatsu.parsers.core
|
||||
|
||||
import androidx.annotation.CallSuper
|
||||
import okhttp3.Headers
|
||||
import okhttp3.HttpUrl
|
||||
import okhttp3.Interceptor
|
||||
import okhttp3.Response
|
||||
import org.koitharu.kotatsu.parsers.InternalParsersApi
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.MangaParser
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.config.MangaSourceConfig
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.model.search.MangaSearchQuery
|
||||
import org.koitharu.kotatsu.parsers.model.search.MangaSearchQueryCapabilities
|
||||
import org.koitharu.kotatsu.parsers.network.OkHttpWebClient
|
||||
import org.koitharu.kotatsu.parsers.network.WebClient
|
||||
import org.koitharu.kotatsu.parsers.util.*
|
||||
import java.util.*
|
||||
|
||||
@Suppress("OVERRIDE_DEPRECATION")
|
||||
@InternalParsersApi
|
||||
public abstract class AbstractMangaParser @InternalParsersApi constructor(
|
||||
@property:InternalParsersApi public val context: MangaLoaderContext,
|
||||
public final override val source: MangaParserSource,
|
||||
) : MangaParser {
|
||||
|
||||
public final override val searchQueryCapabilities: MangaSearchQueryCapabilities
|
||||
get() = filterCapabilities.toMangaSearchQueryCapabilities()
|
||||
|
||||
public override val config: MangaSourceConfig by lazy { context.getConfig(source) }
|
||||
|
||||
public open val sourceLocale: Locale
|
||||
get() = if (source.locale.isEmpty()) Locale.ROOT else Locale(source.locale)
|
||||
|
||||
protected val sourceContentRating: ContentRating?
|
||||
get() = if (source.contentType == ContentType.HENTAI) {
|
||||
ContentRating.ADULT
|
||||
} else {
|
||||
null
|
||||
}
|
||||
|
||||
protected val isNsfwSource: Boolean = source.contentType == ContentType.HENTAI
|
||||
|
||||
protected open val userAgentKey: ConfigKey.UserAgent = ConfigKey.UserAgent(context.getDefaultUserAgent())
|
||||
|
||||
override fun getRequestHeaders(): Headers = Headers.Builder()
|
||||
.add("User-Agent", config[userAgentKey])
|
||||
.build()
|
||||
|
||||
/**
|
||||
* Used as fallback if value of `order` passed to [getList] is null
|
||||
*/
|
||||
public open val defaultSortOrder: SortOrder
|
||||
get() {
|
||||
val supported = availableSortOrders
|
||||
return SortOrder.entries.first { it in supported }
|
||||
}
|
||||
|
||||
final override val domain: String
|
||||
get() = config[configKeyDomain]
|
||||
|
||||
@JvmField
|
||||
protected val webClient: WebClient = OkHttpWebClient(context.httpClient, source)
|
||||
|
||||
/**
|
||||
* Search list of manga by specified searchQuery
|
||||
*
|
||||
* @param query searchQuery
|
||||
*/
|
||||
public final override suspend fun getList(query: MangaSearchQuery): List<Manga> = getList(
|
||||
offset = query.offset,
|
||||
order = query.order ?: defaultSortOrder,
|
||||
filter = convertToMangaListFilter(query),
|
||||
)
|
||||
|
||||
/**
|
||||
* Fetch direct link to the page image.
|
||||
*/
|
||||
public override suspend fun getPageUrl(page: MangaPage): String = page.url.toAbsoluteUrl(domain)
|
||||
|
||||
/**
|
||||
* Parse favicons from the main page of the source`s website
|
||||
*/
|
||||
public override suspend fun getFavicons(): Favicons {
|
||||
return FaviconParser(webClient, domain).parseFavicons()
|
||||
}
|
||||
|
||||
@CallSuper
|
||||
public override fun onCreateConfig(keys: MutableCollection<ConfigKey<*>>) {
|
||||
keys.add(configKeyDomain)
|
||||
}
|
||||
|
||||
public override suspend fun getRelatedManga(seed: Manga): List<Manga> {
|
||||
return RelatedMangaFinder(listOf(this)).invoke(seed)
|
||||
}
|
||||
|
||||
/**
|
||||
* Return [Manga] object by web link to it
|
||||
* @see [Manga.publicUrl]
|
||||
*/
|
||||
override suspend fun resolveLink(resolver: LinkResolver, link: HttpUrl): Manga? = null
|
||||
|
||||
override fun intercept(chain: Interceptor.Chain): Response = chain.proceed(chain.request())
|
||||
}
|
||||
@ -0,0 +1,94 @@
|
||||
package org.koitharu.kotatsu.parsers.core
|
||||
|
||||
import androidx.annotation.CallSuper
|
||||
import okhttp3.Headers
|
||||
import okhttp3.HttpUrl
|
||||
import okhttp3.Interceptor
|
||||
import okhttp3.Response
|
||||
import org.koitharu.kotatsu.parsers.InternalParsersApi
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.MangaParser
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.config.MangaSourceConfig
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.network.OkHttpWebClient
|
||||
import org.koitharu.kotatsu.parsers.network.WebClient
|
||||
import org.koitharu.kotatsu.parsers.util.*
|
||||
import java.util.*
|
||||
|
||||
@Deprecated("Too complex. Use AbstractMangaParser instead")
|
||||
internal abstract class FlexibleMangaParser @InternalParsersApi constructor(
|
||||
@property:InternalParsersApi val context: MangaLoaderContext,
|
||||
final override val source: MangaParserSource,
|
||||
) : MangaParser {
|
||||
|
||||
override val config: MangaSourceConfig by lazy { context.getConfig(source) }
|
||||
|
||||
open val sourceLocale: Locale
|
||||
get() = if (source.locale.isEmpty()) Locale.ROOT else Locale(source.locale)
|
||||
|
||||
protected open val userAgentKey: ConfigKey.UserAgent = ConfigKey.UserAgent(context.getDefaultUserAgent())
|
||||
|
||||
final override val filterCapabilities: MangaListFilterCapabilities
|
||||
get() = searchQueryCapabilities.toMangaListFilterCapabilities()
|
||||
|
||||
protected val sourceContentRating: ContentRating?
|
||||
get() = if (source.contentType == ContentType.HENTAI) {
|
||||
ContentRating.ADULT
|
||||
} else {
|
||||
null
|
||||
}
|
||||
|
||||
final override val domain: String
|
||||
get() = config[configKeyDomain]
|
||||
|
||||
@Deprecated("Override intercept() instead")
|
||||
override fun getRequestHeaders(): Headers = Headers.Builder()
|
||||
.add("User-Agent", config[userAgentKey])
|
||||
.build()
|
||||
|
||||
/**
|
||||
* Used as fallback if value of `order` passed to [getList] is null
|
||||
*/
|
||||
open val defaultSortOrder: SortOrder
|
||||
get() {
|
||||
val supported = availableSortOrders
|
||||
return SortOrder.entries.first { it in supported }
|
||||
}
|
||||
|
||||
@JvmField
|
||||
protected val webClient: WebClient = OkHttpWebClient(context.httpClient, source)
|
||||
|
||||
/**
|
||||
* Fetch direct link to the page image.
|
||||
*/
|
||||
override suspend fun getPageUrl(page: MangaPage): String = page.url.toAbsoluteUrl(domain)
|
||||
|
||||
final override suspend fun getList(offset: Int, order: SortOrder, filter: MangaListFilter): List<Manga> {
|
||||
return getList(convertToMangaSearchQuery(offset, order, filter))
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse favicons from the main page of the source`s website
|
||||
*/
|
||||
override suspend fun getFavicons(): Favicons {
|
||||
return FaviconParser(webClient, domain).parseFavicons()
|
||||
}
|
||||
|
||||
@CallSuper
|
||||
override fun onCreateConfig(keys: MutableCollection<ConfigKey<*>>) {
|
||||
keys.add(configKeyDomain)
|
||||
}
|
||||
|
||||
override suspend fun getRelatedManga(seed: Manga): List<Manga> {
|
||||
return RelatedMangaFinder(listOf(this)).invoke(seed)
|
||||
}
|
||||
|
||||
/**
|
||||
* Return [Manga] object by web link to it
|
||||
* @see [Manga.publicUrl]
|
||||
*/
|
||||
override suspend fun resolveLink(resolver: LinkResolver, link: HttpUrl): Manga? = null
|
||||
|
||||
override fun intercept(chain: Interceptor.Chain): Response = chain.proceed(chain.request())
|
||||
}
|
||||
@ -0,0 +1,60 @@
|
||||
package org.koitharu.kotatsu.parsers.core
|
||||
|
||||
import androidx.annotation.VisibleForTesting
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.model.Manga
|
||||
import org.koitharu.kotatsu.parsers.model.MangaParserSource
|
||||
import org.koitharu.kotatsu.parsers.model.search.MangaSearchQuery
|
||||
import org.koitharu.kotatsu.parsers.model.search.SearchableField
|
||||
import org.koitharu.kotatsu.parsers.util.Paginator
|
||||
|
||||
@Deprecated("Too complex. Use PagedMangaParser instead")
|
||||
internal abstract class FlexiblePagedMangaParser(
|
||||
context: MangaLoaderContext,
|
||||
source: MangaParserSource,
|
||||
@VisibleForTesting(otherwise = VisibleForTesting.PROTECTED) @JvmField public val pageSize: Int,
|
||||
searchPageSize: Int = pageSize,
|
||||
) : FlexibleMangaParser(context, source) {
|
||||
|
||||
@JvmField
|
||||
protected val paginator: Paginator = Paginator(pageSize)
|
||||
|
||||
@JvmField
|
||||
protected val searchPaginator: Paginator = Paginator(searchPageSize)
|
||||
|
||||
final override suspend fun getList(query: MangaSearchQuery): List<Manga> {
|
||||
var containTitleNameCriteria = false
|
||||
query.criteria.forEach {
|
||||
if (it.field == SearchableField.TITLE_NAME) {
|
||||
containTitleNameCriteria = true
|
||||
}
|
||||
}
|
||||
|
||||
return searchManga(
|
||||
paginator = if (containTitleNameCriteria) {
|
||||
paginator
|
||||
} else {
|
||||
searchPaginator
|
||||
},
|
||||
query = query,
|
||||
)
|
||||
}
|
||||
|
||||
public abstract suspend fun getListPage(query: MangaSearchQuery, page: Int): List<Manga>
|
||||
|
||||
protected fun setFirstPage(firstPage: Int, firstPageForSearch: Int = firstPage) {
|
||||
paginator.firstPage = firstPage
|
||||
searchPaginator.firstPage = firstPageForSearch
|
||||
}
|
||||
|
||||
private suspend fun searchManga(
|
||||
paginator: Paginator,
|
||||
query: MangaSearchQuery,
|
||||
): List<Manga> {
|
||||
val offset: Int = query.offset
|
||||
val page = paginator.getPage(offset)
|
||||
val list = getListPage(query, page)
|
||||
paginator.onListReceived(offset, page, list.size)
|
||||
return list
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,77 @@
|
||||
package org.koitharu.kotatsu.parsers.core
|
||||
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.withContext
|
||||
import okhttp3.Interceptor
|
||||
import okhttp3.Request
|
||||
import okhttp3.Response
|
||||
import org.koitharu.kotatsu.parsers.MangaParser
|
||||
import org.koitharu.kotatsu.parsers.MangaParserAuthProvider
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.model.search.MangaSearchQuery
|
||||
import org.koitharu.kotatsu.parsers.util.mergeWith
|
||||
|
||||
internal class MangaParserWrapper(
|
||||
private val delegate: MangaParser,
|
||||
) : MangaParser by delegate {
|
||||
|
||||
override val authorizationProvider: MangaParserAuthProvider?
|
||||
get() = delegate as? MangaParserAuthProvider
|
||||
|
||||
@Deprecated("Too complex. Use getList with filter instead")
|
||||
override suspend fun getList(query: MangaSearchQuery): List<Manga> = withContext(Dispatchers.Default) {
|
||||
if (!query.skipValidation) {
|
||||
searchQueryCapabilities.validate(query)
|
||||
}
|
||||
delegate.getList(query)
|
||||
}
|
||||
|
||||
override suspend fun getList(
|
||||
offset: Int,
|
||||
order: SortOrder,
|
||||
filter: MangaListFilter,
|
||||
): List<Manga> = withContext(Dispatchers.Default) {
|
||||
delegate.getList(offset, order, filter)
|
||||
}
|
||||
|
||||
override suspend fun getDetails(manga: Manga): Manga = withContext(Dispatchers.Default) {
|
||||
delegate.getDetails(manga)
|
||||
}
|
||||
|
||||
override suspend fun getPages(chapter: MangaChapter): List<MangaPage> = withContext(Dispatchers.Default) {
|
||||
delegate.getPages(chapter)
|
||||
}
|
||||
|
||||
override suspend fun getPageUrl(page: MangaPage): String = withContext(Dispatchers.Default) {
|
||||
delegate.getPageUrl(page)
|
||||
}
|
||||
|
||||
override suspend fun getFilterOptions(): MangaListFilterOptions = withContext(Dispatchers.Default) {
|
||||
delegate.getFilterOptions()
|
||||
}
|
||||
|
||||
override suspend fun getFavicons(): Favicons = withContext(Dispatchers.Default) {
|
||||
delegate.getFavicons()
|
||||
}
|
||||
|
||||
override suspend fun getRelatedManga(seed: Manga): List<Manga> = withContext(Dispatchers.Default) {
|
||||
delegate.getRelatedManga(seed)
|
||||
}
|
||||
|
||||
override fun intercept(chain: Interceptor.Chain): Response {
|
||||
val request = chain.request()
|
||||
val headers = request.headers.newBuilder()
|
||||
.mergeWith(delegate.getRequestHeaders(), replaceExisting = false)
|
||||
.build()
|
||||
val newRequest = request.newBuilder().headers(headers).build()
|
||||
return delegate.intercept(ProxyChain(chain, newRequest))
|
||||
}
|
||||
|
||||
private class ProxyChain(
|
||||
private val delegate: Interceptor.Chain,
|
||||
private val request: Request,
|
||||
) : Interceptor.Chain by delegate {
|
||||
|
||||
override fun request(): Request = request
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,57 @@
|
||||
package org.koitharu.kotatsu.parsers.core
|
||||
|
||||
import androidx.annotation.VisibleForTesting
|
||||
import org.koitharu.kotatsu.parsers.InternalParsersApi
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.model.Manga
|
||||
import org.koitharu.kotatsu.parsers.model.MangaListFilter
|
||||
import org.koitharu.kotatsu.parsers.model.MangaParserSource
|
||||
import org.koitharu.kotatsu.parsers.model.SortOrder
|
||||
import org.koitharu.kotatsu.parsers.util.Paginator
|
||||
|
||||
@InternalParsersApi
|
||||
public abstract class PagedMangaParser(
|
||||
context: MangaLoaderContext,
|
||||
source: MangaParserSource,
|
||||
@VisibleForTesting(otherwise = VisibleForTesting.PROTECTED) @JvmField public val pageSize: Int,
|
||||
searchPageSize: Int = pageSize,
|
||||
) : AbstractMangaParser(context, source) {
|
||||
|
||||
@JvmField
|
||||
protected val paginator: Paginator = Paginator(pageSize)
|
||||
|
||||
@JvmField
|
||||
protected val searchPaginator: Paginator = Paginator(searchPageSize)
|
||||
|
||||
final override suspend fun getList(offset: Int, order: SortOrder, filter: MangaListFilter): List<Manga> {
|
||||
return getList(
|
||||
paginator = if (filter.query.isNullOrEmpty()) {
|
||||
paginator
|
||||
} else {
|
||||
searchPaginator
|
||||
},
|
||||
offset = offset,
|
||||
order = order,
|
||||
filter = filter,
|
||||
)
|
||||
}
|
||||
|
||||
public abstract suspend fun getListPage(page: Int, order: SortOrder, filter: MangaListFilter): List<Manga>
|
||||
|
||||
protected fun setFirstPage(firstPage: Int, firstPageForSearch: Int = firstPage) {
|
||||
paginator.firstPage = firstPage
|
||||
searchPaginator.firstPage = firstPageForSearch
|
||||
}
|
||||
|
||||
private suspend fun getList(
|
||||
paginator: Paginator,
|
||||
offset: Int,
|
||||
order: SortOrder,
|
||||
filter: MangaListFilter,
|
||||
): List<Manga> {
|
||||
val page = paginator.getPage(offset)
|
||||
val list = getListPage(page, order, filter)
|
||||
paginator.onListReceived(offset, page, list.size)
|
||||
return list
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,24 @@
|
||||
package org.koitharu.kotatsu.parsers.core
|
||||
|
||||
import org.koitharu.kotatsu.parsers.InternalParsersApi
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.model.Manga
|
||||
import org.koitharu.kotatsu.parsers.model.MangaListFilter
|
||||
import org.koitharu.kotatsu.parsers.model.MangaParserSource
|
||||
import org.koitharu.kotatsu.parsers.model.SortOrder
|
||||
|
||||
@InternalParsersApi
|
||||
public abstract class SinglePageMangaParser(
|
||||
context: MangaLoaderContext,
|
||||
source: MangaParserSource,
|
||||
) : AbstractMangaParser(context, source) {
|
||||
|
||||
final override suspend fun getList(offset: Int, order: SortOrder, filter: MangaListFilter): List<Manga> {
|
||||
if (offset > 0) {
|
||||
return emptyList()
|
||||
}
|
||||
return getList(order, filter)
|
||||
}
|
||||
|
||||
public abstract suspend fun getList(order: SortOrder, filter: MangaListFilter): List<Manga>
|
||||
}
|
||||
@ -1,12 +1,13 @@
|
||||
package org.koitharu.kotatsu.parsers.exception
|
||||
|
||||
import okio.IOException
|
||||
import org.koitharu.kotatsu.parsers.InternalParsersApi
|
||||
import org.koitharu.kotatsu.parsers.model.MangaSource
|
||||
|
||||
/**
|
||||
* Authorization is required for access to the requested content
|
||||
*/
|
||||
class AuthRequiredException @InternalParsersApi @JvmOverloads constructor(
|
||||
val source: MangaSource,
|
||||
public class AuthRequiredException @InternalParsersApi @JvmOverloads constructor(
|
||||
public val source: MangaSource,
|
||||
cause: Throwable? = null,
|
||||
) : RuntimeException("Authorization required", cause)
|
||||
) : IOException("Authorization required", cause)
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
package org.koitharu.kotatsu.parsers.exception
|
||||
|
||||
class ContentUnavailableException(message: String) : RuntimeException(message)
|
||||
public class ContentUnavailableException(message: String) : RuntimeException(message)
|
||||
|
||||
@ -0,0 +1,31 @@
|
||||
package org.koitharu.kotatsu.parsers.exception
|
||||
|
||||
import okio.IOException
|
||||
import java.time.Instant
|
||||
import java.time.temporal.ChronoUnit
|
||||
|
||||
public class TooManyRequestExceptions(
|
||||
public val url: String,
|
||||
retryAfter: Long,
|
||||
) : IOException("Too man requests") {
|
||||
|
||||
public val retryAt: Instant? = if (retryAfter > 0 && retryAfter < Long.MAX_VALUE) {
|
||||
Instant.now().plusMillis(retryAfter)
|
||||
} else {
|
||||
null
|
||||
}
|
||||
|
||||
public fun getRetryDelay(): Long {
|
||||
if (retryAt == null) {
|
||||
return -1L
|
||||
}
|
||||
return Instant.now().until(retryAt, ChronoUnit.MILLIS).coerceAtLeast(0L)
|
||||
}
|
||||
|
||||
override val message: String?
|
||||
get() = if (retryAt != null) {
|
||||
"${super.message}, retry at $retryAt"
|
||||
} else {
|
||||
super.message
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,10 @@
|
||||
package org.koitharu.kotatsu.parsers.model
|
||||
|
||||
public enum class Demographic {
|
||||
SHOUNEN,
|
||||
SHOUJO,
|
||||
SEINEN,
|
||||
JOSEI,
|
||||
KODOMO,
|
||||
NONE,
|
||||
}
|
||||
@ -1,162 +1,203 @@
|
||||
package org.koitharu.kotatsu.parsers.model
|
||||
|
||||
import org.koitharu.kotatsu.parsers.InternalParsersApi
|
||||
import androidx.collection.ArrayMap
|
||||
import org.koitharu.kotatsu.parsers.util.findById
|
||||
import org.koitharu.kotatsu.parsers.util.nullIfEmpty
|
||||
|
||||
class Manga(
|
||||
public data class Manga(
|
||||
/**
|
||||
* Unique identifier for manga
|
||||
*/
|
||||
@JvmField val id: Long,
|
||||
@JvmField public val id: Long,
|
||||
/**
|
||||
* Manga title, human-readable
|
||||
*/
|
||||
@JvmField val title: String,
|
||||
@JvmField public val title: String,
|
||||
/**
|
||||
* Alternative title (for example on other language), may be null
|
||||
* Alternative titles (for example on other language), may be empty
|
||||
*/
|
||||
@JvmField val altTitle: String?,
|
||||
@JvmField public val altTitles: Set<String>,
|
||||
/**
|
||||
* Relative url to manga (**without** a domain) or any other uri.
|
||||
* Used principally in parsers
|
||||
*/
|
||||
@JvmField val url: String,
|
||||
@JvmField public val url: String,
|
||||
/**
|
||||
* Absolute url to manga, must be ready to open in browser
|
||||
*/
|
||||
@JvmField val publicUrl: String,
|
||||
@JvmField public val publicUrl: String,
|
||||
/**
|
||||
* Normalized manga rating, must be in range of 0..1 or [RATING_UNKNOWN] if rating s unknown
|
||||
* @see hasRating
|
||||
*/
|
||||
@JvmField val rating: Float,
|
||||
@JvmField public val rating: Float,
|
||||
/**
|
||||
* Indicates that manga may contain sensitive information (18+, NSFW)
|
||||
*/
|
||||
@JvmField val isNsfw: Boolean,
|
||||
@JvmField public val contentRating: ContentRating?,
|
||||
/**
|
||||
* Absolute link to the cover
|
||||
* @see largeCoverUrl
|
||||
*/
|
||||
@JvmField val coverUrl: String,
|
||||
@JvmField public val coverUrl: String?,
|
||||
/**
|
||||
* Tags (genres) of the manga
|
||||
*/
|
||||
@JvmField val tags: Set<MangaTag>,
|
||||
@JvmField public val tags: Set<MangaTag>,
|
||||
/**
|
||||
* Manga status (ongoing, finished) or null if unknown
|
||||
*/
|
||||
@JvmField val state: MangaState?,
|
||||
@JvmField public val state: MangaState?,
|
||||
/**
|
||||
* Author of the manga, may be null
|
||||
* Authors of the manga
|
||||
*/
|
||||
@JvmField val author: String?,
|
||||
@JvmField public val authors: Set<String>,
|
||||
/**
|
||||
* Large cover url (absolute), null if is no large cover
|
||||
* @see coverUrl
|
||||
*/
|
||||
@JvmField val largeCoverUrl: String? = null,
|
||||
@JvmField public val largeCoverUrl: String? = null,
|
||||
/**
|
||||
* Manga description, may be html or null
|
||||
*/
|
||||
@JvmField val description: String? = null,
|
||||
@JvmField public val description: String? = null,
|
||||
/**
|
||||
* List of chapters
|
||||
*/
|
||||
@JvmField val chapters: List<MangaChapter>? = null,
|
||||
@JvmField public val chapters: List<MangaChapter>? = null,
|
||||
/**
|
||||
* Manga source
|
||||
*/
|
||||
@JvmField val source: MangaSource,
|
||||
@JvmField public val source: MangaSource,
|
||||
) {
|
||||
|
||||
/**
|
||||
* Return if manga has a specified rating
|
||||
* @see rating
|
||||
*/
|
||||
val hasRating: Boolean
|
||||
get() = rating > 0f && rating <= 1f
|
||||
|
||||
fun getChapters(branch: String?): List<MangaChapter>? {
|
||||
return chapters?.filter { x -> x.branch == branch }
|
||||
}
|
||||
|
||||
@InternalParsersApi
|
||||
fun copy(
|
||||
title: String = this.title,
|
||||
altTitle: String? = this.altTitle,
|
||||
publicUrl: String = this.publicUrl,
|
||||
rating: Float = this.rating,
|
||||
isNsfw: Boolean = this.isNsfw,
|
||||
coverUrl: String = this.coverUrl,
|
||||
tags: Set<MangaTag> = this.tags,
|
||||
state: MangaState? = this.state,
|
||||
author: String? = this.author,
|
||||
largeCoverUrl: String? = this.largeCoverUrl,
|
||||
description: String? = this.description,
|
||||
chapters: List<MangaChapter>? = this.chapters,
|
||||
) = Manga(
|
||||
@Deprecated("Use other constructor")
|
||||
public constructor(
|
||||
/**
|
||||
* Unique identifier for manga
|
||||
*/
|
||||
id: Long,
|
||||
/**
|
||||
* Manga title, human-readable
|
||||
*/
|
||||
title: String,
|
||||
/**
|
||||
* Alternative title (for example on other language), may be null
|
||||
*/
|
||||
altTitle: String?,
|
||||
/**
|
||||
* Relative url to manga (**without** a domain) or any other uri.
|
||||
* Used principally in parsers
|
||||
*/
|
||||
url: String,
|
||||
/**
|
||||
* Absolute url to manga, must be ready to open in browser
|
||||
*/
|
||||
publicUrl: String,
|
||||
/**
|
||||
* Normalized manga rating, must be in range of 0..1 or [RATING_UNKNOWN] if rating s unknown
|
||||
* @see hasRating
|
||||
*/
|
||||
rating: Float,
|
||||
/**
|
||||
* Indicates that manga may contain sensitive information (18+, NSFW)
|
||||
*/
|
||||
isNsfw: Boolean,
|
||||
/**
|
||||
* Absolute link to the cover
|
||||
* @see largeCoverUrl
|
||||
*/
|
||||
coverUrl: String?,
|
||||
/**
|
||||
* Tags (genres) of the manga
|
||||
*/
|
||||
tags: Set<MangaTag>,
|
||||
/**
|
||||
* Manga status (ongoing, finished) or null if unknown
|
||||
*/
|
||||
state: MangaState?,
|
||||
/**
|
||||
* Authors of the manga
|
||||
*/
|
||||
author: String?,
|
||||
/**
|
||||
* Large cover url (absolute), null if is no large cover
|
||||
* @see coverUrl
|
||||
*/
|
||||
largeCoverUrl: String? = null,
|
||||
/**
|
||||
* Manga description, may be html or null
|
||||
*/
|
||||
description: String? = null,
|
||||
/**
|
||||
* List of chapters
|
||||
*/
|
||||
chapters: List<MangaChapter>? = null,
|
||||
/**
|
||||
* Manga source
|
||||
*/
|
||||
source: MangaSource,
|
||||
) : this(
|
||||
id = id,
|
||||
title = title,
|
||||
altTitle = altTitle,
|
||||
altTitles = setOfNotNull(altTitle?.nullIfEmpty()),
|
||||
url = url,
|
||||
publicUrl = publicUrl,
|
||||
rating = rating,
|
||||
isNsfw = isNsfw,
|
||||
coverUrl = coverUrl,
|
||||
contentRating = if (isNsfw) ContentRating.ADULT else null,
|
||||
coverUrl = coverUrl?.nullIfEmpty(),
|
||||
tags = tags,
|
||||
state = state,
|
||||
author = author,
|
||||
largeCoverUrl = largeCoverUrl,
|
||||
description = description,
|
||||
authors = setOfNotNull(author),
|
||||
largeCoverUrl = largeCoverUrl?.nullIfEmpty(),
|
||||
description = description?.nullIfEmpty(),
|
||||
chapters = chapters,
|
||||
source = source
|
||||
source = source,
|
||||
)
|
||||
|
||||
override fun equals(other: Any?): Boolean {
|
||||
if (this === other) return true
|
||||
if (javaClass != other?.javaClass) return false
|
||||
/**
|
||||
* Author of the manga, may be null
|
||||
*/
|
||||
@Deprecated("Please use authors")
|
||||
public val author: String?
|
||||
get() = authors.firstOrNull()
|
||||
|
||||
/**
|
||||
* Alternative title (for example on other language), may be null
|
||||
*/
|
||||
@Deprecated("Please use altTitles")
|
||||
public val altTitle: String?
|
||||
get() = altTitles.firstOrNull()
|
||||
|
||||
other as Manga
|
||||
/**
|
||||
* Return if manga has a specified rating
|
||||
* @see rating
|
||||
*/
|
||||
public val hasRating: Boolean
|
||||
get() = rating > 0f && rating <= 1f
|
||||
|
||||
if (id != other.id) return false
|
||||
if (title != other.title) return false
|
||||
if (altTitle != other.altTitle) return false
|
||||
if (url != other.url) return false
|
||||
if (publicUrl != other.publicUrl) return false
|
||||
if (rating != other.rating) return false
|
||||
if (isNsfw != other.isNsfw) return false
|
||||
if (coverUrl != other.coverUrl) return false
|
||||
if (tags != other.tags) return false
|
||||
if (state != other.state) return false
|
||||
if (author != other.author) return false
|
||||
if (largeCoverUrl != other.largeCoverUrl) return false
|
||||
if (description != other.description) return false
|
||||
if (chapters != other.chapters) return false
|
||||
if (source != other.source) return false
|
||||
@Deprecated("Use contentRating instead", ReplaceWith("contentRating == ContentRating.ADULT"))
|
||||
public val isNsfw: Boolean
|
||||
get() = contentRating == ContentRating.ADULT
|
||||
|
||||
return true
|
||||
public fun getChapters(branch: String?): List<MangaChapter> {
|
||||
return chapters?.filter { x -> x.branch == branch }.orEmpty()
|
||||
}
|
||||
|
||||
override fun hashCode(): Int {
|
||||
var result = id.hashCode()
|
||||
result = 31 * result + title.hashCode()
|
||||
result = 31 * result + (altTitle?.hashCode() ?: 0)
|
||||
result = 31 * result + url.hashCode()
|
||||
result = 31 * result + publicUrl.hashCode()
|
||||
result = 31 * result + rating.hashCode()
|
||||
result = 31 * result + isNsfw.hashCode()
|
||||
result = 31 * result + coverUrl.hashCode()
|
||||
result = 31 * result + tags.hashCode()
|
||||
result = 31 * result + (state?.hashCode() ?: 0)
|
||||
result = 31 * result + (author?.hashCode() ?: 0)
|
||||
result = 31 * result + (largeCoverUrl?.hashCode() ?: 0)
|
||||
result = 31 * result + (description?.hashCode() ?: 0)
|
||||
result = 31 * result + (chapters?.hashCode() ?: 0)
|
||||
result = 31 * result + source.hashCode()
|
||||
return result
|
||||
}
|
||||
public fun findChapterById(id: Long): MangaChapter? = chapters?.findById(id)
|
||||
|
||||
public fun requireChapterById(id: Long): MangaChapter = findChapterById(id)
|
||||
?: throw NoSuchElementException("Chapter with id $id not found")
|
||||
|
||||
override fun toString(): String {
|
||||
return "Manga($id - \"$title\" [$url] - $source)"
|
||||
public fun getBranches(): Map<String?, Int> {
|
||||
if (chapters.isNullOrEmpty()) {
|
||||
return emptyMap()
|
||||
}
|
||||
val result = ArrayMap<String?, Int>()
|
||||
chapters.forEach {
|
||||
val key = it.branch
|
||||
result[key] = result.getOrDefault(key, 0) + 1
|
||||
}
|
||||
return result
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,110 +1,65 @@
|
||||
package org.koitharu.kotatsu.parsers.model
|
||||
|
||||
class MangaChapter(
|
||||
import org.koitharu.kotatsu.parsers.util.formatSimple
|
||||
import org.koitharu.kotatsu.parsers.util.ifNullOrEmpty
|
||||
|
||||
public data class MangaChapter(
|
||||
/**
|
||||
* An unique id of chapter
|
||||
*/
|
||||
@JvmField val id: Long,
|
||||
@JvmField public val id: Long,
|
||||
/**
|
||||
* User-readable name of chapter
|
||||
* User-readable name of chapter if provided by parser or null instead
|
||||
* Do not pass manga title or chapter number here
|
||||
*/
|
||||
@JvmField val name: String,
|
||||
@JvmField public val title: String?,
|
||||
/**
|
||||
* Chapter number starting from 1, 0 if unknown
|
||||
*/
|
||||
@JvmField val number: Float,
|
||||
@JvmField public val number: Float,
|
||||
/**
|
||||
* Volume number starting from 1, 0 if unknown
|
||||
*/
|
||||
@JvmField val volume: Int,
|
||||
@JvmField public val volume: Int,
|
||||
/**
|
||||
* Relative url to chapter (**without** a domain) or any other uri.
|
||||
* Used principally in parsers
|
||||
*/
|
||||
@JvmField val url: String,
|
||||
@JvmField public val url: String,
|
||||
/**
|
||||
* User-readable name of scanlator (releaser) or null if unknown
|
||||
*/
|
||||
@JvmField val scanlator: String?,
|
||||
@JvmField public val scanlator: String?,
|
||||
/**
|
||||
* Chapter upload date in milliseconds
|
||||
*/
|
||||
@JvmField val uploadDate: Long,
|
||||
@JvmField public val uploadDate: Long,
|
||||
/**
|
||||
* User-readable name of branch.
|
||||
* A branch is a group of chapters that overlap (e.g. different languages)
|
||||
*/
|
||||
@JvmField val branch: String?,
|
||||
@JvmField val source: MangaSource,
|
||||
@JvmField public val branch: String?,
|
||||
@JvmField public val source: MangaSource,
|
||||
) {
|
||||
|
||||
@Deprecated(message = "Consider using constructor with volume value")
|
||||
constructor(
|
||||
id: Long,
|
||||
name: String,
|
||||
number: Int,
|
||||
url: String,
|
||||
scanlator: String?,
|
||||
uploadDate: Long,
|
||||
branch: String?,
|
||||
source: MangaSource,
|
||||
) : this(
|
||||
id = id,
|
||||
name = name,
|
||||
number = number.toFloat(),
|
||||
volume = 0,
|
||||
url = url,
|
||||
scanlator = scanlator,
|
||||
uploadDate = uploadDate,
|
||||
branch = branch,
|
||||
source = source,
|
||||
)
|
||||
|
||||
override fun equals(other: Any?): Boolean {
|
||||
if (this === other) return true
|
||||
if (javaClass != other?.javaClass) return false
|
||||
|
||||
other as MangaChapter
|
||||
|
||||
if (id != other.id) return false
|
||||
if (name != other.name) return false
|
||||
if (number != other.number) return false
|
||||
if (volume != other.volume) return false
|
||||
if (url != other.url) return false
|
||||
if (scanlator != other.scanlator) return false
|
||||
if (uploadDate != other.uploadDate) return false
|
||||
if (branch != other.branch) return false
|
||||
if (source != other.source) return false
|
||||
@Deprecated("Use title instead", ReplaceWith("title"))
|
||||
val name: String
|
||||
get() = title.ifNullOrEmpty {
|
||||
buildString {
|
||||
if (volume > 0) append("Vol ").append(volume).append(' ')
|
||||
if (number > 0) append("Chapter ").append(number.formatSimple()) else append("Unnamed")
|
||||
}
|
||||
}
|
||||
|
||||
return true
|
||||
public fun numberString(): String? = if (number > 0f) {
|
||||
number.formatSimple()
|
||||
} else {
|
||||
null
|
||||
}
|
||||
|
||||
override fun hashCode(): Int {
|
||||
var result = id.hashCode()
|
||||
result = 31 * result + name.hashCode()
|
||||
result = 31 * result + number.hashCode()
|
||||
result = 31 * result + volume
|
||||
result = 31 * result + url.hashCode()
|
||||
result = 31 * result + (scanlator?.hashCode() ?: 0)
|
||||
result = 31 * result + uploadDate.hashCode()
|
||||
result = 31 * result + (branch?.hashCode() ?: 0)
|
||||
result = 31 * result + source.hashCode()
|
||||
return result
|
||||
public fun volumeString(): String? = if (volume > 0) {
|
||||
volume.toString()
|
||||
} else {
|
||||
null
|
||||
}
|
||||
|
||||
override fun toString(): String {
|
||||
return "MangaChapter($id - #$number [$url] - $source)"
|
||||
}
|
||||
|
||||
internal fun copy(volume: Int, number: Float) = MangaChapter(
|
||||
id = id,
|
||||
name = name,
|
||||
number = number,
|
||||
volume = volume,
|
||||
url = url,
|
||||
scanlator = scanlator,
|
||||
uploadDate = uploadDate,
|
||||
branch = branch,
|
||||
source = source,
|
||||
)
|
||||
}
|
||||
|
||||
@ -1,93 +1,88 @@
|
||||
package org.koitharu.kotatsu.parsers.model
|
||||
|
||||
import org.koitharu.kotatsu.parsers.MangaParser
|
||||
import java.util.*
|
||||
|
||||
sealed interface MangaListFilter {
|
||||
|
||||
fun isEmpty(): Boolean
|
||||
|
||||
val sortOrder: SortOrder?
|
||||
|
||||
fun isValid(parser: MangaParser): Boolean = when (this) {
|
||||
is Advanced -> (sortOrder in parser.availableSortOrders) &&
|
||||
(tags.size <= 1 || parser.isMultipleTagsSupported) &&
|
||||
(tagsExclude.isEmpty() || parser.isTagsExclusionSupported) &&
|
||||
(contentRating.isEmpty() || parser.availableContentRating.containsAll(contentRating)) &&
|
||||
(states.isEmpty() || parser.availableStates.containsAll(states))
|
||||
|
||||
is Search -> parser.isSearchSupported
|
||||
}
|
||||
|
||||
data class Search(
|
||||
@JvmField val query: String,
|
||||
) : MangaListFilter {
|
||||
|
||||
override val sortOrder: SortOrder? = null
|
||||
|
||||
override fun isEmpty() = query.isBlank()
|
||||
public data class MangaListFilter(
|
||||
@JvmField val query: String? = null,
|
||||
@JvmField val tags: Set<MangaTag> = emptySet(),
|
||||
@JvmField val tagsExclude: Set<MangaTag> = emptySet(),
|
||||
@JvmField val locale: Locale? = null,
|
||||
@JvmField val originalLocale: Locale? = null,
|
||||
@JvmField val states: Set<MangaState> = emptySet(),
|
||||
@JvmField val contentRating: Set<ContentRating> = emptySet(),
|
||||
@JvmField val types: Set<ContentType> = emptySet(),
|
||||
@JvmField val demographics: Set<Demographic> = emptySet(),
|
||||
@JvmField val year: Int = YEAR_UNKNOWN,
|
||||
@JvmField val yearFrom: Int = YEAR_UNKNOWN,
|
||||
@JvmField val yearTo: Int = YEAR_UNKNOWN,
|
||||
@JvmField val author: String? = null,
|
||||
) {
|
||||
|
||||
private fun isNonSearchOptionsEmpty(): Boolean = tags.isEmpty() &&
|
||||
tagsExclude.isEmpty() &&
|
||||
locale == null &&
|
||||
originalLocale == null &&
|
||||
states.isEmpty() &&
|
||||
contentRating.isEmpty() &&
|
||||
year == YEAR_UNKNOWN &&
|
||||
yearFrom == YEAR_UNKNOWN &&
|
||||
yearTo == YEAR_UNKNOWN &&
|
||||
types.isEmpty() &&
|
||||
demographics.isEmpty() &&
|
||||
author.isNullOrEmpty()
|
||||
|
||||
public fun isEmpty(): Boolean = isNonSearchOptionsEmpty() && query.isNullOrEmpty()
|
||||
|
||||
public fun isNotEmpty(): Boolean = !isEmpty()
|
||||
|
||||
public fun hasNonSearchOptions(): Boolean = !isNonSearchOptionsEmpty()
|
||||
|
||||
public companion object {
|
||||
|
||||
@JvmStatic
|
||||
public val EMPTY: MangaListFilter = MangaListFilter()
|
||||
}
|
||||
|
||||
data class Advanced(
|
||||
override val sortOrder: SortOrder,
|
||||
@JvmField val tags: Set<MangaTag>,
|
||||
@JvmField val tagsExclude: Set<MangaTag>,
|
||||
@JvmField val locale: Locale?,
|
||||
@JvmField val states: Set<MangaState>,
|
||||
@JvmField val contentRating: Set<ContentRating>,
|
||||
) : MangaListFilter {
|
||||
|
||||
override fun isEmpty(): Boolean =
|
||||
tags.isEmpty() && tagsExclude.isEmpty() && locale == null && states.isEmpty() && contentRating.isEmpty()
|
||||
|
||||
fun newBuilder() = Builder(sortOrder)
|
||||
.tags(tags)
|
||||
.tagsExclude(tagsExclude)
|
||||
.locale(locale)
|
||||
.states(states)
|
||||
.contentRatings(contentRating)
|
||||
|
||||
class Builder(sortOrder: SortOrder) {
|
||||
|
||||
private var _sortOrder: SortOrder = sortOrder
|
||||
private var _tags: Set<MangaTag>? = null
|
||||
private var _tagsExclude: Set<MangaTag>? = null
|
||||
private var _locale: Locale? = null
|
||||
private var _states: Set<MangaState>? = null
|
||||
private var _contentRating: Set<ContentRating>? = null
|
||||
|
||||
fun sortOrder(order: SortOrder) = apply {
|
||||
_sortOrder = order
|
||||
}
|
||||
|
||||
fun tags(tags: Set<MangaTag>?) = apply {
|
||||
_tags = tags
|
||||
}
|
||||
|
||||
fun tagsExclude(tags: Set<MangaTag>?) = apply {
|
||||
_tagsExclude = tags
|
||||
}
|
||||
|
||||
fun locale(locale: Locale?) = apply {
|
||||
_locale = locale
|
||||
}
|
||||
|
||||
fun states(states: Set<MangaState>?) = apply {
|
||||
_states = states
|
||||
}
|
||||
|
||||
fun contentRatings(rating: Set<ContentRating>?) = apply {
|
||||
_contentRating = rating
|
||||
}
|
||||
|
||||
fun build() = Advanced(
|
||||
sortOrder = _sortOrder,
|
||||
tags = _tags.orEmpty(),
|
||||
tagsExclude = _tagsExclude.orEmpty(),
|
||||
locale = _locale,
|
||||
states = _states.orEmpty(),
|
||||
contentRating = _contentRating.orEmpty(),
|
||||
)
|
||||
}
|
||||
internal class Builder {
|
||||
private var query: String? = null
|
||||
private val tags: MutableSet<MangaTag> = mutableSetOf()
|
||||
private val tagsExclude: MutableSet<MangaTag> = mutableSetOf()
|
||||
private var locale: Locale? = null
|
||||
private var originalLocale: Locale? = null
|
||||
private val states: MutableSet<MangaState> = mutableSetOf()
|
||||
private val contentRating: MutableSet<ContentRating> = mutableSetOf()
|
||||
private val types: MutableSet<ContentType> = mutableSetOf()
|
||||
private val demographics: MutableSet<Demographic> = mutableSetOf()
|
||||
private var year: Int = YEAR_UNKNOWN
|
||||
private var yearFrom: Int = YEAR_UNKNOWN
|
||||
private var yearTo: Int = YEAR_UNKNOWN
|
||||
|
||||
fun query(query: String?): Builder = apply { this.query = query }
|
||||
fun addTag(tag: MangaTag): Builder = apply { tags.add(tag) }
|
||||
fun addTags(tags: Collection<MangaTag>): Builder = apply { this.tags.addAll(tags) }
|
||||
fun excludeTag(tag: MangaTag): Builder = apply { tagsExclude.add(tag) }
|
||||
fun excludeTags(tags: Collection<MangaTag>): Builder = apply { this.tagsExclude.addAll(tags) }
|
||||
fun locale(locale: Locale?): Builder = apply { this.locale = locale }
|
||||
fun originalLocale(locale: Locale?): Builder = apply { this.originalLocale = locale }
|
||||
fun addState(state: MangaState): Builder = apply { states.add(state) }
|
||||
fun addStates(states: Collection<MangaState>): Builder = apply { this.states.addAll(states) }
|
||||
fun addContentRating(rating: ContentRating): Builder = apply { contentRating.add(rating) }
|
||||
fun addContentRatings(ratings: Collection<ContentRating>): Builder =
|
||||
apply { this.contentRating.addAll(ratings) }
|
||||
|
||||
fun addType(type: ContentType): Builder = apply { types.add(type) }
|
||||
fun addTypes(types: Collection<ContentType>): Builder = apply { this.types.addAll(types) }
|
||||
fun addDemographic(demographic: Demographic): Builder = apply { demographics.add(demographic) }
|
||||
fun addDemographics(demographics: Collection<Demographic>): Builder =
|
||||
apply { this.demographics.addAll(demographics) }
|
||||
|
||||
fun year(year: Int): Builder = apply { this.year = year }
|
||||
fun yearFrom(year: Int): Builder = apply { this.yearFrom = year }
|
||||
fun yearTo(year: Int): Builder = apply { this.yearTo = year }
|
||||
|
||||
fun build(): MangaListFilter = MangaListFilter(
|
||||
query, tags, tagsExclude, locale, originalLocale, states,
|
||||
contentRating, types, demographics, year, yearFrom, yearTo,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,56 @@
|
||||
package org.koitharu.kotatsu.parsers.model
|
||||
|
||||
import org.koitharu.kotatsu.parsers.InternalParsersApi
|
||||
|
||||
public data class MangaListFilterCapabilities @InternalParsersApi constructor(
|
||||
|
||||
/**
|
||||
* Whether parser supports filtering by more than one tag
|
||||
* @see [MangaListFilter.tags]
|
||||
* @see [MangaListFilterOptions.availableTags]
|
||||
*/
|
||||
val isMultipleTagsSupported: Boolean = false,
|
||||
|
||||
/**
|
||||
* Whether parser supports tagsExclude field in filter
|
||||
* @see [MangaListFilter.tagsExclude]
|
||||
* @see [MangaListFilterOptions.availableTags]
|
||||
*/
|
||||
val isTagsExclusionSupported: Boolean = false,
|
||||
|
||||
/**
|
||||
* Whether parser supports searching by string query
|
||||
* @see [MangaListFilter.query]
|
||||
*/
|
||||
val isSearchSupported: Boolean = false,
|
||||
|
||||
/**
|
||||
* Whether parser supports searching by string query combined within other filters
|
||||
*/
|
||||
val isSearchWithFiltersSupported: Boolean = false,
|
||||
|
||||
/**
|
||||
* Whether parser supports searching/filtering by year
|
||||
* @see [MangaListFilter.year]
|
||||
*/
|
||||
val isYearSupported: Boolean = false,
|
||||
|
||||
/**
|
||||
* Whether parser supports searching by year range
|
||||
* @see [MangaListFilter.yearFrom] and [MangaListFilter.yearTo]
|
||||
*/
|
||||
val isYearRangeSupported: Boolean = false,
|
||||
|
||||
/**
|
||||
* Whether parser supports searching Original Languages
|
||||
* @see [MangaListFilter.originalLocale]
|
||||
* @see [MangaListFilterOptions.availableLocales]
|
||||
*/
|
||||
val isOriginalLocaleSupported: Boolean = false,
|
||||
|
||||
/**
|
||||
* Whether parser supports searching by author name
|
||||
* @see [MangaListFilter.author]
|
||||
*/
|
||||
val isAuthorSearchSupported: Boolean = false,
|
||||
)
|
||||
@ -0,0 +1,45 @@
|
||||
package org.koitharu.kotatsu.parsers.model
|
||||
|
||||
import org.koitharu.kotatsu.parsers.InternalParsersApi
|
||||
import java.util.*
|
||||
|
||||
public data class MangaListFilterOptions @InternalParsersApi constructor(
|
||||
|
||||
/**
|
||||
* Available tags (genres)
|
||||
*/
|
||||
public val availableTags: Set<MangaTag> = emptySet(),
|
||||
|
||||
/**
|
||||
* Supported [MangaState] variants for filtering. May be empty.
|
||||
*
|
||||
* For better performance use [EnumSet] for more than one item.
|
||||
*/
|
||||
public val availableStates: Set<MangaState> = emptySet(),
|
||||
|
||||
/**
|
||||
* Supported [ContentRating] variants for filtering. May be empty.
|
||||
*
|
||||
* For better performance use [EnumSet] for more than one item.
|
||||
*/
|
||||
public val availableContentRating: Set<ContentRating> = emptySet(),
|
||||
|
||||
/**
|
||||
* Supported [ContentType] variants for filtering. May be empty.
|
||||
*
|
||||
* For better performance use [EnumSet] for more than one item.
|
||||
*/
|
||||
public val availableContentTypes: Set<ContentType> = emptySet(),
|
||||
|
||||
/**
|
||||
* Supported [Demographic] variants for filtering. May be empty.
|
||||
*
|
||||
* For better performance use [EnumSet] for more than one item.
|
||||
*/
|
||||
public val availableDemographics: Set<Demographic> = emptySet(),
|
||||
|
||||
/**
|
||||
* Supported content locales for multilingual sources
|
||||
*/
|
||||
public val availableLocales: Set<Locale> = emptySet(),
|
||||
)
|
||||
@ -0,0 +1,6 @@
|
||||
package org.koitharu.kotatsu.parsers.model
|
||||
|
||||
public interface MangaSource {
|
||||
|
||||
public val name: String
|
||||
}
|
||||
@ -1,5 +1,5 @@
|
||||
package org.koitharu.kotatsu.parsers.model
|
||||
|
||||
enum class MangaState {
|
||||
ONGOING, FINISHED, ABANDONED, PAUSED, UPCOMING
|
||||
public enum class MangaState {
|
||||
ONGOING, FINISHED, ABANDONED, PAUSED, UPCOMING, RESTRICTED
|
||||
}
|
||||
|
||||
@ -1,10 +1,22 @@
|
||||
package org.koitharu.kotatsu.parsers.model
|
||||
|
||||
enum class SortOrder {
|
||||
public enum class SortOrder {
|
||||
UPDATED,
|
||||
UPDATED_ASC,
|
||||
POPULARITY,
|
||||
POPULARITY_ASC,
|
||||
RATING,
|
||||
RATING_ASC,
|
||||
NEWEST,
|
||||
NEWEST_ASC,
|
||||
ALPHABETICAL,
|
||||
ALPHABETICAL_DESC
|
||||
ALPHABETICAL_DESC,
|
||||
ADDED,
|
||||
ADDED_ASC,
|
||||
RELEVANCE,
|
||||
POPULARITY_HOUR,
|
||||
POPULARITY_TODAY,
|
||||
POPULARITY_WEEK,
|
||||
POPULARITY_MONTH,
|
||||
POPULARITY_YEAR,
|
||||
}
|
||||
|
||||
@ -0,0 +1,90 @@
|
||||
package org.koitharu.kotatsu.parsers.model.search
|
||||
|
||||
import androidx.collection.ArrayMap
|
||||
import androidx.collection.ArraySet
|
||||
import org.koitharu.kotatsu.parsers.model.SortOrder
|
||||
|
||||
/**
|
||||
* Represents a search query for filtering and sorting manga search results.
|
||||
* This class is immutable and must be constructed using the [Builder].
|
||||
*
|
||||
* @property criteria The set of search criteria applied to the query.
|
||||
* @property order The sorting order for the results (optional).
|
||||
* @property offset The offset number for paginated search results (optional).
|
||||
*/
|
||||
|
||||
@Deprecated("Too complex. Use MangaListFilter instead")
|
||||
@ConsistentCopyVisibility
|
||||
public data class MangaSearchQuery private constructor(
|
||||
@JvmField public val criteria: Set<QueryCriteria<*>>,
|
||||
@JvmField public val order: SortOrder?,
|
||||
@JvmField public val offset: Int,
|
||||
@JvmField public val skipValidation: Boolean,
|
||||
) {
|
||||
|
||||
public fun newBuilder(): Builder = Builder(this)
|
||||
|
||||
public class Builder {
|
||||
|
||||
private val criteria = ArraySet<QueryCriteria<*>>()
|
||||
private var order: SortOrder? = null
|
||||
private var offset: Int = 0
|
||||
private var skipValidation: Boolean = false
|
||||
|
||||
public constructor()
|
||||
|
||||
public constructor(query: MangaSearchQuery) : this() {
|
||||
criteria.addAll(query.criteria)
|
||||
order = query.order
|
||||
offset = query.offset
|
||||
}
|
||||
|
||||
public fun criterion(criterion: QueryCriteria<*>): Builder = apply { criteria.add(criterion) }
|
||||
|
||||
public fun order(order: SortOrder?): Builder = apply { this.order = order }
|
||||
|
||||
public fun offset(offset: Int): Builder = apply { this.offset = offset }
|
||||
|
||||
public fun skipValidation(skip: Boolean): Builder = apply { this.skipValidation = skip }
|
||||
|
||||
@Throws(IllegalArgumentException::class)
|
||||
public fun build(): MangaSearchQuery {
|
||||
return MangaSearchQuery(deduplicateCriteria(criteria), order, offset, skipValidation)
|
||||
}
|
||||
|
||||
private fun deduplicateCriteria(criteria: Set<QueryCriteria<*>>): Set<QueryCriteria<*>> {
|
||||
val uniqueCriteria =
|
||||
ArrayMap<Pair<SearchableField, Class<out QueryCriteria<*>>>, QueryCriteria<*>>(criteria.size)
|
||||
|
||||
for (criterion in criteria) {
|
||||
val key = criterion.field to criterion::class.java
|
||||
val existing = uniqueCriteria[key]
|
||||
|
||||
when {
|
||||
existing == null -> uniqueCriteria[key] = criterion
|
||||
|
||||
existing is QueryCriteria.Include<*> && criterion is QueryCriteria.Include<*> -> {
|
||||
uniqueCriteria[key] =
|
||||
QueryCriteria.Include(criterion.field, existing.values union criterion.values)
|
||||
}
|
||||
|
||||
existing is QueryCriteria.Exclude<*> && criterion is QueryCriteria.Exclude<*> -> {
|
||||
uniqueCriteria[key] =
|
||||
QueryCriteria.Exclude(criterion.field, existing.values union criterion.values)
|
||||
}
|
||||
|
||||
else -> throw IllegalArgumentException(
|
||||
"Match and Range have only one criterion per type, but found duplicates for: ${criterion.field} in ${criterion::class.simpleName}",
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
return uniqueCriteria.values.toSet()
|
||||
}
|
||||
}
|
||||
|
||||
public companion object {
|
||||
|
||||
public val EMPTY: MangaSearchQuery = MangaSearchQuery(emptySet(), null, 0, false)
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,48 @@
|
||||
package org.koitharu.kotatsu.parsers.model.search
|
||||
|
||||
import androidx.collection.ArraySet
|
||||
import org.koitharu.kotatsu.parsers.model.search.QueryCriteria.*
|
||||
import org.koitharu.kotatsu.parsers.util.mapToSet
|
||||
|
||||
@Deprecated("Too complex. Use MangaListFilterCapabilities instead")
|
||||
@ExposedCopyVisibility
|
||||
public data class MangaSearchQueryCapabilities internal constructor(
|
||||
public val capabilities: Set<SearchCapability>,
|
||||
) {
|
||||
|
||||
public constructor(vararg capabilities: SearchCapability) : this(ArraySet(capabilities))
|
||||
|
||||
internal fun validate(query: MangaSearchQuery) {
|
||||
val strictFields = capabilities.filter { it.isExclusive }.mapToSet { it.field }
|
||||
val usedStrictFields = query.criteria.mapToSet { it.field }.intersect(strictFields)
|
||||
|
||||
require(usedStrictFields.isEmpty() || query.criteria.size <= 1) {
|
||||
"Query contains multiple criteria, but at least one field (${usedStrictFields.joinToString()}) does not support multiple criteria."
|
||||
}
|
||||
for (criterion in query.criteria) {
|
||||
val capability = requireNotNull(capabilities.find { it.field == criterion.field }) {
|
||||
"Unsupported search field: ${criterion.field}"
|
||||
}
|
||||
|
||||
require(criterion::class in capability.criteriaTypes) {
|
||||
"Unsupported search criterion: ${criterion::class.simpleName} for field ${criterion.field}"
|
||||
}
|
||||
|
||||
// Ensure single value per criterion if supportMultiValue is false
|
||||
if (!capability.isMultiple) {
|
||||
when (criterion) {
|
||||
is Include<*> -> require(criterion.values.size <= 1) {
|
||||
"Multiple values are not allowed for field ${criterion.field}"
|
||||
}
|
||||
|
||||
is Exclude<*> -> require(criterion.values.size <= 1) {
|
||||
"Multiple values are not allowed for field ${criterion.field}"
|
||||
}
|
||||
|
||||
is Range<*> -> Unit // Range is always valid (from, to)
|
||||
is Match<*> -> Unit // Match always has a single value
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,106 @@
|
||||
package org.koitharu.kotatsu.parsers.model.search
|
||||
|
||||
/**
|
||||
* Represents a generic search criterion used for filtering manga search results.
|
||||
* Each criterion applies a specific condition to a [SearchableField] and operates on values of type [T].
|
||||
*
|
||||
* @param T The type of value associated with the search criterion.
|
||||
* @property field The field to which this search criterion applies.
|
||||
*/
|
||||
@Deprecated("Too complex")
|
||||
public sealed interface QueryCriteria<T> {
|
||||
|
||||
public val field: SearchableField
|
||||
|
||||
override fun equals(other: Any?): Boolean
|
||||
|
||||
override fun hashCode(): Int
|
||||
|
||||
/**
|
||||
* Represents an inclusion criterion that allows search results based on a set of allowed values.
|
||||
*
|
||||
* @param T The type of value being included in the search.
|
||||
* @property values The set of values that should be included in the search results.
|
||||
*
|
||||
* ### Example Usage:
|
||||
* ```kotlin
|
||||
* val genreFilter = QueryCriteria.Include(SearchableField.STATE, setOf(MangaState.ONGOING, MangaState.FINISHED))
|
||||
* ```
|
||||
*/
|
||||
public data class Include<T : Any>(
|
||||
public override val field: SearchableField,
|
||||
@JvmField public val values: Set<T>,
|
||||
) : QueryCriteria<T> {
|
||||
|
||||
init {
|
||||
check(values.all { x -> field.type.isInstance(x) })
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents an exclusion criterion that exclude results containing certain values.
|
||||
*
|
||||
* @param T The type of value being excluded from the search.
|
||||
* @property values The set of values that should be excluded from the search results.
|
||||
*
|
||||
* ### Example Usage:
|
||||
* ```kotlin
|
||||
* val excludeTag = QueryCriteria.Exclude(SearchableField.TAG, setOf(MangaTag(key, title, source)))
|
||||
* ```
|
||||
*/
|
||||
public data class Exclude<T : Any>(
|
||||
public override val field: SearchableField,
|
||||
@JvmField public val values: Set<T>,
|
||||
) : QueryCriteria<T> {
|
||||
|
||||
init {
|
||||
check(values.all { x -> field.type.isInstance(x) })
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents a range criterion that allows search based on a range of values.
|
||||
*
|
||||
* @param T The type of value used in the range (must be comparable).
|
||||
* @property from The starting value of the range (inclusive).
|
||||
* @property to The ending value of the range (inclusive).
|
||||
*
|
||||
* ### Example Usage:
|
||||
* ```kotlin
|
||||
* val yearRange = QueryCriteria.Range(SearchableField.PUBLICATION_YEAR, 2000, 2020)
|
||||
* ```
|
||||
*/
|
||||
public data class Range<T : Comparable<T>>(
|
||||
public override val field: SearchableField,
|
||||
@JvmField public val from: T,
|
||||
@JvmField public val to: T,
|
||||
) : QueryCriteria<T> {
|
||||
|
||||
init {
|
||||
check(field.type.isInstance(from))
|
||||
check(field.type.isInstance(to))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Represents a match criterion that search results based on an exact match of a value.
|
||||
*
|
||||
* @param T The type of value being matched.
|
||||
* @property value The exact value that must be matched.
|
||||
*
|
||||
* ### Example Usage:
|
||||
* ```kotlin
|
||||
* val titleMatch = QueryCriteria.Match(SearchableField.TITLE, "manga title")
|
||||
* ```
|
||||
*/
|
||||
public data class Match<T : Any>(
|
||||
public override val field: SearchableField,
|
||||
@JvmField public val value: T,
|
||||
) : QueryCriteria<T> {
|
||||
|
||||
init {
|
||||
check(field.type.isInstance(value))
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,34 @@
|
||||
package org.koitharu.kotatsu.parsers.model.search
|
||||
|
||||
import kotlin.reflect.KClass
|
||||
|
||||
/**
|
||||
* Defines the search capabilities of a given field in the manga search query.
|
||||
*
|
||||
* @property field The searchable field that this capability applies to.
|
||||
* Example values:
|
||||
* - `SearchableField.TITLE_NAME` for searching by title.
|
||||
* - `SearchableField.AUTHOR` for searching by author names.
|
||||
* - `SearchableField.TAG` for filtering by tags.
|
||||
* @property criteriaTypes The set of supported criteria types for the field.
|
||||
* Example values:
|
||||
* - `setOf(Include::class, Exclude::class)` selected field supports inclusion/exclusion criteria.
|
||||
* - `setOf(Range::class)` selected field support numerical range criteria.
|
||||
* @property isMultiValue Indicates whether the field supports multiple values.
|
||||
* - `true` if multiple values can be provided (e.g., multiple tags or authors).
|
||||
* - `false` if only a single value is allowed (e.g., only one tag or author).
|
||||
* @property isExclusive Specifies whether the field can be used alongside other criteria.
|
||||
* - `true` if this field can be used with other search criteria.
|
||||
* - `false` if using this field requires it to be the only criterion in query.
|
||||
*/
|
||||
@Deprecated("Too complex")
|
||||
public data class SearchCapability(
|
||||
/** The searchable field that this capability applies to. */
|
||||
@JvmField public val field: SearchableField,
|
||||
/** The set of supported criteria types for this field. */
|
||||
@JvmField public val criteriaTypes: Set<KClass<out QueryCriteria<*>>>,
|
||||
/** Indicates whether the field supports multiple values. */
|
||||
@JvmField public val isMultiple: Boolean,
|
||||
/** Specifies whether the field can be used alongside other criteria. */
|
||||
@JvmField public val isExclusive: Boolean = false,
|
||||
)
|
||||
@ -0,0 +1,24 @@
|
||||
package org.koitharu.kotatsu.parsers.model.search
|
||||
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import java.util.*
|
||||
|
||||
/**
|
||||
* Represents the various fields that can be used for searching manga.
|
||||
* Each field is associated with a specific data type that defines its expected values.
|
||||
*
|
||||
* @property type The Java class representing the expected type of values for this field.
|
||||
*/
|
||||
@Deprecated("Too complex")
|
||||
public enum class SearchableField(public val type: Class<*>) {
|
||||
TITLE_NAME(String::class.java),
|
||||
TAG(MangaTag::class.java),
|
||||
AUTHOR(MangaTag::class.java),
|
||||
LANGUAGE(Locale::class.java),
|
||||
ORIGINAL_LANGUAGE(Locale::class.java),
|
||||
STATE(MangaState::class.java),
|
||||
CONTENT_TYPE(ContentType::class.java),
|
||||
CONTENT_RATING(ContentRating::class.java),
|
||||
DEMOGRAPHIC(Demographic::class.java),
|
||||
PUBLICATION_YEAR(Int::class.javaObjectType);
|
||||
}
|
||||
@ -0,0 +1,47 @@
|
||||
package org.koitharu.kotatsu.parsers.network
|
||||
|
||||
import okhttp3.CookieJar
|
||||
import okhttp3.HttpUrl.Companion.toHttpUrl
|
||||
import okhttp3.Response
|
||||
import org.jsoup.Jsoup
|
||||
import java.net.HttpURLConnection.HTTP_FORBIDDEN
|
||||
import java.net.HttpURLConnection.HTTP_UNAVAILABLE
|
||||
|
||||
public object CloudFlareHelper {
|
||||
|
||||
public const val PROTECTION_NOT_DETECTED: Int = 0
|
||||
public const val PROTECTION_CAPTCHA: Int = 1
|
||||
public const val PROTECTION_BLOCKED: Int = 2
|
||||
|
||||
private const val CF_CLEARANCE = "cf_clearance"
|
||||
|
||||
public fun checkResponseForProtection(response: Response): Int {
|
||||
if (response.code != HTTP_FORBIDDEN && response.code != HTTP_UNAVAILABLE) {
|
||||
return PROTECTION_NOT_DETECTED
|
||||
}
|
||||
val content = try {
|
||||
response.peekBody(Long.MAX_VALUE).use {
|
||||
Jsoup.parse(it.byteStream(), Charsets.UTF_8.name(), response.request.url.toString())
|
||||
}
|
||||
} catch (_: IllegalStateException) {
|
||||
return PROTECTION_NOT_DETECTED
|
||||
}
|
||||
return when {
|
||||
content.selectFirst("h2[data-translate=\"blocked_why_headline\"]") != null -> PROTECTION_BLOCKED
|
||||
content.getElementById("challenge-error-title") != null || content.getElementById("challenge-error-text") != null -> PROTECTION_CAPTCHA
|
||||
|
||||
else -> PROTECTION_NOT_DETECTED
|
||||
}
|
||||
}
|
||||
|
||||
public fun getClearanceCookie(cookieJar: CookieJar, url: String): String? {
|
||||
return cookieJar.loadForRequest(url.toHttpUrl()).find { it.name == CF_CLEARANCE }?.value
|
||||
}
|
||||
|
||||
public fun isCloudFlareCookie(name: String): Boolean {
|
||||
return name.startsWith("cf_")
|
||||
|| name.startsWith("_cf")
|
||||
|| name.startsWith("__cf")
|
||||
|| name == "csrftoken"
|
||||
}
|
||||
}
|
||||
@ -1,14 +1,17 @@
|
||||
package org.koitharu.kotatsu.parsers.network
|
||||
|
||||
object UserAgents {
|
||||
public object UserAgents {
|
||||
|
||||
const val CHROME_MOBILE =
|
||||
public const val CHROME_MOBILE: String =
|
||||
"Mozilla/5.0 (Linux; Android 13) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.5735.196 Mobile Safari/537.36"
|
||||
|
||||
const val CHROME_DESKTOP =
|
||||
public const val FIREFOX_MOBILE: String =
|
||||
"Mozilla/5.0 (Android 14; Mobile; LG-M255; rv:123.0) Gecko/123.0 Firefox/123.0"
|
||||
|
||||
public const val CHROME_DESKTOP: String =
|
||||
"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36"
|
||||
|
||||
const val FIREFOX_DESKTOP = "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/116.0"
|
||||
public const val FIREFOX_DESKTOP: String = "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/116.0"
|
||||
|
||||
const val KOTATSU = "Kotatsu/5.3 (Android 13;;; en)"
|
||||
public const val KOTATSU: String = "Kotatsu/6.8 (Android 13;;; en)"
|
||||
}
|
||||
|
||||
@ -1,420 +1,497 @@
|
||||
package org.koitharu.kotatsu.parsers.site.all
|
||||
|
||||
import androidx.collection.ArrayMap
|
||||
import androidx.collection.ArraySet
|
||||
import androidx.collection.SparseArrayCompat
|
||||
import androidx.collection.set
|
||||
import androidx.collection.MutableIntLongMap
|
||||
import androidx.collection.MutableIntObjectMap
|
||||
import okhttp3.HttpUrl.Companion.toHttpUrlOrNull
|
||||
import okhttp3.Interceptor
|
||||
import okhttp3.Response
|
||||
import okhttp3.internal.closeQuietly
|
||||
import org.jsoup.internal.StringUtil
|
||||
import org.jsoup.nodes.Element
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.MangaParserAuthProvider
|
||||
import org.koitharu.kotatsu.parsers.MangaSourceParser
|
||||
import org.koitharu.kotatsu.parsers.PagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.bitmap.Rect
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.PagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.exception.AuthRequiredException
|
||||
import org.koitharu.kotatsu.parsers.exception.TooManyRequestExceptions
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.util.*
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.*
|
||||
import kotlin.math.pow
|
||||
import java.util.Collections.emptyList
|
||||
import java.util.concurrent.TimeUnit
|
||||
|
||||
private const val DOMAIN_UNAUTHORIZED = "e-hentai.org"
|
||||
private const val DOMAIN_AUTHORIZED = "exhentai.org"
|
||||
private val TAG_PREFIXES = arrayOf("male:", "female:", "other:")
|
||||
private const val BANNED_RESPONSE_LENGTH = 256L
|
||||
|
||||
@MangaSourceParser("EXHENTAI", "ExHentai", type = ContentType.HENTAI)
|
||||
internal class ExHentaiParser(
|
||||
context: MangaLoaderContext,
|
||||
) : PagedMangaParser(context, MangaSource.EXHENTAI, pageSize = 25), MangaParserAuthProvider {
|
||||
|
||||
override val availableSortOrders: Set<SortOrder> = setOf(SortOrder.NEWEST)
|
||||
override val isTagsExclusionSupported: Boolean = true
|
||||
|
||||
override val configKeyDomain: ConfigKey.Domain
|
||||
get() = ConfigKey.Domain(
|
||||
if (isAuthorized) DOMAIN_AUTHORIZED else DOMAIN_UNAUTHORIZED,
|
||||
if (isAuthorized) DOMAIN_UNAUTHORIZED else DOMAIN_AUTHORIZED,
|
||||
)
|
||||
|
||||
override val authUrl: String
|
||||
get() = "https://${domain}/bounce_login.php"
|
||||
|
||||
private val ratingPattern = Regex("-?[0-9]+px")
|
||||
private val authCookies = arrayOf("ipb_member_id", "ipb_pass_hash")
|
||||
private var updateDm = false
|
||||
private val nextPages = SparseArrayCompat<Long>()
|
||||
private val suspiciousContentKey = ConfigKey.ShowSuspiciousContent(false)
|
||||
private val tagsMap = SuspendLazy(::fetchTags)
|
||||
|
||||
override val isAuthorized: Boolean
|
||||
get() {
|
||||
val authorized = isAuthorized(DOMAIN_UNAUTHORIZED)
|
||||
if (authorized) {
|
||||
if (!isAuthorized(DOMAIN_AUTHORIZED)) {
|
||||
context.cookieJar.copyCookies(
|
||||
DOMAIN_UNAUTHORIZED,
|
||||
DOMAIN_AUTHORIZED,
|
||||
authCookies,
|
||||
)
|
||||
context.cookieJar.insertCookies(DOMAIN_AUTHORIZED, "yay=louder")
|
||||
}
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
init {
|
||||
context.cookieJar.insertCookies(DOMAIN_AUTHORIZED, "nw=1", "sl=dm_2")
|
||||
context.cookieJar.insertCookies(DOMAIN_UNAUTHORIZED, "nw=1", "sl=dm_2")
|
||||
paginator.firstPage = 0
|
||||
}
|
||||
|
||||
override suspend fun getListPage(page: Int, filter: MangaListFilter?): List<Manga> {
|
||||
val next = nextPages.get(page, 0L)
|
||||
|
||||
if (page > 0 && next == 0L) {
|
||||
assert(false) { "Page timestamp not found" }
|
||||
return emptyList()
|
||||
}
|
||||
|
||||
var search = ""
|
||||
|
||||
val url = buildString {
|
||||
append("https://")
|
||||
append(domain)
|
||||
append("/?next=")
|
||||
append(next)
|
||||
when (filter) {
|
||||
|
||||
is MangaListFilter.Search -> {
|
||||
search += filter.query.urlEncoded()
|
||||
append("&f_search=")
|
||||
append(search.trim().replace(' ', '+'))
|
||||
}
|
||||
|
||||
is MangaListFilter.Advanced -> {
|
||||
|
||||
filter.toSearchQuery()?.let { sq ->
|
||||
append("&f_search=")
|
||||
append(sq.urlEncoded())
|
||||
}
|
||||
|
||||
val catsOn = filter.tags.mapNotNullToSet { it.key.toIntOrNull() }
|
||||
val catsOff = filter.tagsExclude.mapNotNullToSet { it.key.toIntOrNull() }
|
||||
if (catsOff.size >= 10) {
|
||||
return emptyList()
|
||||
}
|
||||
var fCats = catsOn.fold(0, Int::or)
|
||||
if (fCats != 0) {
|
||||
fCats = 1023 - fCats
|
||||
}
|
||||
fCats = catsOff.fold(fCats, Int::or)
|
||||
|
||||
if (fCats != 0) {
|
||||
append("&f_cats=")
|
||||
append(fCats)
|
||||
}
|
||||
}
|
||||
|
||||
null -> {}
|
||||
}
|
||||
// by unknown reason cookie "sl=dm_2" is ignored, so, we should request it again
|
||||
if (updateDm) {
|
||||
append("&inline_set=dm_e")
|
||||
}
|
||||
append("&advsearch=1")
|
||||
if (config[suspiciousContentKey]) {
|
||||
append("&f_sh=on")
|
||||
}
|
||||
}
|
||||
|
||||
val body = webClient.httpGet(url).parseHtml().body()
|
||||
val root = body.selectFirst("table.itg")
|
||||
?.selectFirst("tbody")
|
||||
?: if (updateDm) {
|
||||
body.parseFailed("Cannot find root")
|
||||
} else {
|
||||
updateDm = true
|
||||
return getListPage(page, filter)
|
||||
}
|
||||
updateDm = false
|
||||
nextPages[page + 1] = getNextTimestamp(body)
|
||||
return root.children().mapNotNull { tr ->
|
||||
if (tr.childrenSize() != 2) return@mapNotNull null
|
||||
val (td1, td2) = tr.children()
|
||||
val gLink = td2.selectFirstOrThrow("div.glink")
|
||||
val a = gLink.parents().select("a").first() ?: gLink.parseFailed("link not found")
|
||||
val href = a.attrAsRelativeUrl("href")
|
||||
val tagsDiv = gLink.nextElementSibling() ?: gLink.parseFailed("tags div not found")
|
||||
val mainTag = td2.selectFirst("div.cn")?.let { div ->
|
||||
MangaTag(
|
||||
title = div.text().toTitleCase(),
|
||||
key = tagIdByClass(div.classNames()) ?: return@let null,
|
||||
source = source,
|
||||
)
|
||||
}
|
||||
Manga(
|
||||
id = generateUid(href),
|
||||
title = gLink.text().cleanupTitle(),
|
||||
altTitle = null,
|
||||
url = href,
|
||||
publicUrl = a.absUrl("href"),
|
||||
rating = td2.selectFirst("div.ir")?.parseRating() ?: RATING_UNKNOWN,
|
||||
isNsfw = true,
|
||||
coverUrl = td1.selectFirst("img")?.absUrl("src").orEmpty(),
|
||||
tags = setOfNotNull(mainTag),
|
||||
state = null,
|
||||
author = tagsDiv.getElementsContainingOwnText("artist:").first()
|
||||
?.nextElementSibling()?.text(),
|
||||
source = source,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
override suspend fun getDetails(manga: Manga): Manga {
|
||||
val doc = webClient.httpGet(manga.url.toAbsoluteUrl(domain)).parseHtml()
|
||||
val root = doc.body().selectFirstOrThrow("div.gm")
|
||||
val cover = root.getElementById("gd1")?.children()?.first()
|
||||
val title = root.getElementById("gd2")
|
||||
val tagList = root.getElementById("taglist")
|
||||
val tabs = doc.body().selectFirst("table.ptt")?.selectFirst("tr")
|
||||
val lang = root.getElementById("gd3")
|
||||
?.selectFirst("tr:contains(Language)")
|
||||
?.selectFirst(".gdt2")?.ownTextOrNull()
|
||||
|
||||
val tagMap = tagsMap.get()
|
||||
val tags = ArraySet<MangaTag>()
|
||||
tagList?.selectFirst("tr:contains(female:)")?.select("a")?.mapNotNullTo(tags) { tagMap[it.text()] }
|
||||
tagList?.selectFirst("tr:contains(male:)")?.select("a")?.mapNotNullTo(tags) { tagMap[it.text()] }
|
||||
|
||||
return manga.copy(
|
||||
title = title?.getElementById("gn")?.text()?.cleanupTitle() ?: manga.title,
|
||||
altTitle = title?.getElementById("gj")?.text()?.cleanupTitle() ?: manga.altTitle,
|
||||
publicUrl = doc.baseUri().ifEmpty { manga.publicUrl },
|
||||
rating = root.getElementById("rating_label")?.text()
|
||||
?.substringAfterLast(' ')
|
||||
?.toFloatOrNull()
|
||||
?.div(5f) ?: manga.rating,
|
||||
largeCoverUrl = cover?.styleValueOrNull("background")?.cssUrl(),
|
||||
tags = tags,
|
||||
description = tagList?.select("tr")?.joinToString("<br>") { tr ->
|
||||
val (tc, td) = tr.children()
|
||||
val subTags = td.select("a").joinToString { it.html() }
|
||||
"<b>${tc.html()}</b> $subTags"
|
||||
},
|
||||
chapters = tabs?.select("a")?.findLast { a ->
|
||||
a.text().toIntOrNull() != null
|
||||
}?.let { a ->
|
||||
val count = a.text().toInt()
|
||||
val chapters = ChaptersListBuilder(count)
|
||||
for (i in 1..count) {
|
||||
val url = "${manga.url}?p=${i - 1}"
|
||||
chapters += MangaChapter(
|
||||
id = generateUid(url),
|
||||
name = "${manga.title} #$i",
|
||||
number = i,
|
||||
url = url,
|
||||
uploadDate = 0L,
|
||||
source = source,
|
||||
scanlator = null,
|
||||
branch = lang,
|
||||
)
|
||||
}
|
||||
chapters.toList()
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
override suspend fun getPages(chapter: MangaChapter): List<MangaPage> {
|
||||
val doc = webClient.httpGet(chapter.url.toAbsoluteUrl(domain)).parseHtml()
|
||||
val root = doc.body().requireElementById("gdt")
|
||||
return root.select("a").map { a ->
|
||||
val url = a.attrAsRelativeUrl("href")
|
||||
MangaPage(
|
||||
id = generateUid(url),
|
||||
url = url,
|
||||
preview = null,
|
||||
source = source,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
override suspend fun getPageUrl(page: MangaPage): String {
|
||||
val doc = webClient.httpGet(page.url.toAbsoluteUrl(domain)).parseHtml()
|
||||
return doc.body().requireElementById("img").attrAsAbsoluteUrl("src")
|
||||
}
|
||||
|
||||
private val tags =
|
||||
"ahegao,anal,angel,apron,bandages,bbw,bdsm,beauty mark,big areolae,big ass,big breasts,big clit,big lips," +
|
||||
"big nipples,bikini,blackmail,bloomers,blowjob,bodysuit,bondage,breast expansion,bukkake,bunny girl,business suit," +
|
||||
"catgirl,centaur,cheating,chinese dress,christmas,collar,corset,cosplaying,cowgirl,crossdressing,cunnilingus," +
|
||||
"dark skin,daughter,deepthroat,defloration,demon girl,double penetration,dougi,dragon,drunk,elf,exhibitionism,farting," +
|
||||
"females only,femdom,filming,fingering,fishnets,footjob,fox girl,furry,futanari,garter belt,ghost,giantess," +
|
||||
"glasses,gloves,goblin,gothic lolita,growth,guro,gyaru,hair buns,hairy,hairy armpits,handjob,harem,hidden sex," +
|
||||
"horns,huge breasts,humiliation,impregnation,incest,inverted nipples,kemonomimi,kimono,kissing,lactation," +
|
||||
"latex,leg lock,leotard,lingerie,lizard girl,maid,masked face,masturbation,midget,miko,milf,mind break," +
|
||||
"mind control,monster girl,mother,muscle,nakadashi,netorare,nose hook,nun,nurse,oil,paizuri,panda girl," +
|
||||
"pantyhose,piercing,pixie cut,policewoman,ponytail,pregnant,rape,rimjob,robot,scat,lolicon,schoolgirl uniform," +
|
||||
"sex toys,shemale,sister,small breasts,smell,sole dickgirl,sole female,squirting,stockings,sundress,sweating," +
|
||||
"swimsuit,swinging,tail,tall girl,teacher,tentacles,thigh high boots,tomboy,transformation,twins,twintails," +
|
||||
"unusual pupils,urination,vore,vtuber,widow,wings,witch,wolf girl,x-ray,yuri,zombie,sole male,males only,yaoi," +
|
||||
"tomgirl,tall man,oni,shotacon,prostate massage,policeman,males only,huge penis,fox boy,feminization,dog boy,dickgirl on male,big penis"
|
||||
|
||||
override suspend fun getAvailableTags(): Set<MangaTag> {
|
||||
return tagsMap.get().values.toSet()
|
||||
}
|
||||
|
||||
private suspend fun fetchTags(): Map<String, MangaTag> {
|
||||
val tagMap = ArrayMap<String, MangaTag>()
|
||||
val tagElements = tags.split(",")
|
||||
for (el in tagElements) {
|
||||
if (el.isEmpty()) continue
|
||||
tagMap[el] = MangaTag(
|
||||
title = el.toTitleCase(Locale.ENGLISH),
|
||||
key = el,
|
||||
source = source,
|
||||
)
|
||||
}
|
||||
|
||||
val doc = webClient.httpGet("https://${domain}").parseHtml()
|
||||
val root = doc.body().requireElementById("searchbox").selectFirstOrThrow("table")
|
||||
root.select("div.cs").mapNotNullToSet { div ->
|
||||
val id = div.id().substringAfterLast('_').toIntOrNull() ?: return@mapNotNullToSet null
|
||||
val name = div.text().toTitleCase(Locale.ENGLISH)
|
||||
tagMap[name] = MangaTag(
|
||||
title = "Kind: $name",
|
||||
key = id.toString(),
|
||||
source = source,
|
||||
)
|
||||
}
|
||||
return tagMap
|
||||
}
|
||||
|
||||
override suspend fun getAvailableLocales(): Set<Locale> = setOf(
|
||||
Locale.JAPANESE,
|
||||
Locale.ENGLISH,
|
||||
Locale.CHINESE,
|
||||
Locale("nl"),
|
||||
Locale.FRENCH,
|
||||
Locale.GERMAN,
|
||||
Locale("hu"),
|
||||
Locale.ITALIAN,
|
||||
Locale("kr"),
|
||||
Locale("pl"),
|
||||
Locale("pt"),
|
||||
Locale("ru"),
|
||||
Locale("es"),
|
||||
Locale("th"),
|
||||
Locale("vi"),
|
||||
)
|
||||
|
||||
private fun Locale.toLanguagePath() = when (language) {
|
||||
else -> getDisplayLanguage(Locale.ENGLISH).lowercase()
|
||||
}
|
||||
|
||||
override suspend fun getUsername(): String {
|
||||
val doc = webClient.httpGet("https://forums.$DOMAIN_UNAUTHORIZED/").parseHtml().body()
|
||||
val username = doc.getElementById("userlinks")
|
||||
?.getElementsByAttributeValueContaining("href", "showuser=")
|
||||
?.firstOrNull()
|
||||
?.ownText()
|
||||
?: if (doc.getElementById("userlinksguest") != null) {
|
||||
throw AuthRequiredException(source)
|
||||
} else {
|
||||
doc.parseFailed()
|
||||
}
|
||||
return username
|
||||
}
|
||||
|
||||
override fun onCreateConfig(keys: MutableCollection<ConfigKey<*>>) {
|
||||
super.onCreateConfig(keys)
|
||||
keys.add(suspiciousContentKey)
|
||||
}
|
||||
|
||||
private fun isAuthorized(domain: String): Boolean {
|
||||
val cookies = context.cookieJar.getCookies(domain).mapToSet { x -> x.name }
|
||||
return authCookies.all { it in cookies }
|
||||
}
|
||||
|
||||
private fun Element.parseRating(): Float {
|
||||
return runCatching {
|
||||
val style = requireNotNull(attr("style"))
|
||||
val (v1, v2) = ratingPattern.find(style)!!.destructured
|
||||
var p1 = v1.dropLast(2).toInt()
|
||||
val p2 = v2.dropLast(2).toInt()
|
||||
if (p2 != -1) {
|
||||
p1 += 8
|
||||
}
|
||||
(80 - p1) / 80f
|
||||
}.getOrDefault(RATING_UNKNOWN)
|
||||
}
|
||||
|
||||
private fun String.cleanupTitle(): String {
|
||||
val result = StringBuilder(length)
|
||||
var skip = false
|
||||
for (c in this) {
|
||||
when {
|
||||
c == '[' -> skip = true
|
||||
c == ']' -> skip = false
|
||||
c.isWhitespace() && result.isEmpty() -> continue
|
||||
!skip -> result.append(c)
|
||||
}
|
||||
}
|
||||
while (result.lastOrNull()?.isWhitespace() == true) {
|
||||
result.deleteCharAt(result.lastIndex)
|
||||
}
|
||||
return result.toString()
|
||||
}
|
||||
|
||||
private fun String.cssUrl(): String? {
|
||||
val fromIndex = indexOf("url(")
|
||||
if (fromIndex == -1) {
|
||||
return null
|
||||
}
|
||||
val toIndex = indexOf(')', startIndex = fromIndex)
|
||||
return if (toIndex == -1) {
|
||||
null
|
||||
} else {
|
||||
substring(fromIndex + 4, toIndex).trim()
|
||||
}
|
||||
}
|
||||
|
||||
private fun tagIdByClass(classNames: Collection<String>): String? {
|
||||
val className = classNames.find { x -> x.startsWith("ct") } ?: return null
|
||||
val num = className.drop(2).toIntOrNull(16) ?: return null
|
||||
return 2.0.pow(num).toInt().toString()
|
||||
}
|
||||
|
||||
private fun getNextTimestamp(root: Element): Long {
|
||||
return root.getElementById("unext")
|
||||
?.attrAsAbsoluteUrlOrNull("href")
|
||||
?.toHttpUrlOrNull()
|
||||
?.queryParameter("next")
|
||||
?.toLongOrNull() ?: 1
|
||||
}
|
||||
|
||||
private fun MangaListFilter.Advanced.toSearchQuery(): String? {
|
||||
val joiner = StringUtil.StringJoiner(" ")
|
||||
for (tag in tags) {
|
||||
if (tag.key.isNumeric()) {
|
||||
continue
|
||||
}
|
||||
joiner.add("tag:\"")
|
||||
joiner.append(tag.key)
|
||||
joiner.append("\"$")
|
||||
}
|
||||
for (tag in tagsExclude) {
|
||||
if (tag.key.isNumeric()) {
|
||||
continue
|
||||
}
|
||||
joiner.add("-tag:\"")
|
||||
joiner.append(tag.key)
|
||||
joiner.append("\"$")
|
||||
}
|
||||
locale?.let { lc ->
|
||||
joiner.add("language:\"")
|
||||
joiner.append(lc.toLanguagePath())
|
||||
joiner.append("\"$")
|
||||
}
|
||||
return joiner.complete().takeUnless { it.isEmpty() }
|
||||
}
|
||||
context: MangaLoaderContext,
|
||||
) : PagedMangaParser(context, MangaParserSource.EXHENTAI, pageSize = 25), MangaParserAuthProvider, Interceptor {
|
||||
|
||||
override val availableSortOrders: Set<SortOrder> = setOf(SortOrder.NEWEST)
|
||||
|
||||
override val configKeyDomain: ConfigKey.Domain
|
||||
get() {
|
||||
val isAuthorized = checkAuth()
|
||||
return ConfigKey.Domain(
|
||||
if (isAuthorized) DOMAIN_AUTHORIZED else DOMAIN_UNAUTHORIZED,
|
||||
if (isAuthorized) DOMAIN_UNAUTHORIZED else DOMAIN_AUTHORIZED,
|
||||
)
|
||||
}
|
||||
|
||||
override val authUrl: String
|
||||
get() = "https://${domain}/bounce_login.php"
|
||||
|
||||
private val ratingPattern = Regex("-?[0-9]+px")
|
||||
private val titleCleanupPattern = Regex("(\\[.*?]|\\([C0-9]*\\))")
|
||||
private val spacesCleanupPattern = Regex("(^\\s+|\\s+\$|\\s+(?=\\s))")
|
||||
private val authCookies = arrayOf("ipb_member_id", "ipb_pass_hash")
|
||||
private val suspiciousContentKey = ConfigKey.ShowSuspiciousContent(false)
|
||||
private val nextPages = MutableIntObjectMap<MutableIntLongMap>()
|
||||
|
||||
override val filterCapabilities: MangaListFilterCapabilities
|
||||
get() = MangaListFilterCapabilities(
|
||||
isMultipleTagsSupported = true,
|
||||
isTagsExclusionSupported = true,
|
||||
isSearchSupported = true,
|
||||
isSearchWithFiltersSupported = true,
|
||||
isAuthorSearchSupported = true,
|
||||
)
|
||||
|
||||
override suspend fun isAuthorized(): Boolean = checkAuth()
|
||||
|
||||
init {
|
||||
context.cookieJar.insertCookies(DOMAIN_AUTHORIZED, "nw=1", "sl=dm_2")
|
||||
context.cookieJar.insertCookies(DOMAIN_UNAUTHORIZED, "nw=1", "sl=dm_2")
|
||||
paginator.firstPage = 0
|
||||
searchPaginator.firstPage = 0
|
||||
}
|
||||
|
||||
override suspend fun getFilterOptions() = MangaListFilterOptions(
|
||||
availableTags = mapTags(),
|
||||
availableContentTypes = EnumSet.of(
|
||||
ContentType.DOUJINSHI,
|
||||
ContentType.MANGA,
|
||||
ContentType.ARTIST_CG,
|
||||
ContentType.GAME_CG,
|
||||
ContentType.COMICS,
|
||||
ContentType.IMAGE_SET,
|
||||
ContentType.OTHER,
|
||||
),
|
||||
availableLocales = setOf(
|
||||
Locale.JAPANESE,
|
||||
Locale.ENGLISH,
|
||||
Locale.CHINESE,
|
||||
Locale("nl"),
|
||||
Locale.FRENCH,
|
||||
Locale.GERMAN,
|
||||
Locale("hu"),
|
||||
Locale.ITALIAN,
|
||||
Locale("kr"),
|
||||
Locale("pl"),
|
||||
Locale("pt"),
|
||||
Locale("ru"),
|
||||
Locale("es"),
|
||||
Locale("th"),
|
||||
Locale("vi"),
|
||||
),
|
||||
)
|
||||
|
||||
override suspend fun getListPage(page: Int, order: SortOrder, filter: MangaListFilter): List<Manga> {
|
||||
return getListPage(page, order, filter, updateDm = false)
|
||||
}
|
||||
|
||||
private suspend fun getListPage(
|
||||
page: Int,
|
||||
order: SortOrder,
|
||||
filter: MangaListFilter,
|
||||
updateDm: Boolean,
|
||||
): List<Manga> {
|
||||
val next = synchronized(nextPages) {
|
||||
nextPages[filter.hashCode()]?.getOrDefault(page, 0L) ?: 0L
|
||||
}
|
||||
|
||||
if (page > 0 && next == 0L) {
|
||||
assert(false) { "Page timestamp not found" }
|
||||
return emptyList()
|
||||
}
|
||||
|
||||
val url = urlBuilder()
|
||||
url.addEncodedQueryParameter("next", next.toString())
|
||||
url.addQueryParameter("f_search", filter.toSearchQuery())
|
||||
|
||||
val fCats = filter.types.toFCats()
|
||||
if (fCats != 0) {
|
||||
url.addEncodedQueryParameter("f_cats", (1023 - fCats).toString())
|
||||
}
|
||||
if (updateDm) {
|
||||
// by unknown reason cookie "sl=dm_2" is ignored, so, we should request it again
|
||||
url.addQueryParameter("inline_set", "dm_e")
|
||||
}
|
||||
url.addQueryParameter("advsearch", "1")
|
||||
if (config[suspiciousContentKey]) {
|
||||
url.addQueryParameter("f_sh", "on")
|
||||
}
|
||||
val body = webClient.httpGet(url.build()).parseHtml().body()
|
||||
val root = body.selectFirst("table.itg")?.selectFirst("tbody")
|
||||
if (root == null) {
|
||||
if (updateDm) {
|
||||
if (body.getElementsContainingText("No hits found").isNotEmpty()) {
|
||||
return emptyList()
|
||||
} else {
|
||||
body.parseFailed("Cannot find root")
|
||||
}
|
||||
} else {
|
||||
return getListPage(page, order, filter, updateDm = true)
|
||||
}
|
||||
}
|
||||
val nextTimestamp = getNextTimestamp(body)
|
||||
synchronized(nextPages) {
|
||||
nextPages.getOrPut(filter.hashCode()) {
|
||||
MutableIntLongMap()
|
||||
}.put(page + 1, nextTimestamp)
|
||||
}
|
||||
|
||||
return root.children().mapNotNull { tr ->
|
||||
if (tr.childrenSize() != 2) return@mapNotNull null
|
||||
val (td1, td2) = tr.children()
|
||||
val gLink = td2.selectFirstOrThrow("div.glink")
|
||||
val a = gLink.parents().select("a").first() ?: gLink.parseFailed("link not found")
|
||||
val href = a.attrAsRelativeUrl("href")
|
||||
val tagsDiv = gLink.nextElementSibling() ?: gLink.parseFailed("tags div not found")
|
||||
val rawTitle = gLink.text()
|
||||
val author = tagsDiv.getElementsContainingOwnText("artist:").first()
|
||||
?.nextElementSibling()?.textOrNull()
|
||||
Manga(
|
||||
id = generateUid(href),
|
||||
title = rawTitle.cleanupTitle(),
|
||||
altTitles = emptySet(),
|
||||
url = href,
|
||||
publicUrl = a.absUrl("href"),
|
||||
rating = td2.selectFirst("div.ir")?.parseRating() ?: RATING_UNKNOWN,
|
||||
contentRating = ContentRating.ADULT,
|
||||
coverUrl = td1.selectFirst("img")?.attrAsAbsoluteUrlOrNull("src"),
|
||||
tags = tagsDiv.parseTags(),
|
||||
state = when {
|
||||
rawTitle.contains("(ongoing)", ignoreCase = true) -> MangaState.ONGOING
|
||||
else -> null
|
||||
},
|
||||
authors = setOfNotNull(author),
|
||||
source = source,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
override suspend fun getDetails(manga: Manga): Manga {
|
||||
val doc = webClient.httpGet(manga.url.toAbsoluteUrl(domain)).parseHtml()
|
||||
val root = doc.body().selectFirstOrThrow("div.gm")
|
||||
val cover = root.getElementById("gd1")?.children()?.first()
|
||||
val title = root.getElementById("gd2")
|
||||
val tagList = root.getElementById("taglist")
|
||||
val tabs = doc.body().selectFirst("table.ptt")?.selectFirst("tr")
|
||||
val gd3 = root.getElementById("gd3")
|
||||
val lang = gd3
|
||||
?.selectFirst("tr:contains(Language)")
|
||||
?.selectFirst(".gdt2")?.ownTextOrNull()
|
||||
val uploadDate = gd3
|
||||
?.selectFirst("tr:contains(Posted)")
|
||||
?.selectFirst(".gdt2")?.ownTextOrNull()
|
||||
.let { SimpleDateFormat("yyyy-MM-dd HH:mm", sourceLocale).parseSafe(it) }
|
||||
val uploader = gd3
|
||||
?.getElementsByAttributeValueContaining("href", "/uploader/")
|
||||
?.firstOrNull()
|
||||
?.ownTextOrNull()
|
||||
val tags = tagList?.parseTags().orEmpty()
|
||||
|
||||
return manga.copy(
|
||||
title = title?.getElementById("gn")?.text()?.cleanupTitle() ?: manga.title,
|
||||
altTitles = setOfNotNull(title?.getElementById("gj")?.text()?.cleanupTitle()?.nullIfEmpty()),
|
||||
publicUrl = doc.baseUri().ifEmpty { manga.publicUrl },
|
||||
rating = root.getElementById("rating_label")?.text()
|
||||
?.substringAfterLast(' ')
|
||||
?.toFloatOrNull()
|
||||
?.div(5f) ?: manga.rating,
|
||||
largeCoverUrl = cover?.styleValueOrNull("background")?.cssUrl(),
|
||||
tags = manga.tags + tags,
|
||||
description = tagList?.select("tr")?.joinToString("<br>") { tr ->
|
||||
val (tc, td) = tr.children()
|
||||
val subTags = td.select("a").joinToString { it.html() }
|
||||
"<b>${tc.html()}</b> $subTags"
|
||||
},
|
||||
chapters = tabs?.select("a")?.findLast { a ->
|
||||
a.text().toIntOrNull() != null
|
||||
}?.let { a ->
|
||||
val count = a.text().toInt()
|
||||
val chapters = ChaptersListBuilder(count)
|
||||
for (i in 1..count) {
|
||||
val url = "${manga.url}?p=${i - 1}"
|
||||
chapters += MangaChapter(
|
||||
id = generateUid(url),
|
||||
title = null,
|
||||
number = i.toFloat(),
|
||||
volume = 0,
|
||||
url = url,
|
||||
uploadDate = uploadDate,
|
||||
source = source,
|
||||
scanlator = uploader,
|
||||
branch = lang,
|
||||
)
|
||||
}
|
||||
chapters.toList()
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
override suspend fun getPages(chapter: MangaChapter): List<MangaPage> {
|
||||
val doc = webClient.httpGet(chapter.url.toAbsoluteUrl(domain)).parseHtml()
|
||||
val root = doc.body().requireElementById("gdt")
|
||||
return root.select("a").map { a ->
|
||||
val url = a.attrAsRelativeUrl("href")
|
||||
MangaPage(
|
||||
id = generateUid(url),
|
||||
url = url,
|
||||
preview = a.children().firstOrNull()?.extractPreview(),
|
||||
source = source,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
override suspend fun getPageUrl(page: MangaPage): String {
|
||||
val doc = webClient.httpGet(page.url.toAbsoluteUrl(domain)).parseHtml()
|
||||
return doc.body().requireElementById("img").attrAsAbsoluteUrl("src")
|
||||
}
|
||||
|
||||
@Suppress("SpellCheckingInspection")
|
||||
private val tags: String
|
||||
get() = "ahegao,anal,angel,apron,bandages,bbw,bdsm,beauty mark,big areolae,big ass,big breasts,big clit,big lips," +
|
||||
"big nipples,bikini,blackmail,bloomers,blowjob,bodysuit,bondage,breast expansion,bukkake,bunny girl,business suit," +
|
||||
"catgirl,centaur,cheating,chinese dress,christmas,collar,corset,cosplaying,cowgirl,crossdressing,cunnilingus," +
|
||||
"dark skin,daughter,deepthroat,defloration,demon girl,double penetration,dougi,dragon,drunk,elf,exhibitionism,farting," +
|
||||
"females only,femdom,filming,fingering,fishnets,footjob,fox girl,furry,futanari,garter belt,ghost,giantess," +
|
||||
"glasses,gloves,goblin,gothic lolita,growth,guro,gyaru,hair buns,hairy,hairy armpits,handjob,harem,hidden sex," +
|
||||
"horns,huge breasts,humiliation,impregnation,incest,inverted nipples,kemonomimi,kimono,kissing,lactation," +
|
||||
"latex,leg lock,leotard,lingerie,lizard girl,maid,masked face,masturbation,midget,miko,milf,mind break," +
|
||||
"mind control,monster girl,mother,muscle,nakadashi,netorare,nose hook,nun,nurse,oil,paizuri,panda girl," +
|
||||
"pantyhose,piercing,pixie cut,policewoman,ponytail,pregnant,rape,rimjob,robot,scat,lolicon,schoolgirl uniform," +
|
||||
"sex toys,shemale,sister,small breasts,smell,sole dickgirl,sole female,squirting,stockings,sundress,sweating," +
|
||||
"swimsuit,swinging,tail,tall girl,teacher,tentacles,thigh high boots,tomboy,transformation,twins,twintails," +
|
||||
"unusual pupils,urination,vore,vtuber,widow,wings,witch,wolf girl,x-ray,yuri,zombie,sole male,males only,yaoi," +
|
||||
"tomgirl,tall man,oni,shotacon,prostate massage,policeman,males only,huge penis,fox boy,feminization,dog boy,dickgirl on male,big penis"
|
||||
|
||||
private fun mapTags(): Set<MangaTag> {
|
||||
val tagElements = tags.split(",")
|
||||
val result = ArraySet<MangaTag>(tagElements.size)
|
||||
for (tag in tagElements) {
|
||||
val el = tag.trim()
|
||||
if (el.isEmpty()) continue
|
||||
result += MangaTag(
|
||||
title = el.toTitleCase(Locale.ENGLISH),
|
||||
key = el,
|
||||
source = source,
|
||||
)
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
override fun intercept(chain: Interceptor.Chain): Response {
|
||||
val response = chain.proceed(chain.request())
|
||||
if (response.headersContentLength(BANNED_RESPONSE_LENGTH) <= BANNED_RESPONSE_LENGTH) {
|
||||
val text = response.peekBody(BANNED_RESPONSE_LENGTH).use { it.string() }
|
||||
if (text.contains("IP address has been temporarily banned", ignoreCase = true)) {
|
||||
val hours = Regex("([0-9]+) hours?").find(text)?.groupValues?.getOrNull(1)?.toLongOrNull() ?: 0
|
||||
val minutes = Regex("([0-9]+) minutes?").find(text)?.groupValues?.getOrNull(1)?.toLongOrNull() ?: 0
|
||||
val seconds = Regex("([0-9]+) seconds?").find(text)?.groupValues?.getOrNull(1)?.toLongOrNull() ?: 0
|
||||
response.closeQuietly()
|
||||
throw TooManyRequestExceptions(
|
||||
url = response.request.url.toString(),
|
||||
retryAfter = TimeUnit.HOURS.toMillis(hours)
|
||||
+ TimeUnit.MINUTES.toMillis(minutes)
|
||||
+ TimeUnit.SECONDS.toMillis(seconds),
|
||||
)
|
||||
}
|
||||
}
|
||||
val imageRect = response.request.url.fragment?.split(',')
|
||||
if (imageRect != null && imageRect.size == 4) {
|
||||
// rect: top,left,right,bottom
|
||||
return context.redrawImageResponse(response) { bitmap ->
|
||||
val srcRect = Rect(
|
||||
left = imageRect[0].toInt(),
|
||||
top = imageRect[1].toInt(),
|
||||
right = imageRect[2].toInt(),
|
||||
bottom = imageRect[3].toInt(),
|
||||
)
|
||||
val dstRect = Rect(0, 0, srcRect.width, srcRect.height)
|
||||
val result = context.createBitmap(dstRect.width, dstRect.height)
|
||||
result.drawBitmap(bitmap, srcRect, dstRect)
|
||||
result
|
||||
}
|
||||
}
|
||||
return response
|
||||
}
|
||||
|
||||
private fun Locale.toLanguagePath() = when (language) {
|
||||
else -> getDisplayLanguage(Locale.ENGLISH).lowercase()
|
||||
}
|
||||
|
||||
override suspend fun getUsername(): String {
|
||||
val doc = webClient.httpGet("https://forums.$DOMAIN_UNAUTHORIZED/").parseHtml().body()
|
||||
val username = doc.getElementById("userlinks")
|
||||
?.getElementsByAttributeValueContaining("href", "showuser=")
|
||||
?.firstOrNull()
|
||||
?.ownText()
|
||||
?: if (doc.getElementById("userlinksguest") != null) {
|
||||
throw AuthRequiredException(source)
|
||||
} else {
|
||||
doc.parseFailed()
|
||||
}
|
||||
return username
|
||||
}
|
||||
|
||||
override fun onCreateConfig(keys: MutableCollection<ConfigKey<*>>) {
|
||||
super.onCreateConfig(keys)
|
||||
keys.add(userAgentKey)
|
||||
keys.add(suspiciousContentKey)
|
||||
}
|
||||
|
||||
override suspend fun getRelatedManga(seed: Manga): List<Manga> {
|
||||
val query = seed.title
|
||||
return getListPage(
|
||||
page = 0,
|
||||
order = defaultSortOrder,
|
||||
filter = MangaListFilter(query = query),
|
||||
)
|
||||
}
|
||||
|
||||
private fun isAuthorized(domain: String): Boolean {
|
||||
val cookies = context.cookieJar.getCookies(domain).mapToSet { x -> x.name }
|
||||
return authCookies.all { it in cookies }
|
||||
}
|
||||
|
||||
private fun Element.parseRating(): Float {
|
||||
return runCatching {
|
||||
val style = requireNotNull(attr("style"))
|
||||
val (v1, v2) = ratingPattern.findAll(style).toList()
|
||||
var p1 = v1.groupValues.first().dropLast(2).toInt()
|
||||
val p2 = v2.groupValues.first().dropLast(2).toInt()
|
||||
if (p2 != -1) {
|
||||
p1 += 8
|
||||
}
|
||||
(80 - p1) / 80f
|
||||
}.getOrDefault(RATING_UNKNOWN)
|
||||
}
|
||||
|
||||
private fun String.cleanupTitle(): String {
|
||||
return replace(titleCleanupPattern, "")
|
||||
.replace(spacesCleanupPattern, "")
|
||||
}
|
||||
|
||||
private fun Element.parseTags(): Set<MangaTag> {
|
||||
|
||||
fun Element.parseTag() = textOrNull()?.let {
|
||||
MangaTag(title = it.toTitleCase(Locale.ENGLISH), key = it, source = source)
|
||||
}
|
||||
|
||||
val result = ArraySet<MangaTag>()
|
||||
for (prefix in TAG_PREFIXES) {
|
||||
getElementsByAttributeValueStarting("id", "ta_$prefix").mapNotNullTo(result, Element::parseTag)
|
||||
getElementsByAttributeValueStarting("title", prefix).mapNotNullTo(result, Element::parseTag)
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
private fun Element.extractPreview(): String? {
|
||||
val bg = backgroundOrNull() ?: return null
|
||||
return buildString {
|
||||
append(bg.url)
|
||||
append('#')
|
||||
// rect: left,top,right,bottom
|
||||
append(bg.left)
|
||||
append(',')
|
||||
append(bg.top)
|
||||
append(',')
|
||||
append(bg.right)
|
||||
append(',')
|
||||
append(bg.bottom)
|
||||
}
|
||||
}
|
||||
|
||||
private fun getNextTimestamp(root: Element): Long {
|
||||
return root.getElementById("unext")
|
||||
?.attrAsAbsoluteUrlOrNull("href")
|
||||
?.toHttpUrlOrNull()
|
||||
?.queryParameter("next")
|
||||
?.toLongOrNull() ?: 1
|
||||
}
|
||||
|
||||
private fun MangaListFilter.toSearchQuery(): String? {
|
||||
if (isEmpty()) {
|
||||
return null
|
||||
}
|
||||
val joiner = StringUtil.StringJoiner(" ")
|
||||
if (!query.isNullOrEmpty()) {
|
||||
joiner.add(query)
|
||||
}
|
||||
for (tag in tags) {
|
||||
if (tag.key.isNumeric()) {
|
||||
continue
|
||||
}
|
||||
joiner.add("tag:\"")
|
||||
joiner.append(tag.key)
|
||||
joiner.append("\"$")
|
||||
}
|
||||
for (tag in tagsExclude) {
|
||||
if (tag.key.isNumeric()) {
|
||||
continue
|
||||
}
|
||||
joiner.add("-tag:\"")
|
||||
joiner.append(tag.key)
|
||||
joiner.append("\"$")
|
||||
}
|
||||
locale?.let { lc ->
|
||||
joiner.add("language:\"")
|
||||
joiner.append(lc.toLanguagePath())
|
||||
joiner.append("\"$")
|
||||
}
|
||||
if (!author.isNullOrEmpty()) {
|
||||
joiner.add("artist:\"")
|
||||
joiner.append(author)
|
||||
joiner.append("\"$")
|
||||
}
|
||||
return joiner.complete().nullIfEmpty()
|
||||
}
|
||||
|
||||
private fun Collection<ContentType>.toFCats(): Int = fold(0) { acc, ct ->
|
||||
val cat: Int = when (ct) {
|
||||
ContentType.DOUJINSHI -> 2
|
||||
ContentType.MANGA -> 4
|
||||
ContentType.ARTIST_CG -> 8
|
||||
ContentType.GAME_CG -> 16
|
||||
ContentType.COMICS -> 512
|
||||
ContentType.IMAGE_SET -> 32
|
||||
else -> 449 // 1 or 64 or 128 or 256
|
||||
}
|
||||
acc or cat
|
||||
}
|
||||
|
||||
private fun checkAuth(): Boolean {
|
||||
val authorized = isAuthorized(DOMAIN_UNAUTHORIZED)
|
||||
if (authorized) {
|
||||
if (!isAuthorized(DOMAIN_AUTHORIZED)) {
|
||||
context.cookieJar.copyCookies(
|
||||
DOMAIN_UNAUTHORIZED,
|
||||
DOMAIN_AUTHORIZED,
|
||||
authCookies,
|
||||
)
|
||||
context.cookieJar.insertCookies(DOMAIN_AUTHORIZED, "yay=louder")
|
||||
}
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,140 @@
|
||||
package org.koitharu.kotatsu.parsers.site.all
|
||||
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.MangaSourceParser
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.PagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.util.generateUid
|
||||
import org.koitharu.kotatsu.parsers.util.parseHtml
|
||||
import org.koitharu.kotatsu.parsers.util.selectFirstOrThrow
|
||||
import org.koitharu.kotatsu.parsers.util.parseSafe
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.Locale
|
||||
|
||||
@MangaSourceParser("HOLOEARTH", "HoloEarth")
|
||||
internal class HoloEarthParser(context: MangaLoaderContext) :
|
||||
PagedMangaParser(context, MangaParserSource.HOLOEARTH, 3) {
|
||||
|
||||
override val configKeyDomain: ConfigKey.Domain
|
||||
get() = ConfigKey.Domain("holoearth.com")
|
||||
|
||||
override fun onCreateConfig(keys: MutableCollection<ConfigKey<*>>) {
|
||||
super.onCreateConfig(keys)
|
||||
keys.add(userAgentKey)
|
||||
}
|
||||
|
||||
override val availableSortOrders: Set<SortOrder> = setOf(SortOrder.NEWEST)
|
||||
|
||||
override val filterCapabilities: MangaListFilterCapabilities
|
||||
get() = MangaListFilterCapabilities(
|
||||
isSearchSupported = false,
|
||||
)
|
||||
|
||||
override suspend fun getFilterOptions() = MangaListFilterOptions(
|
||||
availableLocales = setOf(
|
||||
Locale("en"),
|
||||
Locale.JAPANESE,
|
||||
Locale("id"),
|
||||
),
|
||||
)
|
||||
|
||||
override suspend fun getListPage(page: Int, order: SortOrder, filter: MangaListFilter): List<Manga> {
|
||||
val url = buildString {
|
||||
append("https://$domain")
|
||||
|
||||
filter.locale?.let {
|
||||
append(
|
||||
when (it) {
|
||||
Locale("en") -> "/en"
|
||||
Locale.JAPANESE -> ""
|
||||
Locale("id") -> "/id"
|
||||
else -> "" // default
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
append("/alt/holonometria/manga")
|
||||
}
|
||||
|
||||
val doc = webClient.httpGet(url).parseHtml()
|
||||
val root = doc.body().selectFirstOrThrow(".manga__list")
|
||||
val mangaList = root.select("li .manga__item-inner")
|
||||
|
||||
if (mangaList.isEmpty()) return emptyList()
|
||||
|
||||
return mangaList.mapNotNull { li ->
|
||||
val coverUrl = li.getElementsByTag("img").attr("src")
|
||||
val title = li.getElementsByClass("manga__title").text()
|
||||
val altTitle = li.getElementsByClass("manga__copy").text()
|
||||
val description = li.getElementsByClass("manga__caption").text()
|
||||
val url = li.getElementsByTag("a").attr("href")
|
||||
|
||||
Manga(
|
||||
id = generateUid(url),
|
||||
title = title,
|
||||
altTitles = setOf(altTitle),
|
||||
url = url,
|
||||
publicUrl = url,
|
||||
rating = RATING_UNKNOWN,
|
||||
contentRating = null,
|
||||
coverUrl = coverUrl,
|
||||
tags = emptySet(),
|
||||
state = null,
|
||||
authors = emptySet(),
|
||||
source = source,
|
||||
description = description,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
override suspend fun getDetails(manga: Manga): Manga {
|
||||
val doc = webClient.httpGet(manga.url).parseHtml()
|
||||
val dateFormat = SimpleDateFormat("yyyy.MM.dd", Locale.US)
|
||||
val root = doc.body().selectFirstOrThrow(".manga-detail__wrapper")
|
||||
val coverUrl = root.selectFirstOrThrow(".manga-detail__thumb img").attr("src")
|
||||
val chapters = root.select(".manga-detail__list-item")
|
||||
val mangaChapters = chapters.mapIndexed { index, li ->
|
||||
val url = li.selectFirstOrThrow(".manga-detail__list-link").attr("href")
|
||||
val title = li.selectFirstOrThrow(".manga-detail__list-title").text()
|
||||
val dateStr = li.selectFirstOrThrow(".manga-detail__list-date").text()
|
||||
val uploadDate = dateFormat.parseSafe(dateStr) ?: 0L
|
||||
val scanlator = root.selectFirst(".manga-detail__person")?.text()
|
||||
|
||||
MangaChapter(
|
||||
id = generateUid(url),
|
||||
title = title,
|
||||
number = index + 1f,
|
||||
volume = 0,
|
||||
url = url,
|
||||
scanlator = scanlator,
|
||||
uploadDate = uploadDate,
|
||||
branch = null,
|
||||
source = source,
|
||||
)
|
||||
}
|
||||
|
||||
return manga.copy(
|
||||
coverUrl = coverUrl,
|
||||
chapters = mangaChapters,
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
override suspend fun getPages(chapter: MangaChapter): List<MangaPage> {
|
||||
val doc = webClient.httpGet(chapter.url).parseHtml()
|
||||
val imageList = doc.body().selectFirstOrThrow(".manga-detail__swiper-wrapper")
|
||||
val images = imageList.select(".manga-detail__swiper-slide").reversed()
|
||||
|
||||
return images.mapNotNull { page ->
|
||||
val img = page.selectFirst("img") ?: return@mapNotNull null
|
||||
val src = img.attr("src")
|
||||
MangaPage(
|
||||
id = generateUid(src),
|
||||
url = src,
|
||||
preview = src,
|
||||
source = source,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,421 @@
|
||||
package org.koitharu.kotatsu.parsers.site.all
|
||||
|
||||
import okhttp3.HttpUrl.Companion.toHttpUrl
|
||||
import org.json.JSONObject
|
||||
import org.jsoup.HttpStatusException
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.MangaSourceParser
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.PagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.exception.ParseException
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.util.*
|
||||
import org.koitharu.kotatsu.parsers.util.json.getIntOrDefault
|
||||
import org.koitharu.kotatsu.parsers.util.json.getLongOrDefault
|
||||
import org.koitharu.kotatsu.parsers.util.json.getStringOrNull
|
||||
import org.koitharu.kotatsu.parsers.util.json.mapJSONNotNullToSet
|
||||
import org.koitharu.kotatsu.parsers.util.suspendlazy.getOrDefault
|
||||
import org.koitharu.kotatsu.parsers.util.suspendlazy.suspendLazy
|
||||
import java.net.HttpURLConnection
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.*
|
||||
import org.koitharu.kotatsu.parsers.Broken
|
||||
|
||||
@Broken("Need to fix getPages, most manga don't have chapter images due to faulty fetch logic")
|
||||
@MangaSourceParser("KOHARU", "Schale.network", type = ContentType.HENTAI)
|
||||
internal class Koharu(context: MangaLoaderContext) :
|
||||
PagedMangaParser(context, MangaParserSource.KOHARU, 24) {
|
||||
|
||||
override val configKeyDomain = ConfigKey.Domain("niyaniya.moe")
|
||||
private val apiSuffix = "api.schale.network"
|
||||
|
||||
override val userAgentKey = ConfigKey.UserAgent(
|
||||
"Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.7204.46 Mobile Safari/537.36",
|
||||
)
|
||||
|
||||
private val authorsIds = suspendLazy { fetchAuthorsIds() }
|
||||
|
||||
private val preferredImageResolutionKey = ConfigKey.PreferredImageServer(
|
||||
presetValues = mapOf(
|
||||
"0" to "Lowest Quality",
|
||||
"780" to "Low Quality (780px)",
|
||||
"980" to "Medium Quality (980px)",
|
||||
"1280" to "High Quality (1280px)",
|
||||
"1600" to "Highest Quality (1600px)",
|
||||
),
|
||||
defaultValue = "1280",
|
||||
)
|
||||
|
||||
override fun onCreateConfig(keys: MutableCollection<ConfigKey<*>>) {
|
||||
super.onCreateConfig(keys)
|
||||
keys.add(userAgentKey)
|
||||
keys.add(preferredImageResolutionKey)
|
||||
}
|
||||
|
||||
override fun getRequestHeaders() = super.getRequestHeaders().newBuilder()
|
||||
.add("referer", "https://$domain/")
|
||||
.add("origin", "https://$domain")
|
||||
.build()
|
||||
|
||||
override val availableSortOrders: Set<SortOrder> = EnumSet.of(
|
||||
SortOrder.NEWEST,
|
||||
SortOrder.POPULARITY,
|
||||
SortOrder.POPULARITY_TODAY,
|
||||
SortOrder.POPULARITY_WEEK,
|
||||
SortOrder.ALPHABETICAL,
|
||||
SortOrder.ALPHABETICAL_DESC,
|
||||
SortOrder.RATING,
|
||||
)
|
||||
|
||||
override val filterCapabilities: MangaListFilterCapabilities
|
||||
get() = MangaListFilterCapabilities(
|
||||
isMultipleTagsSupported = true,
|
||||
isSearchSupported = true,
|
||||
isAuthorSearchSupported = true,
|
||||
isSearchWithFiltersSupported = true,
|
||||
isTagsExclusionSupported = true,
|
||||
)
|
||||
|
||||
override suspend fun getFilterOptions() = MangaListFilterOptions(
|
||||
availableTags = fetchTags(namespace = 0),
|
||||
)
|
||||
|
||||
override suspend fun getListPage(page: Int, order: SortOrder, filter: MangaListFilter): List<Manga> {
|
||||
val baseUrl = "https://$apiSuffix/books"
|
||||
val url = buildString {
|
||||
append(baseUrl)
|
||||
|
||||
val terms: MutableList<String> = mutableListOf()
|
||||
val includedTags: MutableList<String> = mutableListOf()
|
||||
val excludedTags: MutableList<String> = mutableListOf()
|
||||
|
||||
if (!filter.query.isNullOrEmpty() && filter.query.startsWith("id:")) {
|
||||
val ipk = filter.query.removePrefix("id:")
|
||||
val response = webClient.httpGet("$baseUrl/detail/$ipk").parseJson()
|
||||
return listOf(parseMangaDetail(response))
|
||||
}
|
||||
|
||||
val sortValue = when (order) {
|
||||
SortOrder.POPULARITY, SortOrder.POPULARITY_TODAY -> "8"
|
||||
SortOrder.POPULARITY_WEEK -> "9"
|
||||
SortOrder.ALPHABETICAL -> "2"
|
||||
SortOrder.ALPHABETICAL_DESC -> "2"
|
||||
SortOrder.RATING -> "3"
|
||||
SortOrder.NEWEST -> "4"
|
||||
else -> "4"
|
||||
}
|
||||
append("?sort=").append(sortValue)
|
||||
|
||||
if (!filter.query.isNullOrEmpty()) {
|
||||
terms.add("title:\"${filter.query.urlEncoded()}\"")
|
||||
}
|
||||
|
||||
if (!filter.author.isNullOrEmpty()) {
|
||||
val authors = authorsIds.getOrDefault(emptyMap())
|
||||
val authorId = authors[filter.author.lowercase()]
|
||||
|
||||
if (authorId != null) {
|
||||
includedTags.add(authorId)
|
||||
} else {
|
||||
terms.add("artist:\"${filter.author.urlEncoded()}\"")
|
||||
}
|
||||
}
|
||||
|
||||
filter.tags.forEach { tag ->
|
||||
if (tag.key.startsWith("-")) {
|
||||
excludedTags.add(tag.key.substring(1))
|
||||
} else {
|
||||
includedTags.add(tag.key)
|
||||
}
|
||||
}
|
||||
|
||||
if (excludedTags.isNotEmpty()) {
|
||||
append("&exclude=").append(excludedTags.joinToString(","))
|
||||
append("&e=1")
|
||||
}
|
||||
|
||||
if (includedTags.isNotEmpty()) {
|
||||
append("&include=").append(includedTags.joinToString(","))
|
||||
append("&i=1")
|
||||
}
|
||||
|
||||
append("&page=").append(page)
|
||||
|
||||
if (terms.isNotEmpty()) {
|
||||
append("&s=").append(terms.joinToString(" ").urlEncoded())
|
||||
}
|
||||
}
|
||||
|
||||
val json = webClient.httpGet(url).parseJson()
|
||||
json.getStringOrNull("error")?.let {
|
||||
throw ParseException(it, url)
|
||||
}
|
||||
json.getStringOrNull("message")?.let {
|
||||
throw ParseException(it, url)
|
||||
}
|
||||
return parseMangaList(json)
|
||||
}
|
||||
|
||||
private fun parseMangaList(json: JSONObject): List<Manga> {
|
||||
val entries = json.optJSONArray("entries") ?: return emptyList()
|
||||
val results = ArrayList<Manga>(entries.length())
|
||||
|
||||
for (i in 0 until entries.length()) {
|
||||
val entry = entries.getJSONObject(i)
|
||||
val id = entry.getLong("id")
|
||||
val key = entry.getString("key")
|
||||
val url = "$id/$key"
|
||||
|
||||
results.add(
|
||||
Manga(
|
||||
id = generateUid(id),
|
||||
url = url,
|
||||
publicUrl = "https://$domain/g/$url",
|
||||
title = entry.getString("title"),
|
||||
altTitles = emptySet(),
|
||||
authors = emptySet(),
|
||||
tags = emptySet(),
|
||||
rating = RATING_UNKNOWN,
|
||||
state = null,
|
||||
coverUrl = entry.getJSONObject("thumbnail").getString("path"),
|
||||
contentRating = ContentRating.ADULT,
|
||||
source = source,
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
return results
|
||||
}
|
||||
|
||||
private fun parseMangaDetail(json: JSONObject): Manga {
|
||||
val data = json.getJSONObject("data")
|
||||
val id = data.getLong("id")
|
||||
val key = data.getString("key")
|
||||
val url = "$id/$key"
|
||||
|
||||
var author: String? = null
|
||||
val tags = data.optJSONArray("tags")
|
||||
if (tags != null) {
|
||||
for (i in 0 until tags.length()) {
|
||||
val tag = tags.getJSONObject(i)
|
||||
if (tag.getInt("namespace") == 1) {
|
||||
author = tag.getString("name")
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return Manga(
|
||||
id = generateUid(id),
|
||||
url = url,
|
||||
publicUrl = "https://$domain/g/$url",
|
||||
title = data.getString("title"),
|
||||
altTitles = emptySet(),
|
||||
authors = setOfNotNull(author),
|
||||
tags = emptySet(),
|
||||
rating = RATING_UNKNOWN,
|
||||
state = null,
|
||||
coverUrl = data.getJSONObject("thumbnails").getJSONObject("main").getString("path"),
|
||||
contentRating = ContentRating.ADULT,
|
||||
source = source,
|
||||
)
|
||||
}
|
||||
|
||||
override suspend fun getDetails(manga: Manga): Manga {
|
||||
val url = manga.url
|
||||
val response = webClient.httpGet("https://$apiSuffix/books/detail/$url").parseJson()
|
||||
|
||||
val id = response.getLong("id")
|
||||
val key = response.getString("key")
|
||||
val mangaUrl = "$id/$key"
|
||||
|
||||
val tagsList = mutableSetOf<MangaTag>()
|
||||
var author: String? = null
|
||||
val tags = response.optJSONArray("tags")
|
||||
|
||||
if (tags != null) {
|
||||
for (i in 0 until tags.length()) {
|
||||
val tag = tags.getJSONObject(i)
|
||||
if (tag.has("namespace")) {
|
||||
val namespace = tag.getInt("namespace")
|
||||
val tagName = tag.getString("name")
|
||||
|
||||
when (namespace) {
|
||||
1 -> {
|
||||
author = tagName
|
||||
}
|
||||
|
||||
0, 3, 8, 9, 10, 12 -> {
|
||||
tagsList.add(
|
||||
MangaTag(
|
||||
key = tagName,
|
||||
title = tagName.toTitleCase(sourceLocale),
|
||||
source = source,
|
||||
),
|
||||
)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
val tagName = tag.getString("name")
|
||||
tagsList.add(
|
||||
MangaTag(
|
||||
key = tagName,
|
||||
title = tagName.toTitleCase(sourceLocale),
|
||||
source = source,
|
||||
),
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val description = buildString {
|
||||
val created = response.getLongOrDefault("created_at", 0L)
|
||||
if (created > 0) {
|
||||
append("<b>Posted:</b> ").append(SimpleDateFormat("yyyy-MM-dd", Locale.US).format(created)).append("\n")
|
||||
}
|
||||
|
||||
val thumbnails = response.getJSONObject("thumbnails")
|
||||
val pageCount = thumbnails.optJSONArray("entries")?.length() ?: 0
|
||||
append("<b>Pages:</b> ").append(pageCount)
|
||||
}
|
||||
|
||||
val thumbnails = response.getJSONObject("thumbnails")
|
||||
val base = thumbnails.getString("base")
|
||||
val mainPath = thumbnails.getJSONObject("main").getString("path")
|
||||
val coverUrl = base + mainPath
|
||||
|
||||
return Manga(
|
||||
id = generateUid(id),
|
||||
url = mangaUrl,
|
||||
publicUrl = "https://$domain/g/$mangaUrl",
|
||||
title = response.getString("title"),
|
||||
altTitles = emptySet(),
|
||||
authors = setOfNotNull(author),
|
||||
tags = tagsList,
|
||||
rating = RATING_UNKNOWN,
|
||||
state = MangaState.FINISHED,
|
||||
description = description,
|
||||
coverUrl = coverUrl,
|
||||
contentRating = ContentRating.ADULT,
|
||||
source = source,
|
||||
chapters = listOf(
|
||||
MangaChapter(
|
||||
id = generateUid("$mangaUrl/chapter"),
|
||||
title = null,
|
||||
number = 1f,
|
||||
url = mangaUrl,
|
||||
scanlator = null,
|
||||
uploadDate = response.getLongOrDefault("created_at", 0L),
|
||||
branch = null,
|
||||
source = source,
|
||||
volume = 0,
|
||||
),
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
override suspend fun getPages(chapter: MangaChapter): List<MangaPage> {
|
||||
val mangaUrl = chapter.url
|
||||
val parts = mangaUrl.split('/')
|
||||
if (parts.size < 2) {
|
||||
throw ParseException("Invalid URL", mangaUrl)
|
||||
}
|
||||
|
||||
val id = parts[0]
|
||||
val key = parts[1]
|
||||
|
||||
val clearance = getClearance(chapter.publicUrl())
|
||||
|
||||
val dataUrl = "https://$apiSuffix/books/detail/$id/$key?crt=$clearance"
|
||||
val data = try {
|
||||
webClient.httpPost(
|
||||
url = dataUrl.toHttpUrl(),
|
||||
form = emptyMap(),
|
||||
extraHeaders = getRequestHeaders(),
|
||||
).parseJson().getJSONObject("data")
|
||||
} catch (e: HttpStatusException) {
|
||||
if (e.statusCode == HttpURLConnection.HTTP_FORBIDDEN) {
|
||||
// Token may be invalid or expired
|
||||
// WebView should be closed after receiving Token
|
||||
context.requestBrowserAction(this, chapter.publicUrl())
|
||||
}
|
||||
throw e
|
||||
}
|
||||
|
||||
val preferredRes = config[preferredImageResolutionKey] ?: "1280"
|
||||
val resolutionOrder = when (preferredRes) {
|
||||
"1600" -> listOf("1600", "1280", "0", "980", "780")
|
||||
"1280" -> listOf("1280", "1600", "0", "980", "780")
|
||||
"980" -> listOf("980", "1280", "0", "1600", "780")
|
||||
"780" -> listOf("780", "980", "0", "1280", "1600")
|
||||
else -> listOf("0", "1600", "1280", "980", "780")
|
||||
}
|
||||
|
||||
var selectedImageId: Int? = null
|
||||
var selectedPublicKey: String? = null
|
||||
var selectedQuality = "0"
|
||||
|
||||
for (res in resolutionOrder) {
|
||||
if (data.has(res) && !data.isNull(res)) {
|
||||
val resData = data.getJSONObject(res)
|
||||
if (resData.has("id") && resData.has("key")) {
|
||||
selectedImageId = resData.getInt("id")
|
||||
selectedPublicKey = resData.getString("key")
|
||||
selectedQuality = res
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (selectedImageId == null || selectedPublicKey == null) {
|
||||
throw ParseException("Cant find image data", dataUrl)
|
||||
}
|
||||
|
||||
val imagesResponse = webClient.httpGet(
|
||||
"https://$apiSuffix/books/data/$id/$key/$selectedImageId/$selectedPublicKey/$selectedQuality?crt=$clearance",
|
||||
).parseJson()
|
||||
|
||||
val base = imagesResponse.getString("base")
|
||||
val entries = imagesResponse.getJSONArray("entries")
|
||||
|
||||
val pages = ArrayList<MangaPage>(entries.length())
|
||||
for (i in 0 until entries.length()) {
|
||||
val imagePath = entries.getJSONObject(i).getString("path")
|
||||
val fullImageUrl = "$base$imagePath"
|
||||
|
||||
pages.add(
|
||||
MangaPage(
|
||||
id = generateUid(fullImageUrl),
|
||||
url = fullImageUrl,
|
||||
preview = null,
|
||||
source = source,
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
return pages
|
||||
}
|
||||
|
||||
private suspend fun fetchTags(namespace: Int): Set<MangaTag> =
|
||||
webClient.httpGet("https://$apiSuffix/books/tags/filters").parseJsonArray().mapJSONNotNullToSet {
|
||||
if (it.getIntOrDefault("namespace", 0) != namespace) {
|
||||
null
|
||||
} else {
|
||||
MangaTag(
|
||||
title = it.getStringOrNull("name")
|
||||
?.toTitleCase(sourceLocale) ?: return@mapJSONNotNullToSet null,
|
||||
key = it.getStringOrNull("id") ?: return@mapJSONNotNullToSet null,
|
||||
source = source,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
private suspend fun fetchAuthorsIds(): Map<String, String> = fetchTags(namespace = 1)
|
||||
.associate { it.title.lowercase() to it.key }
|
||||
|
||||
private suspend fun getClearance(chapterUrl: String): String = WebViewHelper(context)
|
||||
.getLocalStorageValue(domain, "clearance")?.removeSurrounding('"')?.nullIfEmpty()
|
||||
?: context.requestBrowserAction(this, chapterUrl)
|
||||
|
||||
private fun MangaChapter.publicUrl() = "https://$domain/g/$url/read/1"
|
||||
}
|
||||
@ -0,0 +1,493 @@
|
||||
package org.koitharu.kotatsu.parsers.site.all
|
||||
|
||||
import kotlinx.coroutines.async
|
||||
import kotlinx.coroutines.awaitAll
|
||||
import kotlinx.coroutines.coroutineScope
|
||||
import okhttp3.HttpUrl.Companion.toHttpUrl
|
||||
import okhttp3.Interceptor
|
||||
import okhttp3.Response
|
||||
import org.jsoup.Jsoup
|
||||
import org.jsoup.nodes.Document
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.MangaParserAuthProvider
|
||||
import org.koitharu.kotatsu.parsers.MangaSourceParser
|
||||
import org.koitharu.kotatsu.parsers.bitmap.Rect
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.PagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.util.*
|
||||
import org.koitharu.kotatsu.parsers.util.suspendlazy.suspendLazy
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.*
|
||||
import kotlin.math.min
|
||||
|
||||
private const val PIECE_SIZE = 200
|
||||
private const val MIN_SPLIT_COUNT = 5
|
||||
|
||||
internal abstract class MangaFireParser(
|
||||
context: MangaLoaderContext,
|
||||
source: MangaParserSource,
|
||||
private val siteLang: String,
|
||||
) : PagedMangaParser(context, source, 30), Interceptor, MangaParserAuthProvider {
|
||||
|
||||
override val configKeyDomain: ConfigKey.Domain = ConfigKey.Domain("mangafire.to")
|
||||
|
||||
override val availableSortOrders: Set<SortOrder> = EnumSet.of(
|
||||
SortOrder.UPDATED,
|
||||
SortOrder.POPULARITY,
|
||||
SortOrder.RATING,
|
||||
SortOrder.NEWEST,
|
||||
SortOrder.ALPHABETICAL,
|
||||
SortOrder.RELEVANCE,
|
||||
)
|
||||
|
||||
override fun onCreateConfig(keys: MutableCollection<ConfigKey<*>>) {
|
||||
super.onCreateConfig(keys)
|
||||
keys.add(userAgentKey)
|
||||
}
|
||||
|
||||
override val authUrl: String
|
||||
get() = "https://${domain}"
|
||||
|
||||
override suspend fun isAuthorized(): Boolean {
|
||||
return context.cookieJar.getCookies(domain).any {
|
||||
it.value.contains("user")
|
||||
}
|
||||
}
|
||||
|
||||
override suspend fun getUsername(): String {
|
||||
val body = webClient.httpGet("https://${domain}/user/profile").parseHtml().body()
|
||||
return body.selectFirst("form.ajax input[name*=username]")?.attr("value")
|
||||
?: body.parseFailed("Cannot find username")
|
||||
}
|
||||
|
||||
private val tags = suspendLazy(soft = true) {
|
||||
webClient.httpGet("https://$domain/filter").parseHtml()
|
||||
.select(".genres > li").map {
|
||||
MangaTag(
|
||||
title = it.selectFirstOrThrow("label").ownText().toTitleCase(sourceLocale),
|
||||
key = it.selectFirstOrThrow("input").attr("value"),
|
||||
source = source,
|
||||
)
|
||||
}.associateBy { it.title }
|
||||
}
|
||||
|
||||
override val filterCapabilities: MangaListFilterCapabilities
|
||||
get() = MangaListFilterCapabilities(
|
||||
isMultipleTagsSupported = true,
|
||||
isTagsExclusionSupported = true,
|
||||
isSearchSupported = true,
|
||||
)
|
||||
|
||||
override suspend fun getFilterOptions() = MangaListFilterOptions(
|
||||
availableTags = tags.get().values.toSet(),
|
||||
availableStates = EnumSet.of(
|
||||
MangaState.ONGOING,
|
||||
MangaState.FINISHED,
|
||||
MangaState.ABANDONED,
|
||||
MangaState.PAUSED,
|
||||
MangaState.UPCOMING,
|
||||
),
|
||||
)
|
||||
|
||||
override suspend fun getListPage(page: Int, order: SortOrder, filter: MangaListFilter): List<Manga> {
|
||||
val url = "https://$domain/filter".toHttpUrl().newBuilder().apply {
|
||||
addQueryParameter("page", page.toString())
|
||||
addQueryParameter("language[]", siteLang)
|
||||
|
||||
when {
|
||||
!filter.query.isNullOrEmpty() -> {
|
||||
val encodedQuery = filter.query.splitByWhitespace().joinToString(separator = "+") { part ->
|
||||
part.urlEncoded()
|
||||
}
|
||||
addEncodedQueryParameter("keyword", encodedQuery)
|
||||
addQueryParameter(
|
||||
name = "sort",
|
||||
value = when (order) {
|
||||
SortOrder.UPDATED -> "recently_updated"
|
||||
SortOrder.POPULARITY -> "most_viewed"
|
||||
SortOrder.RATING -> "scores"
|
||||
SortOrder.NEWEST -> "release_date"
|
||||
SortOrder.ALPHABETICAL -> "title_az"
|
||||
SortOrder.RELEVANCE -> "most_relevance"
|
||||
else -> ""
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
else -> {
|
||||
filter.tagsExclude.forEach { tag ->
|
||||
addQueryParameter("genre[]", "-${tag.key}")
|
||||
}
|
||||
filter.tags.forEach { tag ->
|
||||
addQueryParameter("genre[]", tag.key)
|
||||
}
|
||||
filter.locale?.let {
|
||||
addQueryParameter("language[]", it.language)
|
||||
}
|
||||
filter.states.forEach { state ->
|
||||
addQueryParameter(
|
||||
name = "status[]",
|
||||
value = when (state) {
|
||||
MangaState.ONGOING -> "releasing"
|
||||
MangaState.FINISHED -> "completed"
|
||||
MangaState.ABANDONED -> "discontinued"
|
||||
MangaState.PAUSED -> "on_hiatus"
|
||||
MangaState.UPCOMING -> "info"
|
||||
else -> throw IllegalArgumentException("$state not supported")
|
||||
},
|
||||
)
|
||||
}
|
||||
addQueryParameter(
|
||||
name = "sort",
|
||||
value = when (order) {
|
||||
SortOrder.UPDATED -> "recently_updated"
|
||||
SortOrder.POPULARITY -> "most_viewed"
|
||||
SortOrder.RATING -> "scores"
|
||||
SortOrder.NEWEST -> "release_date"
|
||||
SortOrder.ALPHABETICAL -> "title_az"
|
||||
SortOrder.RELEVANCE -> "most_relevance"
|
||||
else -> ""
|
||||
},
|
||||
)
|
||||
}
|
||||
}
|
||||
}.build()
|
||||
|
||||
return webClient.httpGet(url)
|
||||
.parseHtml().parseMangaList()
|
||||
}
|
||||
|
||||
private fun Document.parseMangaList(): List<Manga> {
|
||||
return select(".original.card-lg .unit .inner").map {
|
||||
val a = it.selectFirstOrThrow(".info > a")
|
||||
val mangaUrl = a.attrAsRelativeUrl("href")
|
||||
Manga(
|
||||
id = generateUid(mangaUrl),
|
||||
url = mangaUrl,
|
||||
publicUrl = mangaUrl.toAbsoluteUrl(domain),
|
||||
title = a.ownText(),
|
||||
coverUrl = it.selectFirstOrThrow("img").attrAsAbsoluteUrl("src"),
|
||||
source = source,
|
||||
altTitles = emptySet(),
|
||||
largeCoverUrl = null,
|
||||
authors = emptySet(),
|
||||
contentRating = null,
|
||||
rating = RATING_UNKNOWN,
|
||||
state = null,
|
||||
tags = emptySet(),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
override suspend fun getDetails(manga: Manga): Manga {
|
||||
val document = webClient.httpGet(manga.url.toAbsoluteUrl(domain)).parseHtml()
|
||||
val availableTags = tags.get()
|
||||
var isAdult = false
|
||||
var isSuggestive = false
|
||||
val author = document.select("div.meta a[href*=/author/]")
|
||||
.joinToString { it.ownText() }.nullIfEmpty()
|
||||
|
||||
return manga.copy(
|
||||
title = document.selectFirstOrThrow(".info > h1").ownText(),
|
||||
altTitles = setOfNotNull(document.selectFirst(".info > h6")?.ownTextOrNull()),
|
||||
rating = document.selectFirst("div.rating-box")?.attr("data-score")
|
||||
?.toFloatOrNull()?.div(10) ?: RATING_UNKNOWN,
|
||||
coverUrl = document.selectFirstOrThrow("div.manga-detail div.poster img")
|
||||
.attrAsAbsoluteUrl("src"),
|
||||
tags = document.select("div.meta a[href*=/genre/]").mapNotNullToSet {
|
||||
val tag = it.ownText()
|
||||
if (tag == "Hentai") {
|
||||
isAdult = true
|
||||
} else if (tag == "Ecchi") {
|
||||
isSuggestive = true
|
||||
}
|
||||
availableTags[tag.toTitleCase(sourceLocale)]
|
||||
},
|
||||
contentRating = when {
|
||||
isAdult -> ContentRating.ADULT
|
||||
isSuggestive -> ContentRating.SUGGESTIVE
|
||||
else -> ContentRating.SAFE
|
||||
},
|
||||
state = document.selectFirst(".info > p")?.ownText()?.let {
|
||||
when (it.lowercase()) {
|
||||
"releasing" -> MangaState.ONGOING
|
||||
"completed" -> MangaState.FINISHED
|
||||
"discontinued" -> MangaState.ABANDONED
|
||||
"on_hiatus" -> MangaState.PAUSED
|
||||
"info" -> MangaState.UPCOMING
|
||||
else -> null
|
||||
}
|
||||
},
|
||||
authors = setOfNotNull(author),
|
||||
description = document.selectFirstOrThrow("#synopsis div.modal-content").html(),
|
||||
chapters = getChapters(manga.url, document),
|
||||
)
|
||||
}
|
||||
|
||||
private data class ChapterBranch(
|
||||
val type: String,
|
||||
val langCode: String,
|
||||
val langTitle: String,
|
||||
)
|
||||
|
||||
private suspend fun getChapters(mangaUrl: String, document: Document): List<MangaChapter> {
|
||||
val availableTypes = document.select(".chapvol-tab > a").map {
|
||||
it.attr("data-name")
|
||||
}
|
||||
val langTypePairs = document.select(".m-list div.tab-content").flatMap {
|
||||
val type = it.attr("data-name")
|
||||
|
||||
it.select(".list-menu .dropdown-item").map { item ->
|
||||
ChapterBranch(
|
||||
type = type,
|
||||
langCode = item.attr("data-code").lowercase(),
|
||||
langTitle = item.attr("data-title"),
|
||||
)
|
||||
}
|
||||
}.filter {
|
||||
it.langCode == siteLang && availableTypes.contains(it.type)
|
||||
}
|
||||
|
||||
val id = mangaUrl.substringAfterLast('.')
|
||||
|
||||
return coroutineScope {
|
||||
langTypePairs.map {
|
||||
async {
|
||||
getChaptersBranch(id, it)
|
||||
}
|
||||
}.awaitAll().flatten()
|
||||
}
|
||||
}
|
||||
|
||||
private suspend fun getChaptersBranch(mangaId: String, branch: ChapterBranch): List<MangaChapter> {
|
||||
val chapterElements = webClient
|
||||
.httpGet("https://$domain/ajax/read/$mangaId/${branch.type}/${branch.langCode}")
|
||||
.parseJson()
|
||||
.getJSONObject("result")
|
||||
.getString("html")
|
||||
.let(Jsoup::parseBodyFragment)
|
||||
.select("ul li a")
|
||||
|
||||
if (branch.type == "chapter") {
|
||||
val doc = webClient
|
||||
.httpGet("https://$domain/ajax/manga/$mangaId/${branch.type}/${branch.langCode}")
|
||||
.parseJson()
|
||||
.getString("result")
|
||||
.let(Jsoup::parseBodyFragment)
|
||||
|
||||
doc.select("ul li a").withIndex().forEach { (i, it) ->
|
||||
val date = it.select("span")[1].ownText()
|
||||
chapterElements[i].attr("upload-date", date)
|
||||
chapterElements[i].attr("other-title", it.attr("title"))
|
||||
}
|
||||
}
|
||||
|
||||
return chapterElements.mapChapters(reversed = true) { _, it ->
|
||||
MangaChapter(
|
||||
id = generateUid(it.attr("href")),
|
||||
title = it.attr("title").ifBlank {
|
||||
"${branch.type.toTitleCase()} ${it.attr("data-number")}"
|
||||
},
|
||||
number = it.attr("data-number").toFloat(),
|
||||
volume = it.attr("other-title").let {
|
||||
volumeNumRegex.find(it)?.groupValues?.getOrNull(2)?.toInt() ?: 0
|
||||
},
|
||||
url = "${branch.type}/${it.attr("data-id")}",
|
||||
scanlator = null,
|
||||
uploadDate = dateFormat.parseSafe(it.attr("upload-date")),
|
||||
branch = "${branch.langTitle} ${branch.type.toTitleCase()}",
|
||||
source = source,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
private val dateFormat = SimpleDateFormat("MMM dd, yyyy", Locale.ENGLISH)
|
||||
private val volumeNumRegex = Regex("""vol(ume)?\s*(\d+)""", RegexOption.IGNORE_CASE)
|
||||
|
||||
override suspend fun getRelatedManga(seed: Manga): List<Manga> = coroutineScope {
|
||||
val document = webClient.httpGet(seed.url.toAbsoluteUrl(domain)).parseHtml()
|
||||
val total = document.select(
|
||||
"section.m-related a[href*=/manga/], .side-manga:not(:has(.head:contains(trending))) .unit",
|
||||
).size
|
||||
val mangas = ArrayList<Manga>(total)
|
||||
|
||||
// "Related Manga"
|
||||
document.select("section.m-related a[href*=/manga/]").map {
|
||||
async {
|
||||
val url = it.attrAsRelativeUrl("href")
|
||||
|
||||
val mangaDocument = webClient
|
||||
.httpGet(url.toAbsoluteUrl(domain))
|
||||
.parseHtml()
|
||||
|
||||
val chaptersInManga = mangaDocument.select(".m-list div.tab-content .list-menu .dropdown-item")
|
||||
.map { it.attr("data-code").lowercase() }
|
||||
|
||||
|
||||
if (!chaptersInManga.contains(siteLang)) {
|
||||
return@async null
|
||||
}
|
||||
|
||||
Manga(
|
||||
id = generateUid(url),
|
||||
url = url,
|
||||
publicUrl = url.toAbsoluteUrl(domain),
|
||||
title = it.ownText(),
|
||||
coverUrl = mangaDocument.selectFirstOrThrow("div.manga-detail div.poster img")
|
||||
.attrAsAbsoluteUrl("src"),
|
||||
source = source,
|
||||
altTitles = emptySet(),
|
||||
largeCoverUrl = null,
|
||||
authors = emptySet(),
|
||||
contentRating = null,
|
||||
rating = RATING_UNKNOWN,
|
||||
state = null,
|
||||
tags = emptySet(),
|
||||
)
|
||||
}
|
||||
}.awaitAll()
|
||||
.filterNotNullTo(mangas)
|
||||
|
||||
// "You may also like"
|
||||
document.select(".side-manga:not(:has(.head:contains(trending))) .unit").forEach {
|
||||
val url = it.attrAsRelativeUrl("href")
|
||||
mangas.add(
|
||||
Manga(
|
||||
id = generateUid(url),
|
||||
url = url,
|
||||
publicUrl = url.toAbsoluteUrl(domain),
|
||||
title = it.selectFirstOrThrow(".info h6").ownText(),
|
||||
coverUrl = it.selectFirstOrThrow(".poster img").attrAsAbsoluteUrl("src"),
|
||||
source = source,
|
||||
altTitles = emptySet(),
|
||||
largeCoverUrl = null,
|
||||
authors = emptySet(),
|
||||
contentRating = null,
|
||||
rating = RATING_UNKNOWN,
|
||||
state = null,
|
||||
tags = emptySet(),
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
mangas.ifEmpty {
|
||||
// fallback: author's other works
|
||||
document.select("div.meta a[href*=/author/]").map {
|
||||
async {
|
||||
val url = it.attrAsAbsoluteUrl("href").toHttpUrl()
|
||||
.newBuilder()
|
||||
.addQueryParameter("language[]", siteLang)
|
||||
.build()
|
||||
|
||||
webClient.httpGet(url)
|
||||
.parseHtml().parseMangaList()
|
||||
}
|
||||
}.awaitAll().flatten()
|
||||
}
|
||||
}
|
||||
|
||||
override suspend fun getPages(chapter: MangaChapter): List<MangaPage> {
|
||||
val images = webClient
|
||||
.httpGet("https://$domain/ajax/read/${chapter.url}")
|
||||
.parseJson()
|
||||
.getJSONObject("result")
|
||||
.getJSONArray("images")
|
||||
|
||||
val pages = ArrayList<MangaPage>(images.length())
|
||||
|
||||
for (i in 0 until images.length()) {
|
||||
val img = images.getJSONArray(i)
|
||||
|
||||
val url = img.getString(0)
|
||||
val offset = img.getInt(2)
|
||||
|
||||
pages.add(
|
||||
MangaPage(
|
||||
id = generateUid(url),
|
||||
url = if (offset < 1) {
|
||||
url
|
||||
} else {
|
||||
"$url#scrambled_$offset"
|
||||
},
|
||||
preview = null,
|
||||
source = source,
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
return pages
|
||||
}
|
||||
|
||||
override fun intercept(chain: Interceptor.Chain): Response {
|
||||
val request = chain.request()
|
||||
val response = chain.proceed(request)
|
||||
|
||||
if (request.url.fragment?.startsWith("scrambled") != true) {
|
||||
return response
|
||||
}
|
||||
|
||||
return context.redrawImageResponse(response) { bitmap ->
|
||||
val offset = request.url.fragment!!.substringAfter("_").toInt()
|
||||
val width = bitmap.width
|
||||
val height = bitmap.height
|
||||
|
||||
val result = context.createBitmap(width, height)
|
||||
|
||||
val pieceWidth = min(PIECE_SIZE, width.ceilDiv(MIN_SPLIT_COUNT))
|
||||
val pieceHeight = min(PIECE_SIZE, height.ceilDiv(MIN_SPLIT_COUNT))
|
||||
val xMax = width.ceilDiv(pieceWidth) - 1
|
||||
val yMax = height.ceilDiv(pieceHeight) - 1
|
||||
|
||||
for (y in 0..yMax) {
|
||||
for (x in 0..xMax) {
|
||||
val xDst = pieceWidth * x
|
||||
val yDst = pieceHeight * y
|
||||
val w = min(pieceWidth, width - xDst)
|
||||
val h = min(pieceHeight, height - yDst)
|
||||
|
||||
val xSrc = pieceWidth * when (x) {
|
||||
xMax -> x // margin
|
||||
else -> (xMax - x + offset) % xMax
|
||||
}
|
||||
val ySrc = pieceHeight * when (y) {
|
||||
yMax -> y // margin
|
||||
else -> (yMax - y + offset) % yMax
|
||||
}
|
||||
|
||||
val srcRect = Rect(xSrc, ySrc, xSrc + w, ySrc + h)
|
||||
val dstRect = Rect(xDst, yDst, xDst + w, yDst + h)
|
||||
|
||||
result.drawBitmap(bitmap, srcRect, dstRect)
|
||||
}
|
||||
}
|
||||
|
||||
result
|
||||
}
|
||||
}
|
||||
|
||||
private fun Int.ceilDiv(other: Int) = (this + (other - 1)) / other
|
||||
|
||||
@MangaSourceParser("MANGAFIRE_EN", "MangaFire English", "en")
|
||||
class English(context: MangaLoaderContext) : MangaFireParser(context, MangaParserSource.MANGAFIRE_EN, "en")
|
||||
|
||||
@MangaSourceParser("MANGAFIRE_ES", "MangaFire Spanish", "es")
|
||||
class Spanish(context: MangaLoaderContext) : MangaFireParser(context, MangaParserSource.MANGAFIRE_ES, "es")
|
||||
|
||||
@MangaSourceParser("MANGAFIRE_ESLA", "MangaFire Spanish (Latim)", "es")
|
||||
class SpanishLatim(context: MangaLoaderContext) :
|
||||
MangaFireParser(context, MangaParserSource.MANGAFIRE_ESLA, "es-la")
|
||||
|
||||
@MangaSourceParser("MANGAFIRE_FR", "MangaFire French", "fr")
|
||||
class French(context: MangaLoaderContext) : MangaFireParser(context, MangaParserSource.MANGAFIRE_FR, "fr")
|
||||
|
||||
@MangaSourceParser("MANGAFIRE_JA", "MangaFire Japanese", "ja")
|
||||
class Japanese(context: MangaLoaderContext) : MangaFireParser(context, MangaParserSource.MANGAFIRE_JA, "ja")
|
||||
|
||||
@MangaSourceParser("MANGAFIRE_PT", "MangaFire Portuguese", "pt")
|
||||
class Portuguese(context: MangaLoaderContext) : MangaFireParser(context, MangaParserSource.MANGAFIRE_PT, "pt")
|
||||
|
||||
@MangaSourceParser("MANGAFIRE_PTBR", "MangaFire Portuguese (Brazil)", "pt")
|
||||
class PortugueseBR(context: MangaLoaderContext) :
|
||||
MangaFireParser(context, MangaParserSource.MANGAFIRE_PTBR, "pt-br")
|
||||
}
|
||||
@ -0,0 +1,390 @@
|
||||
package org.koitharu.kotatsu.parsers.site.all
|
||||
|
||||
import androidx.collection.MutableIntObjectMap
|
||||
import okhttp3.HttpUrl.Companion.toHttpUrl
|
||||
import okhttp3.Interceptor
|
||||
import okhttp3.Response
|
||||
import org.jsoup.Jsoup
|
||||
import org.jsoup.nodes.Document
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.MangaParserAuthProvider
|
||||
import org.koitharu.kotatsu.parsers.MangaSourceParser
|
||||
import org.koitharu.kotatsu.parsers.bitmap.Bitmap
|
||||
import org.koitharu.kotatsu.parsers.bitmap.Rect
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.PagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.util.*
|
||||
import org.koitharu.kotatsu.parsers.util.suspendlazy.suspendLazy
|
||||
import java.util.*
|
||||
import javax.crypto.Cipher
|
||||
import javax.crypto.spec.SecretKeySpec
|
||||
import kotlin.math.min
|
||||
|
||||
@MangaSourceParser("MANGAREADERTO", "MangaReader.To")
|
||||
internal class MangaReaderToParser(context: MangaLoaderContext) :
|
||||
PagedMangaParser(context, MangaParserSource.MANGAREADERTO, 16),
|
||||
Interceptor, MangaParserAuthProvider {
|
||||
|
||||
override val configKeyDomain = ConfigKey.Domain("mangareader.to")
|
||||
|
||||
override fun onCreateConfig(keys: MutableCollection<ConfigKey<*>>) {
|
||||
super.onCreateConfig(keys)
|
||||
keys.add(userAgentKey)
|
||||
}
|
||||
|
||||
override val authUrl: String
|
||||
get() = "https://${domain}/home"
|
||||
|
||||
override suspend fun isAuthorized(): Boolean {
|
||||
return context.cookieJar.getCookies(domain).any {
|
||||
it.name.contains("connect.sid")
|
||||
}
|
||||
}
|
||||
|
||||
// It will be easier to connect to a manga page, as the source redirects to a lot of advertising.
|
||||
override suspend fun getUsername(): String {
|
||||
val body = webClient.httpGet("https://${domain}/user/profile").parseHtml().body()
|
||||
return body.getElementById("pro5-name")?.attr("value") ?: body.parseFailed("Cannot find username")
|
||||
}
|
||||
|
||||
override val availableSortOrders: Set<SortOrder> = EnumSet.of(
|
||||
SortOrder.POPULARITY,
|
||||
SortOrder.RATING,
|
||||
SortOrder.UPDATED,
|
||||
SortOrder.NEWEST,
|
||||
SortOrder.ALPHABETICAL,
|
||||
)
|
||||
|
||||
val tags = suspendLazy(soft = true) {
|
||||
val document = webClient.httpGet("https://$domain/filter").parseHtml()
|
||||
|
||||
document.select("div.f-genre-item").map {
|
||||
MangaTag(
|
||||
title = it.ownText().toTitleCase(sourceLocale),
|
||||
key = it.attr("data-id"),
|
||||
source = source,
|
||||
)
|
||||
}.associateBy { it.title }
|
||||
}
|
||||
|
||||
override val filterCapabilities: MangaListFilterCapabilities
|
||||
get() = MangaListFilterCapabilities(
|
||||
isMultipleTagsSupported = true,
|
||||
isSearchSupported = true,
|
||||
)
|
||||
|
||||
override suspend fun getFilterOptions() = MangaListFilterOptions(
|
||||
availableTags = tags.get().values.toSet(),
|
||||
availableStates = EnumSet.of(
|
||||
MangaState.ONGOING,
|
||||
MangaState.FINISHED,
|
||||
MangaState.ABANDONED,
|
||||
MangaState.PAUSED,
|
||||
MangaState.UPCOMING,
|
||||
),
|
||||
)
|
||||
|
||||
override suspend fun getListPage(page: Int, order: SortOrder, filter: MangaListFilter): List<Manga> {
|
||||
val url = "https://$domain".toHttpUrl().newBuilder().apply {
|
||||
when {
|
||||
!filter.query.isNullOrEmpty() -> {
|
||||
addPathSegment("search")
|
||||
addQueryParameter("keyword", filter.query)
|
||||
addQueryParameter("page", page.toString())
|
||||
}
|
||||
|
||||
else -> {
|
||||
addPathSegment("filter")
|
||||
addQueryParameter("page", page.toString())
|
||||
addQueryParameter(
|
||||
name = "sort",
|
||||
value = when (order) {
|
||||
SortOrder.POPULARITY -> "most-viewed"
|
||||
SortOrder.RATING -> "score"
|
||||
SortOrder.UPDATED -> "latest-updated"
|
||||
SortOrder.NEWEST -> "release-date"
|
||||
SortOrder.ALPHABETICAL -> "name-az"
|
||||
else -> "default"
|
||||
},
|
||||
)
|
||||
addQueryParameter("genres", filter.tags.joinToString(",") { it.key })
|
||||
addQueryParameter(
|
||||
name = "status",
|
||||
value = when (val state = filter.states.oneOrThrowIfMany()) {
|
||||
MangaState.ONGOING -> "2"
|
||||
MangaState.FINISHED -> "1"
|
||||
MangaState.ABANDONED -> "4"
|
||||
MangaState.PAUSED -> "3"
|
||||
MangaState.UPCOMING -> "5"
|
||||
null -> ""
|
||||
else -> throw IllegalArgumentException("$state not supported")
|
||||
},
|
||||
)
|
||||
}
|
||||
}
|
||||
}.build()
|
||||
|
||||
val document = webClient.httpGet(url).parseHtml()
|
||||
|
||||
return document.select(".manga_list-sbs .manga-poster").map {
|
||||
val mangaUrl = it.attrAsRelativeUrl("href")
|
||||
val thumb = it.select("img")
|
||||
Manga(
|
||||
id = generateUid(mangaUrl),
|
||||
url = mangaUrl,
|
||||
publicUrl = mangaUrl.toAbsoluteUrl(domain),
|
||||
title = thumb.attr("alt"),
|
||||
coverUrl = thumb.attr("src"),
|
||||
source = source,
|
||||
altTitles = emptySet(),
|
||||
authors = emptySet(),
|
||||
contentRating = null,
|
||||
rating = RATING_UNKNOWN,
|
||||
state = null,
|
||||
tags = emptySet(),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
override suspend fun getRelatedManga(seed: Manga): List<Manga> {
|
||||
val document = webClient.httpGet(seed.url.toAbsoluteUrl(domain)).parseHtml()
|
||||
return document.select(".block_area_authors-other .manga_list-sbs .manga-poster, .featured-block-ul .manga-poster")
|
||||
.map {
|
||||
val mangaUrl = it.attrAsRelativeUrl("href")
|
||||
val thumb = it.selectFirstOrThrow("img")
|
||||
Manga(
|
||||
id = generateUid(mangaUrl),
|
||||
url = mangaUrl,
|
||||
publicUrl = mangaUrl.toAbsoluteUrl(domain),
|
||||
title = thumb.attr("alt"),
|
||||
coverUrl = thumb.attrAsAbsoluteUrlOrNull("src"),
|
||||
source = source,
|
||||
altTitles = emptySet(),
|
||||
authors = emptySet(),
|
||||
contentRating = null,
|
||||
rating = RATING_UNKNOWN,
|
||||
state = null,
|
||||
tags = emptySet(),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
override suspend fun getDetails(manga: Manga): Manga {
|
||||
val document = webClient.httpGet(manga.url.toAbsoluteUrl(domain)).parseHtml()
|
||||
val availableTags = tags.get()
|
||||
var isAdult = false
|
||||
var isSuggestive = false
|
||||
val author = document.select("div.anisc-info a[href*=/author/]")
|
||||
.joinToString { it.ownText().replace(", ", " ") }.nullIfEmpty()
|
||||
|
||||
return manga.copy(
|
||||
title = document.selectFirst("h2.manga-name")!!.ownText(),
|
||||
altTitles = setOfNotNull(document.selectFirst("div.manga-name-or")?.ownTextOrNull()),
|
||||
rating = document.selectFirst("div.anisc-info .item:contains(score:) > .name")
|
||||
?.text()?.toFloatOrNull()?.div(10) ?: RATING_UNKNOWN,
|
||||
coverUrl = document.selectFirst(".manga-poster > img")?.attrAsAbsoluteUrlOrNull("src"),
|
||||
tags = document.select("div.genres > a[href*=/genre/]").mapNotNullToSet {
|
||||
val tag = it.ownText()
|
||||
if (tag == "Hentai") {
|
||||
isAdult = true
|
||||
} else if (tag == "Ecchi") {
|
||||
isSuggestive = true
|
||||
}
|
||||
availableTags[tag]
|
||||
},
|
||||
contentRating = when {
|
||||
isAdult -> ContentRating.ADULT
|
||||
isSuggestive -> ContentRating.SUGGESTIVE
|
||||
else -> ContentRating.SAFE
|
||||
},
|
||||
state = document.selectFirst("div.anisc-info .item:contains(status:) > .name")
|
||||
?.text()?.let {
|
||||
when (it) {
|
||||
"Publishing" -> MangaState.ONGOING
|
||||
"Finished" -> MangaState.FINISHED
|
||||
"On Hiatus" -> MangaState.PAUSED
|
||||
"Discontinued" -> MangaState.ABANDONED
|
||||
"Not yet published" -> MangaState.UPCOMING
|
||||
else -> null
|
||||
}
|
||||
},
|
||||
authors = setOfNotNull(author),
|
||||
description = document.select("div.description").html(),
|
||||
chapters = parseChapters(document),
|
||||
source = source,
|
||||
)
|
||||
}
|
||||
|
||||
private fun parseChapters(document: Document): List<MangaChapter> {
|
||||
val total =
|
||||
document.select(".chapters-list-ul > ul > li.chapter-item, .volume-list-ul div.lang-volumes > div.item").size
|
||||
val chapters = ChaptersListBuilder(total)
|
||||
|
||||
document.select(".chapters-list-ul > ul").forEach { ul ->
|
||||
ul.select("li.chapter-item").reversed().forEach { li ->
|
||||
val a = li.selectFirst("a")!!
|
||||
|
||||
chapters.add(
|
||||
MangaChapter(
|
||||
id = generateUid(a.attrAsRelativeUrl("href")),
|
||||
title = a.attrOrNull("title"),
|
||||
number = li.attr("data-number").toFloat(),
|
||||
volume = 0,
|
||||
url = a.attrAsRelativeUrl("href"),
|
||||
scanlator = null,
|
||||
uploadDate = 0L,
|
||||
branch = createBranchName(ul.id().substringBefore("-chapters"), "Chapters"),
|
||||
source = source,
|
||||
),
|
||||
)
|
||||
}
|
||||
}
|
||||
val numRegex = Regex("""(\d+)""")
|
||||
document.select(".volume-list-ul div.lang-volumes").forEach { div ->
|
||||
div.select("div.item > div.manga-poster").reversed().forEach { vol ->
|
||||
val url = vol.selectFirst("a")!!.attrAsRelativeUrl("href")
|
||||
val name = vol.selectFirst("span")!!.ownText()
|
||||
chapters.add(
|
||||
MangaChapter(
|
||||
id = generateUid(url),
|
||||
title = name,
|
||||
number = numRegex.find(name)?.groupValues?.getOrNull(1)?.toFloatOrNull() ?: 0f,
|
||||
volume = 0,
|
||||
url = url,
|
||||
scanlator = null,
|
||||
uploadDate = 0L,
|
||||
branch = createBranchName(div.id().substringBefore("-volumes"), "Volumes"),
|
||||
source = source,
|
||||
),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
return chapters.toList()
|
||||
}
|
||||
|
||||
private fun createBranchName(lang: String, type: String): String {
|
||||
val langCode = lang.substringBefore("-")
|
||||
|
||||
return Locale(langCode).displayLanguage + " " + type
|
||||
}
|
||||
|
||||
override suspend fun getPages(chapter: MangaChapter): List<MangaPage> {
|
||||
val typeAndId = webClient.httpGet(chapter.url.toAbsoluteUrl(domain))
|
||||
.parseHtml()
|
||||
.selectFirst("#wrapper")!!.run {
|
||||
"${attr("data-reading-by")}/${attr("data-reading-id")}"
|
||||
}
|
||||
val document = webClient.httpGet("https://$domain/ajax/image/list/$typeAndId?quality=high")
|
||||
.parseJson()
|
||||
.getString("html")
|
||||
.let(Jsoup::parse)
|
||||
|
||||
return document.select(".iv-card").map {
|
||||
val url = it.attr("data-url")
|
||||
MangaPage(
|
||||
id = generateUid(url),
|
||||
url = if (it.hasClass("shuffled")) {
|
||||
"$url#scrambled"
|
||||
} else {
|
||||
url
|
||||
},
|
||||
preview = null,
|
||||
source = source,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
override fun intercept(chain: Interceptor.Chain): Response {
|
||||
val request = chain.request()
|
||||
val response = chain.proceed(request)
|
||||
|
||||
if (request.url.fragment != "scrambled") return response
|
||||
|
||||
return context.redrawImageResponse(response, ::descramble)
|
||||
}
|
||||
|
||||
private val memo = MutableIntObjectMap<IntArray>()
|
||||
|
||||
private fun descramble(bitmap: Bitmap): Bitmap = synchronized(memo) {
|
||||
val width = bitmap.width
|
||||
val height = bitmap.height
|
||||
|
||||
val result = context.createBitmap(width, height)
|
||||
|
||||
val pieces = ArrayList<Piece>()
|
||||
for (y in 0 until height step PIECE_SIZE) {
|
||||
for (x in 0 until width step PIECE_SIZE) {
|
||||
val w = min(PIECE_SIZE, width - x)
|
||||
val h = min(PIECE_SIZE, height - y)
|
||||
pieces.add(Piece(x, y, w, h))
|
||||
}
|
||||
}
|
||||
|
||||
val groups = pieces.groupBy { it.w shl 16 or it.h }
|
||||
|
||||
for (group in groups.values) {
|
||||
val size = group.size
|
||||
|
||||
val permutation = memo.getOrPut(size) {
|
||||
val random = SeedRandom("staystay")
|
||||
|
||||
// https://github.com/webcaetano/shuffle-seed
|
||||
val indices = (0 until size).toMutableList()
|
||||
IntArray(size) { indices.removeAt((random.nextDouble() * indices.size).toInt()) }
|
||||
}
|
||||
|
||||
for ((i, original) in permutation.withIndex()) {
|
||||
val src = group[i]
|
||||
val dst = group[original]
|
||||
|
||||
val srcRect = Rect(src.x, src.y, src.x + src.w, src.y + src.h)
|
||||
val dstRect = Rect(dst.x, dst.y, dst.x + dst.w, dst.y + dst.h)
|
||||
|
||||
result.drawBitmap(bitmap, srcRect, dstRect)
|
||||
}
|
||||
}
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
private class Piece(val x: Int, val y: Int, val w: Int, val h: Int)
|
||||
|
||||
// https://github.com/davidbau/seedrandom
|
||||
private class SeedRandom(key: String) {
|
||||
private val input = ByteArray(RC4_WIDTH)
|
||||
private val buffer = ByteArray(RC4_WIDTH)
|
||||
private var pos = RC4_WIDTH
|
||||
|
||||
private val rc4 = Cipher.getInstance("RC4").apply {
|
||||
init(Cipher.ENCRYPT_MODE, SecretKeySpec(key.toByteArray(), "RC4"))
|
||||
update(input, 0, RC4_WIDTH, buffer) // RC4-drop[256]
|
||||
}
|
||||
|
||||
fun nextDouble(): Double {
|
||||
var num = nextByte()
|
||||
var exp = 8
|
||||
while (num < 1L shl 52) {
|
||||
num = num shl 8 or nextByte()
|
||||
exp += 8
|
||||
}
|
||||
while (num >= 1L shl 53) {
|
||||
num = num ushr 1
|
||||
exp--
|
||||
}
|
||||
return Math.scalb(num.toDouble(), -exp)
|
||||
}
|
||||
|
||||
private fun nextByte(): Long {
|
||||
if (pos == RC4_WIDTH) {
|
||||
rc4.update(input, 0, RC4_WIDTH, buffer)
|
||||
pos = 0
|
||||
}
|
||||
return buffer[pos++].toLong() and 0xFF
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private const val RC4_WIDTH = 256
|
||||
private const val PIECE_SIZE = 200
|
||||
@ -0,0 +1,228 @@
|
||||
package org.koitharu.kotatsu.parsers.site.all
|
||||
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.MangaSourceParser
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.PagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.util.*
|
||||
import java.util.*
|
||||
|
||||
@MangaSourceParser("MANHWA210", "Manhwa210", type = ContentType.MANHWA)
|
||||
internal class Manhwa210(context: MangaLoaderContext) : PagedMangaParser(context, MangaParserSource.MANHWA210, 60) {
|
||||
|
||||
override val configKeyDomain = ConfigKey.Domain("manhwa210.com")
|
||||
|
||||
override fun onCreateConfig(keys: MutableCollection<ConfigKey<*>>) {
|
||||
super.onCreateConfig(keys)
|
||||
keys.add(userAgentKey)
|
||||
}
|
||||
|
||||
override val availableSortOrders: Set<SortOrder> = EnumSet.of(
|
||||
SortOrder.ALPHABETICAL,
|
||||
SortOrder.ALPHABETICAL_DESC,
|
||||
SortOrder.UPDATED,
|
||||
SortOrder.NEWEST,
|
||||
SortOrder.POPULARITY,
|
||||
)
|
||||
|
||||
override val filterCapabilities: MangaListFilterCapabilities
|
||||
get() = MangaListFilterCapabilities(
|
||||
isSearchSupported = true,
|
||||
)
|
||||
|
||||
override suspend fun getFilterOptions() = MangaListFilterOptions(
|
||||
availableTags = availableTags(),
|
||||
availableStates = EnumSet.of(MangaState.ONGOING, MangaState.FINISHED),
|
||||
)
|
||||
|
||||
override suspend fun getListPage(page: Int, order: SortOrder, filter: MangaListFilter): List<Manga> {
|
||||
val url = buildString {
|
||||
append("https://")
|
||||
append(domain)
|
||||
|
||||
when {
|
||||
|
||||
!filter.query.isNullOrEmpty() -> {
|
||||
append("/search")
|
||||
append("?filter[name]=")
|
||||
append(filter.query.urlEncoded())
|
||||
|
||||
if (page > 1) {
|
||||
append("&page=")
|
||||
append(page)
|
||||
}
|
||||
|
||||
append("&sort=")
|
||||
append(
|
||||
when (order) {
|
||||
SortOrder.POPULARITY -> "-views"
|
||||
SortOrder.UPDATED -> "-updated_at"
|
||||
SortOrder.NEWEST -> "-created_at"
|
||||
SortOrder.ALPHABETICAL -> "name"
|
||||
SortOrder.ALPHABETICAL_DESC -> "-name"
|
||||
else -> "-updated_at"
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
filter.tags.isNotEmpty() -> {
|
||||
val tag = filter.tags.first()
|
||||
append("/genre/")
|
||||
append(tag.key)
|
||||
|
||||
append("?page=")
|
||||
append(page)
|
||||
}
|
||||
|
||||
else -> {
|
||||
append("/list")
|
||||
append("?sort=")
|
||||
append(
|
||||
when (order) {
|
||||
SortOrder.POPULARITY -> "-views"
|
||||
SortOrder.UPDATED -> "-updated_at"
|
||||
SortOrder.NEWEST -> "-created_at"
|
||||
SortOrder.ALPHABETICAL -> "name"
|
||||
SortOrder.ALPHABETICAL_DESC -> "-name"
|
||||
else -> "-updated_at"
|
||||
},
|
||||
)
|
||||
append("&page=")
|
||||
append(page)
|
||||
}
|
||||
}
|
||||
|
||||
if (filter.query.isNullOrEmpty()) {
|
||||
append("&sort=")
|
||||
when (order) {
|
||||
SortOrder.POPULARITY -> append("-views")
|
||||
SortOrder.UPDATED -> append("-updated_at")
|
||||
SortOrder.NEWEST -> append("-created_at")
|
||||
SortOrder.ALPHABETICAL -> append("name")
|
||||
SortOrder.ALPHABETICAL_DESC -> append("-name")
|
||||
else -> append("-updated_at")
|
||||
}
|
||||
}
|
||||
|
||||
if (filter.states.isNotEmpty()) {
|
||||
append("&filter[status]=")
|
||||
filter.states.forEach {
|
||||
append(
|
||||
when (it) {
|
||||
MangaState.ONGOING -> "2,"
|
||||
MangaState.FINISHED -> "1,"
|
||||
else -> "1,2"
|
||||
},
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val doc = webClient.httpGet(url).parseHtml()
|
||||
|
||||
return doc.select("div.grid div.relative").map { div ->
|
||||
val href = div.selectFirst("a[href^=/manga/]")?.attrOrNull("href")
|
||||
?: div.parseFailed("Cant find manga image!")
|
||||
val coverUrl = div.selectFirst("div.cover")?.attr("style")
|
||||
?.substringAfter("url('")?.substringBefore("')")
|
||||
|
||||
Manga(
|
||||
id = generateUid(href),
|
||||
title = div.select("div.p-2 a.text-ellipsis").text(),
|
||||
altTitles = emptySet(),
|
||||
url = href,
|
||||
publicUrl = href.toAbsoluteUrl(domain),
|
||||
rating = RATING_UNKNOWN,
|
||||
contentRating = ContentRating.ADULT,
|
||||
coverUrl = coverUrl.orEmpty(),
|
||||
tags = setOf(),
|
||||
state = null,
|
||||
authors = emptySet(),
|
||||
source = source,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
override suspend fun getDetails(manga: Manga): Manga {
|
||||
val root = webClient.httpGet(manga.url.toAbsoluteUrl(domain)).parseHtml()
|
||||
val author = root.selectFirst("div.mt-2:contains(Artist) span a")?.textOrNull()
|
||||
|
||||
return manga.copy(
|
||||
altTitles = setOfNotNull(root.selectLast("div.grow div:contains(Alt name) span")?.textOrNull()),
|
||||
state = when (root.selectFirst("div.mt-2:contains(Status) span.text-blue-500")?.text()) {
|
||||
"Ongoing" -> MangaState.ONGOING
|
||||
"Completed" -> MangaState.FINISHED
|
||||
else -> null
|
||||
},
|
||||
tags = root.select("div.mt-2:contains(Genres) a.bg-gray-500").mapToSet { a ->
|
||||
MangaTag(
|
||||
key = a.attr("href").removeSuffix('/').substringAfterLast('/'),
|
||||
title = a.text(),
|
||||
source = source,
|
||||
)
|
||||
},
|
||||
authors = setOfNotNull(author),
|
||||
description = root.selectFirst("meta[name=description]")?.attrOrNull("content"),
|
||||
chapters = root.select("div.justify-between ul.overflow-y-auto.overflow-x-hidden a")
|
||||
.mapChapters(reversed = true) { i, a ->
|
||||
val href = a.attrAsRelativeUrl("href")
|
||||
val name = a.selectFirst("span.text-ellipsis")?.text().orEmpty()
|
||||
val dateText = a.parent()?.selectFirst("span.timeago")?.attr("datetime").orEmpty()
|
||||
MangaChapter(
|
||||
id = generateUid(href),
|
||||
title = name,
|
||||
number = i.toFloat(),
|
||||
volume = 0,
|
||||
url = href,
|
||||
scanlator = null,
|
||||
uploadDate = parseDateTime(dateText),
|
||||
branch = null,
|
||||
source = source,
|
||||
)
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
override suspend fun getPages(chapter: MangaChapter): List<MangaPage> {
|
||||
val fullUrl = chapter.url.toAbsoluteUrl(domain)
|
||||
val doc = webClient.httpGet(fullUrl).parseHtml()
|
||||
return doc.select("div.text-center img.lazy").mapNotNull { img ->
|
||||
val url = img.requireSrc()
|
||||
MangaPage(
|
||||
id = generateUid(url),
|
||||
url = url,
|
||||
preview = null,
|
||||
source = source,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
private fun parseDateTime(dateStr: String): Long = runCatching {
|
||||
val parts = dateStr.split(' ')
|
||||
val dateParts = parts[0].split('-')
|
||||
val timeParts = parts[1].split(':')
|
||||
|
||||
val calendar = Calendar.getInstance()
|
||||
calendar.set(
|
||||
dateParts[0].toInt(),
|
||||
dateParts[1].toInt() - 1,
|
||||
dateParts[2].toInt(),
|
||||
timeParts[0].toInt(),
|
||||
timeParts[1].toInt(),
|
||||
timeParts[2].toInt(),
|
||||
)
|
||||
calendar.timeInMillis
|
||||
}.getOrDefault(0L)
|
||||
|
||||
private suspend fun availableTags(): Set<MangaTag> {
|
||||
val doc = webClient.httpGet("https://$domain").parseHtml()
|
||||
return doc.select("ul.grid.grid-cols-2 a").mapToSet { a ->
|
||||
MangaTag(
|
||||
key = a.attr("href").removeSuffix('/').substringAfterLast('/'),
|
||||
title = a.text(),
|
||||
source = source,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,148 @@
|
||||
package org.koitharu.kotatsu.parsers.site.all
|
||||
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.MangaSourceParser
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.PagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.util.*
|
||||
import java.util.*
|
||||
|
||||
@MangaSourceParser("MISSKON", "MissKon", type = ContentType.OTHER)
|
||||
internal class Misskon(context: MangaLoaderContext) : PagedMangaParser(context, MangaParserSource.MISSKON, 24) {
|
||||
|
||||
override val configKeyDomain = ConfigKey.Domain("misskon.com")
|
||||
|
||||
override fun onCreateConfig(keys: MutableCollection<ConfigKey<*>>) {
|
||||
super.onCreateConfig(keys)
|
||||
keys.add(userAgentKey)
|
||||
}
|
||||
|
||||
override val availableSortOrders: Set<SortOrder> = EnumSet.of(
|
||||
SortOrder.UPDATED,
|
||||
SortOrder.POPULARITY
|
||||
)
|
||||
|
||||
override val filterCapabilities: MangaListFilterCapabilities
|
||||
get() = MangaListFilterCapabilities( isSearchSupported = true )
|
||||
|
||||
override suspend fun getFilterOptions() = MangaListFilterOptions()
|
||||
|
||||
override suspend fun getListPage(page: Int, order: SortOrder, filter: MangaListFilter): List<Manga> {
|
||||
val url = buildString {
|
||||
append("https://")
|
||||
append(domain)
|
||||
when {
|
||||
!filter.query.isNullOrEmpty() -> {
|
||||
append("/page/$page/")
|
||||
append("?s=")
|
||||
append(filter.query.urlEncoded())
|
||||
}
|
||||
order == SortOrder.POPULARITY -> {
|
||||
append("/top3/")
|
||||
}
|
||||
else -> {
|
||||
append("/page/$page")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val doc = webClient.httpGet(url).parseHtml()
|
||||
return doc.select("article.item-list").map { article ->
|
||||
val titleEl = article.selectFirst(".post-box-title")!!
|
||||
val href = titleEl.selectFirst("a")?.attrAsRelativeUrl("href")
|
||||
?: article.parseFailed("Cannot find manga link")
|
||||
|
||||
Manga(
|
||||
id = generateUid(href),
|
||||
title = titleEl.text(),
|
||||
altTitles = emptySet(),
|
||||
url = href,
|
||||
publicUrl = href.toAbsoluteUrl(domain),
|
||||
rating = RATING_UNKNOWN,
|
||||
contentRating = ContentRating.ADULT,
|
||||
coverUrl = article.selectFirst(".post-thumbnail img")?.absUrl("data-src").orEmpty(),
|
||||
tags = setOf(),
|
||||
state = null,
|
||||
authors = emptySet(),
|
||||
source = source,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
override suspend fun getDetails(manga: Manga): Manga {
|
||||
val doc = webClient.httpGet(manga.url.toAbsoluteUrl(domain)).parseHtml()
|
||||
val postInnerEl = doc.selectFirst("article > .post-inner")!!
|
||||
|
||||
return manga.copy(
|
||||
tags = postInnerEl.select(".post-tag > a").mapToSet { a ->
|
||||
MangaTag(
|
||||
key = a.text().lowercase(),
|
||||
title = a.text(),
|
||||
source = source
|
||||
)
|
||||
},
|
||||
chapters = listOf(
|
||||
MangaChapter(
|
||||
id = manga.id,
|
||||
title = "Oneshot", // 1 album, idk
|
||||
number = 1f,
|
||||
volume = 0,
|
||||
url = manga.url,
|
||||
scanlator = null,
|
||||
uploadDate = 0L,
|
||||
branch = null,
|
||||
source = source
|
||||
)
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
override suspend fun getPages(chapter: MangaChapter): List<MangaPage> {
|
||||
val doc = webClient.httpGet(chapter.url.toAbsoluteUrl(domain)).parseHtml()
|
||||
val basePageUrl = doc.selectFirst("link[rel=canonical]")?.absUrl("href")
|
||||
?: chapter.url.toAbsoluteUrl(domain)
|
||||
|
||||
val pages = mutableListOf<MangaPage>()
|
||||
val pageLinks = doc.select("div.post-inner div.page-link:nth-child(1) .post-page-numbers")
|
||||
|
||||
if (pageLinks.isEmpty()) {
|
||||
// Single page gallery
|
||||
return doc.select("div.post-inner > div.entry > p > img")
|
||||
.mapNotNull { img -> img.absUrl("data-src") }
|
||||
.mapIndexed { i, url ->
|
||||
MangaPage(
|
||||
id = generateUid(url),
|
||||
url = url,
|
||||
preview = null,
|
||||
source = source
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
// Multi-page gallery
|
||||
pageLinks.forEachIndexed { index, pageEl ->
|
||||
val pageDoc = when (index) {
|
||||
0 -> doc
|
||||
else -> {
|
||||
val url = "$basePageUrl${pageEl.text()}/"
|
||||
webClient.httpGet(url).parseHtml()
|
||||
}
|
||||
}
|
||||
|
||||
pages.addAll(
|
||||
pageDoc.select("div.post-inner > div.entry > p > img")
|
||||
.mapNotNull { img -> img.absUrl("data-src") }
|
||||
.map { url ->
|
||||
MangaPage(
|
||||
id = generateUid(url),
|
||||
url = url,
|
||||
preview = null,
|
||||
source = source
|
||||
)
|
||||
}
|
||||
)
|
||||
}
|
||||
return pages
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,229 @@
|
||||
package org.koitharu.kotatsu.parsers.site.all
|
||||
|
||||
import okhttp3.Headers
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.MangaSourceParser
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.PagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.model.*
|
||||
import org.koitharu.kotatsu.parsers.util.*
|
||||
import java.util.*
|
||||
|
||||
@MangaSourceParser("MULTPORN", "Multporn")
|
||||
internal class Multporn(context: MangaLoaderContext) :
|
||||
PagedMangaParser(context, MangaParserSource.MULTPORN, 42) {
|
||||
|
||||
override val configKeyDomain = ConfigKey.Domain("multporn.net")
|
||||
|
||||
override fun getRequestHeaders(): Headers = Headers.Builder()
|
||||
.add("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.122 Safari/537.36")
|
||||
.add("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8")
|
||||
.build()
|
||||
|
||||
override val availableSortOrders: Set<SortOrder> = EnumSet.of(
|
||||
SortOrder.NEWEST,
|
||||
SortOrder.NEWEST_ASC,
|
||||
SortOrder.UPDATED,
|
||||
SortOrder.UPDATED_ASC,
|
||||
)
|
||||
|
||||
override val filterCapabilities: MangaListFilterCapabilities
|
||||
get() = MangaListFilterCapabilities(
|
||||
isSearchSupported = true,
|
||||
)
|
||||
|
||||
init {
|
||||
setFirstPage(0)
|
||||
}
|
||||
|
||||
override suspend fun getFilterOptions() = MangaListFilterOptions(
|
||||
availableLocales = setOf(
|
||||
Locale("en"),
|
||||
Locale("de"),
|
||||
Locale("ru"),
|
||||
Locale("zh"),
|
||||
Locale("es"),
|
||||
),
|
||||
availableContentTypes = EnumSet.of(
|
||||
ContentType.COMICS,
|
||||
ContentType.HENTAI,
|
||||
),
|
||||
)
|
||||
|
||||
override suspend fun getListPage(page: Int, order: SortOrder, filter: MangaListFilter): List<Manga> {
|
||||
val url = buildString {
|
||||
append("https://")
|
||||
append(domain)
|
||||
when {
|
||||
!filter.query.isNullOrEmpty() -> {
|
||||
append("/search?search_api_views_fulltext=")
|
||||
val encodedQuery = filter.query.splitByWhitespace().joinToString(separator = "+") { part ->
|
||||
part.urlEncoded()
|
||||
}
|
||||
append(encodedQuery)
|
||||
append("&undefined=Search")
|
||||
append("&page=$page")
|
||||
}
|
||||
|
||||
filter.tags.isNotEmpty() -> {
|
||||
val tag = filter.tags.first()
|
||||
append("/category/")
|
||||
append(tag.key)
|
||||
|
||||
append("?sort_by=")
|
||||
append(
|
||||
when (order) {
|
||||
SortOrder.NEWEST -> "created"
|
||||
else -> "title" // default
|
||||
}
|
||||
)
|
||||
|
||||
append("&page=0,")
|
||||
append(page)
|
||||
}
|
||||
|
||||
else -> {
|
||||
append("/new")
|
||||
append("?type=")
|
||||
if (filter.types.isNotEmpty()) {
|
||||
filter.types.oneOrThrowIfMany()?.let {
|
||||
append(
|
||||
when (it) {
|
||||
ContentType.COMICS -> "1"
|
||||
ContentType.HENTAI -> "2"
|
||||
else -> "All" // all
|
||||
},
|
||||
)
|
||||
}
|
||||
} else append("All")
|
||||
|
||||
|
||||
filter.locale?.let {
|
||||
append("&language=")
|
||||
append(
|
||||
when (it) {
|
||||
Locale("en") -> "1"
|
||||
Locale("de") -> "2"
|
||||
Locale("ru") -> "3"
|
||||
Locale("zh") -> "4"
|
||||
Locale("es") -> "5"
|
||||
else -> "All"
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
append("&field_user_discription_value=All")
|
||||
|
||||
append("&sort_by=")
|
||||
append(
|
||||
when (order) {
|
||||
SortOrder.NEWEST -> "created&sort_order=DESC"
|
||||
SortOrder.NEWEST_ASC -> "created&sort_order=ASC"
|
||||
SortOrder.UPDATED -> "changed&sort_order=DESC"
|
||||
SortOrder.UPDATED_ASC -> "changed&sort_order=ASC"
|
||||
else -> "created&sort_order=DESC" // default
|
||||
}
|
||||
)
|
||||
|
||||
append("&undefined=Apply")
|
||||
append("&page=$page")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val doc = webClient.httpGet(url).parseHtml()
|
||||
return doc.select(".masonry-item").map { div ->
|
||||
val href = div.selectFirstOrThrow(".views-field-title a").attrAsRelativeUrl("href")
|
||||
val coverUrl = div.selectFirstOrThrow(".views-field img").requireSrc()
|
||||
Manga(
|
||||
id = generateUid(href),
|
||||
title = div.select(".views-field-title").text(),
|
||||
altTitles = emptySet(),
|
||||
url = href,
|
||||
publicUrl = href.toAbsoluteUrl(domain),
|
||||
rating = RATING_UNKNOWN,
|
||||
contentRating = ContentRating.ADULT,
|
||||
coverUrl = coverUrl,
|
||||
tags = emptySet(),
|
||||
state = null,
|
||||
authors = emptySet(),
|
||||
source = source,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
override suspend fun getDetails(manga: Manga): Manga {
|
||||
val doc = webClient.httpGet(manga.url.toAbsoluteUrl(domain)).parseHtml()
|
||||
val authors = (doc.select(".field:has(.field-label:contains(Author:)) .links a").map { it.text() } +
|
||||
parseUnlabelledAuthorNames(doc)).distinct()
|
||||
|
||||
val tags = listOf("Tags", "Section", "Characters")
|
||||
.flatMap { type ->
|
||||
doc.select(".field:has(.field-label:contains($type:)) .links a").map { it.text() }
|
||||
}
|
||||
.distinct()
|
||||
.map { tag ->
|
||||
MangaTag(
|
||||
title = tag,
|
||||
key = tag.lowercase().replace(" ", "_"),
|
||||
source = source,
|
||||
)
|
||||
}.toSet()
|
||||
|
||||
val isOngoing = doc.select(".field .links a").any { it.text() == "Ongoings" }
|
||||
|
||||
return manga.copy(
|
||||
authors = authors.toSet(),
|
||||
tags = tags,
|
||||
description = buildString {
|
||||
append("Pages: ")
|
||||
append(doc.select(".jb-image img").size)
|
||||
append("\n\n")
|
||||
doc.select(".field:has(.field-label:contains(Section:)) .links a").joinTo(this, prefix = "Section: ") { it.text() }
|
||||
doc.select(".field:has(.field-label:contains(Characters:)) .links a").joinTo(this, prefix = "\n\nCharacters: ") { it.text() }
|
||||
},
|
||||
state = if (isOngoing) MangaState.ONGOING else MangaState.FINISHED,
|
||||
chapters = listOf(
|
||||
MangaChapter(
|
||||
id = generateUid(manga.url),
|
||||
title = "Oneshot",
|
||||
number = 1f,
|
||||
volume = 0,
|
||||
url = manga.url,
|
||||
scanlator = null,
|
||||
uploadDate = 0L,
|
||||
branch = null,
|
||||
source = source,
|
||||
)
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
override suspend fun getPages(chapter: MangaChapter): List<MangaPage> {
|
||||
val doc = webClient.httpGet(chapter.url.toAbsoluteUrl(domain)).parseHtml()
|
||||
return doc.select(".jb-image img").mapIndexed { i, img ->
|
||||
val url = img.attrAsAbsoluteUrl("src")
|
||||
.replace("/styles/juicebox_2k/public", "")
|
||||
.substringBefore("?")
|
||||
MangaPage(
|
||||
id = generateUid(url),
|
||||
url = url,
|
||||
preview = null,
|
||||
source = source,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
private fun parseUnlabelledAuthorNames(document: org.jsoup.nodes.Document): List<String> {
|
||||
val authorClasses = listOf(
|
||||
"field-name-field-author",
|
||||
"field-name-field-authors-gr",
|
||||
"field-name-field-img-group",
|
||||
"field-name-field-hentai-img-group",
|
||||
"field-name-field-rule-63-section"
|
||||
)
|
||||
return authorClasses.flatMap { className ->
|
||||
document.select(".$className a").map { it.text().trim() }
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,451 @@
|
||||
package org.koitharu.kotatsu.parsers.site.all
|
||||
|
||||
import org.jsoup.nodes.Document
|
||||
import org.jsoup.nodes.Element
|
||||
import org.koitharu.kotatsu.parsers.MangaLoaderContext
|
||||
import org.koitharu.kotatsu.parsers.MangaSourceParser
|
||||
import org.koitharu.kotatsu.parsers.config.ConfigKey
|
||||
import org.koitharu.kotatsu.parsers.core.PagedMangaParser
|
||||
import org.koitharu.kotatsu.parsers.model.ContentRating
|
||||
import org.koitharu.kotatsu.parsers.model.ContentType
|
||||
import org.koitharu.kotatsu.parsers.model.Manga
|
||||
import org.koitharu.kotatsu.parsers.model.MangaChapter
|
||||
import org.koitharu.kotatsu.parsers.model.MangaListFilter
|
||||
import org.koitharu.kotatsu.parsers.model.MangaListFilterCapabilities
|
||||
import org.koitharu.kotatsu.parsers.model.MangaListFilterOptions
|
||||
import org.koitharu.kotatsu.parsers.model.MangaPage
|
||||
import org.koitharu.kotatsu.parsers.model.MangaParserSource
|
||||
import org.koitharu.kotatsu.parsers.model.MangaState
|
||||
import org.koitharu.kotatsu.parsers.model.MangaTag
|
||||
import org.koitharu.kotatsu.parsers.model.RATING_UNKNOWN
|
||||
import org.koitharu.kotatsu.parsers.model.SortOrder
|
||||
import org.koitharu.kotatsu.parsers.util.attrAsRelativeUrl
|
||||
import org.koitharu.kotatsu.parsers.util.generateUid
|
||||
import org.koitharu.kotatsu.parsers.util.mapToSet
|
||||
import org.koitharu.kotatsu.parsers.util.parseHtml
|
||||
import org.koitharu.kotatsu.parsers.util.toAbsoluteUrl
|
||||
import org.koitharu.kotatsu.parsers.util.urlEncoded
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.EnumSet
|
||||
import java.util.Locale
|
||||
import java.util.regex.Pattern
|
||||
|
||||
@MangaSourceParser("MYREADINGMANGA", "MyReadingManga", type = ContentType.HENTAI)
|
||||
internal class MyReadingManga(context: MangaLoaderContext) :
|
||||
PagedMangaParser(context, MangaParserSource.MYREADINGMANGA, 18) {
|
||||
|
||||
override val configKeyDomain = ConfigKey.Domain("myreadingmanga.info")
|
||||
|
||||
override fun onCreateConfig(keys: MutableCollection<ConfigKey<*>>) {
|
||||
super.onCreateConfig(keys)
|
||||
keys.add(userAgentKey)
|
||||
}
|
||||
|
||||
override val filterCapabilities: MangaListFilterCapabilities
|
||||
get() = MangaListFilterCapabilities(
|
||||
isSearchSupported = true,
|
||||
isOriginalLocaleSupported = true,
|
||||
)
|
||||
|
||||
override val availableSortOrders: Set<SortOrder> = EnumSet.of(
|
||||
SortOrder.UPDATED,
|
||||
)
|
||||
|
||||
override suspend fun getFilterOptions() = MangaListFilterOptions(
|
||||
availableTags = fetchTags(),
|
||||
availableStates = EnumSet.of(
|
||||
MangaState.ONGOING,
|
||||
MangaState.FINISHED,
|
||||
),
|
||||
availableContentRating = EnumSet.of(ContentRating.ADULT),
|
||||
availableLocales = setOf(
|
||||
Locale.ENGLISH,
|
||||
Locale.FRENCH,
|
||||
Locale.JAPANESE,
|
||||
Locale.CHINESE,
|
||||
Locale.GERMAN,
|
||||
Locale.ITALIAN,
|
||||
Locale.KOREAN,
|
||||
Locale.TRADITIONAL_CHINESE,
|
||||
Locale("es"), // Spanish
|
||||
Locale("pt"), // Portuguese
|
||||
Locale("ru"), // Russian
|
||||
Locale("tr"), // Turkish
|
||||
Locale("vi"), // Vietnamese
|
||||
Locale("ar"), // Arabic
|
||||
Locale("id"), // Indonesian (Bahasa)
|
||||
Locale("th"), // Thai
|
||||
Locale("pl"), // Polish
|
||||
Locale("sv"), // Swedish
|
||||
Locale("nl"), // Dutch (Flemish Dutch)
|
||||
Locale("hu"), // Hungarian
|
||||
Locale("hi"), // Hindi
|
||||
Locale("he"), // Hebrew
|
||||
Locale("el"), // Greek
|
||||
Locale("fi"), // Finnish
|
||||
Locale("fil"), // Filipino
|
||||
Locale("da"), // Danish
|
||||
Locale("cs"), // Czech
|
||||
Locale("hr"), // Croatian
|
||||
Locale("bg"), // Bulgarian
|
||||
Locale("zh", "HK"), // Cantonese
|
||||
Locale("fa"), // Persian
|
||||
Locale("sk"), // Slovak
|
||||
Locale("ro"), // Romanian
|
||||
Locale("no"), // Norwegian
|
||||
Locale("ms"), // Malay
|
||||
Locale("lt"), // Lithuanian
|
||||
),
|
||||
)
|
||||
|
||||
private fun getLanguageSlug(locale: Locale?): String? {
|
||||
return when {
|
||||
locale?.language == "fr" -> "french"
|
||||
locale?.language == "ja" -> "jp"
|
||||
locale?.language == "zh" && locale.country == "TW" -> "traditional-chinese"
|
||||
locale?.language == "zh" && locale.country == "HK" -> "cantonese"
|
||||
locale?.language == "zh" -> "chinese"
|
||||
locale?.language == "de" -> "german"
|
||||
locale?.language == "it" -> "italian"
|
||||
locale?.language == "ko" -> "korean"
|
||||
locale?.language == "es" -> "spanish"
|
||||
locale?.language == "pt" -> "portuguese"
|
||||
locale?.language == "ru" -> "russian"
|
||||
locale?.language == "tr" -> "turkish"
|
||||
locale?.language == "vi" -> "vietnamese"
|
||||
locale?.language == "ar" -> "arabic"
|
||||
locale?.language == "id" -> "bahasa"
|
||||
locale?.language == "th" -> "thai"
|
||||
locale?.language == "pl" -> "polish"
|
||||
locale?.language == "sv" -> "swedish"
|
||||
locale?.language == "nl" -> "flemish-dutch"
|
||||
locale?.language == "hu" -> "hungarian"
|
||||
locale?.language == "hi" -> "hindi"
|
||||
locale?.language == "he" -> "hebrew"
|
||||
locale?.language == "el" -> "greek"
|
||||
locale?.language == "fi" -> "finnish"
|
||||
locale?.language == "fil" -> "filipino"
|
||||
locale?.language == "da" -> "danish"
|
||||
locale?.language == "cs" -> "czech"
|
||||
locale?.language == "hr" -> "croatian"
|
||||
locale?.language == "bg" -> "bulgarian"
|
||||
locale?.language == "fa" -> "persian"
|
||||
locale?.language == "sk" -> "slovak"
|
||||
locale?.language == "ro" -> "romanian"
|
||||
locale?.language == "no" -> "norwegian-bokmal"
|
||||
locale?.language == "ms" -> "malay"
|
||||
locale?.language == "lt" -> "lithuanian"
|
||||
else -> null //all
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
override suspend fun getListPage(page: Int, order: SortOrder, filter: MangaListFilter): List<Manga> {
|
||||
val url = buildString {
|
||||
append("https://")
|
||||
append(domain)
|
||||
|
||||
// Add language path if specified
|
||||
val langSlug = getLanguageSlug(filter.locale)
|
||||
if (langSlug != null) {
|
||||
append("/lang/")
|
||||
append(langSlug)
|
||||
}
|
||||
|
||||
when {
|
||||
!filter.query.isNullOrEmpty() -> {
|
||||
// Search with language: /lang/french/page/2/?s=example
|
||||
if (page > 1) {
|
||||
append("/page/")
|
||||
append(page)
|
||||
}
|
||||
append("/?s=")
|
||||
append(filter.query.urlEncoded())
|
||||
}
|
||||
|
||||
filter.tags.isNotEmpty() -> {
|
||||
// Genre filtering doesn't work with language, so we ignore language for genre
|
||||
if (langSlug == null) {
|
||||
append("/genre/")
|
||||
append(filter.tags.first().key)
|
||||
append("/page/")
|
||||
append(page)
|
||||
append("/")
|
||||
} else {
|
||||
// If both language and genre are selected, just use language
|
||||
append("/page/")
|
||||
append(page)
|
||||
append("/")
|
||||
}
|
||||
}
|
||||
|
||||
filter.states.isNotEmpty() -> {
|
||||
// Status filtering doesn't work with language either
|
||||
if (langSlug == null) {
|
||||
append("/status/")
|
||||
append(
|
||||
when (filter.states.first()) {
|
||||
MangaState.ONGOING -> "ongoing"
|
||||
MangaState.FINISHED -> "completed"
|
||||
else -> "ongoing"
|
||||
},
|
||||
)
|
||||
append("/page/")
|
||||
append(page)
|
||||
append("/")
|
||||
} else {
|
||||
// If both language and status are selected, just use language
|
||||
append("/page/")
|
||||
append(page)
|
||||
append("/")
|
||||
}
|
||||
}
|
||||
|
||||
else -> {
|
||||
// Regular browsing with or without language
|
||||
append("/page/")
|
||||
append(page)
|
||||
append("/")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val doc = webClient.httpGet(url).parseHtml()
|
||||
return parseMangaList(doc)
|
||||
}
|
||||
|
||||
private fun parseMangaList(doc: Document): List<Manga> {
|
||||
return doc.select("div.content-archive article.post:not(.category-video)").mapNotNull { element ->
|
||||
val titleElement = element.selectFirst("h2.entry-title a") ?: return@mapNotNull null
|
||||
val thumbnailElement = element.selectFirst("a.entry-image-link img")
|
||||
|
||||
Manga(
|
||||
id = generateUid(titleElement.attr("href")),
|
||||
title = titleElement.text().replace(titleRegex.toRegex(), "").substringBeforeLast("(").trim(),
|
||||
altTitles = emptySet(),
|
||||
url = titleElement.attrAsRelativeUrl("href"),
|
||||
publicUrl = titleElement.absUrl("href"),
|
||||
rating = RATING_UNKNOWN,
|
||||
contentRating = ContentRating.ADULT,
|
||||
coverUrl = findImageSrc(thumbnailElement),
|
||||
tags = emptySet(),
|
||||
state = null,
|
||||
authors = emptySet(),
|
||||
source = source,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
override suspend fun getDetails(manga: Manga): Manga {
|
||||
val doc = webClient.httpGet(manga.url.toAbsoluteUrl(domain)).parseHtml()
|
||||
val title = doc.selectFirst("h1.entry-title")?.text() ?: manga.title
|
||||
|
||||
val altTitles = mutableSetOf<String>()
|
||||
val altTitleElement = doc.selectFirst("p.alt-title-class")
|
||||
if (altTitleElement != null) {
|
||||
var nextElement = altTitleElement.nextElementSibling()
|
||||
while (nextElement != null && nextElement.tagName() == "p" &&
|
||||
!nextElement.hasClass("info-class") && !nextElement.hasClass("chapter-class")
|
||||
) {
|
||||
val altTitle = nextElement.text().trim()
|
||||
if (altTitle.isNotEmpty()) {
|
||||
altTitles.add(altTitle)
|
||||
}
|
||||
nextElement = nextElement.nextElementSibling()
|
||||
}
|
||||
}
|
||||
|
||||
var description = ""
|
||||
val descriptionElement = doc.selectFirst("p.info-class")
|
||||
if (descriptionElement != null) {
|
||||
var nextElement = descriptionElement.nextElementSibling()
|
||||
val descParts = mutableListOf<String>()
|
||||
while (nextElement != null && nextElement.tagName() == "p" &&
|
||||
!nextElement.hasClass("chapter-class") && !nextElement.hasClass("alt-title-class")
|
||||
) {
|
||||
val text = nextElement.text()
|
||||
if (text.isNotEmpty()) {
|
||||
descParts.add(text)
|
||||
}
|
||||
nextElement = nextElement.nextElementSibling()
|
||||
}
|
||||
description = descParts.joinToString("\n\n")
|
||||
}
|
||||
|
||||
if (description.isEmpty()) {
|
||||
description = doc.select("div.entry-content p strong")
|
||||
.joinToString("\n") { it.text() }
|
||||
.trim()
|
||||
.ifEmpty { title }
|
||||
}
|
||||
|
||||
val authorFromTitle = title.substringAfter("[").substringBefore("]").trim()
|
||||
val authorFromTag = doc.select("span.entry-tags a[href*='/tag/']")
|
||||
.firstOrNull { it.text().contains("(") && it.text().contains(")") }
|
||||
?.text()?.trim()
|
||||
val author = authorFromTag ?: authorFromTitle
|
||||
|
||||
val genres = mutableSetOf<MangaTag>()
|
||||
|
||||
doc.select("span.entry-terms:has(span:contains(Genres)) a").forEach {
|
||||
genres.add(
|
||||
MangaTag(
|
||||
title = it.text(),
|
||||
key = it.attr("href").substringAfterLast("/genre/").substringBefore("/"),
|
||||
source = source,
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
val state = when (doc.select("a[href*=status]").firstOrNull()?.text()) {
|
||||
"Ongoing" -> MangaState.ONGOING
|
||||
"Completed" -> MangaState.FINISHED
|
||||
else -> null
|
||||
}
|
||||
|
||||
val chapters = parseChapters(doc)
|
||||
|
||||
return manga.copy(
|
||||
altTitles = altTitles,
|
||||
description = description,
|
||||
tags = genres,
|
||||
state = state,
|
||||
authors = setOfNotNull(author.takeIf { it.isNotEmpty() && it != title }),
|
||||
chapters = chapters,
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
override suspend fun getPages(chapter: MangaChapter): List<MangaPage> {
|
||||
val doc = webClient.httpGet(chapter.url.toAbsoluteUrl(domain)).parseHtml()
|
||||
|
||||
val images = doc.select("div.entry-content img.img-myreadingmanga, div.entry-content div > img")
|
||||
.filter { element ->
|
||||
val src = findImageSrc(element)
|
||||
src != null && !src.contains("GH-") && !src.contains("nucarnival") &&
|
||||
!src.contains("/wp-content/uploads/202") // Exclude old uploads that might be ads
|
||||
}
|
||||
.mapNotNull { findImageSrc(it) }
|
||||
.distinct()
|
||||
|
||||
return images.mapIndexed { index, url ->
|
||||
MangaPage(
|
||||
id = generateUid(url),
|
||||
url = url,
|
||||
preview = null,
|
||||
source = source,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
private suspend fun fetchTags(): Set<MangaTag> {
|
||||
val doc = webClient.httpGet("https://$domain/").parseHtml()
|
||||
return doc.select("h4.widget-title.widgettitle:contains(Genres) + .tagcloud a")
|
||||
.mapToSet { element ->
|
||||
|
||||
MangaTag(
|
||||
title = element.text().substringBefore(" ("),
|
||||
key = element.attr("href").trimEnd('/').substringAfterLast('/'),
|
||||
source = source,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
private val titleRegex = Pattern.compile("""\[[^]]*]""")
|
||||
private val imgRegex = Pattern.compile("""\.(jpg|png|jpeg|webp)""")
|
||||
|
||||
private fun findImageSrc(element: Element?): String? {
|
||||
element ?: return null
|
||||
|
||||
return when {
|
||||
element.hasAttr("data-src") && imgRegex.matcher(element.attr("data-src")).find() ->
|
||||
element.absUrl("data-src")
|
||||
element.hasAttr("data-cfsrc") && imgRegex.matcher(element.attr("data-cfsrc")).find() ->
|
||||
element.absUrl("data-cfsrc")
|
||||
element.hasAttr("src") && imgRegex.matcher(element.attr("src")).find() ->
|
||||
element.absUrl("src")
|
||||
element.hasAttr("data-lazy-src") ->
|
||||
element.absUrl("data-lazy-src")
|
||||
else -> null
|
||||
}
|
||||
}
|
||||
|
||||
private fun parseChapters(document: Document): List<MangaChapter> {
|
||||
val chapters = mutableListOf<MangaChapter>()
|
||||
val mangaUrl = document.baseUri().removeSuffix("/")
|
||||
val date = parseDate(document.select("time.entry-time").text())
|
||||
|
||||
// Look for chapter information
|
||||
val chapterClass = document.selectFirst("div.chapter-class")
|
||||
|
||||
// Check if there's a chapter title after the chapter-class div
|
||||
var chapterTitle: String? = null
|
||||
if (chapterClass != null) {
|
||||
var nextElement = chapterClass.nextElementSibling()
|
||||
while (nextElement != null && nextElement.tagName() != "div") {
|
||||
if (nextElement.tagName() == "p" && nextElement.text().contains("Chapter", ignoreCase = true)) {
|
||||
chapterTitle = nextElement.text().trim()
|
||||
break
|
||||
}
|
||||
nextElement = nextElement.nextElementSibling()
|
||||
}
|
||||
}
|
||||
|
||||
// Check for pagination
|
||||
val paginationInContent =
|
||||
document.select("div.entry-pagination a.page-numbers, div.chapter-class .entry-pagination a.page-numbers")
|
||||
.mapNotNull { it.text().toIntOrNull() }
|
||||
.maxOrNull()
|
||||
|
||||
if (paginationInContent != null && paginationInContent > 1) {
|
||||
// Multi-page manga with chapters
|
||||
for (i in 1..paginationInContent) {
|
||||
val title = when {
|
||||
chapterTitle != null && i == 1 -> chapterTitle
|
||||
chapterTitle != null -> chapterTitle.replace("1", i.toString())
|
||||
else -> "Chapter $i"
|
||||
}
|
||||
|
||||
chapters.add(
|
||||
MangaChapter(
|
||||
id = generateUid("$mangaUrl/$i"),
|
||||
title = title,
|
||||
number = i.toFloat(),
|
||||
url = if (i == 1) mangaUrl else "$mangaUrl/$i/",
|
||||
uploadDate = date,
|
||||
source = source,
|
||||
scanlator = null,
|
||||
branch = null,
|
||||
volume = 0,
|
||||
),
|
||||
)
|
||||
}
|
||||
} else {
|
||||
// Single page manga or no pagination found
|
||||
chapters.add(
|
||||
MangaChapter(
|
||||
id = generateUid(mangaUrl),
|
||||
title = chapterTitle ?: "Complete",
|
||||
number = 1f,
|
||||
url = mangaUrl,
|
||||
uploadDate = date,
|
||||
source = source,
|
||||
scanlator = null,
|
||||
branch = null,
|
||||
volume = 0,
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
return chapters
|
||||
}
|
||||
|
||||
private fun parseDate(date: String): Long {
|
||||
return try {
|
||||
SimpleDateFormat("MMMM dd, yyyy", Locale.US).parse(date)?.time ?: 0
|
||||
} catch (_: Exception) {
|
||||
0L
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue