-
Notifications
You must be signed in to change notification settings - Fork 0
/
batch-download.py
44 lines (36 loc) · 1.32 KB
/
batch-download.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#batch-download.py
import os, sys
import settings #settings.py
import util #util.py
#create download directory if it doesn't exist
if not os.path.exists(settings.DOWNLOAD_FOLDER):
os.makedirs(settings.DOWNLOAD_FOLDER)
#check to make sure download folder is empty
if not util.folderEmpty(settings.DOWNLOAD_FOLDER):
print "Error: The download folder is not empty: ", settings.DOWNLOAD_FOLDER
sys.exit(1)
print "******************************************"
print "Don't close the Firefox window that opens."
print "******************************************"
counter = 0
total_dl = 0
total_skipped = 0
total_deleted = 0
for WebExID in settings.WEBEX_IDS:
print "Percent done: %.2f %%" % float(float(counter)/float(len(settings.WEBEX_IDS)) * 100)
userid = util.getUserID(WebExID, settings.PASSWORD)
print "Starting download for: ", WebExID
downloaded, skipped, deleted = util.downloadRecording(WebExID, settings.PASSWORD)
print "Downloaded: ", downloaded
print "Skipped: ", skipped
print "Deleted: ", deleted
total_dl += downloaded
total_skipped += skipped
total_deleted += deleted
counter += 1
print "Finished batch downloading."
print "Total stats breakdown:"
print "Total Downloads: ", total_dl
print "Total Skipped: ", total_skipped
print "Total Deleted: ", total_deleted
print "Downloaded files are here: ", settings.DOWNLOAD_FOLDER