The International Simutrans Forum

Development => Patches & Projects => Incorporated Patches and Solved Bug Reports => Topic started by: R1dO on December 25, 2017, 02:16:17 PM

Title: [r8356] script to download language files fails when using curl
Post by: R1dO on December 25, 2017, 02:16:17 PM
Not sure if it is a problem with the curl library on ubuntu17.04 or because something has changed on the simutranslator site

When trying to download the language files using the provided script: get_lang_files.sh curl only receives a 301 Moved Permanently response (on both invocations), causing an error when trying to extract the zip (which is actually a plain text file when this happens).
The code-path using wget is returning a correct zip file.

A workable solution is to pass the location flag to curl (-L or --location) [1], to make it resends the request to the page indicated by the server.
This will return the zip-file with the same contents as in the wget case. But i'm not sure if this should be the preferred solution to the problem.


[1] this flag must precede the -d flag if that one is in use.
Title: Re: [r8356] script to download language files fails when using curl
Post by: Frank on December 25, 2017, 03:07:06 PM
simutrans-germany.com changed from http to https
Title: Re: [r8356] script to download language files fails when using curl
Post by: R1dO on December 25, 2017, 03:16:14 PM
In that case:
Good job by providing the redirect response, this made the workaround viable ;)

Best solution for the problem is to alter the http calls in the script i suppose.

[edit] Attached the script with both alterations (-L option and https calls), also sneaked in an option to specify an arbitrary output directory in the script file. Perhaps it is of any help (dont forget to remove .txt from the name, it was necessary to fool the forum).
Title: Re: [r8356] script to download language files fails when using curl
Post by: prissi on March 20, 2018, 12:34:33 AM
Incorporated in r8409, thank you.