python - Youtube videos location undetected -
i'm trying download youtube videos simple self written python script using "youtube-dl.exe" i've downloaded. on running command cmd ie "c:\youtube-dl.exe https://www.youtube.com/watch?v=gkk3kloz-_y", i'm able video extracted under c:\users\john when trying below python module, i'm unable detect video location. -----------------youtube downloader python module------------------------
#!/usr/bin/python -tt import os import sys def main(): link = raw_input("please enter youtube link wish download\n") link = "https://" + link result = os.system("c:\youtube-dl.exe %s"%(link)) if result == 0: print "the youtube video got downloaded , stored under c:\users\john folder" else: print "sorry! video couldn't downloaded" if __name__ == '__main__': main()
can somehow know videos getting downloaded. somewhere under c:\python27\ .... ??
you try print(os.path.getcwd())
before run os.system
command. print python's working directory, inherited executable , place file put (if isn't, might need @ documentation executable).
Comments
Post a Comment