X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=youtube_dl%2F__main__.py;h=65a0f891c5998cd49c7e1a98dbca75b6c926ccb8;hb=6917d2a2f0396f7fb6373e6160c6f25b8664aafb;hp=8c12bfb6477ff7f7626937ff373757539870baeb;hpb=9e8056d5a7b6b366874088cd30d23ba4a52d3861;p=youtube-dl diff --git a/youtube_dl/__main__.py b/youtube_dl/__main__.py index 8c12bfb64..65a0f891c 100755 --- a/youtube_dl/__main__.py +++ b/youtube_dl/__main__.py @@ -1,5 +1,17 @@ #!/usr/bin/env python -# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +# Execute with +# $ python youtube_dl/__main__.py (2.6+) +# $ python -m youtube_dl (2.7+) + +import sys + +if __package__ is None and not hasattr(sys, "frozen"): + # direct call of __main__.py + import os.path + path = os.path.realpath(os.path.abspath(__file__)) + sys.path.append(os.path.dirname(os.path.dirname(path))) import youtube_dl