Skip to content

Magic-tape is an image supporting fuzzy finder command line interface YouTube client.

License

Notifications You must be signed in to change notification settings

christosangelopoulos/magic-tape

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

magic-tape

Magic-tape is an image supporting fuzzy finder command line interface YouTube client.

Downloading data is achieved with yt-dlp and cURL, while selections are achieved mainly with fzf.

Image support is achieved either with kitty terminal, ueberzugpp, ueberzug or chafa.

With magic-tape, through the main menu, the user can

  • Browse videos from subscriptions.

  • Browse videos suggested by YT algorithm.

  • Browse through trending video feed.

  • make a video search, using keywords or phrases.

  • Watch a previously watched video (watch history).

  • Browse videos from a subcsribed channel.

  • Watch a liked video.

  • Repeat the previous selection.

  • Repeat a previous search (search history).

  • Watch/download video/audio content, in various formats.

Through the miscellaneous menu the user can

  • Edit Preferences file (configuration).

  • Like / Unlike a video.

  • Synchronize the above actions with their YouTube account.

  • Import subscriptions from YouTube.

  • Subscribe to/ Unsubscribe from a channel.

  • Clear their watch/search history, liked videos, thumbnail cache.


Dependencies

Instructions on installing yt-dlp can be found here:

https://github.com/yt-dlp/yt-dlp#installation

Easily install yt-dlp using pip:

pip install yt-dlp

Other dependencies include:

Regarding image support, it can either be achived with

sudo apt install kitty

with

  • ueberzugpp (install instructions in the page)

    Ueberzugpp works great with older hardware, where installing kitty is not an option.

with

sudo apt install chafa

or with



How to install Ueberzug

The ueberzug project has been archived. However, in order to install ueberzug one can follow these steps:

  • Install dependencies
sudo apt install libx11-dev libxres-dev libxext-dev

If during the installation process, errors appear due to absence of other depedencies, the user is encouraged to search the error message in the internet in order to locate the misssing dependency.

git clone "https://github.com/gokberkgunes/ueberzug-tabbed.git"

cd ueberzug-tabbed

python -m pip install .

NOTE: One may need to call above pip install commands as pip install --break-system-packages to successfully install the packages.



To install these magic-tape.sh dependencies, run the following command:

sudo apt install curl fzf mpv jq xclip

To install rofi:

sudo apt install rofi

To install dmenu:

sudo apt install dmenu

Install

Clone the magic-tape repo, and then get to the magic-tape/ directory:

git clone https://gitlab.com/christosangel/magic-tape.git
cd magic-tape/

Make install.sh executable, then run it:

chmod +x install.sh
./install.sh

Run

From any directory, run:

magic-tape.sh


Usage

Configuring

Through the P Option in the Miscellaneous Menu, the user can configure many pamaters of this script. The same can be equally well achieved by editing the ~/.config/magic-tape/magic-tape.conffile, outside the script :

Parameter Explanation Default Value Acceptable Values
PREF_SELECTOR Preferred selector is the program used to select actions rofi dmenu rofi fzf
PREF_EDITOR Editor used to edit the configuration file nano -ml nano, vim, gedit, xed, or any other terminal or graphical text editor
PREF_BROWSER Preferred browser is the browser the cookies of which are used to login to YouTube firefox brave-browser-stable, chrome, chromium, edge, firefox, opera, vivaldi
LINK_BROWSER The browser to use to open links with firefox Any Browser
LIST_LENGTH The length of the list of videos to choose from 40 10 - 60 or more (although, the smaller the length, the faster the response)
TERMINAL_MESSAGE_DURATION Terminal message duration (sleep command) 2 1 - 5 sec (or more, if you love sleeping)
COLORED_MESSAGES Tui messages in color yes yes / no
NOTIFICATION_DURATION Notification duration 6000 1 - 10000 msec
IMAGE_SUPPORT Image support, the program used to render image previews in the terminal window. ueberzug kitty ueberzugpp ueberzug chafa none
SHOW_MPV_KEYBINDINGS Show mpv keybindings while playing yes yes / no
DOWNLOAD_DIRECTORY Directory to download audio video into /Downloads $HOME is the root directory, e.g. if you want to download your files in the Desktop directory, instead of $HOME/Desktop, just put /Desktop

Also, by editing the ~/.config/magic-tape/magic-tape.conf file, the user can configure the colors used in the terminal user text.

Finally, by editing the ~/.config/magic-tape/magic-tape.conf file, the format of the preferred selector program can be also configured. However the user is advised to avoid such editing, unless they know what they are doing.

image 1{height=300}


Import Subscribed channels

When the script is run for the first time, it would be advisable for the user to import their subcsribed channels from YouTube.

The user user can do that by navigating to the Miscellaneous Menu (option m), then selecting Import Subscriptions from YouTube (option I).


Main Menu

Once the program is run, the user is presented with the Main Menu:

image 2{height=320}

Entering the respective key, the user can :

key Action
f Browse their Subscriptions Feed.
y Browse YT algorithm Feed
t Browse YouTube Trending Feed.
s Search for a key word/phrase
r Repeat previous selection.
c Select a Subscribed Channel Feed.
l Browse Liked Videos.
h Browse Watch History.
j Browse Search History.
m Open Miscellaneous Menu.
q Quit the program.
  • In order for the f and y Options to function, the user must already be logged in to YT in the browser.

  • Selecting channel feed, Browsing watch history, search history & liked videos is done with rofi, fzf or dmenu:

image 3{width=320} image 4{width=320} image 5{width=320} image 6{width=320}


Search and Search History

The user can search for a video using a keyword or phrase. Also the user can browse Search history and repeat a previous search.

There is now a duration filter prompt in the search and search history option:

image 7{width=320}


Video selection

Video selection is done with fzf:

image 8{height=450}

Search shortcuts

Shortcut Function
Enter, Right Arrow Accept
Esc Abort Selection
Shift+Right Arrow Next Page
Shift+Left Arrow Previous Page

Once a video is selected, the user is prompted to select action:

  • Play ⭐ Video 144p

  • Play ⭐⭐ Video 360p

  • Play ⭐⭐⭐ Video 720p

  • Play ⭐⭐⭐⭐ Best Video

  • Play ⭐⭐⭐⭐ Best Audio

  • Download Video 🔽

  • Download Audio 🔽

  • Like Video ❤️

  • Browse Feed of channel that uploaded the video 📺

  • Subscribe to the channel that uploaded the video 📋

  • Open in browser 🌐

  • Copy link 🔗

  • Quit ❌

image 9{height=180} image 10{height=180} image 11{height=180}


Miscellaneous Menu

The m option of the Main Menu opens up the Miscellaneous Menu:

image 12{height=320}

Entering the respective key, the user can :

key Action
P Set Up Preferences
l LIKE a video.
L UNLIKE a video.
I Import subscriptions from YouTube.
n Subscribe to a new channel.
u Unsubscribe to a new channel.
H Clear watch history.
S Clear search history.
T Clear thumbnail cache.
q Quit this menu, Return to Main Menu.

Subscribing to a new channel

Selecting the n option of the Miscellaneous Menu, the user can subscribe to a new channel.

Initially, the user is asked to enter a keyword / keyphrase to search channels with.

Channel selection then is made with fzf:

image 13{height=320}

  • In the n & u options of the Miscellaneous Menu (subcribe/unsubscribe to a channel), after a selection, the user will be asked to sync the changes manually to their YouTube account.

About

Magic-tape is an image supporting fuzzy finder command line interface YouTube client.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages