mpris
Esse commit está contido em:
rachmadani haryono
2022-03-13 12:09:35 +08:00
commit de GitHub
commit 67e5be7b5a
2 arquivos alterados com 69 adições e 7 exclusões
+46 -1
Ver Arquivo
@@ -148,8 +148,53 @@ yewtube is run on the command line using the command:
Enter `h` from within the program for help.
Using yewtube with mpris
------------------------
1. Install PyGObject, GTK and their dependencies based on this guide https://pygobject.readthedocs.io/en/latest/getting_started.html
2. Install yewtube with mpris extra
```shell
> # recommended
> pipx install 'yewtube[mpris]'
> # or
> pip install 'yewtube[mpris]'
```
3. check yewtube version
```shell
> yt --version
yewtube version : 2.8.2
yt_dlp version : 2022.02.04
Python version : 3.9.7 (default, Nov 7 2021, 15:17:57)
[GCC 11.2.0]
Processor : x86_64
Machine type : x86_64
Architecture : 64bit, ELF
Platform : Linux-5.13.0-35-generic-x86_64-with-glibc2.34
sys.stdout.enc : utf-8
default enc : utf-8
Config dir : /home/user/.config/mps-youtube
dbus : 1.2.18
glib : True
env:TERM : tmux-256color
env:SHELL : /usr/bin/zsh
env:LANG : en_US.UTF-8
```
If everything working correctly, dbug and glib would have similar result as above text
4. run `set mpris true` on yewtube
5. check with `playerctl`
```shell
> playerctl -l
mps-youtube.instance567867
```
How to Contribute
-----------------
Contributions are welcomed! However, please check out the [contribution page](https://github.com/iamtalhaasghar/yewtube/blob/master/CONTRIBUTING.md) before making a contribution.
+23 -6
Ver Arquivo
@@ -1,11 +1,11 @@
import argparse
import logging
import multiprocessing
import os
import platform
import re
import sys
import logging
import tempfile
import argparse
import platform
import multiprocessing
try:
# pylint: disable=F0401
@@ -23,9 +23,9 @@ try:
except ImportError:
has_readline = False
from . import cache, g, __version__, screen, c, paths, config
from .util import has_exefile, dbg, xprint, load_player_info, assign_player
from . import __version__, c, cache, config, g, paths, screen
from .helptext import helptext
from .util import assign_player, dbg, has_exefile, load_player_info, xprint
mswin = os.name == "nt"
@@ -274,6 +274,21 @@ def _get_version_info():
from yt_dlp.version import __version__ as ytdlp_version
dbus_version = None
glib = False
try:
import dbus
dbus_version = dbus.__version__
except Exception:
pass
try:
from gi.repository import GLib
glib = True
except Exception:
pass
out = "yewtube version : " + __version__
out += "\nyt_dlp version : " + ytdlp_version
out += "\nPython version : " + sys.version
@@ -284,6 +299,8 @@ def _get_version_info():
out += "\nsys.stdout.enc : " + sys.stdout.encoding
out += "\ndefault enc : " + sys.getdefaultencoding()
out += "\nConfig dir : " + paths.get_config_dir()
out += "\ndbus : " + str(dbus_version)
out += "\nglib : " + str(glib)
for env in "TERM SHELL LANG LANGUAGE".split():
value = os.environ.get(env)