Thann / play-with-mpv

Chrome extension that allows you to play videos in webpages like youtube with MPV instead
https://chrome.google.com/webstore/detail/play-with-mpv/hahklcmnfgffdlchjigehabfbiigleji
The Unlicense
348 stars 80 forks source link

Question: Is it possible to use umpv to append videos to playlist? #78

Closed PercyDLR closed 2 years ago

PercyDLR commented 2 years ago

When I use the extension, it creates a new instance for each video I select. I have the doubt about if it's possible to exec the script using umpv instead of mpv to add the video to the playlist, or if there's a similar workaround.

PercyDLR commented 2 years ago

Okay, I found a workaround, after locating the play-with-mpv library with pip show play_with_mpv, I modified the following lines:

try: 
    pipe = Popen(['mpv', urls, '--force-window'] + 
               query.get("mpv_args", [])) 
except FileNotFoundError as e: 
    missing_bin('mpv')

with:

try:
    pipe = Popen(['umpv', urls]) 
except FileNotFoundError as e: 
    missing_bin('umpv')`

and then reloading the script seems been working fine to me