As I noticed, the script uses the http status code returned from cURL to identify whether a file is successfully downloaded.
if [[ "$http_return_code" == "416" ]] || [[ "$http_return_code" == "200" ]]; then
add-downloaded-id "$videoid";
However, when cURL ends up with an error
curl: (92) HTTP/2 stream 0 was not closed cleanly: PROTOCOL_ERROR (err 1)
It returns 200 even the file is not successfully downloaded.

I am not very familiar with shell scripts and commands, so I am wondering if you have a better way to solve this problem.
As for now , I mannually copy the progress bar of cURL and check download integrity, since I don't know how to read the progress bar in commands or write them to files. It maybe a feasbile way to solve this issue if you can get the message in progress bar.
What's more, the '.file.size' argument in $video_stat got in function iwara-dl-by-videoid is not reliable. I don't know why there is difference between the actual size and the one provided by API. Maybe it's useful if you know the correlation between these 2 figures.
Thanks a lot.
Best regards,
As I noticed, the script uses the http status code returned from cURL to identify whether a file is successfully downloaded.
However, when cURL ends up with an error
curl: (92) HTTP/2 stream 0 was not closed cleanly: PROTOCOL_ERROR (err 1)It returns 200 even the file is not successfully downloaded.
I am not very familiar with shell scripts and commands, so I am wondering if you have a better way to solve this problem.
As for now , I mannually copy the progress bar of cURL and check download integrity, since I don't know how to read the progress bar in commands or write them to files. It maybe a feasbile way to solve this issue if you can get the message in progress bar.
What's more, the
'.file.size'argument in$video_statgot in functioniwara-dl-by-videoidis not reliable. I don't know why there is difference between the actual size and the one provided by API. Maybe it's useful if you know the correlation between these 2 figures.Thanks a lot.
Best regards,