Add mpv to default players
It's another fork of mplayer, more active than mplayer2.
This commit is contained in:
parent
83520a177a
commit
a3306cc222
1 changed files with 9 additions and 9 deletions
|
|
@ -19,28 +19,28 @@
|
||||||
|
|
||||||
|
|
||||||
import os
|
import os
|
||||||
from subprocess import Popen, PIPE
|
from subprocess import PIPE, Popen
|
||||||
|
|
||||||
from weboob.tools.log import getLogger
|
from weboob.tools.log import getLogger
|
||||||
|
|
||||||
|
|
||||||
__all__ = ['InvalidMediaPlayer', 'MediaPlayer', 'MediaPlayerNotFound']
|
__all__ = ['InvalidMediaPlayer', 'MediaPlayer', 'MediaPlayerNotFound']
|
||||||
|
|
||||||
|
|
||||||
PLAYERS = (
|
PLAYERS = (
|
||||||
|
('mpv', '-'),
|
||||||
('mplayer2', '-'),
|
('mplayer2', '-'),
|
||||||
('mplayer', '-'),
|
('mplayer', '-'),
|
||||||
('vlc', '-'),
|
('vlc', '-'),
|
||||||
('parole', 'fd://0'),
|
('parole', 'fd://0'),
|
||||||
('totem', 'fd://0'),
|
('totem', 'fd://0'),
|
||||||
('xine', 'stdin:/'),
|
('xine', 'stdin:/'),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class MediaPlayerNotFound(Exception):
|
class MediaPlayerNotFound(Exception):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
Exception.__init__(self, u'No media player found on this system. Please install one of them: %s.' %
|
Exception.__init__(self, u'No media player found on this system. Please install one of them: %s.' %
|
||||||
', '.join(player[0] for player in PLAYERS))
|
', '.join(player[0] for player in PLAYERS))
|
||||||
|
|
||||||
|
|
||||||
class InvalidMediaPlayer(Exception):
|
class InvalidMediaPlayer(Exception):
|
||||||
|
|
@ -76,7 +76,7 @@ class MediaPlayer(object):
|
||||||
player_names = [player[0] for player in PLAYERS]
|
player_names = [player[0] for player in PLAYERS]
|
||||||
if not player_name:
|
if not player_name:
|
||||||
self.logger.debug(u'No media player given. Using the first available from: %s.' %
|
self.logger.debug(u'No media player given. Using the first available from: %s.' %
|
||||||
', '.join(player_names))
|
', '.join(player_names))
|
||||||
player_name = self.guess_player_name()
|
player_name = self.guess_player_name()
|
||||||
if player_name is None:
|
if player_name is None:
|
||||||
raise MediaPlayerNotFound()
|
raise MediaPlayerNotFound()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue