Welcome to Drifty Docs!
Drifty
Usage
Drifty CLI
Downloading Files

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:

  1. Single File Download: Download individual files by providing their URLs one at a time.
  2. Batch download: You can download multiple files by providing a YAML file with the list of URLs.
  3. Using Drifty CLI Queue: Add multiple URLs to a download queue, allowing you to download them at your convenience.

Single file download

  1. Open Drifty CLI in your terminal.

  2. You will be prompted to choose the download option. Enter 1 for Single File download. Download Options Prompt

  3. Enter the URL of the video you want to download.

  4. 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.

    Download Destination Prompt

  5. The file name will be automatically detected from the URL. You will be prompted to confirm the file name. Enter Y to proceed or N to enter a custom file name (followed by the file extension, if any). File Name Prompt

  6. The file will be downloaded to the specified directory.

  7. 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. Exit Prompt

Batch download

  1. Open Drifty CLI in your terminal.

  2. You will be prompted to choose the download option. Enter 2 for Batch download. Download Options Prompt

  3. 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.yaml
    links:
      [
        "https://download.oracle.com/java/22/latest/jdk-22_linux-x64_bin.tar.gz",
        "https://www.youtube.com/watch?v=pBy1zgt0XPc",
      ]

    Batch File Prompt

  4. 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.

    File Exists Prompt

  5. The files will be downloaded sequentially to the default download directory, as we have not specified a custom download location in our YAML file. Batch Download Progress

  6. 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. Exit Prompt

Using Drifty CLI Queue

  1. Open your terminal in the directory containing the Drifty CLI executable.
  2. Check if any URLs are already in the download queue by using the --list command.
    drifty --list
    List Command
  3. 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"
    Add Command
  4. You can view the URLs just added to the queue by using the --list command.
    drifty --list
    List Command
  5. Start downloading the URLs in the download queue using the --get command.
    drifty --get
    Get Command
  6. 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. Queue Download Done