https://github.com/vaibkumr/ytermplayer
Stream youtube playlists as audio on linux terminal
https://github.com/vaibkumr/ytermplayer
music pafy player python terminal urwid youtube
Last synced: 23 days ago
JSON representation
Stream youtube playlists as audio on linux terminal
- Host: GitHub
- URL: https://github.com/vaibkumr/ytermplayer
- Owner: vaibkumr
- License: gpl-3.0
- Created: 2018-08-04T14:20:36.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2025-01-13T17:11:56.000Z (over 1 year ago)
- Last Synced: 2026-05-30T06:23:00.139Z (25 days ago)
- Topics: music, pafy, player, python, terminal, urwid, youtube
- Language: Python
- Homepage:
- Size: 4.4 MB
- Stars: 276
- Watchers: 2
- Forks: 20
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ytTerm player (BETA)
Play youtube playlists as audio on linux terminal
[](https://travis-ci.com/SamSamhuns/yTermPlayer)
[](https://badge.fury.io/py/yTermPlayer)
[](https://pypi.python.org/pypi/yTermPlayer/)
[](https://pypi.python.org/pypi/yTermPlayer/)
[](https://pepy.tech/project/ytermplayer)
## About
ytTerm player is a terminal youtube music player. It's completely written in python.
**UI**: Made using a wrapper for curses called [urwid][urwid]
**Player**: Handled using [python-mpv](https://github.com/jaseg/python-mpv)
**Stream fetch**: Audio streams from youtube are fetched using [pafy][pafy]
Features:
- Import and play youtube playlists on terminal
- Save playlists in library
- Use several playback modes such as repeat one, repeat list, random
- Download complete list (coming soon)
### Installation
Set up a virtual environment and install the dependencies:
```sh
$ pip install -r requirements.txt
```
python3 pip :-
```sh
$ pip install ytermplayer
$ yterm
```
or Git clone :-
```sh
$ git clone https://github.com/TimeTraveller-San/yTermPlayer
$ cd yTermPlayer/yTermPlayer/
$ python __main__.py
```
### Dependencies
Python 3
ytTerm player uses a number of open source projects to work properly:
* [urwid][urwid]
* [python-mpv](https://github.com/jaseg/python-mpv)
* [pafy][pafy]
* python3
* mpv player (sudo pacman -S mpv) or (sudo apt-get install mpv)
ytTerm player itself is open source. Feel free to modify and distribute the code
### KeyBindings
| Key | Function |
| :--- | :--- |
| s | save current list |
| enter | select option/play song at selection |
| n | play next song |
| p | play previous song |
| h | play first song |
| e | play last song |
| space | pause/play song |
| u | volume up |
| d | volume down |
| q | quit |
| 1 | playback mode: Repeat one |
| 2 | playback mode: Repeat list |
| 3 | playback mode: None |
| r | playback mode: Random |
more features coming soon
### Screenshots
### Start screen :

### The UI will automatically use your terminal colors.


[urwid]:
[vlc]:
[pafy]:
#### Working video:
#### Working video 2:
### FAQ
- How to fix out of range/url not found errors?
YouTube keeps changing its structure so it's important you have installed the latest version of youtube-dl as follows:
` pip install --upgrade youtube_dl `
- Where are my playlists stored and how to delete playlists?
Playlists are saved in `$HOME/.yTermPlayer/playlists` as plain text. You may delete or add new playlists directly here.
- How to contact me?
**Email:** time.traveller.san@gmail.com
**Twitter:**
### Known Bugs
- ~~Buggy / unexpected playback behavior~~
It was caused because of race conditions and absence of critical section among the threads. Fixed it using semaphores
- ~~If some VLC error starts showing up on the screen, just resize the terminal and it will be gone~~
Completely removed VLC and replaced it with much more minimal and faster mpv player. Thank to [python-mpv by jaseg](https://github.com/jaseg/python-mpv)