Download

Inheritance diagram of musify.processors.download

Processor that helps user download songs from collections based on given configuration.

Classes:

ItemDownloadHelper([urls, fields, interval])

Runs operations for helping the user to download items from given collections.

class musify.processors.download.ItemDownloadHelper(urls=(), fields=Fields.ALL, interval=1)

Bases: InputProcessor

Runs operations for helping the user to download items from given collections.

Parameters:
  • urls (Union[str, Iterable[str]] (default: ())) – The template URLs for websites to open queries for. The given sites should contain exactly 1 ‘{}’ placeholder into which the processor can place a query for the item being searched. e.g. bandcamp.com/search?q={}&item_type=t

  • fields (Union[Field, Iterable[Field]] (default: <Fields.ALL: 0>)) – The default fields to take from an item for use as the query string when initially opening sites.

  • interval (int (default: 1)) – The number of items to open sites for before pausing for user input.

Attributes:

urls

fields

interval

Methods:

open_sites(collections)

Run the download helper.

as_dict()

Return a dictionary representation of the key attributes of this object.

urls: list[str]
fields: list[Field]
interval
open_sites(collections)

Run the download helper.

Opens the formatted urls for each item in all given collections in the user’s browser.

Return type:

None

as_dict()

Return a dictionary representation of the key attributes of this object.

Return type:

dict[str, Any]

The results of this function are used to produce the following:
  • A JSON representation of the object when calling json()

  • The string representation of the object when calling str() on the object

  • The representation of the object when calling repr() on the object