linuxmint / hypnotix

An M3U IPTV Player
1.18k stars 160 forks source link

Exception when using mpv 0.38.0 #331

Closed loxley closed 4 months ago

loxley commented 5 months ago

Getting the following exception when mpv was upgraded to 0.38.0 (Manjaro).

Exception in thread Thread-3 (play_async):
Traceback (most recent call last):
  File "/usr/lib/python3.11/threading.py", line 1045, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.11/threading.py", line 982, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/lib/hypnotix/hypnotix.py", line 908, in play_async
    self.mpv.play(channel.url)
  File "/usr/lib/hypnotix/mpv.py", line 1648, in play
    self.loadfile(filename)
  File "/usr/lib/hypnotix/mpv.py", line 1151, in loadfile
    self.command('loadfile', filename.encode(fs_enc), mode, MPV._encode_options(options))
  File "/usr/lib/hypnotix/mpv.py", line 1043, in command
    _mpv_command(self.handle, (c_char_p*len(args))(*args))
  File "/usr/lib/hypnotix/mpv.py", line 133, in raise_for_ec
    raise ex(ec, *args)
ValueError: ('Invalid value for mpv parameter', -4, (<MpvHandle object at 0x732420d9fec0>, <mpv.c_char_p_Array_5 object at 0x732420bf09e0>))
loxley commented 5 months ago

A temporary fix on Arch based distros is to look in pacman cache for the older library, for example /var/cache/pacman/pkg/mpv-1:0.37.0-3-x86_64.pkg.tar.zst. Unpack it and place the library libmpv.so.2.2.0 somewhere in your path. Then edit /usr/lib/hypnotix/mpv.py line 47:

     sofile = '/home/yourhomedir/.local/libmpv/libmpv.so.2.2.0'

It should work again after that.

Gert-Boers commented 5 months ago

I've edited /usr/lib/hypnotix/mpv.py with the patch provided by Ame-chan-angel and I can confirm that Hypnotix works that way with mpv 0.38. (I'm on ArcolinuxB Gnome.)

@Ame-chan-angel: Thanks for the patch!

chiefy commented 4 months ago

Same here, patch fixed my issues on EndeavourOS latest. Thanks @ame-chan-angel

lineage-of-roots commented 4 months ago

Until the patch by @Ame-chan-angel gets merged upstream, anyone reading will have to edit the /usr/lib/hypnotix/mpv.py file manually.

just add/remove the provided lines in

https://github.com/linuxmint/hypnotix/pull/332/commits/37187015ad0ea8966113bdbf10a9dc2d677c3539

and be careful of the indentation

The patch works. Thanks to @Ame-chan-angel