diff --git a/zsh/fn.zsh b/zsh/fn.zsh index 60e3ad2..6a15fed 100644 --- a/zsh/fn.zsh +++ b/zsh/fn.zsh @@ -17,7 +17,7 @@ alias cat="bat -p" alias gfold="gfold -d classic" function hs() { - $(cat ~/.zsh_history|sk) + rg "$1" ~/.zsh_history } alias notes="codium ~/Notes" diff --git a/zsh/youtube-dl.zsh b/zsh/youtube-dl.zsh index c217d37..835af59 100644 --- a/zsh/youtube-dl.zsh +++ b/zsh/youtube-dl.zsh @@ -18,7 +18,43 @@ function downloadList() { } # info_json VIDEO_FILE -# View info.json from video file +# Extract info.json from video file function info_json() { - mkvextract -q attachments "$1" "1:/proc/self/fd/1"|jq . + mkvextract -q attachments "$1" "1:/proc/self/fd/1" +} + +# info_json_url VIDEO_FILE +# Get URL from info.json +function info_json_url() { + info_json "$1" | jq -r .webpage_url +} + +# info_json_title VIDEO_FILE +# Get Title from info.json +function info_json_title() { + info_json "$1" | jq -r .title +} + +# info_json_desc VIDEO_FILE +# Get description from info.json +function info_json_desc() { + info_json "$1" | jq -r .description +} + +# info_json_uploader VIDEO_FILE +# Get uploader from info.json +function info_json_uploader() { + info_json "$1" | jq -r .uploader +} + +# info_json_uploader_url VIDEO_FILE +# Get uploader URL from info.json +function info_json_uploader_url() { + info_json "$1" | jq -r .uploader_url +} + +# info_json_upload_date VIDEO_FILE +# Get upload date from info.json +function info_json_upload_date() { + info_json "$1" | jq -r .upload_date } \ No newline at end of file