karthink / elfeed-tube

Youtube integration for Elfeed, the feed reader for Emacs
The Unlicense
241 stars 11 forks source link

Elfeed-tube launches a minimized mpv instance, but video does not consistently play #25

Open kofm opened 9 months ago

kofm commented 9 months ago

Hello!

First of all, thanks for the hard work you've put into creating Emacs packages. They have been greatly helpful to me.

I came across an issue while trying to use elfeed-tube. After setting everything up as per the README and loading the videos in my feed, launching elfeed-tube-mpv opens a minimized mpv instance, but no video starts playing. The strange thing is, after numerous attempts, the video does begin to play, and live transcripts work just fine, but I cannot figure out what change causes this to happen.

I did find errors in elfeed-tube-log, like the following:

[2023-11-01 08:48:59] [error]: [Sponsorblock][video:Grano Saraceno. Il c]: HTTP 502

I was hoping you could provide some assistance or guidance on where I can start to debug this issue. Thank you for your time and your contributions to the Emacs community.

Best regards

karthink commented 9 months ago

The error in *elfeed-tube-log* is unrelated and not really an error.

I'm not sure what could be causing mpv to fail. What is the variable elfeed-tube-mpv-options set to? You could try changing the force-window option to --force-window=immediate and see if that helps (see #16).

kofm commented 9 months ago

Hey, thanks for the fast response.

I'm not sure what could be causing mpv to fail. What is the variable elfeed-tube-mpv-options set to? You could try changing the force-window option to --force-window=immediate and see if that helps (see #16).

I tried, but it does not help. If I leave the window open, after several minutes, it starts playing (often without the video, just black screen). Sometimes, it plays right away, and everything works correctly.

However, using the following to open the video (found in another issue), it launches consistently after just a few seconds. It seems to be a connection-related issue, but I don't understand why it works correctly with the command below.

(defun elfeed-mpv-url ()
    "Visit the current entry in mpv."
    (interactive)
    (let ((browse-url-browser-function
           #'browse-url-mpv))
      (pcase major-mode
        ('elfeed-search-mode (elfeed-search-browse-url))
        ('elfeed-show-mode (elfeed-show-visit)))))

(defun browse-url-mpv (url &optional _)
  (start-process "mpv" nil "mpv"
                 (shell-quote-wildcard-pattern URL)))