@danielquinn@lemmy.ca avatar

danielquinn

@danielquinn@lemmy.ca

Canadian software engineer living in Europe.

This profile is from a federated server and may be incomplete. Browse more on the original instance.

danielquinn,
@danielquinn@lemmy.ca avatar

Is there another way to do this? This hack was the only way I could figure out how to get Firefox to invoke an external binary, but if there’s a more conventional way to do it, I’d like to know 'cause I have another more complicated project in need of a pattern much like this one.

danielquinn,
@danielquinn@lemmy.ca avatar

I don’t think I have it in me to put together a video, but I can describe it if you like.

Once you install the extension and follow the setup instructions, you just go to a YouTube page. The extension adds an ugly button to the top-left of the page that says “bypass”. When you click it, Firefox launches yt-dlp [the URL you’re at] -o - | mpv - which basically just downloads the video and streams the output through the mpv video player. So now you’re watching just the video, with no web page necessary.

danielquinn,
@danielquinn@lemmy.ca avatar

Honestly, because I didn’t know (a) that ff2mpv even existed, or that (b) mpv could play YouTube URLs directly. So thanks! I learnt two things today :-)

It was still a fun project though 'cause I learnt how to write a Firefox extension and get the browser to launch programs on-click, so not a waste of time!

danielquinn,
@danielquinn@lemmy.ca avatar

That’s actually very helpful, thanks. I’ve been working on another project to open certain URLs in specific browsers/profiles, and wanted to be sure that I wasn’t missing a more obvious design pattern. The project is here if you’re curious.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • localhost
  • All magazines
  • Loading…
    Loading the web debug toolbar…
    Attempt #