text
stringlengths 1
93.6k
|
|---|
def get_videos(url):
|
"""Download all videos in the course.
|
"""
|
# Lynda.com login and video filename options
|
options = {
|
'username': USERNAME,
|
'password': PASSWORD,
|
'outtmpl': u'%(playlist_index)s-%(title)s.%(ext)s',
|
'writesubtitles': SUBTITLES,
|
'allsubtitles': SUBTITLES,
|
'download_archive': ARCHIVE,
|
'external_downloader': EXTERNAL_DL
|
}
|
try:
|
with youtube_dl.YoutubeDL(options) as ydl:
|
ydl.download([url])
|
except:
|
print('Could not download the video in course: {}'.format(url))
|
def main():
|
"""Process the list of courses.
|
"""
|
for url in open(LINKS):
|
try:
|
print(url)
|
title = get_title(url)
|
print(title)
|
move_to_course_directory(title)
|
get_videos(url)
|
except:
|
print('Something went wrong.')
|
print('DONE.')
|
if __name__ == '__main__':
|
main()
|
# <FILESEP>
|
from Tkinter import *
|
import tkFileDialog
|
import subprocess
|
import thread
|
import examdownloader
|
FONT = ('Arial', 14, 'bold')
|
class examdownloadergui(object):
|
def __init__(self):
|
self.module = ''
|
self.username = ''
|
self.password = ''
|
self.destination = ''
|
root = Tk()
|
root.withdraw()
|
root.update_idletasks() # Update "requested size" from geometry manager
|
x = (root.winfo_screenwidth() - root.winfo_reqwidth()) / 2
|
y = (root.winfo_screenheight() - root.winfo_reqheight()) / 2
|
root.geometry("+%d+%d" % (x, y))
|
root.deiconify()
|
root.title('NUS Past Year Exam Paper Downloader')
|
root.resizable(0, 0)
|
self.top = Frame(root)
|
self.top.grid(row=0, column=0, padx=20, pady=20)
|
self.top.columnconfigure(0, weight=1)
|
self.top.rowconfigure(0, weight=1)
|
titleLabel = Label(self.top, text='NUS PYP Downloader', font=('Arial', 28, 'bold'))
|
titleLabel.grid(row=1, column=0, columnspan=3, padx=20, pady=20)
|
moduleLabel = Label(self.top, text='Module Code:', font=FONT)
|
moduleLabel.grid(row=2, column=0)
|
self.moduleField = Entry(self.top, bd=2, textvariable=self.module)
|
self.moduleField.grid(row=2, column=1)
|
empty = Label(self.top, text='')
|
empty.grid(row=2, column=2, rowspan=3)
|
usernameLabel = Label(self.top, text='NUSNET ID:', font=FONT)
|
usernameLabel.grid(row=3, column=0)
|
self.usernameField = Entry(self.top, bd=2, textvariable=self.username)
|
self.usernameField.grid(row=3, column=1)
|
passwordLabel = Label(self.top, text='Password:', font=FONT)
|
passwordLabel.grid(row=4, column=0)
|
self.passwordField = Entry(self.top, bd=2, show='*', textvariable=self.password)
|
self.passwordField.grid(row=4, column=1)
|
destLabel = Label(self.top, text='Save To Destination:', font=FONT)
|
destLabel.grid(row=5, column=0)
|
self.destField = Entry(self.top, bd=2, textvariable=self.destination)
|
self.destField.grid(row=5, column=1)
|
destButton = Button(self.top, text='Choose Folder', command=self.askForDestination)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.