removed last changed. it was allready doing the thing i wanted. renamed get_yt2.sh to getyt. added actual args
This commit is contained in:
parent
475c01dc19
commit
796b4c064f
11
README.md
11
README.md
|
@ -5,7 +5,7 @@ Technically you can modify this to store anything other than just yt videos
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
# download.
|
# download
|
||||||
Just download this repo and rename youtube_stuffs.db.def to youtube_stuffs.db
|
Just download this repo and rename youtube_stuffs.db.def to youtube_stuffs.db
|
||||||
|
|
||||||
# requirements
|
# requirements
|
||||||
|
@ -25,16 +25,15 @@ Just download this repo and rename youtube_stuffs.db.def to youtube_stuffs.db
|
||||||
- run ``fetch.sh "youtube url/playlist url" "playlist name"``.
|
- run ``fetch.sh "youtube url/playlist url" "playlist name"``.
|
||||||
that should pretty much do everything.
|
that should pretty much do everything.
|
||||||
- check download_err.txt for download errors. Videos that are marked as nsfw and require sign in will NOT be added to the list and require manual intervention
|
- check download_err.txt for download errors. Videos that are marked as nsfw and require sign in will NOT be added to the list and require manual intervention
|
||||||
- then ``get_yt2.sh.``.
|
- then ``getyt``.
|
||||||
- if you want thumbnails ``get_yt2.sh 1``.
|
- if you want thumbnails ``getyt -c``.
|
||||||
- if you want to de a specific "category" or playlist. do ``get_yt2.sh 0 playlistname``
|
- if you want to de a specific "category" or playlist. do ``getyt playlistname``
|
||||||
- if you want too then delete download.txt and download_err.txt and thumberr.txt
|
- if you want too then delete download.txt and download_err.txt and thumberr.txt
|
||||||
|
|
||||||
# config
|
# config
|
||||||
- In ``get_yt2.sh`` there is the preview lines and columns. Idk if I can autodetect this because something something fzf doesn't do something something
|
- In ``getyt`` there is the preview lines and columns. Idk if I can autodetect this because something something fzf doesn't do something something
|
||||||
- If you want to change anything else you would have to change the script. Feel free to make your own config system
|
- If you want to change anything else you would have to change the script. Feel free to make your own config system
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# todo
|
# todo
|
||||||
- auto detect detect last item in list when and before adding new item so thumbnails doesn't start at 1. Or async it or something idk
|
- auto detect detect last item in list when and before adding new item so thumbnails doesn't start at 1. Or async it or something idk
|
||||||
|
|
|
@ -4,27 +4,41 @@ FZF_PREVIEW_COLUMN=3
|
||||||
|
|
||||||
|
|
||||||
cd "$(dirname "$0")"
|
cd "$(dirname "$0")"
|
||||||
has_chafa=$1
|
has_chafa=0
|
||||||
|
|
||||||
|
while getopts "c" opt; do
|
||||||
|
case "$opt" in
|
||||||
|
c) has_chafa=1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
shift $((OPTIND-1))
|
||||||
|
[ "${1:-}" = "--" ] && shift
|
||||||
|
|
||||||
! command -v chafa >/dev/null && has_chafa=0
|
! command -v chafa >/dev/null && has_chafa=0
|
||||||
|
|
||||||
playlist=$2
|
playlist=$1
|
||||||
|
|
||||||
if [ "$2" == "" ]; then
|
|
||||||
|
if [ "$playlist" == "" ]; then
|
||||||
item="$(sqlite3 ./youtube_stuffs.db "select rowid,* from ytlist")"
|
item="$(sqlite3 ./youtube_stuffs.db "select rowid,* from ytlist")"
|
||||||
else
|
else
|
||||||
item="$(sqlite3 ./youtube_stuffs.db "select rowid,* from ytlist where category='$playlist'")"
|
item="$(sqlite3 ./youtube_stuffs.db "select rowid,* from ytlist where category='$playlist'")"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
if [ "$has_chafa" == "1" ]; then
|
if [ "$has_chafa" == "1" ]; then
|
||||||
item="$( printf -- "%s" "$item" | \
|
item="$( printf -- "%s" "$item" | \
|
||||||
fzf --no-sort --layout=reverse-list --preview "./preview.sh {} | xargs chafa --clear -f iterm -s ${FZF_PREVIEW_COLUMNS}x${FZF_PREVIEW_LINES}" \
|
fzf --preview "./preview.sh {} | xargs chafa --clear -f iterm -s ${FZF_PREVIEW_COLUMNS}x${FZF_PREVIEW_LINES}" \
|
||||||
| sed -- 's/|.*//g')"
|
| sed -- 's/|.*//g')"
|
||||||
else
|
else
|
||||||
item="$( printf -- "%s" "$item" | \
|
item="$( printf -- "%s" "$item" | \
|
||||||
fzf --no-sort --reverse --layout=reverse-list \
|
fzf \
|
||||||
| sed -- 's/|.*//g')"
|
| sed -- 's/|.*//g')"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
url=$(sqlite3 ./youtube_stuffs.db "select id from ytlist where rowid=$item")
|
url=$(sqlite3 ./youtube_stuffs.db "select id from ytlist where rowid=$item")
|
||||||
if [ -z "$WAYLAND_DISPLAY" ]; then
|
if [ -z "$WAYLAND_DISPLAY" ]; then
|
||||||
printf "https://youtube.com/watch?v=$url" | xclip -selection clipboard
|
printf "https://youtube.com/watch?v=$url" | xclip -selection clipboard
|
Loading…
Reference in New Issue