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.

22 lines
439 B

5 months ago
  1. #!/bin/bash
  2. # Check if the user provided a URL as an argument
  3. if [ $# -eq 0 ]; then
  4. echo "Usage: $0 <youtube_url> <song_name>"
  5. exit 1
  6. fi
  7. # Assign the YouTube URL to a variable
  8. youtube_url="$1"
  9. shift
  10. # Download the audio using youtube-dl
  11. youtube_file="$2"
  12. yt-dlp --extract-audio --audio-format mp3 "$youtube_url" -o "$youtube_file"
  13. # Play the audio using ffmpeg
  14. vlc "$youtube_file"
  15. # Remove the downloaded file
  16. rm "$youtube_file"