/python-youtube-player

Python project to play youtube videos and receive commands over the network

Primary LanguagePython

Python Youtube Player

Python project to play YouTube videos through a multi-clint server and receive commands over the network

Description

This is a python project that uses both pafy and vlc libraries to stream videos from Youtube. It is the final project for the class EE810 - Engineering Programming: Python at Stevens Institute of Technology.

Features

  • Multiclient - let everyone in the network add their music to your play-list
  • Play-list Management - add, pause and skip any music on your play-list
  • Ad-Free

Usage

Dependencies

In order to run this project, you need to install vlc (and plugins), youtube-dl and pafy. Run the following lines:

$ sudo apt-get install vlc
$ sudo apt-get install vlc-plugin-*
$ sudo pip install youtube_dl
$ sudo pip install pafy

See the following links for further information on the installation process:

####Running the Server Just run the server script, assigning a hostname and a port to it.

usage: 
$ python server.py [hostname] [port]

example: 
$ python server.py localhost 9999

####Running the Client First, run the client script, assigning a hostname and a port to it.

usage: 
$ python client.py [hostname] [port]

example: 
$ python client.py localhost 9999

This will initialize the client and open a command prompt. The following commands are accepted:

  • /play
  • /pause
  • /next
  • /add [YOUTUBE URL]
  • /search [KEYWORDS]
  • /nowplaying
  • /playlist
  • /queue

See the example:

$ python client.py localhost 9999
>> /add https://www.youtube.com/watch?v=OPf0YbXqDm0
>> /add https://www.youtube.com/watch?v=YQHsXMglC9A
>> /add https://www.youtube.com/watch?v=oyEuk8j8imI
>> /play