mps-youtube / yewtube

yewtube, forked from mps-youtube , is a Terminal based YouTube player and downloader. No Youtube API key required.
GNU General Public License v3.0
7.98k stars 643 forks source link

feature: sixel thumbnails #1196

Closed porterdcarnegie closed 1 year ago

porterdcarnegie commented 2 years ago

I would like sixel video thumbnails in mps-youtube, wouldn't it be great?

Sixel: https://en.wikipedia.org/wiki/Sixel

iamtalhaasghar commented 1 year ago

There are many hiccups involved in this.

  1. PySixel is not compatible with python >= 3.7 https://github.com/saitoha/PySixel/issues/4 and there is no other actively maintained python library to render sixel images in terminal.
  2. I've tried chafa (it doesn't uses sixel standard) and it works fine but the problem is yewtube will have to download thumbnails of all videos being shown in search result page (at least 10 videos on a single page). This will take time to render the results as downloading a single thumbnail takes around 20 secs (see output below). We can use async / await may be.
    [info] Downloading video thumbnail 41 ...
    [info] Writing video thumbnail 41 to: thumbnail.png.webp
    [dashsegments] Total fragments: 2
    [download] Destination: thumbnail.png.f247.webm
    [download] 100% of   11.89MiB in 00:00:19 at 624.12KiB/s
    [dashsegments] Total fragments: 1
    [download] Destination: thumbnail.png.f251.webm
    [download] 100% of    4.34MiB in 00:00:07 at 597.26KiB/s
    [Merger] Merging formats into "thumbnail.png.webm"
    Deleting original file thumbnail.png.f251.webm (pass -k to keep)
  3. With youtube-dl / yt-dlp you can only download thumbnails in .webp format (correct me if i am wrong). So, we need to convert .webp to either .png or .jpeg if you want them to use in terminal. This will take even more time and eventually affecting user experience.

Closing issue for now so that i can focus on other issues. If somebody comes up with a good solution we can rethink about this.

Cheers!

Edit: typos