blob: 7760e2dd73fcf8b21ec9467326e79f257897f3e8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
# Copyright (C) 2024-2025 Maria Lisina
# Copyright (C) 2024-2025 Danil Lisin
# SPDX-License-Identifier: Apache-2.0
ib_mode="p"
. "${units}/ib_config.zsh"
. "${units}/ib_authconfig.zsh"
if [[ -z "${ib_data_url}" ]]
then
exit 0
fi
ib_query="md5:${ib_post_md5}"
ib_hash="$(sha1sum <<< "${user_id}${ib_board}${ib_query}" | cut -d ' ' -f 1)"
. "${units}/ib_file.zsh"
if [[ -z "${output_text}" ]]
then
ib_id="$(jq -r ".${ib_iarray}[0].${ib_iid}" "${ib_file}")"
if ! [[ -f "${ib_sample}" ]]
then
ib_file_size="$(jq -r ".${ib_iarray}[0].${ib_isize}" "${ib_file}")"
ib_file_url="$(jq -r ".${ib_iarray}[0].${ib_ifile}" "${ib_file}")"
ib_sample_url="$(jq -r ".${ib_iarray}[0].${ib_isample}" "${ib_file}")"
ib_preview_url="$(jq -r ".${ib_iarray}[0].${ib_ipreview}" "${ib_file}")"
. "${units}/ib_meta.zsh"
printf "%s\n" "${ib_sample_url}" > "${ib_sample}"
fi
printf "%s\n" "${ib_id}" > "${ib_post_id}"
fi
|