News:

Use the "Forum Search"
It may help you to find anything in the forum ;).

[r8356] script to download language files fails when using curl

Started by R1dO, December 25, 2017, 02:16:17 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

R1dO

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.


R1dO

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).

prissi