Created
April 18, 2018 00:46
-
-
Save tcurvelo/5ba09230817cca64f283f29e5226e3cc to your computer and use it in GitHub Desktop.
WIP: Automating Google Takeout Download
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
const puppeteer = require('puppeteer'); | |
(async () => { | |
const browser = await puppeteer.launch({headless: false}); | |
const page = await browser.newPage(); | |
await page.goto('https://takeout.google.com/'); | |
const input = await page.evaluate(() => { | |
const next = document.querySelector('#identifierNext'); | |
document.querySelector('input[type=email]') | |
.value = 'login@gmail.com' ; | |
next.click(); | |
document.querySelector('input[type=password]') | |
.value = 'password' ; | |
next.click() | |
}); | |
await page.goto('https://takeout.google.com/settings/takeout/light'); | |
document | |
.querySelectorAll('input[type=checkbox]') | |
.forEach((e) => e.checked=false); | |
document | |
.querySelectorAll(` | |
[value=profile], | |
[value=calendar], | |
[value=drive], | |
[value=plus_photos], | |
[value=keep], | |
[value=gmail] | |
`) | |
.forEach((e) => e.checked=true); | |
// ... | |
await browser.close(); | |
})(); |
@prithvi514 @tcurvelo end up using a different solution? Would be good if it did not overwrite the latest Takeout if the new take is < the size of the last one. Also an adjustable value on how many Takeouts to keep and how often to do it would be ideal.
Thanks.
where to find the complete code?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@tcurvelo looking forward for the complete code. Thanks