Re: [PATCH] emms-info-ytdl

Daniel Semyonov <[email protected]> Mon, 09 Dec 2024 02:40:37 +0200
Newsgroups gmane.emacs.emms.user
Message-ID <[email protected]>
>>>>> Konstantin  writes:

    > Hello,
    > Few years ago Yuchen Pei started to develop emms-info-ytdl (branch
    > info-ytdl), which provides info for links like:
    > https://www.youtube.com/watch?v=.....

    > I do not know why these changes where not accepted in master.
    > Perhaps it is because ytdl is called synchronously, and therefore
    > emms-info-ytdl freezes Emacs.

    > For a few years i am using without any problem the version, which works
    > asynchronously.

    > Please find attached the asynchronous version of emms-info-ytdl.

    > I am not programmer, so maybe there are some style things.
    > With some guidance, i am ready to correct them.
    > I hope it can be added in emms.

Very cool, I wanted something like this for a while but never got the
chance to implement it.
However, it didn't actually work for me since yt-dlp emitted a warning
on my machine before the JSON output, and then when I fixed it I started
hitting other issues; eventually I just replicated the original logic in
a single function written in a style I'm more comfortable with, and also
made a few more minor changes and made 'emms-info-ytdl-command' a user
option.

I've attached the modified version; only tested on the master branch of
Emacs but I don't think there should be an issue with older versions.

Daniel
emms-info-ytdl.el (application/emacs-lisp, 4.3 KB) - not displayed