client:ytfzf
This is an old revision of the document!
Table of Contents
yt-fzf
yt-fzf is a posix script to find and watch youtube videos from the terminal. Unfortenetly public instances wont work so we have to run our own locally.
git clone https://github.com/pystardust/ytfzf.git make sudo make install
Edit the config file
vim .config/ytfzf/conf.sh
And add this content:
#!/bin/sh
# This is a sample config file, refer to ytfzf(5) for more information
ytdl_pref='bestvideo[height<=?1080]+bestaudio/best'
sub_link_count=8
show_thumbnails=1
pages_start=1
search_again=1
multi_search=1
invidious_instance="http://localhost:3000"
# Thumbnail
thumbnail_viewer="ueberzug"
thumbnail_quality="maxres"
fzf_preview_side="right"
sort_by="upload_date"
on_opt_parse_c () {
arg="$1"
case "$arg" in
#when scraping subscriptions enable -l
#-cSI or -cS
SI|S) is_loop=1 ;;
esac
}
Invidous Instance
Install Dependencys
sudo pacman -S crystal shards postgresql
Compile Invidious
git clone https://github.com/iv-org/invidious cd invidious shards install crystal build src/invidious.cr --release
Initialise Database and start postgres:
sudo su - postgres -c 'initdb -D /var/lib/postgres/data' postgresql
Copy the infivous config file over:
cp config/config.example.yml config/config.yml
And change the following entrys in config/config.yml:
db: user: postgres password: "" dbname: invidious host: localhost port: 5432 hmac_key: "8f3d342cfb8a11d93e9f..."
Postgres
Login into postgres
sudo -u postgres psql
Within the psql-Prompt:
CREATE USER invidious WITH PASSWORD 'invidious'; CREATE DATABASE invidious OWNER invidious; \q
Import DB-Scheme:
Jetzt füllst du die Datenbank mit dem Schema, das Invidious braucht: psql -U invidious -h localhost -d invidious < config/sql/channels.sql psql -U invidious -h localhost -d invidious < config/sql/videos.sql psql -U invidious -h localhost -d invidious < config/sql/users.sql psql -U invidious -h localhost -d invidious < config/sql/session_ids.sql psql -U invidious -h localhost -d invidious < config/sql/nonces.sql psql -U invidious -h localhost -d invidious < config/sql/channel_videos.sql
Now you can start invidious
./invidious
Refining
Add both postgres and invidous to your boot runlevel.
Now you can search anything with yt-fzf
ytfzf "Anything"
Done! Have fun with ytfzf