How to download files using Drifty CLI?
Drifty CLI allows you to download files from the internet using a simple command-line interface. There are three ways to download files using Drifty CLI:
- Single File Download: Download individual files by providing their URLs one at a time.
- Batch download: You can download multiple files by providing a YAML file with the list of URLs.
- Using Drifty CLI Queue: Add multiple URLs to a download queue, allowing you to download them at your convenience.
Single file download
-
Open Drifty CLI in your terminal.
-
You will be prompted to choose the download option. Enter
1
for Single File download. -
Enter the URL of the video you want to download.
-
After validating the URL, Drifty will prompt you to choose a download destination folder. Enter
.
if you want to download the video in the default download directory (which is{user_home}/Downloads
in most cases).L
if you want to use the last used directory.- the absolute path of the directory where you want to save the video, e.g.,
/home/user/Videos
.
-
The file name will be automatically detected from the URL. You will be prompted to confirm the file name. Enter
Y
to proceed orN
to enter a custom file name (followed by the file extension, if any). -
The file will be downloaded to the specified directory.
-
After the download is complete, you will be prompted to download another file or exit the application. Enter
Q
to exit or any other key to continue downloading files.
Batch download
-
Open Drifty CLI in your terminal.
-
You will be prompted to choose the download option. Enter
2
for Batch download. -
Enter the path to the YAML file containing the list of URLs you want to download. For this example, we are going to use the following data:
batch.yamllinks: [ "https://download.oracle.com/java/22/latest/jdk-22_linux-x64_bin.tar.gz", "https://www.youtube.com/watch?v=pBy1zgt0XPc", ]
-
The batch file will be processed, and if any of those files exist with the same name, or you have previously downloaded any, you will be prompted to skip or re-download them.
- Enter
Y
to continue downloading the file. A new file name will be generated, and you will be prompted to confirm the file name. - Enter
N
to skip downloading the file.
- Enter
-
The files will be downloaded sequentially to the default download directory, as we have not specified a custom download location in our YAML file.
-
After the download is complete, you will be prompted to download another file or exit the application. Enter
Q
to exit or any other key to continue downloading files.
Using Drifty CLI Queue
- Open your terminal in the directory containing the Drifty CLI executable.
- Check if any URLs are already in the download queue by using the
--list
command.drifty --list
- Add URLs to the download queue using the
--add
command.drifty --add "https://download.oracle.com/java/22/latest/jdk-22_linux-x64_bin.tar.gz" "https://www.youtube.com/watch?v=pBy1zgt0XPc"
- You can view the URLs just added to the queue by using the
--list
command.drifty --list
- Start downloading the URLs in the download queue using the
--get
command.drifty --get
- The files will be downloaded sequentially to the default download directory. After the download is complete, Drifty CLI will automatically remove the URLs from the queue and exit.