Created
October 1, 2020 10:46
-
-
Save itsfarseen/e40781df53e28adea0791c716fbf8376 to your computer and use it in GitHub Desktop.
Computational Geometry Downloader
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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("-----------") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The doc in google drive is updated by https://github.com/mushrifshahreyar/