I wanted to download files - Sarcasm_Headlines_Dataset.json and glove.6B.300d.txt from https://drive.google.com/drive/folders/1s37-DVvRWfOcv59ojc6DnwHzPFkA6e8M into my drive so that I can read in Google collab.
In google collab, I tried the below:
import urllib.request
urllib.request.urlretrieve('https://drive.google.com/drive/folders/1s37-DVvRWfOcv59ojc6DnwHzPFkA6e8M', 'Sarcasm_Headlines_Dataset')
os.listdir()
import pandas as pd
url = 'https://drive.google.com/drive/folders/1s37-DVvRWfOcv59ojc6DnwHzPFkA6e8M'
df = pd.read_json(url, orient='columns')
https://developers.google.com/drive/api/v3/quickstart/python - a) I downloaded the client API for the desktop app for project quickstart into my local drive. (credentials.json). b) Installed the Google Client Library c) When I ran the python quickstart.py, it said Please visit this URL to authorize this application. I visited the url and got the
Error 400: redirect_uri_mismatch; does not match the ones authorized for the OAuth client. To update the authorized redirect URIs, visit: https://console.developers.google.com/apis/credentials/oauthclient/${your_client_id}?project=${your_project_number}
I went to API console and got the Client ID and Client secret in the web browser. Again reran python quickstart.py and get the same error.
I believe I need to run the below code in google collab:
request = service.files().get_media(fileId=file_id)
fh = io.FileIO(location + filename, 'wb')
downloader = MediaIoBaseDownload(fh, request, 1024 * 1024 * 1024)
I couldn't file_id. Help please.
I wanted the json to run LSTM code in the google collab.