X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=youtube_dl%2F__main__.py;h=3fe29c91f416e0d6c957ed750d3f0f69950dc9c0;hb=ca97a56e4bd920971e02a55ee5d42fe83e25b4f9;hp=ccc782bec162084147bfebbcbb8eb6bee86c191a;hpb=f1cb5bcad2bf2983b584730164238adcd8fa7e94;p=youtube-dl diff --git a/youtube_dl/__main__.py b/youtube_dl/__main__.py index ccc782bec..3fe29c91f 100755 --- a/youtube_dl/__main__.py +++ b/youtube_dl/__main__.py @@ -1,6 +1,16 @@ #!/usr/bin/env python -# Execute with python -m youtube_dl +# 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