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

too many values to unpack (expected 1)

StinThiago opened this issue · comments

Hi All! Today I got this issue. Does anyone have any idea of what is causing this?
Follow print!
Many thanks in advance.

image

It's because according to Packt's API there are not one, but two Packt Free Learning offers (you can see that in developer's console when opening Free Learning website). I'll modify the script to grab all available offers and add it to #121 pull request.

@mjenczmyk I've cloned your changes but I have a new issue ImportError: No module named 'api'

screen shot 2019-02-24 at 07 14 27

@develsites I'm sorry, I messed it up (unfortunately the pull request is already merged, you can always comment in the pull request if you see the code there is broken, so it won't be merged that likely) - thanks for noticing. For now install it using pip install git+https://github.com/mjenczmyk/Packt-Publishing-Free-Learning.git@api-fix command, I'll make a pull request in the evening. I've merged the fix already.

The main problem from the issue seems to be temporarily resolved as now there is only on Packt Free Learning Book, we may choose to assume that such problem will or won't happen again.

@mjenczmyk thank you for fixing but I have another one problem after uploading files [ERROR] - Exception occurred Incorrect file paths argument format

screen shot 2019-02-26 at 16 51 56

@develsites Thanks, you've found another problem - it happens if you try to upload to GoogleDrive. I'll take care of it as soon as I'll find the time (I cannot promise anything before next Tuesday) unless anybody else will take care of it earlier. It happens somewhere between 325th and 350th line.

@mjenczmyk Thank you :)

Hello @mjenczmyk
Exception raised line 334 : google_drive.send_files(paths). Looks like the file paths are not correct.
I was wondering if the statements from line 317 to 322
ebook.download_books(api_client, into_folder=into_folder)
should be changed to something like :
ebook.download_books(api_client, into_folder=cfg.download_folder_path)
Hope this helps, regards
Laurent

@develsites @laurentlemercier I fixed the problem at 10ee718
Please take a look, in case of any problems please open another ticket. I am closing this one.

@luk6xff Thanks, I'll release a new patch version. Could you make a pull request next time? That way linters will run on Travis and you won't need to fix Pylama warnings in additional commits - the entire change will be contained in single one.