-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathboost-document.py
More file actions
35 lines (28 loc) · 933 Bytes
/
boost-document.py
File metadata and controls
35 lines (28 loc) · 933 Bytes
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
from studydriveapi import *
from functions import *
import argparse
# Create the parser
my_parser = argparse.ArgumentParser(description = 'Give me the ID of the document')
# Add the arguments
my_parser.add_argument('id', metavar='id', type=str, help='ID of document')
# Execute the parse_args() method
args = my_parser.parse_args()
docID = args.id
file = open("alts.txt")
alts = file.read().splitlines()
file.close()
for alt in alts:
try:
username = alt.split(":")[0]
password = alt.split(":")[1]
folderName = username.split("@")[0]
print("Use alt: " + str(username))
#download the documents
tokenAlt = login(username, password)
print("Downloading documents:")
f = open(folderName + "/downloadedDocuments.txt", "a+")
document = getDocument(docID, tokenAlt)
f.write(str(docID) + "\n")
f.close()
except Exception as e:
pass