Unzip Zipped Google drive files using colab

Have you ever thought of unzipping a zip-file stored in Google Drive directly to Google Drive? I found one trick to do this using Google Colab.

Open the colab script from HERE

Open Runtime and change runtime type to GPU ( be sure that you are using Python 3).

image

after this you look at the right and press connect, choose hosted runtime

image

wait until ok

image

Go to left side bar and choose Files in menu and MOUNT DRIVE
Execute that script and you will get the link to auth your account. Click the link, select your account that you want to use as a google drive storage. Allow the permission and you will get the code to auth your Gdrive. Copy the code, back to your Notebook, paste the code in the box under the sentence ‘Enter your authorization code:’, then click enter.

image

If is ok you will see you will see your drive in the sidebar by expand ‘drive’ folder

Step 1:

Copy path of the zipped file

Step2:

Select the type of zipped file. ie. zip, rar, 7z

Step3:

Put zipped file path in source_path.
Put destination folder where you want to unzip it in destination_folder
Put the zip file password if it has any or type some random text in password .

13 Likes

How about if I want to zip a folder for easy download

Download the .ipynb file from HERE and open it on colab.
You can zip and unzip the files with this script.

2 Likes

Thanks bro

How to do this for zipped files in a bulk?

How do you get 358 GB, i’m getting 107 GB in TPU & 68 GB in GPU, TELL ME WHAT TO DO TO GET 358 GB

It’s a long time ago screenshot. Now google has reduced its storage.

1 Like

I have two questions here, plz someone help to achieve it.

  1. Can i zip multiple folders/sub-folders with single command or script??

  2. Can i zip or rar large files into multiple parts?

1 Like

yes, its easy

how?
plz explain

Zipped link is not working, please update the link

File doesn’t exist. New link please.