Skip to content

Commit

Permalink
Quality of Life improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
madprogramer committed Sep 3, 2021
1 parent b270da5 commit 426ad4a
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 6 deletions.
Binary file added How_To_Train_Your_Cookies.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 19 additions & 3 deletions gdrivac.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
import requests, argparse, os, json
try:
import requests, argparse, os, json, random, time, datetime
except:
print("Hmm... import error. Did you remember to run\n$pip install -r requirements.txt")

#Internal Imports
from subscripts.classes import *

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

def main():

#CONSTANTS
Expand All @@ -11,8 +22,12 @@ def main():
IM = Immmunizer()
CC = CookieChecker()

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

#PARSE ARGUMENTS

Expand Down Expand Up @@ -88,6 +103,7 @@ def main():

#SHOW TODAY'S HELLO MESSAGE
print(HELLOMESSAGE)
time.sleep(5)

#GET IMMUNIZED
if len(URLs):
Expand Down
10 changes: 7 additions & 3 deletions subscripts/classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,12 @@ def cookieInfoMessage(self):
To be able to associate your Google account with Drive links, you will need to specify your session cookies.
Don't worry! These are only stored locally, you won't be exposing your account to anyone.
TODO: EXPLAIN HOW TO CHECK COOKIES
TODO: EXPLAIN HOW TO EXPORT COOKIES""")
You can find your browser cookies in Chrome by going into
Command Menu > Application > Cookies > https://drive.google...
See the bundled How_To_Train_Your_Cookies.png for reference.
Alternatively, you can export your browser cookies as a cookies.json into the gdrivac directory to skip this step.""")
self.cookieInfoShown = True
def askFor(self,s):
self.cookieInfoMessage()
Expand Down Expand Up @@ -142,7 +146,7 @@ def immunize(self,args,visit_queue, cookie_payload):

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

#TODO: Maybe check for duplicates?
#Maybe check for duplicates?
for URL in URLs:
self.visit_queue.put(URL)

Expand Down

0 comments on commit 426ad4a

Please sign in to comment.