python-based downloader (youtube-dl) missing critical feature ...
Philipp Hagemeister
phihag at phihag.de
Fri Nov 4 08:45:23 EDT 2011
-----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 at 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-----
More information about the Python-list
mailing list