A CLI script for Celluloid that can search, download and stream YouTube videos directly from your terminal with the help of yt-dlp.
Note
This tool is designed for Linux distros such as Mint, Ubuntu and Debian based OS. Please make sure you're in the right Operating System.
- YouTube Search: Search for videos right within the terminal without having to open browser or YouTube.
- Instant Streaming: Downloads and launches videos immediately into Celluloid.
- Interactive Menu: Allows options and configurations within searching and downloading videos.
- No Tracking: Doesn't load javascript, no cookies and offers more privacy from not having to use the browser and website.
- Zero Ads: No ads or any other distractions.
- Temporary Cache: Videos are stored temporarily and gets de-cluttered upon closing the script. (v1.1.0 onwards)
Important
The script requires bash, latest version of yt-dlp, ffmpeg and Celluloid in order to work. Make sure these dependencies are installed. The earlier versions (v1.0.0 and v1.0,1) also require bin folder within the home directory of the file system as the folder was needed to save the downloaded videos.
| Dependency | Purpose | Install Command |
|---|---|---|
yt-dlp |
Video downloading | sudo apt install yt-dlp |
ffmpeg |
Merging audio/video | sudo apt install ffmpeg |
Tip
Alternatively, you can install the latest version of yt-dlp in the terminal by using curl -L https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -o ~/bin/yt-dlp. Just ensure you have a folder named "bin" within your Home directory. You can also save the script over to this folder as well.
- Download the script file from the repository or through the releases.
- Find the ytplay.sh file and right click and select properties.
- Click on permissions and click the checkbox with "allow executing file as a program".
Alternatively, you can also use the following commands to turn the file executable through the terminal:
git clone https://github.com/Codebase-Z/yt-dlp-celluloid-streamer.git
cd yt-dlp-celluloid-streamer
chmod +x ytplay.sh
Note
The file is turned into an executable so it'll be easier to run the file directly and takes less to type the command manually if needed as well. If you don't want to turn it into an executable file, it can still work by using the command bash ytplay.sh to run the script.
Tip
You can also remove the .sh file extension from the script and it will still work. This will also make it easier to type the command to execute as you just need to write only the file name ytplay in this case.
- Open the terminal.
- Type
ytplay.shorytplaydepending on the filename. (If the file isn't being located and executed as intended, try using./ytplay.shinstead) - Type the video you're looking for. ("Me at the zoo" for example)
- Type the number the search results to fetch or press enter key to leave it as default. The script will fetch the results.
- Enter the number given to the video in the list to download that video. The video will play automatically once downloaded.
- You can also enter "r" to search for another result or enter "q" to close the script.
- Video Quality: Currently hardcoded to 480p for fast streaming. You can edit the yt-dlp format line in the script within the play_video_by_index function to change this. The Code being referenced:
yt-dlp -f "bestvideo[height<=480]+bestaudio/best[height<=480]" ...
For examle, to change it to 720p, edit the height<=480 part to height<=720.
- Video Player: Defaults to celluloid. You can change the command in the script to mpv, vlc, etc. To do so, head to the play_video_by_index function and change this code:
celluloid "$temp_file" &
To change it, replace celluloid with your preferred player command. For mpv, change to mpv "$temp_file" & and for vlc, just change to vlc "$temp_file" &.
This project is licensed under the MIT License - see the LICENSE file for details.
This project is open to contributions. If any bugs were foung or want to request and implement any features, feel free to open an issue or submit a pull request. Thank you for contributing to the project.