Skip to content

Instantly share code, notes, and snippets.

@ymollard
Last active March 12, 2017 00:54
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 ymollard/197e90090753be89ec915dc7c4fcc64d to your computer and use it in GitHub Desktop.
Save ymollard/197e90090753be89ec915dc7c4fcc64d to your computer and use it in GitHub Desktop.
#!/bin/bash
# TF1 utilisant toujours des technologies obsolètes en 2016 (Adobe Flash),
# voici un script Bash trivial pour regarder le programme Quotidien sous Linux
if [ $# -eq 2 ]
then
day=$1
month=$2
year=`date +%Y`
elif [ $# -eq 0 ]
then
day=`date +%e | tr -d '[[:space:]]'`
month=`date +%B | iconv -f utf8 -t ascii//TRANSLIT`
year=`date +%Y`
else
>&2 echo "USAGE : Ne pas fournir d'argument pour visualiser le jour courant ou bien "$0" <jour> <mois>"
>&2 echo "Exemple: "$0" 3 octobre"
exit 1
fi
url='http://www.tf1.fr/tmc/quotidien-avec-yann-barthes/videos/quotidien-premiere-partie-'$day'-'$month'-'$year'.html'
out='Quotidien_1_'$day'-'$month'-'$year'.mp4'
youtube-dl --postprocessor-args "-bsf:a aac_adtstoasc" ${url} --output ${out}
if [ -f ${out} ]; then
vlc ${out} --play-and-exit
echo
echo '#### To re-play:'
echo vlc ${out} --play-and-exit
else
>&2 echo
>&2 echo '#### To re-execute:'
>&2 echo youtube-dl --postprocessor-args \"-bsf:a aac_adtstoasc\" ${url} --output ${out}
>&2 echo
>&2 echo '#### To re-play:'
>&2 echo vlc ${out} --play-and-exit
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment