OrIdow6 / google-drive-downloader

Downloader for the ArchiveTeam grab of Google Drive
GNU Affero General Public License v3.0
0 stars 1 forks source link

download fail #1

Open awliiii opened 4 months ago

awliiii commented 4 months ago

Windows 11 Python 3.12.0 i tried to recursively download a directory, it worked fine until the downloader came across one specific video that after would just crash.

no other arguments than folder:[id]

error log:

...\google-drive-archive-retrieval.py:303: SyntaxWarning: invalid escape sequence '\.'
  if match := re.match("^folder:([^/? ]+)$", item) or re.match("^(?:https?://)?drive\.google\.com/drive/folders/([^/? ]+)[/\?]", item):
DLing at CulturalPhilistine (adam lanza's yt account)/
DLing at CulturalPhilistine (adam lanza's yt account)/just with audio/
Traceback (most recent call last):
  File "...\google-drive-archive-retrieval.py", line 308, in <module>
    recursive_download(f, args.base_dir, args.force)
  File "...\google-drive-archive-retrieval.py", line 280, in recursive_download
    recursive_download(item, path)
  File "...\google-drive-archive-retrieval.py", line 278, in recursive_download
    nice_download_file(item, path, bypass_checks)
  File "...\google-drive-archive-retrieval.py", line 264, in nice_download_file
    did_skip = item.save_body_to_path(dest, True)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "...\google-drive-archive-retrieval.py", line 244, in save_body_to_path
    with path.open("wb") as f:
         ^^^^^^^^^^^^^^^
  File "D:\Python312\Lib\pathlib.py", line 1014, in open
    return io.open(self, mode, buffering, encoding, errors, newline)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: [Errno 22] Invalid argument: "CulturalPhilistine (adam lanza's yt account)\\just with audio\\Strange Dream #3 - ... Door?.mp3"
awliiii commented 4 months ago

fixed it myself by modifing the sanatize_name function

OrIdow6 commented 4 months ago

Glad someone is using this. If it's not private could you give the ID you are downloading? A fix seems simple and obvious but I'd prefer to test it.