diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 82092db..620b447 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -21,7 +21,7 @@ jobs: poetry run python -m pip install nuitka - name: Build run: | - poetry run python -m nuitka main.py --assume-yes-for-downloads --standalone --follow-imports --include-data-dir=assets=assets --include-data-files=config.toml=config.toml --include-data-files=agent.js=agent.js --include-module=mitmproxy_windows + poetry run python -m nuitka main.py --assume-yes-for-downloads --standalone --follow-imports --include-data-dir=assets=assets --include-data-files=config.example.toml=config.toml --include-data-files=agent.js=agent.js --include-module=mitmproxy_windows - name: Rename run: | ren main.dist AppleMusicDecrypt diff --git a/.gitignore b/.gitignore index 287a2f0..c8dc31a 100644 --- a/.gitignore +++ b/.gitignore @@ -160,3 +160,4 @@ cython_debug/ # option (not recommended) you can uncomment the following to ignore the entire idea folder. #.idea/ +config.toml diff --git a/config.example.toml b/config.example.toml new file mode 100644 index 0000000..5ab6570 --- /dev/null +++ b/config.example.toml @@ -0,0 +1,71 @@ +[region] +# Used when the song region cannot be obtained, currently only used for m3u8 command and mitm command +# Recommend value: Your Apple Music's subscription region +defaultStorefront = "jp" +# The language of song metadata. Influence song title, author and other information. +# Simplified Chinese: zh-Hans-CN, Tradidional Chinese(Hong Kong): zh-Hant-HK, Tradidional Chinese(Taiwan): zh-Hant-TW +# English(British): en-GB, English(American): en-US, Japanese: ja, Korean: ko +language = "zh-Hans-CN" + +[[devices]] +# ADB service host of Android device +host = "127.0.0.1" +# ADB service port of Android device +port = 58526 +# For decryption service. This value should not be repeated when using multiple devices +agentPort = 10020 +# The method the script executes commands with Root permissions +# For Magisk user, the recommend value is "su -c". For other Root solutions, the recommend value is "su 0" +# If not sure which method to use, execute “su 0 ls /” and “su -c ls /” respectively in adb shell and choose the output method +suMethod = "su -c" + +[m3u8Api] +# Use zhaarey's m3u8 api to get higher song m3u8. +enable = false +endpoint = "" + +[download] +# Send request to Apple Music through proxy. Only support http and https protocol +proxy = "" +# Number of concurrent song downloads +parallelNum = 1 +# After enabling this feature, if the specified codec does not exist, the script will look for other codec to download +codecAlternative = true +# Priority for script to look for alternative codec +codecPriority = ["alac", "ec3", "ac3", "aac"] +# Encapsulate Atmos(ec-3/ac-3) as M4A and write the song metadata +atmosConventToM4a = true +# Follow the Python Format format (https://docs.python.org/3/library/string.html#formatstrings) +# Available values: +# title, artist, album, album_artist, composer, +# genre, created, track, tracknum, disk, +# record_company, upc, isrc, copyright, +songNameFormat = "{disk}-{tracknum:02d} {title}" +# Ditto +dirPathFormat = "downloads/{album_artist}/{album}" +# Save lyrics as .lrc file +saveLyrics = true +saveCover = true +coverFormat = "jpg" +coverSize = "5000x5000" +# The command to be executed after the song is ripped successfully, passing in the filename parameter. +# Example: "\"C:\\Program Files\\DAUM\\PotPlayer\\PotPlayerMini64.exe\" \"{filename}\"" +# Pay attention to escaping issues +afterDownloaded = "" + +[metadata] +# Metadata to be written to the song +# Available values: +# title, artist, album, album_artist, composer, +# genre, created, track, tracknum, disk, +# record_company, upc, isrc, copyright, +# lyrics, cover +embedMetadata = ["title", "artist", "album", "album_artist", "composer", + "genre", "created", "track", "tracknum", "disk", "lyrics", "cover", "copyright", + "record_company", "upc", "isrc"] + +[mitm] +# The host proxy server listens on +host = "127.0.0.1" +# The port proxy server listens on +port = "11080" \ No newline at end of file diff --git a/config.toml b/config.toml deleted file mode 100644 index faab891..0000000 --- a/config.toml +++ /dev/null @@ -1,33 +0,0 @@ -[region] -defaultStorefront = "jp" -language = "zh_CN" - -[[devices]] -host = "127.0.0.1" -port = 58526 -agentPort = 10020 -suMethod = "su -c" - -[download] -proxy = "" -parallelNum = 1 -codecAlternative = true -codecPriority = ["alac", "ec3", "ac3", "aac"] -atmosConventToM4a = true -songNameFormat = "{disk}-{tracknum:02d} {title}" -dirPathFormat = "downloads/{album_artist}/{album}" -saveLyrics = true -saveCover = true -coverFormat = "jpg" -coverSize = "5000x5000" -afterDownloaded = "" -check = "" - -[metadata] -embedMetadata = ["title", "artist", "album", "album_artist", "composer", - "genre", "created", "track", "tracknum", "disk", "lyrics", "cover", "copyright", - "record_company", "upc", "isrc"] - -[mitm] -host = "127.0.0.1" -port = "11080" \ No newline at end of file