Re-organized code and a lot of other stuff. by FiloSottile · Pull Request #342 · ytdl-org/youtube-dl (original) (raw)
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:
- [ The code should be broken out in smaller pieces #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 bymake 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 and the relevant Python bug as a reference.
- [ Provide an official exe for windows #153 ] I've written
build_exe.py
andwine-py2exe.sh
that creates a Windows EXE automatically using WINE that is able to update itself.- When executed,
wine-py2exe.sh
creates a WINEPREFIX inwine-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.
- When executed,
- 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 release, without official binary/documentation releases since 2008 and "under the current release policy, no security issues in Python 2.5 will be fixed anymore". It is now a really bad thing to run 2.5 and it should be deprecated everywhere.
- [ Add the option to return only the info_dict #296 ] Moved increment_downloads and process_info calls from IEs to FD.download; a small step towards importability (about import #217)
That pull request includes the following branches, so refer to them for what the changes are:
- added support for HTTP redirects. Closes #315 #316 - [ @FiloSottile ] added support for HTTP redirects. Closes youtube-dl: does not work with bit.ly #315
- Handle next_url redirections (and whitespaces stripping) #321 - [ @FiloSottile ] Handle next_url redirections (and whitespaces stripping)
- So long lxml, and thanks for all the fish #329 - [ @FiloSottile ] So long lxml, and thanks for all the fish
This is a fast-forward ready merge from the current upstream.