Skip to content

Commit

Permalink
added option to disable resourcekey log updates
Browse files Browse the repository at this point in the history
(Why would you ever use it tho? Resource Keys good)
  • Loading branch information
madprogramer committed Sep 11, 2021
1 parent 8de09a2 commit ab05194
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
!requirements.txt
*.html
*.csv
*.log
*.json
__pycache__/*
*/__pycache__/*
1 change: 1 addition & 0 deletions gdrivac.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ def main():
parser.add_argument("-apisid",type=str,help="Specify cookie value for APISID")
parser.add_argument("-tcount",type=int,help="Thread count (default = 6)")
parser.add_argument("-ignoreNonDrive",type=int,default=0,help="Requeue non-Google Drive URLs if a failure occurs. Not recommended unless you are repurposing the script.")
parser.add_argument("-dontCollectKeys",type=int,default=0,help="Set to non-zero to disable resource key extraction.")

args = parser.parse_args()

Expand Down
7 changes: 4 additions & 3 deletions subscripts/classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,10 @@ def immunize(self,args,visit_queue, cookie_payload):
resourcekey = r.json().get("resourceKey")

#Save resourceKey to a log file
with self.resourcekey_lock:
with open("resourceKeys.log", "a") as fl:
fl.write(f"{url_id} {resourcekey}\n")
if not args.dontCollectKeys:
with self.resourcekey_lock:
with open("resourceKeys.log", "a") as fl:
fl.write(f"{url_id} {resourcekey}\n")

with self.print_lock: log("\033[93mAccessing {}\nStatus: {}\033[0m".format(URL,r.status_code))

Expand Down

0 comments on commit ab05194

Please sign in to comment.