News for hackers. Stuff that matters.
Re:ZX Origins 8x8 bitmap fonts by tyingq on Thursday September 07, 2023 @05:52AM (#37416718)
The mirror option depends on a hierarchy where it can exclude parents. Since the actual downloads are on a different domain, it seems this won't work. A hacky script to do it:

  #!/bin/bash
  for page in $(curl -s https://damieng.com/sitemap.xml | perl -ne 's/<loc>/\n<loc>/g;while ($_ =~ s#<loc>(https://damieng.com/typography/zx-origins/[^\<]+)</loc>##) {print $1."\n"}'); do
    echo "Page is [$page]"
    download=$(curl -sL "$page" | perl -ne 'm#(download\.damieng\.com/fonts/zx-origins/[^"]*)#g && print "https://$1"')
    echo "Download is [$download]"
    wget -qN "$download"
  done
Re:ZX Origins 8x8 bitmap fonts by INTPenis on Thursday September 07, 2023 @06:36AM (#37417013)
Sure but wget has a -D option to specify transitioning to other domains.

So my command was actually something more like wget -m -D download.damieng.com,damieng.com -A .zip https://damieng.com/typography/zx-origins/

But it still wouldn't download the .zip files. I think this is one case where wget should, on paper, be superior to curl.

Re:ZX Origins 8x8 bitmap fonts by tyingq on Thursday September 07, 2023 @07:01AM (#37417182)
I think that would work if that page directly had references to the zip files, but it doesn't. The references are on the sub pages for each font.
Re:ZX Origins 8x8 bitmap fonts by INTPenis on Thursday September 07, 2023 @02:37PM (#37423566)
Yeah but wget -m sets -l (depth limit) to unlimited, I don't see why it shouldn't work out of box. But for some reason it won't get those .zip files.
Re:ZX Origins 8x8 bitmap fonts by tyingq on Thursday September 07, 2023 @07:04PM (#37426883)
Doesn't the -A zip cause it to skip the subpages? That's what I'm saying...the filter is keeping you from traversing main page -> sub page -> zip file.
Re:ZX Origins 8x8 bitmap fonts by INTPenis on Thursday September 07, 2023 @07:13PM (#37426965)
No if you check the output, or even enable -d, you'll see that it goes through sub-pages. It downloads all the index files into a tmp file so it can parse them for more sub-pages, then deletes them after because they don't match the pattern.

It even goes as far as to download download.damieng.com/fonts/conversions/Micropack.zip, proving that it does traverse domains and sub-dirs, but nothing under download.damieng.com/fonts/zx-origins.

It's really strange, I'm thinking it has something to do with all the .zip archives being linked without a protocol (//download.damieng.com), might be a bug but I'd be shocked if no one had encountered it before.