isamert / empv.el

An Emacs media player, media library manager, radio player, YouTube frontend
GNU General Public License v3.0
103 stars 18 forks source link

Youtube playback doesn't work #78

Closed nameiwillforget closed 3 months ago

nameiwillforget commented 3 months ago

Youtube playback through empv-youtube doesn't play either video or audio and does not provide any error message, even though mpv with the same urls works. My config is

(use-package empv
  :config
  (setq empv-invidious-instance "https://invidious.protokolla.fi/api/v1")
  (add-to-list 'empv-mpv-args "--ytdl-format=best"))

If I use empv-youtube, I can search for videos and it displays the results, but then if I press RET and p(lay), nothing happens and I get no message whatsoever. I've looked a bit into the lisp-code and defined this test command variant:

(defun empv-youtube-last-results-test ()
  "Show and act on last search results."
  (interactive)
  (ignore-error (quit minibuffer-quit)
    (thread-last
      (empv--completing-read-object
       "YouTube results"
       (empv--yt-search-results empv--last-youtube-search)
       :formatter #'empv--format-yt-item
       :category 'empv-youtube-item
       :sort? nil)
      (empv--youtube-item-extract-link)
      (message))))

If I use this function and select a video, I get

"https://youtube.com/watch?v=8QcI43IwkVc##(:title \"Gentoo Linux Important Details Explained\" :youtube t)"

If I use this url (up to the ##'s) with mpv in the command line, it works.

isamert commented 3 months ago

Can you check if empv works with any local file? And which operating system are you on?

Also can you try:

nameiwillforget commented 3 months ago

So I rebooted my computer in the meantime and only now tried to use empv again with your suggestions, and now it works, both if I use empv-play and if I use empv-youtube. No idea what changed. Anyway, I'm closing this and re-open if it stops working again.

isamert commented 3 months ago

Sometimes mpv process may fail to start but in that case it would've printed an error message. If it happens again I suggest doing M-x empv-exit and then starting empv again by empv-play or empv-youtube etc.