Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

books can't be downloaded if the filename contains symbol <?> #34

Open
reason195 opened this issue Nov 5, 2020 · 1 comment
Open

books can't be downloaded if the filename contains symbol <?> #34

reason195 opened this issue Nov 5, 2020 · 1 comment

Comments

@reason195
Copy link

Starting to download G:\packt/AWS_Certified_Developer_???Associate_Guide-Second_Edition.epub
Traceback (most recent call last):
File "G:\packtpub-downloader-master\main.py", line 226, in
main(sys.argv[1:])
File "G:\packtpub-downloader-master\main.py", line 218, in main
download_book(filename, url)
File "G:\packtpub-downloader-master\main.py", line 103, in download_book
with open(filename, 'wb') as f:
OSError: [Errno 22] Invalid argument: 'G:\packt/AWS_Certified_Developer
???Associate_Guide-_Second_Edition.epub'

@reason195 reason195 changed the title books can't be downloaded if the filename contents ? books can't be downloaded if the filename contains symbol <?> Nov 7, 2020
pablodelflo added a commit to pablodelflo/packtpub-downloader that referenced this issue Feb 9, 2021
Corrected the issue lmbringas#34 (books can't be downloaded if the filename contains symbol <?>) for errors in book names with ?
@pablodelflo
Copy link

pablodelflo commented Feb 9, 2021

Hello @reason195 @lmbringas .

I found a workarround for this issue. You have to edit the main.py file on line 209.

Originally we have:

book_name = book['productName'].replace(' ', '_').replace('.', '_').replace(':', '_').replace('/','')

Change it to:

book_name = book['productName'].replace(' ', '_').replace('.', '_').replace(':', '_').replace('/','').replace('?','')

greenflute pushed a commit to greenflute/Packt-Subscriber_Downloader that referenced this issue Sep 12, 2021
Corrected the issue lmbringas#34 (books can't be downloaded if the filename contains symbol <?>) for errors in book names with ?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants