salman-abedin/devour

Mpv Problems

Closed this issue · 19 comments

I am trying to use devour with mpv on hersbstuftwm, but the termial just fades out and then fades back in again. I know the script works because it works with emacs.

Give the new version a shot. BTW, are you, by any chance, using alias to launch mpv?

I have tried using the new version with no luck. I am not using an alias

I have the same problem with a single .webm file. If I just open with mpv it works though. Devouring other video files has worked so far.

I am facing the same issue with mpv too.

if you guys are having issues with devouring mpv when using something like youtube-viewer or straw-viewer (or just from a URL of some kind), I use the following wrapper for mpv:

#!/bin/bash

# run mpv in devoured mode with escaped args
devour /usr/bin/`basename $0` `printf %q\  "$@"`

which appears to solve the issue of devouring mpv with a URL

it uses printf to format the arguments to be used properly in the shell (as described here)

NOTE: this isn't a POSIX-compliant solution, since printf in sh doesn't support this

Guys, let me have a look at your devour execution by sharing with me a demonstration(GIF/Video).

@salman-abedin I realized that the issue appears only when opening files that have spaces in their names. It works fine otherwise.

@rusty-electron
I had a feeling the issue would be somewhere along that line due to devour being such a simple program.
However, I have explicitly built this feature into devour and tested it thoroughly and I can tell with a good bit of certainty that the issue is not with the script.
You are probably launching the file incorrectly.
That is why I asked for a demonstration.
Then, it would be much easier for all of us to figure out what is actually up.

@rusty-electron
As I suspected. First of all, you are not using devour in Unsafe mode where you would prefix your unsafe file with " - - " (refer back to the doc).
Second, notice that you let your shell escape the spaces using backslashes.
Devour actually does that for you.
So basically you end up with two backslashes instead of one.
As far as the fix is concerned, I'm gonna write a check for you guys so that the program accounts for such mistakes.
Either way, you're gonna have to use the prefix if you wanna launch unsafe file properly.
I appreciate you going through the trouble btw. =)

Thanks, I will keep the UNSAFE (--) option in mind. I will also be looking out the double backslash fix. Keep up the good work 😀.

I also have this issue but I can't seem to fix it by using -- or putting my file name in quotes instead I'm using devour as such devour mpv -- "[example] file.mkv". (Yes the file I'm using has brackets in them so I used that as an example) I've had devour work with things like sxiv so what exactly is the problem with my usage?

@antaxiom @rusty-electron
Just pushed the fixes for you guys. Tested for both of your use cases. Should be fine now, probably for all of you.
Give it a spin and kindly let me know how it went.

FYI: You no longer have to use -- to distinguish between safe and unsafe files.
Either escape the spaces using backslashes like @rusty-electron or quote the file name like @antaxiom.

@salman-abedin it works like a charm! thanks for the fix 😀

Hi, thanks for all the great work you've done for this! I'm still having trouble with this. Now whenever I open a window with devour it takes no more no less than 40 seconds to open which makes it utterly unusable. On another note if the file has spaces (or brackets I'm not sure) I'll get an error like zsh:1: no matches found: [Sample Text] (my file here started with a section in brackets and I'm a zsh user). Incidentally I did another test where I ran my mpv command (which works) then did devour !! and that actually seemed to work perfectly on a file with no spaces. So it seems the bug with things with spacing in them are still there. I did build devour from source but if I did anything wrong please inform me. I'd like to help this project as much as possible.

@antaxiom @rusty-electron
Just pushed the fixes for you guys. Tested for both of your use cases. Should be fine now, probably for all of you.
Give it a spin and kindly let me know how it went.

FYI: You no longer have to use -- to distinguish between safe and unsafe files.
Either escape the spaces using backslashes like @rusty-electron or quote the file name like @antaxiom.

Thanks, it now works, the only thing I noticed was it seemed to be starting my shell again

I wanted to put up an update about devour, I always installed the AUR repo but now I tried installing but hand and it worked like a charm, sorry for the inconvenience. Thanks to the dev for the useful improvements.

Didn't know someone packaged devour for the AUR. That's pretty cool.
However, that also means I'm not responsible for that particular package.
In any case, closing this thread guys.
If you face any further issues, just reopen the thread.

Hi, @salman-abedin sorry to bother you again but devour has the same issue I previously had, this time it is with filenames that have parentheses in them.

image

mpvd is an alias for devour mpv