Usage#

pybox#

This tool include a bunch of useful commands:

1. Download single file or all files in a folder for Google Driver
2. Send message to Slack
3. more to come…
pybox [options] <command>

Yangyang-Li https://yangyangli.top/ 2023

Command#

gfile#

Download file in Google Driver. You need to provide the sharing url, and estimated size of the file. The config is in terms of the file size so you need to be careful! Specify the size is divided into 2 classes:

the large file : file size > 100mb -> size parameters: l
the small file : file size < 100mb -> size parameters: s
Usage:
pybox gfile -f url-file.txt l
gfile [options] <size>

Options

-u, --url <url>#

the sharing link of the google drive file.

-o, --out <name>#

the output file name.

Default:

out

-f, --url-file <url-file>#

the file contains the sharing link of the google drive file.

Arguments

<size>#

Required argument

gfolder#

Download files in folders in Google Drive.

Usage:
pybox gfolder <json-file> -i <folder_id>
pybox gfolder <json-file> -f <folder_ids>

If you use server to download files, you may need to supress browser open:

pybox gfolder <json-file> -i <folder_id> –code

folder_id: id of the folder to download.
folder_ids: a file contains a list of folder ids.
gfolder [options] <json>

Options

-i, --fid <folder_id>#
-f, --fids <folder_ids>#
--code#

Arguments

<json>#

Required argument

slack#

Send message to Slack. You can either provide a message or a file containing the messages. Also, you can provide both a message and a file containing messages. However, if the message and message file are both missing, the command will exit with an error.

slack [options] <webhook-url>

Options

-m, --message <message>#

the message to send to slack

Default:

No message provided

-mf, --message-file <message-file>#

read message from file instead of command line

--log-level <log-level>#
Default:

INFO

Options:

DEBUG | INFO | WARNING | ERROR | CRITICAL

Arguments

<webhook-url>#

Required argument

asyncdown#

Download files in terms of links asynchronously.

Examples:
pybox asyncdown -u url-link -o book.pdf
pybox asyncdown -f url-file.txt
Note:
1. If you want to download multiple files, you can use the url-file.
asyncdown [options]

Options

-u, --url <url>#

URL to download

-o, --out <name>#

Output name

Default:

out

-f, --url-file <url-file>#

File containing URLs to download

-t, --time <time-out>#

Time out (min) for each download

Default:

40

-w, --workers <max-worker>#

Maximum number of workers

Default:

128

--wf#

Write failed items to failed.txt

Default:

False