Skip to content

#94 use requests module instead of urllib.request to download preset#97

Merged
bordoray merged 2 commits intoMIERUNE:mainfrom
smellman:dev-fix-94
Jun 27, 2025
Merged

#94 use requests module instead of urllib.request to download preset#97
bordoray merged 2 commits intoMIERUNE:mainfrom
smellman:dev-fix-94

Conversation

@smellman
Copy link
Contributor

Close #94

What I did(変更内容)

  • fixes download bug for preset "[JPN][北海道]北海道拓殖バス(一般路線バス・各町コミュニティバス)" by using requests module.

Notes(連絡事項)

Select "[JPN][北海道]北海道拓殖バス(一般路線バス・各町コミュニティバス)" and download it.

@bordoray bordoray self-requested a review May 28, 2025 23:43
@bordoray
Copy link
Contributor

bordoray commented May 28, 2025

@smellman Got a download error which appears in another way comparing to before.

エラー: Failed to download GTFS data from the URL: https://www.takubus.com/app/download/10941479479/GTFS_regular_line.zip?t=1606785205
image

Ran as it
image

Copy link
Contributor

@bordoray bordoray left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't work as above comment

@smellman
Copy link
Contributor Author

smellman commented Jun 9, 2025

I run test in QGIS's Python console on Windows 11.

>>> import requests
>>> response = requests.get("https://www.takubus.com/app/download/10941479479/GTFS_regular_line.zip?t=1606785205")
>>> response.status_code
429

429 is Too Many Requests.
I think it is server reason, but, I can run above code without error in macOS and Windows 11 Powershell.
I will check requests modules with windows bug.

Copy link
Contributor

@bordoray bordoray left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't works for Japan due to server error as you said, but fixed for NY area.
Approve for urllib fixing, thanks

@bordoray bordoray merged commit 4effd06 into MIERUNE:main Jun 27, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Occured Python error if GTFS data cannot be retrieved.

2 participants