Whenever the token refresh is hit and the function returns, it will continue on to the error which is probably why issues #19 and #9 were also created.
Adding a 'return' at the beginning of this line will make it so that it returns the value of the recursively called function and exit the initially called function.
This will stop it from flowing onto the error message and returning the blank string, indicating a failure to retrieve the book URL.
https://github.com/lmbringas/packtpub-downloader/blob/f0e03ff636efcc06af6b1e3e361622116362ff03/main.py#L67
Whenever the token refresh is hit and the function returns, it will continue on to the error which is probably why issues #19 and #9 were also created.
Adding a 'return' at the beginning of this line will make it so that it returns the value of the recursively called function and exit the initially called function. This will stop it from flowing onto the error message and returning the blank string, indicating a failure to retrieve the book URL.