ref: e1d1c44de98fcaabbeab0ef5225d76908bfba76b
parent: 88aeb8b6ebf3934430be9ab8e629201499eb1aba
author: Halfwit <michaelmisch1985@gmail.com>
date: Fri Feb 16 15:01:33 PST 2018
Seems to work well for most things! Signed-off-by: Halfwit <michaelmisch1985@gmail.com>
--- a/README.md
+++ b/README.md
@@ -10,6 +10,8 @@
will return a list of URLs and descritions
user <username>
will return a list of videos by user
+ playlist
+ will return a list of playlists
channel <channel name>
will return a list of videos by channel
channel-id <channel name>
--- a/ytcli
+++ b/ytcli
@@ -1,11 +1,5 @@
#!/bin/sh
-# TODO: Searching by normal tokens
-# TODO: Searching by user
-# TODO: Searching by channel
-# TODO: Fetch channel ID
-# TODO: Fetch images
-
CFG="$XDG_CONFIG_HOME/ytcli/config"
API="https://www.googleapis.com/youtube/v3/search?part=snippet"
THUMB=
@@ -15,7 +9,8 @@
Will return a list of [thumbs], URLs, and Descriptions for a given search.
'chanid' will return the ID of a named channel
Usage:
- ytctl [-t] [search|playlist|user|channel|chanid] KEYWORD
+ ytctl [-t] [search|playlist|user|channel] KEYWORD
+ ytctl [channel-id] KEYWORD
USAGE
}
@@ -77,6 +72,7 @@
get "$API&maxResults=$(max_results)&key=$(key)&type=playlist&q=$@" playlist
}
+# TODO: Verify this is working
user() {
url="https://www.googleapis.com/youtube/v3/channels?part=contentDetails&forUsername=$@&key=$(key)"
pid="$(curl -s "$url" | jshon -CQ -e items -e -id -e id -u)"