diff --git a/Diagramme.drawio b/Diagramme.drawio index 01ce08a..6f12a51 100644 --- a/Diagramme.drawio +++ b/Diagramme.drawio @@ -1,102 +1,102 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Diagramme.drawio.png b/Diagramme.drawio.png index b718478..68188d2 100644 Binary files a/Diagramme.drawio.png and b/Diagramme.drawio.png differ diff --git a/README.md b/README.md index 7d75540..b407bfc 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,70 @@ +# AppleMusicExporter + +AppleMusicExporter est un projet conçu pour exporter les musiques depuis Apple Music en temps réel. AppleMusicExporter utilise [AppleScript](https://developer.apple.com/library/archive/documentation/AppleScript/Conceptual/AppleScriptLangGuide/introduction/ASLR_intro.html) pour les interactions avec Apple Music. + ![music player](Music-Player.gif) ![diagramme](Diagramme.drawio.png) -![test](Diagramme.drawio) +## Dépendances : + +### Back : + - flask + - python-dotenv (optionnel) + - requests + +### User : + - colorthief + - python-dotenv + - requests + +## Install : +### Back : +```bash +git clone https://github.com/NohamR/AM-Exporter.git +cd back +``` +Créer le fichier .users avec les utilisateurs et leurs mots de passe hashés ([.user.example](back/.users.example)). +```bash +docker build -t amexporter . +``` +```bash +docker run -d -p 3005:3005 amexporter +``` +Ou +```bash +docker-compose up -d +``` + +### User : +```bash +git clone https://github.com/NohamR/AM-Exporter.git +cd user +python install -r requirements.txt +``` +Configuer [music-exp.plist](user/music-exp.plist) sur l'exemple de [music-exp.plist.example](user/music-exp.plist.example) : +PYTHON_PATH +WORKING_DIRECTORY +```bash +./install.sh +``` + +Logs can but found in the working direcrtory : +```bash +cd WORKING_DIRECTORY +tail -f error_logfile.log +tail -f logfile.log +``` + +### Front : +Un exemple d'implémentation de l'api est disponible dans [front-example](front-example). +![screen.png](front-example/screen.png) + +## Uninstall : +```bash +cd user +./unistall.sh +``` # To do : -- readme - make script proper -- comment - -tail -f logfile.log \ No newline at end of file +- comment \ No newline at end of file diff --git a/back/.users.example b/back/.users.example new file mode 100644 index 0000000..fce7234 --- /dev/null +++ b/back/.users.example @@ -0,0 +1,3 @@ +{ + "user": "hashed_password" +} \ No newline at end of file diff --git a/back/docker-compose.yaml b/back/docker-compose.yaml index f0a6ad9..ecfa4de 100644 --- a/back/docker-compose.yaml +++ b/back/docker-compose.yaml @@ -1,4 +1,4 @@ -name: applemusicexporter +name: amexporter services: app: cpu_shares: 90 @@ -11,7 +11,7 @@ services: - PGID=1000 - PUID=1000 - TZ=Europe/Paris - image: applemusicexporter + image: amexporter labels: icon: https://noh.am/static/assets/music.png ports: @@ -21,7 +21,7 @@ services: restart: unless-stopped # volumes: # - type: bind - # source: /DATA/AppData/applemusicexporter + # source: /DATA/AppData/amexporter # target: /hard x-casaos: envs: @@ -42,7 +42,7 @@ services: container_name: "" networks: default: - name: applemusicexporter + name: amexporter x-casaos: architectures: - amd64 @@ -55,9 +55,9 @@ x-casaos: main: app port_map: "3005" scheme: http - store_app_id: applemusicexporter + store_app_id: amexporter tagline: - en_us: applemusicexporter + en_us: amexporter title: - custom: applemusicexporter - en_us: applemusicexporter + custom: amexporter + en_us: amexporter diff --git a/back/requirements.txt b/back/requirements.txt index 0da3071..4c606c6 100644 --- a/back/requirements.txt +++ b/back/requirements.txt @@ -1,2 +1,2 @@ Flask==3.0.2 -Flask_Cors==4.0.0 \ No newline at end of file +Flask_Cors==4.0.0 diff --git a/front-example/screen.png b/front-example/screen.png new file mode 100644 index 0000000..0103c23 Binary files /dev/null and b/front-example/screen.png differ diff --git a/user/music-exp.plist.example b/user/music-exp.plist.example new file mode 100644 index 0000000..85402cc --- /dev/null +++ b/user/music-exp.plist.example @@ -0,0 +1,23 @@ + + + + + KeepAlive + + Label + am.noh.music-exp + ProgramArguments + + PYTHON_PATH + export.py + + RunAtLoad + + StandardOutPath + logfile.log + StandardErrorPath + error_logfile.log + WorkingDirectory + WORKING_DIRECTORY + + diff --git a/user/requirements.txt b/user/requirements.txt new file mode 100644 index 0000000..e647ac6 --- /dev/null +++ b/user/requirements.txt @@ -0,0 +1,3 @@ +colorthief==0.2.1 +python-dotenv==1.0.1 +Requests==2.31.0