Skip to main content

Easy to use youtube music streamer command line tool written in python3

Project description

pYTerm 0.4

pYTerm is a simple command line youtube music player using python 3. This is still currently under heavy development and features are subject to being changed and things being added. Bugs will happen.

Requirements

  • VLC media player installed
  • All libraries from requirements.txt if using the source code instead of the pip package.
  • Patience

Playback controls

Controls: [v]olume,[s]kip,[prev]ious,[p]ause,[m]ove,[t]imestamp,[g]oto,[e]xit

When in the player is active you can control it via typing in the command letters above to do the function shown with them. A few examples are below.

In this example the volume is changed by entering v <volume percent wanted>

Controls: [v]olume,[s]kip,[prev]ious,[p]ause,[m]ove,[t]imestamp,[g]oto,[e]xit
playing [1/1] "STAR SHOPPING (Instrumental)" by Theolonius Kelly - Topic [02:11]
v 75

In this example the player head is moved by entering m <± seconds to move>

Controls: [v]olume,[s]kip,[prev]ious,[p]ause,[m]ove,[t]imestamp,[g]oto,[e]xit
playing [1/1] "STAR SHOPPING (Instrumental)" by Theolonius Kelly - Topic [02:11]
m -10

pYTerm command line

For all the info in this section you can use pYTerm -h to view it offline.

usage: pYTerm.py [-h] [--version] [-v VOLUME] [-l] [-s] [-a] [-p PLAYLIST] [-rp RICHPRESENCE] [-ni] [-as] [--verbose] [-vl] [--fr] ...

Play youtube audio from the commandline / écouter l'audio des vidéos youtube sur la ligne de commande

positional arguments:
  songs                 name of the song you want to play / nom de la chanson à jouer tu veux jouer

optional arguments:
  -h, --help            show this help message and exit
  --version             prints version / version imprimé
  -v VOLUME, --volume VOLUME
                        starts with <value> volume / le programme démarrer avec un niveau de volume <value>
  -l, --loop            enable playlist looping
  -s, --shuffle         enable playlist shuffling
  -a, --autoplay        enable automatically playing recommended songs based on the playlist
  -p PLAYLIST, --playlist PLAYLIST
                        use playlist file / utiliser une playlist à partir d'un fichier
  -rp RICHPRESENCE, --richpresence RICHPRESENCE
                        either False to disable RP, True or a rich presence ID string to enable
  -ni, --noinput        disables player controls / désactiver les contrôles
  -as, --audiostream    forces the use of audio streams, reduces bandwith and might increase quality at the cost of stability
  --verbose             enable verbose logging
  -vl, --vlclogs        enable vlc logging
  --fr                  enable french output / activer mode français

Using pYTerm as a library

ALL LIBRARY FUNCTIONS AND CLASSES ARE STILL UNDER DEVELOPMENT AND MAY NOT WORK OR BEHAVIORS MAY CHANGE.

pYTerm is able to be imported as a library how you would with any other python library:

#!/usr/bin/python3
import pYTerm

The next thing to do is to make a player object, and you are ready to use the methods when they are working.

from pYTerm import pYTerm

# Initializes a player object from the player class.
player = pYTerm.player(richPresenceID=True,  # -rp argument (can be a boolean or RPC ID
                       quiet=False,  # Whether the player will output to the console (also disables user input)
                       debug=False,  # Whether pYTerm logs will be printed
                       vlclogs=False,  # Whether VLC logs will be printed
                       forceaudiostream=True,
                       # Forces the use of audio streams, reduces bandwidth and might increase quality at the cost of stability
                       wait=True,
                       # If true it will halt the program if go() gets run if false it will run in a thread and continue the program
                       allowInput=True,  # Whether or not user input will be accepted
                       songs=None,  #
                       playlistFile=None,
                       shuffle=False,
                       loop=False,
                       volume=100,
                       fr=False,
                       autoplay=False,
                       keepAlive=False)

player.playSong("Benz Truck lil peep")  # Not functional at the moment.
# This should play a song using pYTerm the only arg needed is the search query
# for the song or the link to the song.

player.pause()  # Should work
player.unpause()  # Should work
player.togglepause()  # Should work
# These three methods should pause, unpause, or toggle pause for the player.

player.go()  # Unknown status
# go runs the main playlist and must be called if you want playlist functionality;
# like keeping track of the songs, being able to use next() and previous(), using the loop option in the class init, and stuff like autoplay.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

p-yt-erm-0.5b6.tar.gz (15.9 kB view details)

Uploaded Source

Built Distribution

p_yt_erm-0.5b6-py3-none-any.whl (14.3 kB view details)

Uploaded Python 3

File details

Details for the file p-yt-erm-0.5b6.tar.gz.

File metadata

  • Download URL: p-yt-erm-0.5b6.tar.gz
  • Upload date:
  • Size: 15.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.9.1

File hashes

Hashes for p-yt-erm-0.5b6.tar.gz
Algorithm Hash digest
SHA256 77a817f39b391d802484bd42ded1a7d05c7896074d1bda50e1053f9c9e0937e4
MD5 856fd38242827412d231c3eb5592c6ab
BLAKE2b-256 739b91ed7ec70b604f6e22da3ba02364336b324bda0c30899bf9e6fa27821f43

See more details on using hashes here.

File details

Details for the file p_yt_erm-0.5b6-py3-none-any.whl.

File metadata

  • Download URL: p_yt_erm-0.5b6-py3-none-any.whl
  • Upload date:
  • Size: 14.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.9.1

File hashes

Hashes for p_yt_erm-0.5b6-py3-none-any.whl
Algorithm Hash digest
SHA256 ce6e5107da331e441b4edcb445935c475c148f09bd5b0f205a9cdf5a6fe18f62
MD5 1b0e8879cba893a1fffd551828cdf5b9
BLAKE2b-256 5128b2556bc2abab3d09d4735c3b0cfd0d5ffd0a1b024530a22441aa26879ee8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page