macearl/Wallhaven-Downloader

Syntax error

Opened this issue · 6 comments

Checking dependencies...OK
Download Page 1
- done!
Download Wallpapers from Page 1
./wallhaven.sh: line 173: ((: 1 >= : syntax error: operand expected (error token is ">= ")

Could you provide some more information?
Which system are you running, which shell, which parameters did you set in the script, are you using the latest commit?

I haven't used the script in a while, but a quick test download worked on my side.

Same
After removing the function to check if reached the last page
It still cant download wallpaperers while rinning with no errors

my previous comment also applies here.
I just tested the script again on my side and it seems to work fine, so i need more information to be able to pinpoint this issue or even reproduce it.

My bad, I just figured out that my internet caused that error

I was getting this error and I've added an echo line just before line 173 :-
echo "$page"+">="+"$(jq -r ".meta.last_page" tmp)"
I'm not very well versed in bash (I asumed I needed the + for string concatanization)
because I don't get the error for every file download request I see :-

35+>=+35
	Wallpaper %WallpaperURL% already downloaded!

for files that I already have and on line with the error I see :-

33+>=+
%pathToScript%: line 175: ((: 33 >=  : syntax error: operand expected (error token is ">=  ")

from this I can see that "$(jq -r ".meta.last_page" tmp)" sometimes results in a blank string don't know why yet.
still looking into it.

try integrating a read command around there and take a look at tmp when the error happens, it might be that you exceeded the api limitations