YouTube is a media streaming and video-sharing platform. It requires one to watch videos online or download them to watch later. YouTube can be accessed from PCs, tablets, mobile phones, and TVs. There are different products on YouTube like YouTube Go, YouTube Kids, YouTube Premium, and YouTube TV.

YouTube offers an inbuilt download option for videos to watch later but cannot be shared as videos but as links. Most people prefer downloading videos that can be shared and not links. These bring about different software that helps users download YouTube videos for offline use. An example is Lux.

Lux is a YouTube video downloader tool built with the Go programming language. This guide will show you how to Download Youtube videos using Lux on Linux, macOS, and Windows operating systems.

Install Lux YouTube Downloader on Linux

Update your system packages.

#Ubuntu / Debian
sudo apt update

#Fedora
sudo dnf -y update

Install using Go install

Install the dependencies on your system – Golang and ffmpeg;

#Ubuntu / Debian
sudo apt install ffmpeg golang-go git -y

#Fedora
sudo dnf -y install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm
sudo dnf -y install https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
sudo dnf -y install golang ffmpeg

Set PATH for the modules

export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin
export PATH=$PATH:/usr/bin/git

Install the latest version of Lux with go install

go install github.com/iawia002/[email protected]

Install using Binary File

Install wget and curl tools:

#Ubuntu / Debian
sudo apt install wget curl

#Fedora
sudo dnf -y install wget curl

Go to the Lux repository Github page to download the latest version or use the following command.

VERSION=$(curl -s https://api.github.com/repos/iawia002/lux/releases/latest|grep tag_name|cut -d '"' -f 4|sed 's/v//')
wget https://github.com/iawia002/lux/releases/download/v${VERSION}/lux_${VERSION}_Linux_64-bit.tar.gz

Extract the file downloaded by running below commands:

tar xvf lux_${VERSION}_Linux_64-bit.tar.gz

Move binary file created to a directory in your $PATH or add its current directory to $PATH.

sudo mv lux /usr/local/bin/

To confirm successful installation, check the version

$ lux -v
lux: version v0.15.0, A fast and simple video downloader.

This will download and install lux on your Linux system.

Install Lux YouTube Downloader on macOS

You should first install the Homebrew package manager if you do not have it.

Use the following command to install homebrew

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

Enter the admin password and then press Return to continue the installation.

To install lux on macOS, use the following command.

brew install ffmpeg
brew install lux

You have successfully installed Lux on your macOS system.

Install Lux YouTube Downloader on Windows

Use of the these two methods;

Option 1: Install Lux using Scoop

Open Powershell as a normal user to install Scoop with the following command.

$ iwr -useb get.scoop.sh | iex

Then install lux using scoop with the following command.

$ scoop install lux
Updating Scoop...
Updating 'extras' bucket...
Updating 'main' bucket...
Checking repo... ok
The main bucket was added successfully.
Scoop was updated successfully!
Installing 'ffmpeg' (5.0.1) [64bit]
ffmpeg-5.0.1-full_build.7z (42.6 MB) [========================================================================] 100%
Checking hash of ffmpeg-5.0.1-full_build.7z ... ok.
Extracting ffmpeg-5.0.1-full_build.7z ... done.
Linking ~\scoop\apps\ffmpeg\current => ~\scoop\apps\ffmpeg\5.0.1
Creating shim for 'ffmpeg'.
Creating shim for 'ffplay'.
Creating shim for 'ffprobe'.
Persisting fonts
Running post-install script...
'ffmpeg' (5.0.1) was installed successfully!
Installing 'lux' (0.14.0) [64bit]
lux_0.14.0_Windows_64-bit.zip (13.0 MB) [=====================================================================] 100%
Checking hash of lux_0.14.0_Windows_64-bit.zip ... ok.
Extracting lux_0.14.0_Windows_64-bit.zip ... done.
Linking ~\scoop\apps\lux\current => ~\scoop\apps\lux\0.14.0
Creating shim for 'lux'.
'lux' (0.14.0) was installed successfully!

Confirm installation by checking the version

$ lux -v
lux: version v0.15.0, A fast and simple video downloader.

Option 2: Install Lux using Chocolatey

You will need to install Chocolatey first.

Install Chocolatey with PowerShell

We have to first ensure Get-ExecutionPolicy is not Restricted in PowerShell.

Run Get-ExecutionPolicy. If it returns Restricted, then run either of the following commands to set it.

Set-ExecutionPolicy AllSigned
Set-ExecutionPolicy Bypass -Scope Process

Paste the following command to install Chocolatey.

Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))

Install Chocolatey using CMD

Open Command Prompt and paste the following command to install Chocolatey.

@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "[System.Net.ServicePointManager]::SecurityProtocol = 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"

Then install lux using the following command.

$ choco install lux

Confirm installation by checking the version.

lux version

Option 3: Downloading zip file

Go to the official Lux Github release page to download the latest windows zip file of Lux.

Once downloaded, extract the file in a suitable location and copy the path.

Then go to My Computer -> Click Properties -> Click Advanced system settings -> Click Environment Variables. Or search for Environment variables on the search bar and click to open.

Once open click on Edit on that screen with the Path variable selected as shown below.

Then click on New and paste the path where the file is located.

Then click OK on all windows and close them.

To confirm successful installation, open the command prompt check the version

$ lux -v
lux: version v0.15.0, A fast and simple video downloader.

You have successfully installed lux on your Windows system.

Download Youtube videos using lux

Use the following command to download a YouTube video using Lux

$ lux "https://www.youtube.com/watch?v=f2OGhJoypPw"

 Site:      YouTube youtube.com
 Title:     The Mystery of Marilyn Monroe: The Unheard Tapes | Official Trailer | Netflix
 Type:      video
 Stream:
     [137]  -------------------
     Quality:         1080p video/mp4; codecs="avc1.640028"
     Size:            32.37 MiB (33943914 Bytes)
     # download with: lux -f 137 ...

32.37 MiB / 32.37 MiB [===================================================================] 82.09 KiB p/s 100.00% 6m44s
Merging video parts into The Mystery of Marilyn Monroe:The Unheard Tapes - Official Trailer - Netflix.mp4

To download a playlist, use the -p option.

$ lux -p "https://www.youtube.com/playlist?list=PLS1QulWo1RIaJECMeUT4LFwJ-ghgoSH6n"

To view video details without downloading, use the -i option.

$ lux -i "https://www.youtube.com/watch?v=f2OGhJoypPw"

 Site:      YouTube youtube.com
 Title:     The Mystery of Marilyn Monroe: The Unheard Tapes | Official Trailer | Netflix
 Type:      video
 Streams:   # All available quality
     [137]  -------------------
     Quality:         1080p video/mp4; codecs="avc1.640028"
     Size:            32.37 MiB (33943914 Bytes)
     # download with: lux -f 137 ...

     [248]  -------------------
     Quality:         1080p video/webm; codecs="vp9"
     Size:            22.79 MiB (23895398 Bytes)
     # download with: lux -f 248 ...

     [399]  -------------------
     Quality:         1080p video/mp4; codecs="av01.0.08M.08"
     Size:            20.58 MiB (21579129 Bytes)
     # download with: lux -f 399 ...

     [398]  -------------------
     Quality:         720p video/mp4; codecs="av01.0.05M.08"
     Size:            12.20 MiB (12790866 Bytes)
     # download with: lux -f 398 ...

This command also lists all the video quality available. You can use the following command to download a specific quality.

$ lux -f stream "URL"

You can also download multiple videos using the following command.

$ lux "https://www.youtube.com/watch?v=f2OGhJoypPw" "https://www.youtube.com/watch?v=HFBCHQJBkB8"

The videos get downloaded one by one.

Conclusion

From this guide, we have learned how to install Lux on Linux, macOS, and Windows systems. We have also gone through how to download single and multiple videos using lux and also how to download a playlist. Lux is a fast and easy option to download youtube videos and any other video from supported sites like bilibili, Facebook, Twitter, and Vimeo.

LEAVE A REPLY

Please enter your comment!
Please enter your name here