simons-public / protonfixes

A module for applying fixes at runtime to unsupported games with Steam Proton without changing game installation files
https://simons-public.github.io/protonfixes/
Other
234 stars 114 forks source link

corefonts.py can't fetch fonts #147

Closed flukejones closed 3 years ago

flukejones commented 3 years ago

Helping someone troubleshoot why a fresh install was failing and found that https://github.com/pushcx/corefonts/raw/master/ is down. corefonts.py will need updating.

simons-public commented 3 years ago

The url https://github.com/pushcx/corefonts/raw/master/ is a 404 and can't be browsed, but corefonts.py downloads the url + font name + 32.exe which is still working from the pushcx/corefonts repo as far as I can tell. For example, it would try https://github.com/pushcx/corefonts/raw/master/andale32.exe first which still downloads for me. Is it possible there's something else blocking the download?

Coolthulhu commented 3 years ago

I had the same problem. Ran GloriousEgg version of Proton with waitandrun instead of run option and it printed a log made mostly of:

Threads getting "403 forbidden"

``` Exception in thread Thread-4: Traceback (most recent call last): File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner self.run() File "/usr/lib/python3.8/threading.py", line 870, in run self._target(*self._args, **self._kwargs) File "/home/username/Proton-6.0-GE-1/protonfixes/corefonts.py", line 48, in download_file with urllib.request.urlopen(url, files) as font: File "/usr/lib/python3.8/urllib/request.py", line 222, in urlopen return opener.open(url, data, timeout) File "/usr/lib/python3.8/urllib/request.py", line 531, in open response = meth(req, response) File "/usr/lib/python3.8/urllib/request.py", line 640, in http_response response = self.parent.error( File "/usr/lib/python3.8/urllib/request.py", line 569, in error return self._call_chain(*args) File "/usr/lib/python3.8/urllib/request.py", line 502, in _call_chain result = func(*args) File "/usr/lib/python3.8/urllib/request.py", line 649, in http_error_default raise HTTPError(req.full_url, code, msg, hdrs, fp) ```

For some reason, calling urllib.request.urlopen(url, files) gets a 403 on github links. This reproduces outside of the protonfixes script, with just:

import urllib.request
url = "https://github.com/pushcx/corefonts/raw/master/andale32.exe"
files = []
font = urllib.request.urlopen(url, files)

Changing the files from [] to None seems to have fixed it - the fonts downloaded properly and extracted into some ttf files.

simons-public commented 3 years ago

Yeah that makes sense looking at the urllib docs, I'm surprised Github wasn't throwing 403's before. Thanks!