squiter / ivy-youtube

Search for an Youtube video inside Emacs with Ivy
MIT License
29 stars 7 forks source link

Query youtube directly via mpv #1

Closed troublew closed 7 years ago

troublew commented 7 years ago

It would be the best to actually query the youtube link directly through my player, using the youtube-dl library (i'm using mpsyt right now, the command being "mpsyt playurl", but livestreamer or mpv works too). How could I achieve that? Thanks you!

squiter commented 7 years ago

I don't undertant exactly what you want to do.
Do you want to use ivy-youtube to find a video, but instead open the url on browser you pass it to youtube-dl?
Can you give me more details?

troublew commented 7 years ago

Do you want to use ivy-youtube to find a video, but instead open the url on browser you pass it to youtube-dl?

Exactly. And by talking about youtube-dl, I was talking about tools which directly play the video in my media player (currently mpv). Tools like mpsyt, livestreamer (mpv support this too, with the syntax "mpv https://www.youtube.com/watch?v=vid"). It would be amazing. Thanks you for the extension.

squiter commented 7 years ago

@troublew it's a good idea! I'll try to do it. If you have more ideas feel free to share.

squiter commented 7 years ago

@troublew I opened a PR here that (I think) implements what you need. If you want to test you can download the code or read the new readme in https://github.com/squiter/ivy-youtube/tree/support-process

troublew commented 7 years ago

Works perfecty for me, with mpv. I did a little modification, to make it accepts argument:

:command `(,@ivy-youtube-play-at ,video-url))) (setq ivy-youtube-play-at '("/usr/bin/mpv" "--no-video" "--volume=60"))

It's ugly though, and situational ("--no-video" argument for music).

Anyway, thanks for the feature. It's very handy.

squiter commented 7 years ago

When I was thinking about the feature, my first idea was to create a variable that stores a lambda to make it more flexible... maybe I implement that in the future. Anyway thanks for the idea.