Skip to content

Instantly share code, notes, and snippets.

@mrkrstphr
Last active May 26, 2024 18:18
Show Gist options
  • Select an option

  • Save mrkrstphr/0ddb2ecf9c15f506eeafbe0aa41da7cf to your computer and use it in GitHub Desktop.

Select an option

Save mrkrstphr/0ddb2ecf9c15f506eeafbe0aa41da7cf to your computer and use it in GitHub Desktop.

Revisions

  1. mrkrstphr revised this gist May 26, 2024. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    # Copy All HumbleBundle Download Links

    I frequently buy books and comic books from [HumbleBunde](https://humblebundle.com). It's kind of an obsession, whether I manage to read them all, or not.
    I frequently buy books and comic books from [HumbleBundle](https://humblebundle.com). It's kind of an obsession, whether I manage to read them all, or not.

    I also like to use [Motrix](https://motrix.app/) to manage downloading lots of files. HumbleBundle has a bulk download link which just fires off a ton of browser downloads, but I've found that sometimes using that features results in missing a download or two.

  2. mrkrstphr revised this gist May 26, 2024. 1 changed file with 0 additions and 1 deletion.
    1 change: 0 additions & 1 deletion snippet.js
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,6 @@ console.log(
    Array.from(document.querySelectorAll('.row'))
    .map((r) => {
    const links = Array.from(r.querySelectorAll('a'));
    console.log(links.map(l => l.href));

    const cbz = links.find(l => l.href.includes('.cbz'))?.href;
    const epub = links.find(l => l.href.includes('.epub'))?.href;
  3. mrkrstphr revised this gist Nov 12, 2023. 1 changed file with 13 additions and 5 deletions.
    18 changes: 13 additions & 5 deletions snippet.js
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,15 @@
    console.log(
    Array.from(document.querySelectorAll('a'))
    .map((a) => a.href)
    .filter((h) => h && h.substring(0, 11) === 'https://dl.')
    .filter(h => h.includes('.epub'))
    Array.from(document.querySelectorAll('.row'))
    .map((r) => {
    const links = Array.from(r.querySelectorAll('a'));
    console.log(links.map(l => l.href));

    const cbz = links.find(l => l.href.includes('.cbz'))?.href;
    const epub = links.find(l => l.href.includes('.epub'))?.href;
    const pdf = links.find(l => l.href.includes('.pdf'))?.href;

    return (cbz || epub || pdf);
    })
    .filter(Boolean)
    .join('\n')
    );
    );
  4. mrkrstphr created this gist Oct 3, 2022.
    19 changes: 19 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@
    # Copy All HumbleBundle Download Links

    I frequently buy books and comic books from [HumbleBunde](https://humblebundle.com). It's kind of an obsession, whether I manage to read them all, or not.

    I also like to use [Motrix](https://motrix.app/) to manage downloading lots of files. HumbleBundle has a bulk download link which just fires off a ton of browser downloads, but I've found that sometimes using that features results in missing a download or two.

    And clicking the download links one-by-one is boring.

    I just want to get a list of download URLs so I can paste them into Motrix at once and have it manage downloading them.

    So I wrote a quick snippet to paste into the browser developer tools to find all the download links on any given page and output them to the console so I can copy it.

    *Note*: the URLs provided by HumbleBundle eventually expire, so don't hold on to the copied links too long without using them.

    To use, simply change the file type you want in the second join (.epub, .mobi, .pdf, etc), then paste the link in your browsers developer tools.

    The snippet can probably be modified to get rid of the first filter.

    Enjoy!
    7 changes: 7 additions & 0 deletions snippet.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    console.log(
    Array.from(document.querySelectorAll('a'))
    .map((a) => a.href)
    .filter((h) => h && h.substring(0, 11) === 'https://dl.')
    .filter(h => h.includes('.epub'))
    .join('\n')
    );