Merge remote-tracking branch 'origin/mpv-control'
This commit is contained in:
commit
891824c363
90
.gitignore
vendored
90
.gitignore
vendored
@ -1,89 +1 @@
|
||||
# Byte-compiled / optimized / DLL files
|
||||
__pycache__/
|
||||
*.py[cod]
|
||||
*$py.class
|
||||
|
||||
# C extensions
|
||||
*.so
|
||||
|
||||
# Distribution / packaging
|
||||
.Python
|
||||
env/
|
||||
build/
|
||||
develop-eggs/
|
||||
dist/
|
||||
downloads/
|
||||
eggs/
|
||||
.eggs/
|
||||
lib/
|
||||
lib64/
|
||||
parts/
|
||||
sdist/
|
||||
var/
|
||||
*.egg-info/
|
||||
.installed.cfg
|
||||
*.egg
|
||||
|
||||
# PyInstaller
|
||||
# Usually these files are written by a python script from a template
|
||||
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
||||
*.manifest
|
||||
*.spec
|
||||
|
||||
# Installer logs
|
||||
pip-log.txt
|
||||
pip-delete-this-directory.txt
|
||||
|
||||
# Unit test / coverage reports
|
||||
htmlcov/
|
||||
.tox/
|
||||
.coverage
|
||||
.coverage.*
|
||||
.cache
|
||||
nosetests.xml
|
||||
coverage.xml
|
||||
*,cover
|
||||
.hypothesis/
|
||||
|
||||
# Translations
|
||||
*.mo
|
||||
*.pot
|
||||
|
||||
# Django stuff:
|
||||
*.log
|
||||
local_settings.py
|
||||
|
||||
# Flask stuff:
|
||||
instance/
|
||||
.webassets-cache
|
||||
|
||||
# Scrapy stuff:
|
||||
.scrapy
|
||||
|
||||
# Sphinx documentation
|
||||
docs/_build/
|
||||
|
||||
# PyBuilder
|
||||
target/
|
||||
|
||||
# IPython Notebook
|
||||
.ipynb_checkpoints
|
||||
|
||||
# pyenv
|
||||
.python-version
|
||||
|
||||
# celery beat schedule file
|
||||
celerybeat-schedule
|
||||
|
||||
# dotenv
|
||||
.env
|
||||
|
||||
# virtualenv
|
||||
venv/
|
||||
ENV/
|
||||
|
||||
# Spyder project settings
|
||||
.spyderproject
|
||||
|
||||
# Rope project settings
|
||||
.ropeproject
|
||||
*.pyc
|
||||
|
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
[submodule "python-mpv"]
|
||||
path = lib/python_mpv
|
||||
url = https://github.com/gustaebel/python-mpv.git
|
22
mpv_control.py
Normal file
22
mpv_control.py
Normal file
@ -0,0 +1,22 @@
|
||||
from lib.python_mpv.mpv import MPV as next_MPV
|
||||
import youtube_dl
|
||||
|
||||
ydl = youtube_dl.YoutubeDL()
|
||||
|
||||
class MPV(next_MPV):
|
||||
def __init__(self):
|
||||
self.default_argv += (
|
||||
[ '--keep-open'
|
||||
, '--force-window'
|
||||
])
|
||||
super().__init__(debug=True)
|
||||
|
||||
def play(self, url):
|
||||
self.command("loadfile", path)
|
||||
self.set_property("pause", False)
|
||||
|
||||
@staticmethod
|
||||
def fetchTitle(url):
|
||||
return ydl.extract_info(url, download=False).get('title')
|
||||
|
||||
mpv = MPV()
|
2
requirements.txt
Normal file
2
requirements.txt
Normal file
@ -0,0 +1,2 @@
|
||||
mpv==0.1
|
||||
youtube-dl==2016.9.11.1
|
Loading…
Reference in New Issue
Block a user