Author Topic: [r8356] script to download language files fails when using curl  (Read 1334 times)

0 Members and 1 Guest are viewing this topic.

Offline R1dO

  • *
  • Posts: 13
  • Languages: NL EN
[r8356] script to download language files fails when using curl
« 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:
Code: [Select]
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.

Offline Frank

  • *
  • Posts: 1359
  • Languages: DE
Re: [r8356] script to download language files fails when using curl
« Reply #1 on: December 25, 2017, 03:07:06 PM »
simutrans-germany.com changed from http to https

Offline R1dO

  • *
  • Posts: 13
  • Languages: NL EN
Re: [r8356] script to download language files fails when using curl
« Reply #2 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).
« Last Edit: December 25, 2017, 03:58:13 PM by R1dO »

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 8976
  • Languages: De,EN,JP
Re: [r8356] script to download language files fails when using curl
« Reply #3 on: March 20, 2018, 12:34:33 AM »
Incorporated in r8409, thank you.