GASで愛媛県の愛媛県内の状況を日付入りでバックアップ

function myFunction() {

  // folder id
  const id = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
  const folder = DriveApp.getFolderById(id);

  const url = "https://www.pref.ehime.jp/h25500/kansen/documents/kennai_link.pdf";
  const options = {
    "muteHttpExceptions": true,
    "validateHttpsCertificates": false,
    "followRedirects": false,
  };

  try {
    const res = UrlFetchApp.fetch(url, options);
    Logger.log(res.getResponseCode());

    if (res.getResponseCode() == 200) {
      const d = Utilities.formatDate(new Date(), "JST", "yyyyMMdd");
      let blob = res.getBlob().setName("ehime_" + d + ".pdf");
      folder.createFile(blob);
    }

  } catch (e) {
    Logger.log("Error:");
    Logger.log(e);
  }
}