woodruffw / ff2mpv

A Firefox/Chrome add-on for playing URLs in mpv.

Home Page:https://addons.mozilla.org/en-US/firefox/addon/ff2mpv/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Extension doesn't work on YouTube in Chrome

boopnbop opened this issue · comments

commented

Describe the bug

MPV is not opened when I try to use the extension on YouTube.

Reproduction steps

When I click on the extension in the extension bar, or click "Play in MPV" on a thumbnail, nothing at all happens.

Expected behavior

I expected mpv to open showing the video.

Screenshots

image
image
image
image
image
image
image
image

Platform information

  • OS information: Windows 10
  • Google Chrome version: 102.0.5005.115
  • MPV version: 0.34.0
  • yt-dlp version: 2022.06.22.1

Additional context

Doing "mpv [insert link]" in the command prompt works fine, but this extension has not worked a single time. I also tried this extension quickly on Vimeo and it did not work either, but I haven't tried my chances on Vimeo many times or on any other streaming services, simply because I'm just not interested. I messed around with the troubleshooting methods but I still can't get it to work. Have I done something wrong?

I installed the extension from the Chrome web store, and the code from the zip file at the top of the github page. I don't remember where I installed any of my programs, but I'm sure I could figure that out if it's necessary. Thank you in advance! Sorry, I'm not very technologically literate ig haha.

Thanks for the report @boopnbop.

I don't directly maintain this extension for Windows, but as a guess: it looks like the JSON in your ff2mpv-windows.json file is slightly malformed.

In particular, you're missing a closing ] after the line that contains the chrome-extension:// URL. It should probably look something like this:

{
    "name": "ff2mpv",
    "description": "ff2mpv's native manifest",
    "path": "ff2mpv.bat",
    "type": "stdio",
    "allowed_extensions": ["chrome-extension://ephjcajbkgplkjmelpglennepbpmdpjg/"]
}

Try copying and pasting that into your file, and see if it works.

commented

Still doesn't seem to work but thank you for your help!

CC @DanSM-5, in case you have any theories.

Just to confirm this is not an issue with the encoding, could you delete ff2mpv.bat (the one that says "Windows Batch file") and create a new file with the same name copying this as the content?

@echo off
call py -3 ff2mpv.py
commented

I had a feeling this was gonna fix it but it still hasn't lmaooo maybe I did something wrong

image
image
image

I noticed that you have yt-dlp in the same folder that mpv. If that's the case you don't need the extra line in the mpv.conf file. Could you try without that?

Another thing, could you check which version of python you have?
Try py --version in powershell. If it doesn't work try python or python3.

commented

I tried deleting the line from mpv.conf but I am faced with the same problem

I have Python 3.10.5

Also, I don't know if this is worth mentioning at all but when I click on the extension inside a video, despite mpv not opening it pauses the video, and when I right-click on a thumbnail and do "play in mpv", a black box with the link shows the bottom left corner for a significant amount of time. It looks like this: (literally just a picture of a link but thought I'd add context haha)
lYWbhd0MVK
I doubt any of this means anything to you but I thought I'd mention it anyway.

The video stopping is a feature of the extension. It stops the current video element if there is one.
The black box with the link is a behavior of Chrome. It will appear every time you hover a link.

Could you confirm which python command you use to check the version of python? It varies depending on how you installed python.

@boopnbop I think I found the issue. The path in the registry key should be set in the (Default) key.

image

In the screenshot I see it is set in a different key with the name of the path. It should be set in (Default).

commented

i used py --version and i have Python 3.10.5

hmm still doesn't seem to work. i've tried removing and adding the "ff2mpv-windows.json" at the end of the path and neither options work either.

image

something to note is that the key is under Google->Chrome and not Chromium. i have no idea what the registry key does to be honest but i thought i might as well try creating a key under Chromium called ff2mpv and added the path to the (Default) key but to no avail haha. oh and i also tried adding and removing the "\ff2mpv-windows.json" to the end of the path on this key as well, but neither worked.

image

The entry in the registry is fine if you are using Google Chrome (Google -> Chrome). The entry under Chromium is for the Chromium browser which is a different browser.

The ff2mpv-windows.json has the key "allowed_extensions" that is for Firefox. For chromium browsers it should be "allowed_origins".

{
  "name": "ff2mpv",
  "description": "ff2mpv's native manifest",
  "path": "ff2mpv.bat",
  "type": "stdio",
  "allowed_origins": [
    "chrome-extension://ephjcajbkgplkjmelpglennepbpmdpjg/"
  ]
}

Hopefully this will work.

commented

Thank you so much, it works now! You've been really helpful