Skip to content

Instantly share code, notes, and snippets.

@lunarplasma
Created February 27, 2019 13:37
Show Gist options
  • Select an option

  • Save lunarplasma/4aa08a8180f362e22b2b1bed7deb9e20 to your computer and use it in GitHub Desktop.

Select an option

Save lunarplasma/4aa08a8180f362e22b2b1bed7deb9e20 to your computer and use it in GitHub Desktop.
This script downloads all podcasts from a BBC podcasts page
// Press F12 to get the Developer Console, then paste these 3 lines into the console:
var jq = document.createElement('script');
jq.src = "https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js";
document.getElementsByTagName('head')[0].appendChild(jq);
// Next, paste these two lines in to start the download.
x = 0;
$('a[href*="download/"]').each(function(){setTimeout(_ => this.click(), x); x = x + 5000;});
/*
How it works:
This uses jquery to find all the 'a' tags (links) which have an href which includes the term "download".
Then, it triggers the click event for each one, but staggers them (by 5000 milliseconds) so that all don't download at once.
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment