Download Station API Functions

class download_station_api.download_station_api.DownloadStationAPI(user_name: str, password: str, nas_ip: str, api_port: str = '5000', api_endpoint: str = 'webapi')[source]
add_download_task(url: str, destination: str = '')bool[source]
Parameters
  • url – Magnet download URL

  • destination – Relative synology URL. If left blank will take the default of the synology download station

Returns

True or false based on whether or the the download was successfully added

Return type

bool

authenticate(session: str, auth_format: str, method: str, version: int)str[source]

See init for example usage

Parameters
  • session – Authentication session type.

  • auth_format – Authentication format

  • method – Authentication method

  • version – API version to address

bt_search_with_wait(search_term: str, default_search_quality: str = '720p')[source]
Parameters
  • search_term

  • default_search_quality

Returns

Return type

check_if_search_is_done(search_task_id: str, quality_to_search: str)[source]
Parameters
  • search_task_id

  • quality_to_search

Returns

correct_finished_downloads(download_task_id: str)bool[source]

Simple function written for finished downloads, in the case that the download has already completed rather resume it so we can get more info or remove it if the file is no longer there

Parameters

download_task_id

Returns

True if corrected successfully

Return type

bool

get_download_info()Dict[source]

Retrieves a list of current downloads

Returns

Dict containing a list of current downloads along with metadata

Return type

Dict

get_individual_download_info(download_task_id: str)Dict[source]
Parameters

download_task_id

Returns

Return type

remove_download_task(download_task_id: object)bool[source]
Returns

True if removed successfully

Return type

bool

Parameters

download_task_id – Synology task ID, retrieved when getting the download info

resume_download_task(download_task_id: object)bool[source]
Returns

Return type

Return type

object

Parameters

download_task_id – Synology task ID, retrieved when getting the download info

Returns

search(search_term: str, wait_time: int = 30, quality_to_search: str = '720p')object[source]
  • Uses any configured search locations configured for the download station to search

  • Essentially the same as typing in the search bar there

Parameters
  • search_term – Thing to search for

  • wait_time – Time to wait for the search to complete.

  • quality_to_search – Video quality to search for.

Returns

Return type