rg3/youtube-dl — pull request #342 by FiloSottile (2012-05-01 17:45:45+00:00)
Title: Re-organized code and a lot of other stuff.

Here is my recent work on youtube-dl. I've been really bold, but I tried to keep it elegant, in line with the philosophy of this project and tested.
Let's enumerate the changes:

* [ #193 ] I've split the code in a python package, that is a bunch of files inside the `youtube_dl` directory. The package gets compiled by `make compile` into an executable zipfile. The zipfile is prepended with a shebang so that it remains executable on Linux.
* This is a really stable and portable way to distribute the code: it is a single file; it behaves exactly as a script (supported on Python >= 2.6); the tracebacks are readable; it is compatible with all the platforms I was able to test on.
* Please read [that StackOverflow discussion](http://stackoverflow.com/questions/9851156/python-preprocessing-imports/) and [the relevant Python bug](http://bugs.python.org/issue1739468) as a reference.
* [ #153 ] I've written `build_exe.py` and `wine-py2exe.sh` that creates a Windows EXE *automatically* __using WINE__ that is __able to update itself__.
* When executed, `wine-py2exe.sh` creates a WINEPREFIX in `wine-py2exe/`, installs Python and py2exe inside it and the creates the exe using the setup.py passed as argument (`build_exe.py`).
* That required a lot of hacks: the WINE support is achieved patching the PE headers of the template executables of py2exe; the `-U` writes a bat file and executes it before dying.
* I dropped Python 2.5 support. Because:
* It doesn't support a lot of things, that block the development of some ideas and require a lot of fallback code.
* It is a [6 years old](http://www.python.org/getit/releases/2.5/) release, without official binary/documentation releases [since 2008](http://www.python.org/getit/releases/2.5.4/) and ["under the current release policy, __no security issues in Python 2.5 will be fixed anymore__"](http://www.python.org/getit/releases/2.5.6/). It is now a really bad thing to run 2.5 and it should be deprecated everywhere.
* [ #296 ] Moved increment_downloads and process_info calls from IEs to FD.download; a small step towards importability (#217)

That pull request includes the following branches, so refer to them for what the changes are:

* #316 - [ @FiloSottile ] added support for HTTP redirects. Closes #315
* #321 - [ @FiloSottile ] Handle next_url redirections (and whitespaces stripping)
* #329 - [ @FiloSottile ] So long lxml, and thanks for all the fish

This is a fast-forward ready merge from the current upstream.