Baldomo/open-in-mpv

bug: Totally unresponsive in Windows 11

Opened this issue ยท 13 comments

Bug Description

First I unzipped the windows tar. I installed the registry component and tried using the mpv:// protocol. Nothing happened.
Soon I learned that the protocol is mpv://open?url=...the URI encoded URL. Still nothing. mpv and mpv.net executables are in my path user path. I just added them to the system path, will check if that makes a difference, don't expect it to. I'm posting the bug report and will relog to test.

Anyways I checked the registry keys and learned about registry schema. Apparently it's expected to be installed to C:\Program Files\open-in-mpv. Didn't see this documented anywhere. I moved the exe there. Previously I had tried and failed to install the chrome extension to Edge. Edge's fault that it wouldn't. I installed the extension to Firefox. Everything is lined up at this point.

I tried running open-in-mpv.exe 'open?url=https%3A%2F%2Fyoutu.be%2FdQw4w9WgXcQ' from the command line. Nothing.

The Firefox extension doesn't do anything either. I got it installed, put the button on the browser toolbar and clicked it on a YouTube page. I even moved the entire mpv install to the same dir as open-in-mpv. I made sure to have yt-dlp.exe renamed to youtube-dl.exe in the same directory which I manually tested. The extension ff2mpv works OOTB but it is less hackable bc it uses browser.runtime.sendNativeMessage which prevents me from jerry-rigging the URL protocol to do my bidding.

Extension doesn't install in Edge (no problem, this is bc M$/Google are bogus).

Anyways I've spent at least an hour and a half making absolutely 0 progress other than briefly changing the URL protocol to directly open mpvnet.exe, which although gratifying, was totally useless.

How to Reproduce

Steps to reproduce the behavior:

  1. Attempt to install on W11
  2. IDK

Expected Behavior

Open mpv

Version

2.1.0

Configuration

players:
  mpv:
    name: mpv
    executable: mpv
    fullscreen: "--fs"
    pip: "--ontop --no-border --autofit=384x216 --geometry=98\\%:98\\%"
    needs_ipc: true
    flag_overrides: {}

Relevant log output (optional)

No logs have been produced.

What browsers are you seeing the problem on? (optional)

Other (please specify in the description above)

Checklist:

  • I have checked for existing issues that describe my problem prior to opening this one.
  • I understand that improperly formatted bug reports may be closed without explanation.

Hi, thank you for the bug report. This behavior is quite weird indeed since everything does work in Win10 for some reason but Win11 has issue, and I don't have a Win11 machine set up to test the project.

Apparently it's expected to be installed to C:\Program Files\open-in-mpv. Didn't see this documented anywhere.

You're right, thank you for spotting that.

I moved the exe there. Previously I had tried and failed to install the chrome extension to Edge. Edge's fault that it wouldn't. I installed the extension to Firefox. Everything is lined up at this point.

I guess Edge doesn't like something in the manifest for some reason? The extension isn't doing anything crazy, just sending a URL to the system protocol runner with a standard extension API.

I tried running open-in-mpv.exe 'open?url=https%3A%2F%2Fyoutu.be%2FdQw4w9WgXcQ' from the command line. Nothing.

The CLI expects the whole string with mpv:// in front of it, that's how the OS usually passes it to the executable (or at least has been that way, still know next to nothing about Win11)

The Firefox extension doesn't do anything either. I got it installed, put the button on the browser toolbar and clicked it on a YouTube page.

Have you placed the config.yml file alongside the executable? It should not be needed but I may inadvertedly have broken something related to the configuration loading.

I even moved the entire mpv install to the same dir as open-in-mpv. I made sure to have yt-dlp.exe renamed to youtube-dl.exe in the same directory which I manually tested.

That's not needed, in Win10 I personally tested having mpv in the user path and it worked just fine

Anyways I've spent at least an hour and a half making absolutely 0 progress other than briefly changing the URL protocol to directly open mpvnet.exe, which although gratifying, was totally useless.

You may be able to just use the config.yml file in the root of the repository, it contains a sample player configuration for mpvnet which worked the last time I tried it (about 2 years ago)

The way it's totally unresponsive, it may very well be something wrong with my environment.
I just tried ./open-in-mpv.exe 'mpv://open?url=https%3A%2F%2Fyoutu.be%2FdQw4w9WgXcQ&player=mpvnet'
And with a freshly encoded youtube video with the output of encodeURIComponent(https://www.youtube.com/watch?v=2amFEh9Xig0)
I redownloaded the config and placed it in C:\Program Files\open-in-mpv to no avail.

I am also having this issue. Happy to test on my machine if you need someone to! I went through the steps in this thread, no dice.

Maybe just recompiling it would fix the issue. It could be that Go has been updated to target Windows 11. The code in this project is fairly straightforward and I doubt there's anything that needs changing.

Unsure of how to setup make in Windows without WSL.

Unsure of how to setup make in Windows without WSL.

I went ahead and built the Windows target with WSL Ubuntu. Installed it, but still no luck. I confirmed that the URL handler was set in the registry and targeting the correct executable.

go version go1.18.1 linux/amd64 on Ubuntu 22.04.3 LTS

Happened to come across here again when I am setting open in mpv in my new device (had the same issue as described few weeks back, explored a bit and did the workaround below), and so here's what I did as a workaround for now.

Tested in Edge on Windows (file downloads are done in Firefox as Edge is blocking the files for some reason)

Extension Installation

  1. Download the latest chrome.crx, rename it to chrome.7z
  2. Open chrome.7z using 7zip and extract it to a new folder
  3. Enable Developer mode in Edge and use load unpacked and point to the open in mpv folder and the extension should be installed

Open in MPV setup

  1. (If not already done) Add the mpv.exe into the environment path variable so you can
  2. Download the version 2.0.0 of open in mpv (windows.zip), extract to ://Program Files/open-in-mpv (create the folder)
  3. Run the reg file
  4. Copy the config.yml to C:\ProgramData\open-in-mpv folder and update it accordingly or you can use the file below (and re
    name it back to config.yml as Github doesn't support uploading yml files)
    config.txt
  5. Try opening a video url by right clicking and it should work (just did this on a fresh setup)

also on windows 11. not sure if this is the same bug but i get a "This app can't run on your PC" error from windows when i open the app.

also on windows 11. not sure if this is the same bug but i get a "This app can't run on your PC" error from windows when i open the app.

@dustinfaulkner: The reason why this is happening is because of the install-protocol.reg file and how its written:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\mpv]
"URL Protocol"=""
@="URL:mpv"

[HKEY_CLASSES_ROOT\mpv\shell]

[HKEY_CLASSES_ROOT\mpv\shell\open]

[HKEY_CLASSES_ROOT\mpv\shell\open\command]
@="\"C:\\Program Files\\open-in-mpv\\open-in-mpv.exe\" \"%1\""

Its only set to point to the Program Files directory as you see above. If you have the executable stored anywhere else, it will not work unless you edit this registry file. If you move the open-in-mpv.exe file to the path above, it should fix the problem without you having to edit anything.

UPDATE: I just tried this and I'm still getting an error that the app cannot run on my PC on Windows 11, but the registry key pointing to the Program Files path is still a valid problem. I've tried running open-in-mpv.exe in PowerShell and I'm getting this error:

Program 'open-in-mpv.exe' failed to run: The specified executable is not a valid application for this OS platform.

It looks like the application is currently not compatible with Windows 11 in its current state?

I shall recompile the program with a more recent version of Go then, that should fix things :) So much for retrocompatibility of WIndows executables, but I think Go is to blame here more than anything

I shall recompile the program with a more recent version of Go then, that should fix things :) So much for retrocompatibility of WIndows executables, but I think Go is to blame here more than anything

@Baldomo this unfortunately still did not fix the problem. I just tried using the new build you released and the same error is occurring about it not being a valid application for Windows 11.

Please test the attached exe, which was compiled with the correct GOARCH (I built the last two versions on a work laptop which is arm64). There was a typo in the Makefile (GOARCh instead of GOARCH) so the target architecture for Windows ended up being arm64 and thus the error. Additionally, I tested the program on a Win11 arm64 VM so I totally didn't notice the error, so I apologize for the mistake.

windows.zip

I have downloaded and have tried to get your program to work from this zip file you provided. But nothing is happening, and the lack of feedback or errors is very frustrating.

Please test the attached exe, which was compiled with the correct GOARCH (I built the last two versions on a work laptop which is arm64). There was a typo in the Makefile (GOARCh instead of GOARCH) so the target architecture for Windows ended up being arm64 and thus the error. Additionally, I tested the program on a Win11 arm64 VM so I totally didn't notice the error, so I apologize for the mistake.

windows.zip

The zip you provided is the first WIndows build that works on my x86 PC since 2.0.1. Thanks!