-
-
Save MuhamedFathy/2e7e511ff2b3bb765b40 to your computer and use it in GitHub Desktop.
Download udemy lectures using youtube-dl script (by : @luiz-rocha)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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