What makes us different from other similar websites? › Forums › Tech › How to Stop Ad Blocker Detection on Websites Like YouTube › Reply To: How to Stop Ad Blocker Detection on Websites Like YouTube
March 4, 2025 at 12:56 pm
#7992

Keymaster
There are two ways to avoid as on YouTube. Option one has a GUI, but option 2 removes the ads from the videos and works better.
Option 1
$ sudo apt install snapd
$ sudo snap install ytdownloader
Option 2
$ sudo apt install python3-pip
$ mkdir ~/Videos/Youtube/
$ cd ~/Videos/Youtube/
$ python3 -m venv yt-dlp-venv
$ source yt-dlp-venv/bin/activate
$ pip install --upgrade yt-dlp
$ yt-dlp your_youtube_video_url
Option 2 [Script] Save as yt-dlp.sh
#!/bin/bash
# Install dependencies (if not already installed)
if ! command -v python3 &> /dev/null; then
sudo apt install python3 -y
fi
if ! command -v python3-pip &> /dev/null; then
sudo apt install python3-pip -y
fi
# Create or enter the download directory
DOWNLOAD_DIR="$HOME/Videos/Youtube"
mkdir -p "$DOWNLOAD_DIR"
cd "$DOWNLOAD_DIR"
# Create and activate a virtual environment
VENV_DIR="$DOWNLOAD_DIR/yt-dlp-venv"
if [ ! -d "$VENV_DIR" ]; then
python3 -m venv "$VENV_DIR"
fi
source "$VENV_DIR/bin/activate"
# Use the virtual environment's python executable
"$VENV_DIR/bin/python3" -m pip install --upgrade yt-dlp
# Prompt the user for the YouTube link
read -p "Enter the YouTube video URL: " YOUTUBE_URL
# Download the video
if [[ -n "$YOUTUBE_URL" ]]; then
yt-dlp "$YOUTUBE_URL"
else
echo "No URL provided."
fi
# Deactivate the virtual environment
deactivate
Option 2 [Run Script]
$ bash yt-dlp.sh