Skip to content

Commit 426ad4a

Browse files
committed
Quality of Life improvements
1 parent b270da5 commit 426ad4a

File tree

3 files changed

+26
-6
lines changed

3 files changed

+26
-6
lines changed

How_To_Train_Your_Cookies.png

243 KB
Loading

gdrivac.py

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,19 @@
1-
import requests, argparse, os, json
1+
try:
2+
import requests, argparse, os, json, random, time, datetime
3+
except:
4+
print("Hmm... import error. Did you remember to run\n$pip install -r requirements.txt")
25

36
#Internal Imports
47
from subscripts.classes import *
58

9+
def timeRemaining():
10+
DEADLINE = datetime.datetime(year=2021,month=9,day=13)
11+
if datetime.datetime.now() > DEADLINE:
12+
return "ANY MINUTE NOW"
13+
else:
14+
diff = DEADLINE - datetime.datetime.now()
15+
return str(diff.days) + " days, " + str(diff.seconds//3600) + " hours, " + str((diff.seconds%3600)//60) + " minutes"
16+
617
def main():
718

819
#CONSTANTS
@@ -11,8 +22,12 @@ def main():
1122
IM = Immmunizer()
1223
CC = CookieChecker()
1324

14-
HELLOMESSAGE = "\033[92mWelcome to Google-Drivac!\033[92m"
15-
#TODO: ADD RANDOM TIPS FOR THE HELLOMESSAGE
25+
HELLOMESSAGE = "\033[93mWelcome to Google-Drivac!\nStarting up...\n\033[90m" + random.choice([
26+
"TIP: \033[93mGoogle Docs, Sheets, and Slides files are NOT impacted by the security update\033[90m",
27+
"TIP: \033[93mYou can pass multiple .txt files to GDrivac with\n\033[92m$ gdrivac.py -f file1.txt file2.txt\033[90m",
28+
"TIP: \033[93mYou can export your browser cookies as cookies.json into the gdrivac folder.\033[90m",
29+
"TIP: \033[91mApproximate time remaining until September 13:\n{}\033[90m".format(timeRemaining()),
30+
])
1631

1732
#PARSE ARGUMENTS
1833

@@ -88,6 +103,7 @@ def main():
88103

89104
#SHOW TODAY'S HELLO MESSAGE
90105
print(HELLOMESSAGE)
106+
time.sleep(5)
91107

92108
#GET IMMUNIZED
93109
if len(URLs):

subscripts/classes.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,12 @@ def cookieInfoMessage(self):
2626
To be able to associate your Google account with Drive links, you will need to specify your session cookies.
2727
Don't worry! These are only stored locally, you won't be exposing your account to anyone.
2828
29-
TODO: EXPLAIN HOW TO CHECK COOKIES
30-
TODO: EXPLAIN HOW TO EXPORT COOKIES""")
29+
You can find your browser cookies in Chrome by going into
30+
Command Menu > Application > Cookies > https://drive.google...
31+
32+
See the bundled How_To_Train_Your_Cookies.png for reference.
33+
34+
Alternatively, you can export your browser cookies as a cookies.json into the gdrivac directory to skip this step.""")
3135
self.cookieInfoShown = True
3236
def askFor(self,s):
3337
self.cookieInfoMessage()
@@ -142,7 +146,7 @@ def immunize(self,args,visit_queue, cookie_payload):
142146

143147
def request(self,args,URLs,cookie_payload):
144148

145-
#TODO: Maybe check for duplicates?
149+
#Maybe check for duplicates?
146150
for URL in URLs:
147151
self.visit_queue.put(URL)
148152

0 commit comments

Comments
 (0)