Skip to content

Instantly share code, notes, and snippets.

@tobek
Last active October 4, 2025 16:15
Show Gist options
  • Save tobek/a17fa9101d7e28ddad26 to your computer and use it in GitHub Desktop.
Save tobek/a17fa9101d7e28ddad26 to your computer and use it in GitHub Desktop.

Revisions

  1. tobek renamed this gist Oct 10, 2019. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. tobek revised this gist Oct 10, 2019. 1 changed file with 15 additions and 12 deletions.
    27 changes: 15 additions & 12 deletions gistfile1.js
    Original file line number Diff line number Diff line change
    @@ -1,14 +1,17 @@
    /* right click on an entry in the network log, select Copy All as Har
    * type in console: x = [paste]
    /* open up chrome dev tools (Menu > More tools > Developer tools)
    * go to network tab, refresh the page, wait for images to load (on some sites you may have to scroll down to the images for them to start loading)
    * right click/ctrl click on any entry in the network log, select Copy > Copy All as HAR
    * open up JS console and enter: var har = [paste]
    * (pasting could take a while if there's a lot of requests)
    * paste the following JS code into the console
    * copy the output, paste into a file
    * then wget -i [that file]
    * copy the output, paste into a text file
    * open up a terminal in same directory as text file, then: wget -i [that file]
    */
    (function(logObj, mime) {
    var results = [];
    logObj.log.entries.forEach(function (entry) {
    if (mime && entry.response.content.mimeType !== mime) return;
    results.push(entry.request.url);
    });
    console.log(results.join('\n'));
    })(x, 'image/jpeg');

    var imageUrls = [];
    har.log.entries.forEach(function (entry) {
    // This step will filter out all URLs except images. If you just want e.g. just jpg's then check mimeType against "image/jpeg", etc.
    if (entry.response.content.mimeType.indexOf("image/") !== 0) return;
    imageUrls.push(entry.request.url);
    });
    console.log(imageUrls.join('\n'));
  3. tobek revised this gist Oct 10, 2019. No changes.
  4. tobek created this gist Sep 3, 2014.
    14 changes: 14 additions & 0 deletions gistfile1.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    /* right click on an entry in the network log, select Copy All as Har
    * type in console: x = [paste]
    * paste the following JS code into the console
    * copy the output, paste into a file
    * then wget -i [that file]
    */
    (function(logObj, mime) {
    var results = [];
    logObj.log.entries.forEach(function (entry) {
    if (mime && entry.response.content.mimeType !== mime) return;
    results.push(entry.request.url);
    });
    console.log(results.join('\n'));
    })(x, 'image/jpeg');