diff --git a/README.txt b/README.txt index 7c4efda..4d980b9 100644 --- a/README.txt +++ b/README.txt @@ -6,7 +6,7 @@ browse YouTube quickly, and entirely without captive UIs. Right now, there's only one script, yt-search shelltube is written in pure shell; its only dependencies -are any modern shell (pdksh, bash, zsh) and curl/wget/ftp. +are any modern shell (pdksh, bash, zsh), lynx, and curl/wget/ftp. Your terminal should accept ANSI color-codes, too~ Before, shelltube was a set of scripts that culimated in a wrapper @@ -22,9 +22,9 @@ ye spectre of ole!), and starting from scratch. :) ---------------------------------------- USAGE ---------------------------------------- -There is one script that makes up shelltube: - * yt-search +YT-SEARCH +-------------------- yt-search lists videos matching a certain search query. USAGE: yt-search [-csmb] query @@ -38,10 +38,19 @@ Big takes up two lines, while the rest only use one. If you're piping output, you might wanna usa -m, -s, or -c. +YT-DESC +-------------------- +yt-desc prints the description of a YT video. + USAGE: yt-desc url/id +The only argument it takes is the URL/ID of the video. +This script requires `lynx`. + + +GENDL +-------------------- There is another script that comes with shelltube (which it uses -extensively: - * gendl +extensively: gendl. gendl can download files on a system that has at least one of these: * ftp @@ -50,7 +59,7 @@ gendl can download files on a system that has at least one of these: ... to stdout or to a file. -yt-search uses gendl-- +yt-search and yt-desc use gendl-- so make sure they're both in the same directory (or, at least, that gendl is in your $PATH) diff --git a/yt-desc b/yt-desc new file mode 100755 index 0000000..7d439ed --- /dev/null +++ b/yt-desc @@ -0,0 +1,39 @@ +############################## +# name: yt-desc +# lisc: gnu gplv3 +# main: jadedctrl +# desc: print desc of yt video +############################## + +# Usage: yt-desc "$url/id" + +# -------------------------------------- +# invocation + +USAGE="usage: yt-desc url/id" + +if test -z "$1" +then + echo "$USAGE" + exit 2 +fi + +if test -n "$1"; then + if echo "$1" | grep "youtube"; then + URL="$1" + else + URL="https://www.youtube.com/watch?v=${1}" + fi +fi + + + +# -------------------------------------- +# invocation <3 + +gendl "$URL" \ +| grep "action-panel-details" \ +| sed 's/.*

//' \ +| sed 's%

.*%%' \ +| lynx -stdin -dump \ +| sed 's/^ //'