Copyurl skip on 403/404 error

Hi,

  1. Can copyurl command check the http response code and not copy on the following errors?
  • 403 - Forbidden
  • 404 - File does not exist
  1. Is there a way to set the file name as the name sent by the server?
    For example:

rclone copyurl "http://example.com/file" gd:

here say the url http://example.com/file returns file example.txt,
but we dont know the exact or extension.

That is a good idea... copyurl doesn't appear to be checking the results of the HTTP response! Can you please make a new issue on github about this - thanks.

Provide the name after the remote so gd:filename.txt

But I don't know what name the file has on the server,
although I really need the name to be resolved.
Something like what idm/chrome does.

Thanks for taking the time to reply.
I really appreciate it.

HI,
Is there a work around to get the files name from the server when using rclone copyurl?

There isn't at the moment. This would probably have to be a new flag to CopyURL... Or maybe CopyURL could print the name - would that help?

How come you don't know the name in advance? Isn't it part of the URL? Or do the URLs redirect?

No, the url looks something like:
http://example.com/wp-content/themes/download.php?id=4460

On calling the url, it returns a status 302 and redirects to:
http://example.com/wp-content/uploads/2015/01/54c9975cd2f90/filename.txt?verify=1565166562-j3oMSduA%2FXDukfrcavrhUdJn0FFN%2FlxKxmRxoJ2zQa8%3D

So basically, I change the id=XXXX part and get different files.

Ah I see... What would you like rclone to do? Save the file with its original name?

Maybe we could make it so if you passed a destination ending in / rclone would use the leaf name of the file in the URL (after any redirection)?

Yes that would be Perfect!

Can you please make a new issue on github about that? And we'll see what we can do!

1 Like