cross-posted from: https://lemmy.world/post/530920

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

https://gitlab.com/christosangel/magic-tape

Image rendering can be done with the use of ueberzugpp, ueberzug, kitty terminal or chafa.

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

  • Browse videos from subscriptions.

  • 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

  • Set up Preferences (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.

  • Archy
    link
    11 year ago

    I finally got to my main workstation with GUI, pulled the latest code, installed rofi there and it works now, I sill could not to get previews to show because of the draw_preview: command not found error. But I don’t think rofi can run on a headless machine:

    rofi
    (process:1456958): X11Helper-WARNING **: 10:52:55.600: Failed to open display: (null)
    (process:1456958): Rofi-WARNING **: 10:52:55.600: Connection has error
    
    • christosOP
      link
      11 year ago

      I think that apart from not installing the dependencies, both problems that you have faced in your machine (zsh-bash conflict, headless machine) are beyond the scope of this script and need to be examined individually.

      At the end of the day, one could easily substitute rofi with fzf itself in the script, they do more or less the same job. I am not certain rofi is your main obstacle here.

      • Archy
        link
        11 year ago

        I tried to substitute rofi with fzf in vim, and when I try Preferences - it says 😕 Selection canceled...

        My main goal was to use this program on my server which has no GUI and I can access it from anywhere. For example, I successfully use newsboat and neomutt remotely. When I saw TUI, I thought I could use that too headless, but you may wanna put a disclaimer that the script requires a GUI application rofi.

        Anyways, thanks for the project, I will keep an eye on it if it keeps developing, great idea! While troubleshooting this program I came across ytfzf that also supposedly supports subscriptions and seems like can work headlessly

        • christosOP
          link
          11 year ago

          may wanna put a disclaimer that the script requires a GUI application rofi.

          This is clearly stated in the instructions, and in the dependencies.

          https://imgur.com/Anr1SSh.png

          You might consider always read the instructions before installing anything.

          • Archy
            link
            11 year ago

            undefined> https://imgur.com/Anr1SSh.png

            Don’t get mad, I’ve read. It’s a little unusual for me to see amongst 6 CLI dependencies on GUI one. But even installing a GUI application on a headless machine won’t do any good

            • christosOP
              link
              21 year ago

              No worries! Thanks for the feedback anyway.

              ytfzf is great. And if you don’t mind the image support, give newsboat a try, it works great for youtube feeds.

            • christosOP
              link
              2
              edit-2
              1 year ago

              I have made some updates that may concern you:


              UPDATES:

              1. The directory structure of the program has been updated. Instead of keeping everything in ~git/magic-tape/, now various files and directories are kept in various places.This way,
              • the magic-tape.sh is in ~/.local/bin/
              • the magic-tape cache files are all in ~/.cache/magic-tape/
              • the configuration text file will be created in ~/.config/magic-tape/
              1. The action selection can be either with rofi, or fzf (if the user wants to go full TUI).This can be configured during the P option of the misc menu.

              So if you want to go full tui, you can avoid rofi and go full fzf.

              Let me know how it goes if you try.

              • Archy
                link
                21 year ago

                Thank you for the update. Can’t wait to try. Looks like GitLab is down right now (503) - I will look as they restore service

                • christosOP
                  link
                  11 year ago

                  I know, I have just found out. Last night I also added dmenu as well as an action selector (together with fzf and rofi). Let me know how it goes!

                  • Archy
                    link
                    11 year ago

                    Actual git still worked. I was able to git pull I also figured out a way to launch the script using bash - needed to export $SHELL - the only way it worked. I could not update yt-dlp to the latest version - the latest I could install is 2023.06.22 from the side PPA repo. Official Ubuntu repo provides 2023.03 and pip breaks my system with compatibility issues that I don’t have desire to troubleshoot. I could try in the future downloading their binary but I don’t like when stuff doesn’t auto-update. The preferences worked this time and I was able to save them.

                    yt-dlp gives me an error every time I try to browse either Trending or do a search. I have a TV with a cross and 1 option to Abort Selection.

                    I have a question: is the script dependent on having browser cookies? Because I don’t have any of the browsers installed on a headless machine. ANd I think that is what yt-dlp wasn’t happy about…

                    Downloading /feed/trending ...
                    Traceback (most recent call last) :
                    File "/usr/bin/yt-dlp", line 33, in <module>
                    sys. , 'console_scripts'
                    ' yt—dtp'
                    Fite py", tine 1008, in main
                    File "/usr/lib/python3/dist-packages/yt_dlp/_init_.py", tine 962, in _real_main
                    with YoutubeDL(ydl_opts) as ydl:
                    AAAAAAAAAAAAAAAAAAA
                    File "/usr/tib/python3/dist—packages/yt_dlp/YoutubeDL.py", tine 762, in _ init
                    self. _ setup_opener()
                    File "/usr/Iib/python3/dist—packages/yt_dIp/YoutubeDL.py", tine 3929, in _ setup_opener
                    self. cookiejar = load_cookies(opts_cookiefile, opts_cookiesfrombrowser, self)
                    File "/usr/lib/python3/dist-packages/yt_dtp/cookies.py", line 106, in load_cookies
                    extract_cookies_from_browser(browser_name, profile, YDLLogger(ydI), keyring=keyring, container=container))
                    File "/usr/lib/python3/dist-packages/yt_dlp/cookies.py", line 123, in extract_cookies_from_browser
                    return _extract_firefox_cookies(profile, container, logger)
                    File py", tine 148, in _extract_firefox_cookies
                    raise FileNotFoundError(f' could not find Firefox cookies database in {search_root}')
                    FiteNotFoundError: could not find Firefox cookies database in /home/user/. mozitta/firefox
                    Completed /feed/trendinq.