onthegomap / planetiler

Flexible tool to build planet-scale vector tilesets from OpenStreetMap data fast
Apache License 2.0
1.2k stars 98 forks source link

[BUG] Downloader error getting size of GitHub zipball #928

Open wipfli opened 1 week ago

wipfli commented 1 week ago

Describe the bug

I would like to use the Downloader to get a zipball from GitHub but the execution fails.

To Reproduce

Steps to reproduce the behavior:

  1. Create a power.java file with this content:
    
    import java.nio.file.Path;

import com.onthegomap.planetiler.FeatureCollector; import com.onthegomap.planetiler.Planetiler; import com.onthegomap.planetiler.util.Downloader; import com.onthegomap.planetiler.Profile; import com.onthegomap.planetiler.config.Arguments; import com.onthegomap.planetiler.reader.SourceFeature;

/**

Expected behavior Should download the zip file.

Environment (please complete the following information):

wipfli commented 1 week ago

Maybe the problem is that the GitHub api want some HTTP headers like for example User-Agent, see https://docs.github.com/en/rest/using-the-rest-api/getting-started-with-the-rest-api?apiVersion=2022-11-28#headers.