$mirrors = {
  'Africa' => {
    'Algeria' => {
      'http://ctan.epst-tlemcen.dz/tex-archive/' => 1,
    },
    'Morocco' => {
      'https://mirror.marwan.ma/ctan/' => 1,
    },
    'South Africa' => {
      'http://ftp.sun.ac.za/ftp/CTAN/' => 1,
      'http://mirror.ufs.ac.za/ctan/' => 1,
      'https://ftp.leg.uct.ac.za/pub/packages/ctan/' => 1,
    },
  },
  'Asia' => {
    'China' => {
      'https://mirror.bjtu.edu.cn/CTAN/' => 1,
      'https://mirrors.aliyun.com/CTAN/' => 1,
      'https://mirrors.bfsu.edu.cn/CTAN/' => 1,
      'https://mirrors.cqu.edu.cn/CTAN/' => 1,
      'https://mirrors.dgut.edu.cn/CTAN/' => 1,
      'https://mirrors.hit.edu.cn/CTAN/' => 1,
      'https://mirrors.nju.edu.cn/CTAN/' => 1,
      'https://mirrors.sjtug.sjtu.edu.cn/ctan/' => 1,
      'https://mirrors.sustech.edu.cn/CTAN/' => 1,
      'https://mirrors.tuna.tsinghua.edu.cn/CTAN/' => 1,
      'https://mirrors.ustc.edu.cn/CTAN/' => 1,
    },
    'Hong Kong' => {
      'https://mirror-hk.koddos.net/CTAN/' => 1,
    },
    'India' => {
      'http://ctan.imsc.res.in/' => 1,
    },
    'Indonesia' => {
      'https://mirror.unpad.ac.id/ctan/' => 1,
    },
    'Iran' => {
      'http://ctan.yazd.ac.ir/' => 1,
      'https://ctan.asis.ai/' => 1,
      'https://ctan.um.ac.ir/' => 1,
    },
    'Japan' => {
      'ftp://ftp.u-aizu.ac.jp/pub/tex/CTAN/' => 1,
      'http://ftp.jaist.ac.jp/pub/CTAN/' => 1,
      'https://ftp.kddilabs.jp/CTAN/' => 1,
      'https://ftp.yz.yamagata-u.ac.jp/pub/CTAN/' => 1,
    },
    'Korea' => {
      'http://ftp.kaist.ac.kr/pub/tex-archive/' => 1,
      'http://ftp.ktug.org/tex-archive/' => 1,
      'http://mirror.kakao.com/CTAN/' => 1,
      'https://cran.asia/tex/' => 1,
      'https://ftp.harukasan.org/CTAN/' => 1,
      'https://mirror.navercorp.com/CTAN/' => 1,
      'https://mirror.yongbok.net/ctan/' => 1,
    },
    'Philippines' => {
      'https://mirror.pregi.net/tex-archive/' => 1,
    },
    'Singapore' => {
      'https://download.nus.edu.sg/mirror/ctan/' => 1,
    },
  },
  'Europe' => {
    'Austria' => {
      'https://mirror.easyname.at/ctan/' => 1,
      'https://mirror.kumi.systems/ctan/' => 1,
    },
    'Belarus' => {
      'https://mirror.datacenter.by/pub/mirrors/CTAN/' => 1,
    },
    'Czech Republic' => {
      'http://ftp.cvut.cz/tex-archive/' => 1,
      'https://mirrors.nic.cz/tex-archive/' => 1,
    },
    'Denmark' => {
      'https://mirrors.dotsrc.org/ctan/' => 1,
    },
    'Finland' => {
      'https://www.texlive.info/CTAN/' => 1,
    },
    'France' => {
      'http://ctan.mines-albi.fr/' => 1,
      'https://ctan.crest.fr/tex-archive/' => 1,
      'https://ctan.gutenberg.eu.org/' => 1,
      'https://ctan.tetaneutral.net/' => 1,
      'https://distrib-coffee.ipsl.jussieu.fr/pub/mirrors/ctan/' => 1,
      'https://mirror.ibcp.fr/pub/CTAN/' => 1,
      'https://mirrors.chevalier.io/CTAN/' => 1,
      'https://mirrors.ircam.fr/pub/CTAN/' => 1,
      'https://texlive.mycozy.space/' => 1,
    },
    'Germany' => {
      'ftp://ftp.fu-berlin.de/tex/CTAN/' => 1,
      'http://ctan.ebinger.cc/tex-archive/' => 1,
      'http://ftp.rrzn.uni-hannover.de/pub/mirror/tex-archive/' => 1,
      'http://mirror.physik-pool.tu-berlin.de/pub/CTAN/' => 1,
      'http://vesta.informatik.rwth-aachen.de/ftp/pub/mirror/ctan/' => 1,
      'https://ctan.kako-dev.de/' => 1,
      'https://ctan.mc1.root.project-creative.net/' => 1,
      'https://ctan.mirror.norbert-ruehl.de/' => 1,
      'https://ctan.net/' => 1,
      'https://ftp.agdsn.de/pub/mirrors/latex/dante/' => 1,
      'https://ftp.fau.de/ctan/' => 1,
      'https://ftp.gwdg.de/pub/ctan/' => 1,
      'https://ftp.rrze.uni-erlangen.de/ctan/' => 1,
      'https://ftp.tu-chemnitz.de/pub/tex/' => 1,
      'https://mirror.clientvps.com/CTAN/' => 1,
      'https://mirror.dogado.de/tex-archive/' => 1,
      'https://mirror.informatik.hs-fulda.de/tex-archive/' => 1,
      'https://packages.oth-regensburg.de/ctan/' => 1,
    },
    'Greece' => {
      'http://ftp.ntua.gr/mirror/ctan/' => 1,
      'https://ftp.cc.uoc.gr/mirrors/CTAN/' => 1,
    },
    'Hungary' => {
      'https://mirror.szerverem.hu/ctan/' => 1,
    },
    'Italy' => {
      'https://ctan.mirror.garr.it/mirrors/ctan/' => 1,
    },
    'Netherlands' => {
      'http://ctan.cs.uu.nl/' => 1,
      'https://ftp.snt.utwente.nl/pub/software/tex/' => 1,
      'https://mirror.koddos.net/CTAN/' => 1,
      'https://mirror.lyrahosting.com/CTAN/' => 1,
    },
    'Norway' => {
      'https://ctan.uib.no/' => 1,
    },
    'Poland' => {
      'https://ftp.gust.org.pl/TeX/' => 1,
      'https://sunsite.icm.edu.pl/pub/CTAN/' => 1,
    },
    'Portugal' => {
      'https://ftp.eq.uc.pt/software/TeX/' => 1,
      'https://mirrors.up.pt/pub/CTAN/' => 1,
    },
    'Romania' => {
      'https://mirrors.nxthost.com/ctan/' => 1,
    },
    'Russia' => {
      'http://ctan.altspu.ru/' => 1,
      'http://mirror.macomnet.net/pub/CTAN/' => 1,
      'http://mirrors.mi.ras.ru/CTAN/' => 1,
      'https://mirror.truenetwork.ru/CTAN/' => 1,
    },
    'Serbia' => {
      'http://ctan.mirror.ftn.uns.ac.rs/' => 1,
    },
    'Spain' => {
      'https://ctan.javinator9889.com/' => 1,
      'https://osl.ugr.es/CTAN/' => 1,
    },
    'Sweden' => {
      'https://ftp.acc.umu.se/mirror/CTAN/' => 1,
      'https://ftpmirror1.infania.net/mirror/CTAN/' => 1,
    },
    'Switzerland' => {
      'https://mirror.foobar.to/CTAN/' => 1,
    },
    'United Kingdom' => {
      'https://anorien.csc.warwick.ac.uk/mirrors/CTAN/' => 1,
    },
  },
  'North America' => {
    'Canada' => {
      'http://ctan.mirror.colo-serv.net/' => 1,
      'http://ctan.mirror.globo.tech/' => 1,
      'https://muug.ca/mirror/ctan/' => 1,
    },
    'Costa Rica' => {
      'https://mirrors.ucr.ac.cr/CTAN/' => 1,
    },
    'USA' => {
      'http://ctan.math.utah.edu/ctan/tex-archive/' => 1,
      'http://ctan.math.washington.edu/tex-archive/' => 1,
      'http://ctan.mirrors.hoobly.com/' => 1,
      'http://mirrors.ibiblio.org/pub/mirrors/CTAN/' => 1,
      'https://ctan.math.illinois.edu/' => 1,
      'https://mirror.las.iastate.edu/tex-archive/' => 1,
      'https://mirrors.concertpass.com/tex-archive/' => 1,
      'https://mirrors.rit.edu/CTAN/' => 1,
    },
  },
  'Oceania' => {
    'Australia' => {
      'https://mirror.aarnet.edu.au/pub/CTAN/' => 1,
    },
    'New Zealand' => {
      'http://mirror.aut.ac.nz/CTAN/' => 1,
    },
  },
  'South America' => {
    'Brazil' => {
      'http://linorg.usp.br/CTAN/' => 1,
    },
    'Chile' => {
      'https://ctan.dcc.uchile.cl/' => 1,
    },
  },
};
