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

img2pdf not able to converty #109

Open
lucas-ljb opened this issue Feb 20, 2024 · 4 comments · May be fixed by #120
Open

img2pdf not able to converty #109

lucas-ljb opened this issue Feb 20, 2024 · 4 comments · May be fixed by #120

Comments

@lucas-ljb
Copy link

lucas-ljb commented Feb 20, 2024

C:\Users\Lucas> python "C:\Users\Lucas\Archive.org-Downloader\archive-org-downloader.py" -e "EMAIL@SITE" -p "PASSWORD!" -r 0 -u "https://archive.org/details/bibletarot0000cori/"
1 Book(s) to download
[+] Successful login

Current book: https://archive.org/details/bibletarot0000cori
[+] Successful loan
[+] Found 292 pages
Downloading pages...
100%|████████████████████████████████████████████████████████████████████████████████| 292/292 [00:24<00:00, 12.04it/s]
Traceback (most recent call last):
File "C:\Users\Lucas\Archive.org-Downloader\archive-org-downloader.py", line 267, in
pdf = img2pdf.convert(images, **pdfmeta)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Lucas\AppData\Roaming\Python\Python312\site-packages\img2pdf.py", line 2651, in convert
pdf = pdfdoc(
^^^^^^^
File "C:\Users\Lucas\AppData\Roaming\Python\Python312\site-packages\img2pdf.py", line 742, in init
v = ("D:" + datetime_to_pdfdate(v)).encode("ascii")
^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Lucas\AppData\Roaming\Python\Python312\site-packages\img2pdf.py", line 725, in datetime_to_pdfdate
return dt.astimezone(tz=timezone.utc).strftime("%Y%m%d%H%M%SZ")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: [Errno 22] Invalid argument

I am able to call img2pdf on cmd but when Archive downloader tries it fails

@ali7mrd
Copy link

ali7mrd commented Mar 16, 2024

Running the "pip install -r requirements.txt" command again solved the issue for me.

@Raradra
Copy link

Raradra commented Jun 23, 2024

I have the same issue. Unfortunately, running the "pip install -r requirements.txt" command again didn't help.

@asheroto
Copy link

Same issue here. Looksl ike the jpg images are actually downloaded, but the PDF is not created.

Details

Traceback (most recent call last):
  File "C:\tools\Archive.org-Downloader\archive-org-downloader.py", line 267, in <module>
    pdf = img2pdf.convert(images, **pdfmeta)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python312\Lib\site-packages\img2pdf.py", line 2651, in convert
    pdf = pdfdoc(
          ^^^^^^^
  File "C:\Python312\Lib\site-packages\img2pdf.py", line 742, in __init__
    v = ("D:" + datetime_to_pdfdate(v)).encode("ascii")
                ^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python312\Lib\site-packages\img2pdf.py", line 725, in datetime_to_pdfdate
    return dt.astimezone(tz=timezone.utc).strftime("%Y%m%d%H%M%SZ")
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: [Errno 22] Invalid argument

asheroto added a commit to asheroto/Archive.org-Downloader that referenced this issue Jul 25, 2024
asheroto added a commit to asheroto/Archive.org-Downloader that referenced this issue Jul 25, 2024
asheroto added a commit to asheroto/Archive.org-Downloader that referenced this issue Jul 25, 2024
asheroto added a commit to asheroto/Archive.org-Downloader that referenced this issue Jul 25, 2024
@asheroto asheroto linked a pull request Jul 25, 2024 that will close this issue
@asheroto
Copy link

Got it figured out in #120.

Here's a link to the fixed version:
https://github.com/asheroto/Archive.org-Downloader/blob/patch-5/archive-org-downloader.py

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

Successfully merging a pull request may close this issue.

4 participants