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

A question about running youtube-dl for the first time. #1492

Closed
origal opened this issue Sep 24, 2013 · 2 comments
Closed

A question about running youtube-dl for the first time. #1492

origal opened this issue Sep 24, 2013 · 2 comments

Comments

@origal
Copy link

@origal origal commented Sep 24, 2013

Hey. just a short question,

Generally and very briefly going over the code, I see that the first time running ./youtube-dl, it prompts the user for what it's about to do and than gets new content from http://rg3.github.io/youtube-dl/update/ and writes the received newcontent to itself. This changes this file from python code to a binary.

I was wondering about the benefits of this flow. Is this about efficiency? What is this binary responsible for? Why not fetch a new file which is python code as well, with a "shabang" for the python interpreter, similar to the original file? (Just one that imports the module, and runs it with the accepted arguments)

A little confused here. Thanks! :)

@phihag
Copy link
Contributor

@phihag phihag commented Sep 24, 2013

That file is just there for legacy reasons (to allow old versions to update) and will likely be removed (when we're reasonably sure that no old versions are present anymore). If you follow the installation instructions (or use pip, or your distribution's package manager to install youtube-dl), you will never see it.

The reason that current releases of youtube-dl are binary (well, they're basically a zip file) is that the source code has grown too large to be maintained in a single source file. The zip file just contains all .py files and can be run directly with any supported Python interpreter.

If you want to develop youtube-dl, feel free to remove the file if it bothers you (but please don't record the removal in a commit). You can run youtube-dl either by typing make and then running the then-overwritten ./youtube-dl, or just use python -m youtube_dl.

@phihag phihag closed this Sep 24, 2013
@phihag
Copy link
Contributor

@phihag phihag commented Sep 24, 2013

Oh, and the reason why we can't simply distribute __main__.py (which is basically import youtube_dl;youtube_dl.main()) is that ... that wouldn't help anyone who doesn't already have the whole source code.

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

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.