gnu-system-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Free-Software Youtube downloader


From: Dmitry Alexandrov
Subject: Re: Free-Software Youtube downloader
Date: Mon, 14 Oct 2019 00:58:30 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Alexandre François Garreau <address@hidden> wrote:
> Please correct me right away if I’m wrong (just posting that right away upon  
> reading) —I’d be happy to be— but currently there’s no free-software youtube  
> downloader as youtube makes them need to execute autogenerated non-free  
> javascript to get essential information to download them, isn’t it?

No, youtube.com does not really conceal direct links to the video.  On the 
contrary, is provides them in machine-readable way.  As a proof of concept, try 
this piece of mess in context of a page:

fetch('/get_video_info?&format=json&video_id='
      + new URLSearchParams(location.search).get('v'))
  .then(resp => resp.text())
  .then(text => open(JSON.parse(new URLSearchParams(text)
                                .get('player_response'))
                     .streamingData.formats
                     .filter(i => i.mimeType.startsWith('video/webm'))
                      // find max height video
                     .reduce((acc, elt) => acc.height > elt.height ? acc : elt)
                     .url));
I do not know, how youtube-dl works, though.

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]