aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile2
-rwxr-xr-x__main__.py6
-rwxr-xr-xyoutube_dl/__main__.py3
3 files changed, 9 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index aea967148..c4937a512 100644
--- a/Makefile
+++ b/Makefile
@@ -24,7 +24,7 @@ test:
# TODO un-phony README.md and youtube-dl.bash_completion by reading from .in files and generating from them
youtube-dl: youtube_dl/*.py
- zip --quiet --junk-paths youtube-dl youtube_dl/*.py
+ zip --quiet youtube-dl __main__.py youtube_dl/*.py
echo '#!/usr/bin/env python' > youtube-dl
cat youtube-dl.zip >> youtube-dl
rm youtube-dl.zip
diff --git a/__main__.py b/__main__.py
new file mode 100755
index 000000000..fc3cc8ad8
--- /dev/null
+++ b/__main__.py
@@ -0,0 +1,6 @@
+#!/usr/bin/env python
+
+import youtube_dl
+
+if __name__ == '__main__':
+ youtube_dl.main()
diff --git a/youtube_dl/__main__.py b/youtube_dl/__main__.py
index 8c12bfb64..ccc782bec 100755
--- a/youtube_dl/__main__.py
+++ b/youtube_dl/__main__.py
@@ -1,5 +1,6 @@
#!/usr/bin/env python
-# -*- coding: utf-8 -*-
+
+# Execute with python -m youtube_dl
import youtube_dl