How to rebuild python youtube-dl from the source

if you are in hurry and want to test you changes on youtube-dl file you can run it from it source python main file src_path/youtube_dl/__main__.py I use this to test running youtube-dl on Python3.8 instead of my system default 2.7.12 I just change #!/usr/bin/env python to #!/usr/bin/env python3.8 and I ad soft link to the file youtube_dl/__main__.py on my system /usr/local/sbin/ so you can test your changes immediately .


As documented in the development instructions, you can run youtube-dl interactively with

python -m youtube_dl

while the youtube-dl repository is in your PYTHONPATH, for example because your cwd is the root of the youtube-dl repository.

For development, it's often easier to run the tests instead. Again, as documented, any of these work:

python -m unittest discover
python test/test_download.py
nosetests

If you're developing an extractor, you can run

python test/test_download.py TestDownload.test_YourExtractor

to just test your extractor.

If you actually want a youtube-dl binary, type

make

in the root directory of the youtube-dl repository. You will get a binary called youtube-dl.

Note that make works with any well-maintained software project, although some new-millennium hipster languages prefer to reinvent their own incompatible version.