A simple and efficient CLI tool to search, play, and manage YouTube playlists and videos directly from the terminal. YTCLI utilizes mpv
and yt-dlp
to provide seamless YouTube integration without requiring API keys.
- Features
- Demo
- Dependencies
- Installation
- Usage
- Modules
- Advantages
- Tools, Technologies, and Platforms
- Future Improvements
- Challenges
- Contributing
- License
- Add and delete YouTube playlists
- Automatically update playlists when changed on YouTube
- Search and play YouTube videos
- Support for audio-only mode and regular mode for both playlists and searches
- Works on Windows and Linux
- Minimal system requirements
Check out the demo here.
All dependencies will be automatically installed during setup. Note: On Windows, mpv
will be a standalone executable in the working directory.
- Python 3.x
- MySQL Server
-
Clone the repository:
git clone https://github.com/yourusername/ytcli.git cd ytcli
-
Set up the MySQL database:
CREATE DATABASE ytcli_db; CREATE USER 'ytcli_user'@'localhost' IDENTIFIED BY 'yourpassword'; GRANT ALL PRIVILEGES ON ytcli_db.* TO 'ytcli_user'@'localhost'; FLUSH PRIVILEGES;
-
Modify the MySQL configuration in
ytcli.py
:# Update the following lines with your MySQL credentials db_config = { 'user': 'ytcli_user', 'password': 'yourpassword', 'host': '127.0.0.1', 'database': 'ytcli_db' }
-
Run the setup script:
python setup.py
-
Start the application:
python ytcli.py
-
Follow the menu prompts to:
- Start a playlist
- Add a new playlist
- Delete an existing playlist
- Search and play YouTube videos
- Add Playlist: Add a new YouTube playlist to the database.
- Delete Playlist: Remove an existing playlist from the database.
- Update Playlist: Automatically update playlists when changes are detected on YouTube.
- Fetch Playlist: Retrieve playlists from the MySQL database.
- Search for Videos: Search YouTube videos using keywords.
- Play Video: Play selected videos in audio-only mode or regular mode using
mpv
.
- Store Playlists: Store playlist information in MySQL.
- Retrieve Playlists: Retrieve stored playlists for playback.
- No API Key Required: Accessible to anyone without the need for registration.
- Lightweight: Minimal system requirements make it easy to use on various devices, including IoT and mobile devices.
- Efficient: Consumes less internet bandwidth compared to traditional YouTube applications.
- Productivity Boost: Allows developers to enjoy YouTube content while working in the terminal.
- Programming Language: Python
- Media Player:
mpv
- YouTube Downloader:
yt-dlp
- Database: MySQL
- Python Libraries:
mysql-connector-python
,youtube-search-python
,pytube
- Windows
- Linux
- Enhanced search capabilities with more filters and options.
- User authentication to manage personal playlists.
- Simple GUI for users who prefer graphical interfaces.
- Optimizing the tool for macOS and Raspberry Pi.
- Ensuring cross-platform compatibility.
- Automating dependency installation for different operating systems.
- Efficient database integration with MySQL for playlist management.
Contributions are welcome! Please fork the repository and create a pull request with your changes.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/YourFeature
) - Commit your Changes (
git commit -m 'Add some feature'
) - Push to the Branch (
git push origin feature/YourFeature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.