Last active
August 2, 2023 04:26
-
-
Save vogler/5bb22703e2dc95f6bc4eb0c35abcd600 to your computer and use it in GitHub Desktop.
Download all Videos in Ring Event History
This file contains hidden or 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
// Even with a subscription, videos are saved online only for 3 months. | |
// Downloading videos manually is a pain since you can only select 50 at a time, and 'Select Multiple' only has up to 'First 100'. | |
// 1. Go to https://account.ring.com/account/activity-history | |
// 2. Click button 'Manage'. | |
// 3. Scroll down in the event list to load as many events as you want. | |
// 4. Open Chrome Dev Tools (cmd+alt+i) and open Console to paste the following: | |
f = (xs, i) => { | |
const n = xs.length; | |
xs.slice(Math.max(0, n-i*50), Math.max(0, n-(i-1)*50)).map(x => x.click()); | |
document.querySelector('button[data-testid="manage-events__download"]').click(); // Download | |
document.querySelector('button[data-testid="manage-events__select-multiple"]').click(); // Deselect | |
}; | |
es = Array.from(document.querySelectorAll('label')); | |
// manual: | |
es.length; // to see how many entries there are | |
f(es, 1); // downloads the first pack of 50 videos from the end of the list | |
f(es, 2); // ... continue until you reach the top | |
// or in a loop with waiting for downloads inbetween: | |
const sleep = s => new Promise(r => setTimeout(r, s*1000)); | |
for (let i = 1; i <= es.length/50; i++) { console.log(`${i} out of ${es.length/50}`); f(es, i); await sleep(60); } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment