Skip to content

Instantly share code, notes, and snippets.

@akiraaisha
Last active May 9, 2019 03:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save akiraaisha/58878fae0a89110733cd79e89be74773 to your computer and use it in GitHub Desktop.
Save akiraaisha/58878fae0a89110733cd79e89be74773 to your computer and use it in GitHub Desktop.
Coub Downloader
#/bin/sh
color=$(tput setaf 153)
color2=$(tput setaf 6)
set -e
yt -o 1.mp4 "$1"
yt -f html5-audio-high -o 1.mp3 "$1"
printf '\x00\x00' | dd of=1.mp4 bs=1 count=2 conv=notrunc
for i in `seq 1 $2`; do echo "file '1.mp4'" >> 1.txt; done
ffmpeg -nostats -loglevel error -y -hide_banner -f concat -i 1.txt -i 1.mp3 -c copy -shortest -movflags faststart "$3.mp4"
rm 1.mp4 1.mp3 1.txt
printf "$color2\nSuccess!!!\n${color}Time Duration: "
ffmpeg -i "$3.mp4" 2>&1 | grep Duration | cut -d ' ' -f 4 | sed s/,//
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment