Skip to content

Instantly share code, notes, and snippets.

@melkopisi
Created January 14, 2016 23:10
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save melkopisi/0f0de19c35141be3c355 to your computer and use it in GitHub Desktop.
Save melkopisi/0f0de19c35141be3c355 to your computer and use it in GitHub Desktop.
Download udemy lectures using youtube-dl script (by : @luiz-rocha)
#!/usr/bin/env python3
#by luiz-rocha
#You can now download udemy lectures by this script which uses youtube-dl script :))
import getpass
import subprocess
try:
url = input('Course URL: ')
email = input('Udemy E-mail: ')
pwd = getpass.getpass('Password: ')
start = input('Playlist start: ')
end = input('Playlist end: ')
out_format = "%(playlist_index)s-%(title)s.%(ext)s"
folder = "videos_downloads/"
# If you use windows, try youtube-dl.exe
command = "youtube-dl %s -o %s%s -u %s -p %s" % (
url, folder, out_format, email, pwd
)
if start is not '':
command += " --playlist-start " + start
if end is not '':
command += " --playlist-end " + end
print("Starting Download ...")
process = subprocess.call(command.split())
except KeyboardInterrupt:
print("\nCtrl-C Detected")
except Exception as e:
print("Something wrong occur:", e)
finally:
print("Closed!")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment