Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #15343

Re: python-based downloader (youtube-dl) missing critical feature ...

Date 2011-11-04 13:45 +0100
From Philipp Hagemeister <phihag@phihag.de>
Subject Re: python-based downloader (youtube-dl) missing critical feature ...
References <1320407282.243739@nntp.aceinnovative.com>
Newsgroups comp.lang.python
Message-ID <mailman.2432.1320412148.27778.python-list@python.org> (permalink)

Show all headers | View raw


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

As already said, you should file your request at
https://github.com/rg3/youtube-dl/issue , not here.

A few things to note:

* Not all sites necessarily send the Content-Length header.
* RTMP URLs would have to be treated differently
* Sending a Range header might allow for a better implementation.

Why do you want to restrict the filesize of the download in the first
place? I can't see a use case, but that doesn't mean there isn't one.

Due to me not having lots of time at the moment, your best chance to get
any youtube-dl feature implemented is providing a patch (in form of a
github pull-request, if possible).

- -- Philipp (youtube-dl developer)

lbrt@mail.python.org wrote:
>  python-based youtube-dl
> ~ 
>  http://rg3.github.com/youtube-dl/
> ~ 
>  is sorely missing a flag in order to indicate the maximum file length of the data feed it would download (well, unless, for some reason, it is considered a "feature").
> ~ 
>  I wonder what developers were thinking about when they came up this nice piece of code. If you actually look in the code
> ~ 
> ...
>  data = urllib2.urlopen(basic_request)
>  content_length = data.info()['Content-Length']
> ...
> ~ 
>  you will see they get the content length of the actual data feed and they also print the progress status based on the content length
> ~ 
>  Implementing an if statement a la:
> ~ 
>  max_indicated_content_length = self.params.get('max_content_length', None);
> ~ 
>  if( content_length > max_indicated_content_length ){ [do not download, just report "data feed too large"] }
>  else{ [do] }
> ~ 
>  shouldn't be hard at all
> ~ 
>  youtube-dl is under the Creative Commons License copyrighted by 2006-2011 Ricardo Garcia Gonzalez and maintained by him and a group of python developers
> ~ 
>  They are the ones keeping a mental map of that project. It would be a plus if they implement this feature, but anyother python developer can implemented (please, let me know if/when you do)
> ~ 
>  lbrtchx

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iEYEAREKAAYFAk6z3mMACgkQ9eq1gvr7CFyr1wCgpqf8xuORDC4LBVY8WFmtAufG
k+AAoIX+mXa7SGLULP2M67IQ34sBgk1o
=duyH
-----END PGP SIGNATURE-----

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

python-based downloader (youtube-dl) missing critical feature ... lbrt chx _ gemale - 2011-11-04 11:48 +0000
  Re: python-based downloader (youtube-dl) missing critical feature ... Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-11-04 12:32 +0000
    Re: python-based downloader (youtube-dl) missing critical feature ... Jean-Michel Pichavant <jeanmichel@sequans.com> - 2011-11-04 14:31 +0100
    RE: python-based downloader (youtube-dl) missing critical feature ... "Prasad, Ramit" <ramit.prasad@jpmorgan.com> - 2011-11-07 16:34 -0500
  Re: python-based downloader (youtube-dl) missing critical feature ... Philipp Hagemeister <phihag@phihag.de> - 2011-11-04 13:45 +0100

csiph-web