Curl to download file from subdivx.com after following location without knowing the file name/extens

This question could be specific to the site subdivx.com In the past, I've been able to download a file following location using cURL but there is something about subdivx.com that's different and can't figure out how to get it to work.

I tried the following directly in the terminal with no success:

curl -O -J -L http://www.subdivx.com/bajar.php?id=240853&u=7

it returns:

curl: (6) Could not resolve host: 240853.rar

Part of the problem, I think, is the "&u=7" gets split out into its own little useless background command from the lack of quoting. Try

to make sure the complete URL gets sent.

Also, just wget "http://www.subdivx.com/bajar.php?id=240853&u=7" seemed to work.

1 Like

Thanks @Corona688! This is getting me somewhere now. Both commands work and I'm able to download the file, only thing is that it downloads with a weird name: "bajar.php?id=240853&u=7". If I rename it a get a working file but it would be nice to get the original file name from the server since the files from subdivx.com may be zip or rar files. Any idea on how?

For wget, --trust-server-names will save .rar or .zip. At first glance, curl doesn't appear to have a similar option.

That did it! Thanks! :slight_smile:
I'm new to this forum. Is there a way to select this post as answered by you? :confused:

1 Like

You can add "solved" to the tags, though I just did so. The thread will close by itself, after a few weeks of inactivity.