From f1416eda07b1c4b0aac2643f75f929cf58b5974e Mon Sep 17 00:00:00 2001 From: Jade Levesque Date: Thu, 5 Jan 2017 22:38:38 -0600 Subject: [PATCH] Support for running w/o installation --- lib/yt-channel | 11 +++++++++++ lib/yt-down | 12 ++++++++++++ lib/yt-meta | 11 +++++++++++ lib/yt-search | 11 +++++++++++ shelltube | 11 +++++++++++ 5 files changed, 56 insertions(+) diff --git a/lib/yt-channel b/lib/yt-channel index 098e5ce..c215354 100755 --- a/lib/yt-channel +++ b/lib/yt-channel @@ -17,6 +17,17 @@ else results=21 fi +if [ -e "./lib/yt-meta" ] +then + alias yt-channel="./lib/yt-channel" + alias yt-search="./lib/yt-down" + alias yt-meta="./lib/yt-meta" + alias yt-search="./lib/yt-search" + alias yt-down="./lib/yt-channel" + alias st-download="./lib/st-download" + alias st-video="./lib/st-video" +fi + interactive_mode=0 channel_file="/tmp/$(mktemp -u yt-channel_XXXXXX)" diff --git a/lib/yt-down b/lib/yt-down index d82c05c..cfa5032 100755 --- a/lib/yt-down +++ b/lib/yt-down @@ -20,6 +20,18 @@ else id=$1 fi +if [ -e "./lib/yt-meta" ] +then + alias yt-channel="./lib/yt-channel" + alias yt-search="./lib/yt-down" + alias yt-meta="./lib/yt-meta" + alias yt-search="./lib/yt-search" + alias yt-down="./lib/yt-channel" + alias st-download="./lib/st-download" + alias st-video="./lib/st-video" +fi + + if echo "$id" | grep "youtube.com" then id="$(echo "$id" | sed 's/.*video_id=//')" diff --git a/lib/yt-meta b/lib/yt-meta index 062a942..310d8b0 100755 --- a/lib/yt-meta +++ b/lib/yt-meta @@ -20,6 +20,17 @@ else id="$1" fi +if [ -e "./lib/yt-meta" ] +then + alias yt-channel="./lib/yt-channel" + alias yt-search="./lib/yt-down" + alias yt-meta="./lib/yt-meta" + alias yt-search="./lib/yt-search" + alias yt-down="./lib/yt-channel" + alias st-download="./lib/st-download" + alias st-video="./lib/st-video" +fi + video_file="/tmp/$(mktemp -u yt-video_XXXXXX)" if type "wget" &> /dev/null diff --git a/lib/yt-search b/lib/yt-search index 150c9e2..477cabf 100755 --- a/lib/yt-search +++ b/lib/yt-search @@ -17,6 +17,17 @@ else results=21 fi +if [ -e "./lib/yt-meta" ] +then + alias yt-channel="./lib/yt-channel" + alias yt-search="./lib/yt-down" + alias yt-meta="./lib/yt-meta" + alias yt-search="./lib/yt-search" + alias yt-down="./lib/yt-channel" + alias st-download="./lib/st-download" + alias st-video="./lib/st-video" +fi + row=0 if [ "$1" == "-i" ] diff --git a/shelltube b/shelltube index 4d3d0f4..541da0d 100755 --- a/shelltube +++ b/shelltube @@ -25,6 +25,17 @@ then . "$HOME/.config/shelltube" fi +if [ -e "./lib/yt-meta" ] +then + alias yt-channel="./lib/yt-channel" + alias yt-search="./lib/yt-down" + alias yt-meta="./lib/yt-meta" + alias yt-search="./lib/yt-search" + alias yt-down="./lib/yt-channel" + alias st-download="./lib/st-download" + alias st-video="./lib/st-video" +fi + search() { output="$(mktemp -u /tmp/yt_XXXXXX)" yt-search -i "$1" "$output"