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.
35 lines
489 B
35 lines
489 B
#!/bin/sh
|
|
usage() {
|
|
echo "youtuber
|
|
-c [channel name]
|
|
-u [channel url]"
|
|
echo "you may only specify channel name or url, and must specify one"
|
|
}
|
|
|
|
if [ $#@ != 2 ]
|
|
then
|
|
usage()
|
|
exit 127
|
|
fi
|
|
|
|
while getopts "u:c:" opt; do
|
|
case "$opt" in
|
|
u)
|
|
URL=$2
|
|
shift
|
|
;;
|
|
c)
|
|
URL=https://www.youtube.com/$2
|
|
shift
|
|
;;
|
|
*)
|
|
usage()
|
|
exit 127
|
|
;;
|
|
esac
|
|
done
|
|
shift $((OPTIND-1))
|
|
|
|
RSS=`curl -s $URL |tr ':' '\n'|grep -A 2 rssUrl|tail -1 |cut -d'"' -f1|cut -d'/' -f3,4,5`
|
|
|
|
echo $RSS
|
|
|