简体   繁体   中英

How To Extract Password Protected Rar File Using Patool On Google Colab

I have installed patool on Google Colab. The patool command works file with:

patoolib.extract_archive("/content/drive/My Drive/File_name.part1.rar", outdir="/content/drive/My Drive/Folder/")`

After it's sucessfully finished, it has extracted 10 part zip files.

But when I am trying to extract those 10 files, it returns errors, and is asking for a password. I do know the password and whenever I give the password, it says "program aborted".

For 7z, you can use

! 7z e -pPASSWORD "path/to/file.zip"

to extract a file with password.

patool can handle password protected archives. You only need to add verbosity=1 as shown:

import patoolib
patoolib.extract_archive(r'your file path', outdir=r"folder path", verbosity=1)

now, cmd opened in new window like this and asked you to enter the password:

在此处输入图像描述

if you have other files in it, it asked you again. you can press 'A' to apply this to all files in it like this:

在此处输入图像描述

I hope this help you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM