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
(async function() { | |
const delay = (ms) => new Promise(r => setTimeout(r, ms)); | |
// Given a url, try to download a high-res version of it | |
// This prevents us from downloading a downscaled thumbnail | |
function replaceUrlParam(url) { | |
return url | |
.split('?')[0] // get rid of querystring | |
.replace('-scaled.', '.'); // Remove `-scaled` to attempt to get the full res image | |
} |