Skip to content

Instantly share code, notes, and snippets.

@darkfeline
Created December 31, 2015 11:07
Show Gist options
  • Select an option

  • Save darkfeline/ad7f08a4f3f31950ffb5 to your computer and use it in GitHub Desktop.

Select an option

Save darkfeline/ad7f08a4f3f31950ffb5 to your computer and use it in GitHub Desktop.
#!/usr/bin/python3
"""
ytplay
======
Play a list of youtube songs from stdin, echoing to stdout.
"""
import subprocess
import sys
for line in sys.stdin:
subprocess.call(['mpv', '--no-video', '--no-terminal', line.rstrip()])
sys.stdout.write(line)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment