packt-cli / Packt-Publishing-Free-Learning

Scripts that automatically claim and download free daily eBooks from https://www.packtpub.com/packt/offers/free-learning

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Googledrive "Error Redirected but the response is missing a Location" Issue

laurentlemercier opened this issue · comments

I got this message on a fresh install using 1.5.1 version, with combat proven config files and credentials used in 1.5 version.

Found a clue here : googleapis/google-api-python-client#803. Looks like
httplib2> v0.15.0 is incompatible with google-api-python library .

Solved by using prior version : pip install httplib2==0.15.0

Can you try to clone the repository, upgrade google-api-python-client, install the script with pip install -e . and check if that helps? We may pin the httplib2 version, but I think it'd be better to upgrade other packages.

Nevermind, just check if fresh installation from pip-upgrade branch helps. Just install the script with pip install git+https://github.com/luk6xff/Packt-Publishing-Free-Learning.git@pip-upgrade command.

Hi,
Thank you for your tips.
On a fresh installation , with pip-upgrade branch, and adding " pip install --upgrade oauth2client", it works fine.
If you want any other test, would be a pleasure to help (venv helps so much :) !
Regards,
Laurent

Was running pip install --upgrade oauth2client essential here? If it was than my changes weren't sufficient, than I'd ask ask you to run pip freeze after upgrading oauth2client and post the output here.

If it wasn't necessary than we may merge this branch and release a new version.

Sorry for the long response time, I try to respond as soon as possible, but in this case I put this off and forgot about it.

Sorry, I have been long.

"pip install --upgrade oauth2client" is required for use with google drive API. Without, you get this message after claiming and downloading (successfully !) the books : [ERROR] - Exception occurred No module named 'oauth2client'

This is the result of pip freeze:
cachetools==4.1.0
certifi==2020.4.5.1
chardet==3.0.4
click==7.1.1
google-api-core==1.17.0
google-api-python-client==1.8.0
google-auth==1.14.1
google-auth-httplib2==0.0.3
googleapis-common-protos==1.51.0
httplib2==0.17.3
idna==2.9
oauth2client==4.1.3
packt==1.5.1
pkg-resources==0.0.0
protobuf==3.11.3
pyasn1==0.4.8
pyasn1-modules==0.2.8
python-slugify==4.0.0
pytz==2019.3
requests==2.23.0
rsa==4.0
six==1.14.0
text-unidecode==1.3
uritemplate==3.0.1
urllib3==1.25.9

Regards

Laurent

Thanks, I'll update the pull request in the afternoon and let you know - I'd like to ask you to check it once more after that change.

Can you try now on a fresh virtualenv installing the script with pip install git+https://github.com/luk6xff/Packt-Publishing-Free-Learning.git@pip-upgrade? I've made a pull request #182 with this possible fix.

Tested tonight, on a new env, it works perfectly.
Thanks a lot
Laurent

Thanks for raising this issue. I've merged the pull request and released a new patch version.