Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-organized code and a lot of other stuff. #342

Merged
merged 25 commits into from May 22, 2012
Merged

Conversation

FiloSottile
Copy link
Collaborator

@FiloSottile FiloSottile commented May 1, 2012

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 and the relevant Python bug 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:
  • [ #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:

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

FiloSottile and others added 25 commits Mar 18, 2012
…oad (#296) (follows current doclines); a small step towards importability #217
…HTML; fixed a bug in the use of _unescapeHTML (missing _, from d6a9615)
let's elaborate the decision: Python 2.5 is a 6 years old release
and "under the current release policy, no security issues in Python
2.5 will be fixed anymore" (!!); also, it doesn't support the new
zipfile distribution format.
and stitle is created in process_info() and is cross-filesystem sanitized by sanitize_filename();
closes #164
phihag added a commit that referenced this issue May 22, 2012
Re-organized code and a lot of other stuff.
@phihag phihag merged commit 1b91a2e into ytdl-org:master May 22, 2012
@phihag
Copy link
Contributor

@phihag phihag commented May 22, 2012

These changes are too good to be left out. Merged all of them. I might change some details though before releasing a new version.

mirabilos
Copy link

@mirabilos mirabilos commented on d77c3df Oct 31, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excuse me, but, what?!

This breaks my Python, which chokes on the zip binary junk.

Tailszefox
Copy link
Contributor

@Tailszefox Tailszefox commented on d77c3df Oct 31, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which version of Python are you using? This new format works perfectly with Python >=2.6 but is unsupported by other versions. If you have a lower version and can't upgrade, try giving a look at the FAQ which outlines a way to make it work with lower versions.

FiloSottile
Copy link
Collaborator Author

@FiloSottile FiloSottile commented on d77c3df Oct 31, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you are using cPython 2.5, well, you have a bigger problem than this. Otherwise, it will work fine. Also, this is the common way to ship Python packages, the zipfile is only a commodity, you can grab the package folder and run that.

mirabilos
Copy link

@mirabilos mirabilos commented on d77c3df Oct 31, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah okay. Ouch. Looks like I’m going to have to port a newer Python then… the latest of 2.7 would be best I suppose.

FiloSottile
Copy link
Collaborator Author

@FiloSottile FiloSottile commented on d77c3df Oct 31, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mirabilos
Copy link

@mirabilos mirabilos commented on d77c3df Oct 31, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, thanks anyway. It used to work well. I wonder how much I have to fix BitTorrent 3.4 to work with Python 2.7 though… bumping it from 2.3 to 2.5 was “fun” already. But that’s not your construction site. Thanks for the heads-up (I thought I had received a garbage file until I found this after some discussion on Debian) and your work on this program.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants