Skip to content

Instantly share code, notes, and snippets.

@itsfarseen
Created October 1, 2020 10:46
Show Gist options
  • Save itsfarseen/e40781df53e28adea0791c716fbf8376 to your computer and use it in GitHub Desktop.
Save itsfarseen/e40781df53e28adea0791c716fbf8376 to your computer and use it in GitHub Desktop.
Computational Geometry Downloader
import requests
from pprint import pprint
from subprocess import call
print("Getting latest lecture lists")
r = requests.get("https://docs.google.com/document/d/19aANt5jiIrCiSUnOvjRGpv3J1aY1l4ZSkWBPapeKSyo/export?format=txt")
lines = r.text.splitlines()
links = []
prev_line = None
for line in lines:
line = line.strip()
if line.startswith("https://drive.google.com"):
links.append((prev_line, line))
prev_line = line
print("Got links: ", len(links))
print()
pprint(links)
for day, link in links:
print("Downloading ", day)
id = link[32:65]
call(["python", "-m", "gdown.cli", "--no-clobber", "-O", day+"/", "https://drive.google.com/uc?id="+id],
env={"PYTHONPATH":"/home/farzeen/Projects/97.Temp/gdown"})
print("Downloaded ", day)
print("-----------")
@itsfarseen
Copy link
Author

You need to clone this (https://github.com/happycoder97/gdown/) and update PYTHONPATH in line 26 accordingly.

@itsfarseen
Copy link
Author

itsfarseen commented Oct 1, 2020

The doc in google drive is updated by https://github.com/mushrifshahreyar/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment