def main(cookie): temp = sys.argv[2] if len(temp) != 0: cookie = temp #trial ### dl = Skillshare(cookie) course_url = sys.argv[1] dl.download_course_by_url(course_url)
def main(): target_folder = sys.argv[1] downloaded_history_file_name = "downloaded.txt" downloaded_history_file_path = "{target_folder}/{file_name}".format( target_folder=target_folder, file_name=downloaded_history_file_name) if not os.path.exists(downloaded_history_file_path): downloaded_history_file = open(downloaded_history_file_path, "w") downloaded_history_file.write("") downloaded_history_file.close() course_url = sys.argv[2] course_urls = course_url.split(',') print("+ Total courses: " + str(len(course_urls))) print("") dl = Skillshare(cookie, downloaded_history_file_path) for co in course_urls: print("Starting: " + co) dl.download_course_by_url(co, target_folder) print("______________________ FINISHED ______________________") print("") print("______________________ DONE ______________________") print("")
def main(): dl = Skillshare(cookie) course_url = sys.argv[1] dl.download_course_by_url(course_url)
from skillshare import Skillshare cookie = open('cookie.txt').read().replace('\n', '') def yes_or_no(question): reply = str(input(question + ' (y/n): ')).lower().strip() if reply[0] == 'y': return True if reply[0] == 'n': return False else: return yes_or_no("Uhhhh... please enter again") dl = Skillshare(cookie=cookie) url = input("Enter class url:: ") # bool for downloading subtitle boolSubtitle = yes_or_no("Do you want to download subtitle") # bool for downloading resources boolResources = yes_or_no("Do you want to download resources") dl.download_course_by_url(url, boolSubtitle, boolResources)