Skip to content

Instantly share code, notes, and snippets.

View bayousteve's full-sized avatar

bayousteve

  • Joined Jul 10, 2024
View GitHub Profile
@STRML
STRML / bat-download.js
Last active July 10, 2024 15:47
A simple script for downloading all images for a listing on BringATrailer.com
(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
}