jaseg / python-mpv

Python interface to the awesome mpv media player
https://git.jaseg.de/python-mpv.git
Other
554 stars 69 forks source link

"Watch later" does not work #65

Closed maximst closed 6 years ago

maximst commented 6 years ago

When i can use 'watch-latter' functionality i get the error:

        mpv.MPV(
            ytdl=True,
            vo='vdpau',
            log_handler=print,
            watch_later_directory='~/.config/mpv/watch_later'
        )
   File "/usr/local/lib/python3.5/dist-packages/mpv.py", line 537, in __init__
     _mpv_set_option_string(self.handle, k.replace('_', '-').encode('utf-8'), istr(v).encode('utf-8'))
   File "/usr/local/lib/python3.5/dist-packages/mpv.py", line 102, in raise_for_ec
     raise ex(ec, *args)
 AttributeError: ('mpv option does not exist', -5, (<MpvHandle object at 0x7fb423cd7a60>, b'watch-later-directory', b'~/.config/mpv/watch_later'))

And when i run command player.command('quit-watch-later') without watch-later-directory option nothing happens

jaseg commented 6 years ago

I have been unable to reproduce this. Your code works on my setup (mpv 0.28.2).

When used via libmpv, mpv's behavior is different in many details such as it not loading key bindings. I'd suggest you take a very close read through mpv's doc and source code to figure out why libmpv might not be doing this. Also have a look at the debug output mpv.MPV(loglevel='debug', ...). Maybe libmpv is having some problem that just doesn't surface with the default loglevel.

Maybe have a look at --save-position-on-quit. There is also a write_watch_later_config command.

jaseg commented 6 years ago

Feel free to re-open this if you think this can be reproduced. So far it looks the original error message was most likely caused by a wrong libmpv version. Make sure --watch-later-directory actually works with the mpv on your system and make sure that and libmpv are the same version.