mihaip / infinite-mac

A classic Mac loaded with everything you'd want
https://infinitemac.org
Apache License 2.0
1.12k stars 66 forks source link

import-cd-roms fails as fam-cd no longer available #304

Closed Sembiance closed 3 months ago

Sembiance commented 3 months ago

With latest code from a few moments ago, running npm run import-cd-roms fails with:

Failed to download https://archive.org/download/fam-cd/FAM_CD.ISO
Traceback (most recent call last):
  File "/mnt/compendium/DevLab/discmaster2/emu/mac/infinite-mac/scripts/import-cd-roms.py", line 141, in <module>
    main()
  File "/mnt/compendium/DevLab/discmaster2/emu/mac/infinite-mac/scripts/import-cd-roms.py", line 133, in main
    output_manifest = get_output_manifest(input_manifest)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/compendium/DevLab/discmaster2/emu/mac/infinite-mac/scripts/import-cd-roms.py", line 62, in get_output_manifest
    headers = urls.read_url_headers(src_url)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/compendium/DevLab/discmaster2/emu/mac/infinite-mac/scripts/urls.py", line 17, in read_url_headers
    cache_path = read_url_to_path(url, headers=True)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/compendium/DevLab/discmaster2/emu/mac/infinite-mac/scripts/urls.py", line 33, in read_url_to_path
    contents = fetch_url(url, headers)
               ^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/compendium/DevLab/discmaster2/emu/mac/infinite-mac/scripts/urls.py", line 49, in fetch_url
    response = urllib.request.urlopen(request, context=context)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/urllib/request.py", line 216, in urlopen
    return opener.open(url, data, timeout)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/urllib/request.py", line 525, in open
    response = meth(req, response)
               ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/urllib/request.py", line 634, in http_response
    response = self.parent.error(
               ^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/urllib/request.py", line 563, in error
    return self._call_chain(*args)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/urllib/request.py", line 496, in _call_chain
    result = func(*args)
             ^^^^^^^^^^^
  File "/usr/lib/python3.11/urllib/request.py", line 643, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 403: Forbidden

Visiting https://archive.org/details/fam-cd/ does indeed show that it's been removed from archive.org

that-ben commented 3 months ago

FYI, HTTP Error 403: Forbidden is a permission issue.

mihaip commented 3 months ago

Should be fixed now (the script will output a warning but keep going, and I fixed some of the URLs that were no longer valid).