Git Product home page Git Product logo

ytpy's Introduction

yt.py

A Python script to play media from YouTube without needing API keys

Sections

Click to navigate.

Dependencies

Installation

  • Download the file from the Releases page: yt.py
  • Place it in your $PATH and make it executable.
  • Enjoy!

Usage

usage: yt.py [-h] [-u] [-v] [-d] [-n NUM] [-o DIR] [SEARCH_STRING ...]

Play YouTube media without API

positional arguments:
  SEARCH_STRING         media to play

options:
  -h, --help            show this help message and exit
  -u, --url             display URL instead of playing
  -v, --video           play video instead of music
  -d, --download        download media instead of playing
  -n NUM, --num NUM     nth result to play or download
  -o DIR, --output DIR  folder to save downloaded media

List of mpv hotkeys: https://defkey.com/mpv-media-player-shortcuts

Examples

  • Stream audio:

    yt.py gurenge band cover

  • Download audio:

    yt.py -d astronomia

  • Watch a video:

    yt.py -v rickroll

  • Download a video:

    yt.py -dv penguin flock

  • Play the audio of the second search result:

    yt.py -n 2 plastic love daft punk

  • Download a video to a directory other than $HOME/Videos (default location):

    yt.py -do "$HOME/Music/" darude sandstorm

PS: Here's a list of mpv keyboard shortcuts for your convenience.

Credits

Extras

About the .pyx file

I'm currently not updating it anymore. Please consider using the .py file instead

Cython is supposed to be faster but I don't really know Cython so I couldn't optimize it as well. If you can do so, feel free to make a fork, and maybe even a pull request so the script can be improved. It'll be a learning experience for me as well.

As for the performance... It may be slightly faster but the program is still network-bound. Which means, faster internet = faster query = media is played sooner.

Compile an executable file using this shell script if you want.

ytpy's People

Contributors

cybardev avatar pystardust avatar westofer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

thieung

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.