duplicity.backends.adbackend module

class duplicity.backends.adbackend.ADBackend(parsed_url)[source]

Bases: Backend

Backend for Amazon Drive. It communicates directly with Amazon Drive using their RESTful API and does not rely on externally setup software (like acd_cli).

CLIENT_ID = 'amzn1.application-oa2-client.791c9c2d78444e85a32eb66f92eb6bcc'
CLIENT_SECRET = '5b322c6a37b25f16d848a6a556eddcc30314fc46ae65c87068ff1bc4588d715b'
MULTIPART_BOUNDARY = 'DuplicityFormBoundaryd66364f7f8924f7e9d478e19cf4b871d114a1e00262542'
OAUTH_AUTHORIZE_URL = 'https://www.amazon.com/ap/oa'
OAUTH_REDIRECT_URL = 'https://breunig.xyz/duplicity/copy.html'
OAUTH_SCOPE = ['clouddrive:read_other', 'clouddrive:write']
OAUTH_TOKEN_PATH = '/root/.duplicity_ad_oauthtoken.json'
OAUTH_TOKEN_URL = 'https://api.amazon.com/auth/o2/token'

Delete file from Amazon Drive

_get(remote_filename, local_path)[source]

Download file from Amazon Drive


List files in Amazon Drive backup folder

_put(source_path, remote_filename)[source]

Upload a local file to Amazon Drive


Retrieve file size info from Amazon Drive


Find id of remote file in backup target folder


Setup or refresh oauth2 session with Amazon Drive

mkdir(parent_node_id, folder_name)[source]

Create a new folder as a child of a parent node

multipart_stream(metadata, source_path)[source]

Generator for multipart/form-data file upload from source file


Report error when file already existed in location and delete it


Iterates over nodes API URL until all pages were read


Resolve node id for remote backup target folder