# args checking if [ -z "$1" ] || [ "$1" = "-h" ] || [ "$1" = "--help" ]; then echo "usage: $(basename $0) INPUT_URL" echo exit 1 fi INPUT_URL="$1" printf "#EXTM3U\r\n" # TODO: add support for other users folders like "https://drive.google.com/folderview?id=0B_pKju79reouR1ZGZTlReTRQWXM&usp=sharing" #gdrive list -q "\'$INPUT_URL\' in parents" --name-width 0 | grep -e '\.ogg' -e '\.mp3' -e '\.aac' -e '\.flac' -e '\.mp4' | while read -r line ; do gdrive sync content --path-width 0 "$INPUT_URL" | grep -e '\.ogg' -e '\.mp3' -e '\.aac' -e '\.flac' -e '\.mp4' | while read -r line ; do id=$(echo "$line" | cut -d' ' -f1) name=$(echo "$line" | cut -d' ' -f2- | sed 's/^ //g' | cut -d. -f1 ) # trim spaces at the beginning echo "#EXTINF:-1,$name" # add lyrics/srt file via VLC custom tags (autosearch does not work with remote files?) #SRT_LOCAL_PATH="$(find /p/Documents/mus/lyrics -name "$(echo -n $name | cut -d. -f1).srt" | head -n1 )" #[ -f "$SRT_LOCAL_PATH" ] && echo "#EXTVLCOPT:sub-file=$SRT_LOCAL_PATH" echo "https://docs.google.com/uc?id=$id&export=download" done # ALTERNATIVE 2FIX: youtube-dl --skip-download --get-id --get-title "$INPUT_URL" | ... https://github.com/rg3/youtube-dl/issues/9797