Skip to content

get_file() function is assuming the download file path is same as file path where the downloads are saved. #41

Closed
@daedaluschan

Description

@daedaluschan

Not sure if I read that correctly.

The parameter "path" is used for

  1. constructing the url

url = ('%s%s' % (self.base_url, api_path)) + '?api=%s&version=%s&method=download&path=%s&mode=%s&_sid=%s' % ( api_name, info['maxVersion'], parse.quote_plus(path), mode, self._sid)

  1. passing as the writing path of the download response.

with session.get(url, stream=True) as r: r.raise_for_status() with open(os.path.basename(path), 'wb') as f:

These 2 would not be the same in most cases.
The function should take 2 separate parameters.

Metadata

Metadata

Assignees

No one assigned

    Labels

    requestimplementation request

    Projects

    • Status

      Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions