File tree Expand file tree Collapse file tree 2 files changed +36
-1
lines changed
Expand file tree Collapse file tree 2 files changed +36
-1
lines changed Original file line number Diff line number Diff line change 1- # MusicBox
1+ <h1 align =" center " id =" title " >Music Box API</h1 >
2+
3+ <p align =" center " ><img src =" https://socialify.git.ci/MusicBoxRaspberryPi/MusicBoxAPI/image?description=1& ; font=Inter& ; language=1& ; name=1& ; owner=1& ; theme=Light " alt =" project-image " ></p >
4+
5+
6+ ## 🛠️ Installation
7+
8+ 1 . Clone the repository ` git clone https://github.com/MusicBoxRaspberryPi/MusicBoxAPI `
9+ 2 . Rename ` .env.dist ` to ` .env `
10+ 3 . Edit ` .env ` to your needs
11+ 4 . Install dependencies ` pip install -r requirements.txt `
12+ 5 . [ Create Spotify App] ( https://developer.spotify.com/dashboard ) with redirect URIs: ` http://localhost:8080 `
13+ 6 . Copy ** Client ID** and ** Client Secret** from _ Spotify App -> Settings -> View client secret_ to ` .env `
14+ 7 . Run ` python -m app.spotify.service ` , webpage should open in your browser and ` .cache ` file should be created
15+
16+ ## 🚀 Usage
17+
18+ - With Docker: ` docker compose up `
19+
20+ - Without Docker: ` python -m app.main `
Original file line number Diff line number Diff line change @@ -93,3 +93,19 @@ def get_devices_count(self) -> int:
9393 def __get_devices_from_api (self ) -> list [Device ]:
9494 devices_json = self .__api .devices ()["devices" ]
9595 return [Device (** device ) for device in devices_json ]
96+
97+
98+ if __name__ == "__main__" :
99+ import dotenv
100+ from app .container import Container
101+
102+ dotenv .load_dotenv ()
103+ container = Container ()
104+
105+ SpotifyService (
106+ client_id = container .config .spotify .client_id (),
107+ client_secret = container .config .spotify .client_secret (),
108+ redirect_uri = container .config .spotify .redirect_uri ()
109+ )
110+
111+ print (".cache file created" )
You can’t perform that action at this time.
0 commit comments