On Tue 2024-12-10 01:21:28 +0200, Daniel Semyonov wrote: >>>>>> Yuchen Pei writes:
> > On Tue 2024-12-10 00:17:43 +0200, Daniel Semyonov wrote: > >>>>>>> Yoni Rabkin writes: > >> > Konstantin <[email protected]> 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. > >> > You would need to dive into these threads to read the backstory: > >> > https://lists.gnu.org/archive/html/emms-help/2022-03/msg00035.html > >> > https://lists.gnu.org/archive/html/emacs-devel/2022-03/msg00754.html > >> > If the situation has changed in the interim, I'm willing to > reconsider > >> > merging it into Emms. > >> Using yt-dlp with Invidious or Piped just makes it redirect the > requests > >> to Youtube, and I haven't looked too deep into it but there's still a > >> JavaScript interpreter included in yt-dlp which is imported by the > >> Youtube extractor (so it is very likely to still run JavaScript code > >> locally in order to function). > >> It's a shame really, as yt-dlp supports many sites other than Youtube, > >> but obviously using an info method in EMMS should never run non-free > >> code automatically. > > Instead of relying on youtube-dl or yt-dlp, why not just do it all in > > emacs? If you fetch a youtube video url (e.g. the rickroll video > > https://youtube.com/watch?v=dQw4w9WgXcQ) without executing any > > javascript (e.g. with wget), the resulting html includes all the video > > metadata info - just search for "var ytInitialPlayerResponse" and the > > json value that's assigned to it contains the video metadata needed by > > emms-info. > Not a bad idea, though I think in this won't work in the EU as Youtube > will try to display an intermediate page due to GDPR (not tested, I'm > not in the EU, I experienced a similar issue in the past while using a > VPN). An alternative could be to use an Invidious instance, but this > might also be unreliable (I usually use yewtu.be, doesn't seem to work > for the Rickroll video for example). > It will also limit this info method to Youtube only. Yes unfortunately yt-dlp/youtube-dl does not have the same commitment to free software as a GNU project like emms. The same can be said about mpv which is supported by emms and plays youtube videos through yt-dlp/youtube-dl. I assume the reasoning here is that maintaining status quo is better than making changes that could potentially introduce execution of nonfree code or removing support of things that could potentially execute nonfree code by with another degree of separation. > Daniel Best, Yuchen -- Dr Yuchen Pei | https://ypei.org | Timezone: UTC+10 PGP Key: 47F9 D050 1E11 8879 9040 4941 2126 7E93 EF86 DFD0 https://ypei.org/assets/ypei-pubkey.txt
