fidodone
(FiDO)
December 6, 2024, 2:13am
1
I can create a shortcut normally using rclone:
rclone backend shortcut drive: source_item -o target=drive2: destination_shortcut
but I'd like to know how to do this using rclone rcd with python, it could be with rclone rc via subprocess or even http
fidodone
(FiDO)
December 6, 2024, 2:37am
2
after studying a bit more about the rclone api I managed to make it work
import json
import requests
backend_url = "http://localhost:5572/backend/command"
auth = ("username", "password")
data = {
"command": "shortcut",
"fs": "remotename:",
"arg": ["source_file.foo", "destination_file.bar"],
}
headers = {"Content-Type": "application/json"}
response = requests.post(backend_url, auth=auth, data=json.dumps(data), headers=headers)
print(response.json())
Here's an example for anyone who needs this in the future
Yes, you can create a Google Drive shortcut using rclone rc
or via HTTP by utilizing the rc
commands to interact with rclone's remote control API. Ensure you specify the correct parameters for the operations/shortcut
function.