The other day someone was complaining about the new ad blocker-blocker on YouTube and I mentioned that it might be fun to write a Firefox extension that would just load up yt-dlp and play the video through mpv.

It turns out, writing a Firefox extension is easy and tricking Firefox into launching yt-dlp isn’t much harder (though it does require some annoying configuration on the user’s end).

Anyway, if you’re a Linux user, feel free to try it out. I don’t know how much I’m going to pour into this, but as an exercise of “can this be done”, it was pretty good for a few hours on a Friday night.

  • demesisx@infosec.pub
    link
    fedilink
    English
    arrow-up
    10
    ·
    9 months ago

    Additional pro-tip: you can just launch mpv from the terminal using the YouTube url and it will open a new player.

    • Daniel Quinn@lemmy.caOP
      link
      fedilink
      English
      arrow-up
      7
      ·
      9 months ago

      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!

  • zaknenou@lemmy.dbzer0.com
    link
    fedilink
    English
    arrow-up
    3
    ·
    edit-2
    9 months ago

    can you please share a video of how it looks like when implemented. I think it is already possible to watch videos using VLC ?

    • Telorand@reddthat.com
      link
      fedilink
      English
      arrow-up
      2
      ·
      9 months ago

      I’ve had a couple videos that wouldn’t load properly in VLC. Rare, but it happens. Alternatives are always welcome.

    • Contend6248@feddit.de
      link
      fedilink
      English
      arrow-up
      2
      ·
      9 months ago

      My best guess would be that the internal player of Firefox comes to play here.

      You can try opening any MP4 with Firefox

  • Morgikan@lemm.ee
    link
    fedilink
    English
    arrow-up
    2
    ·
    9 months ago

    I was curious how you implemented this as it’s pretty much the default YT bypass qutebrowser users use. Then I read the MIME type addition you did and had a good laugh. That’s clever. Always nice to see a fellow Go user, too.

  • MonkCanatella@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    2
    ·
    9 months ago

    This is sweet, this exact same idea has been kicking around my head for awhile but I’ve never taken the initiative.

    I did write a script (powershell lol), that uses yt-dlp to download all your subscription videos as they come in and sends a notification. Could easily be modified to work on linux and use ntfy or another notification service. ALso no need to scrape your subscriptions as it stays in sync with your currently subscribed channels.