PC & IT SUPPORT MADE EASY FORUM
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Download VIA CLI On Linux

Go down

Download VIA CLI On Linux  Empty Download VIA CLI On Linux

Post by jamied_uk 19th July 2024, 12:23

Setting up yt dl using bashrc



Code:
mkdir /home/jay/Documents/Scripts/yt-dl
cd /home/jay/Documents/Scripts/yt-dl
git clone https://github.com/ytdl-org/youtube-dl.git



Code:
sudo gedit ~/.bashrc



function yt(){
present=$(pwd)
cd /home/jay/Documents/Scripts/PYTHON/yt-dl
python -m venv myenv
source myenv/bin/activate
    # Check if URL is provided
    if [ -z "$1" ]; then
        echo "Usage: yt <URL> or -f file.ext"
        return 1
    fi
    pip install yt_dlp
    python dl.py $1
    mv *.mp4 ~/Downloads
    # Use yt-dlp to download the video
    #sudo yt-dlp -f bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4] -o "/home/jay/Downloads/%(title)s.%(ext)s" "$1"
cd $present
}
jamied_uk
jamied_uk
Admin

Posts : 3053
Join date : 2010-05-09
Age : 41
Location : UK

https://jnet.sytes.net

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum