Build shadow platform while consuming platforms content playing it. Works for youtube until now.
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
#!/bin/bash
|
|
|
|
# Check if the user provided a URL as an argument
|
|
if [ $# -eq 0 ]; then
|
|
echo "Usage: $0 <youtube_url> <song_name>"
|
|
exit 1
|
|
fi
|
|
|
|
|
|
# Assign the YouTube URL to a variable
|
|
youtube_url="$1"
|
|
shift
|
|
|
|
# Download the audio using youtube-dl
|
|
youtube_file="$2"
|
|
yt-dlp --extract-audio --audio-format mp3 "$youtube_url" -o "$youtube_file"
|
|
|
|
# Play the audio using ffmpeg
|
|
vlc "$youtube_file"
|
|
|
|
# Remove the downloaded file
|
|
rm "$youtube_file"
|