# bascurtiz/orpheusdl-amazonmusic architecture

> Architecture diagram of the GitHub repository bascurtiz/orpheusdl-amazonmusic, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/bascurtiz/orpheusdl-amazonmusic
- Repository: https://github.com/bascurtiz/orpheusdl-amazonmusic

## Overview

This is an Amazon Music adapter for OrpheusDL. The main workflow accepts a music URL or search request, resolves catalog metadata and region through the module interface, fetches track manifests through the Amazon mobile API, and supports DRM licensing for downloads. The README also documents browser login, quality and spatial-audio settings, and external media tools. Source excerpts are partial, so edges are limited to relationships shown there or stated in the README.

Main entry points: [`interface.py`](https://github.com/bascurtiz/orpheusdl-amazonmusic/blob/main/interface.py) (Module interface), [`azapi.py`](https://github.com/bascurtiz/orpheusdl-amazonmusic/blob/main/azapi.py) (Mobile API client), [`models.py`](https://github.com/bascurtiz/orpheusdl-amazonmusic/blob/main/models.py) (Regions and credentials)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_adapter["OrpheusDL adapter"]
  node_interface["Module interface<br/>[interface.py]"]
  node_models["Regions and credentials<br/>[models.py]"]
  node_catalog["Catalog and search<br/>[interface.py]"]
end

subgraph group_api["Amazon API"]
  node_mobile_api["Mobile API client<br/>[azapi.py]"]
  node_login["Browser login<br/>[azapi.py]"]
end

subgraph group_download["Download support"]
  node_manifest["Track manifests<br/>[interface.py]"]
  node_drm["DRM licensing<br/>[azapi.py]"]
end

node_orpheus(("OrpheusDL"))
node_amazon{{"Amazon Music services"}}
node_media_tools{{"Media processing tools"}}

node_orpheus -->|"invokes"| node_interface
node_interface -->|"resolves requests"| node_catalog
node_interface -->|"uses API client"| node_mobile_api
node_mobile_api -->|"uses credentials"| node_models
node_mobile_api -->|"sends requests"| node_amazon
node_interface -->|"fetches manifests"| node_manifest
node_manifest -->|"gets track manifest"| node_mobile_api
node_mobile_api -->|"requests license"| node_drm
node_interface -.->|"supports sign-in"| node_login
node_manifest -.->|"uses for processing"| node_media_tools

click node_interface "https://github.com/bascurtiz/orpheusdl-amazonmusic/blob/main/interface.py"
click node_models "https://github.com/bascurtiz/orpheusdl-amazonmusic/blob/main/models.py"
click node_mobile_api "https://github.com/bascurtiz/orpheusdl-amazonmusic/blob/main/azapi.py"
click node_login "https://github.com/bascurtiz/orpheusdl-amazonmusic/blob/main/azapi.py"
click node_catalog "https://github.com/bascurtiz/orpheusdl-amazonmusic/blob/main/interface.py"
click node_manifest "https://github.com/bascurtiz/orpheusdl-amazonmusic/blob/main/interface.py"
click node_drm "https://github.com/bascurtiz/orpheusdl-amazonmusic/blob/main/azapi.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_interface,node_models,node_catalog toneBlue
class node_mobile_api,node_login toneAmber
class node_manifest,node_drm toneMint
class node_orpheus,node_amazon,node_media_tools toneIndigo
```

## Components

### OrpheusDL adapter

- [Module interface](https://github.com/bascurtiz/orpheusdl-amazonmusic/blob/main/interface.py): `interface.py`
- [Regions and credentials](https://github.com/bascurtiz/orpheusdl-amazonmusic/blob/main/models.py): `models.py`
- [Catalog and search](https://github.com/bascurtiz/orpheusdl-amazonmusic/blob/main/interface.py): `interface.py`

### Amazon API

- [Mobile API client](https://github.com/bascurtiz/orpheusdl-amazonmusic/blob/main/azapi.py): `azapi.py`
- [Browser login](https://github.com/bascurtiz/orpheusdl-amazonmusic/blob/main/azapi.py): `azapi.py`

### Download support

- [Track manifests](https://github.com/bascurtiz/orpheusdl-amazonmusic/blob/main/interface.py): `interface.py`
- [DRM licensing](https://github.com/bascurtiz/orpheusdl-amazonmusic/blob/main/azapi.py): `azapi.py`

### Other components

- **OrpheusDL**
- **Amazon Music services**
- **Media processing tools**

## Connections

- OrpheusDL → Module interface: invokes (evidence: `README.md`)
- Module interface → Catalog and search: resolves requests (evidence: `interface.py`)
- Module interface → Mobile API client: uses API client (evidence: `interface.py`)
- Mobile API client → Regions and credentials: uses credentials (evidence: `azapi.py`)
- Mobile API client → Amazon Music services: sends requests (evidence: `azapi.py`)
- Module interface → Track manifests: fetches manifests (evidence: `interface.py`)
- Track manifests → Mobile API client: gets track manifest (evidence: `interface.py`)
- Mobile API client → DRM licensing: requests license (evidence: `azapi.py`)
- Module interface → Browser login: supports sign-in (evidence: `README.md`)
- Track manifests → Media processing tools: uses for processing (evidence: `README.md`)
