gamdl
2.3.7
用於下載 Apple Music 歌曲/音樂影片/貼文的 Python CLI 應用程式。
不和諧伺服器: https://discord.gg/aBjMEZ9tnq
以下工具是可選的,但特定功能是必要的。將它們新增至系統的 PATH 或使用命令列參數或設定檔指定它們的路徑。
mp4box
設定為 remux 模式、下載音樂影片和下載非舊格式的歌曲時需要。mp4box
設定為 remux 模式時需要。nm3u8dlre
設定為下載模式時需要。 gamdl
包pip install gamdl
cookies.txt
運行 Gamdl 的目前目錄,也可以使用命令列參數/設定檔指定其路徑。 gamdl [OPTIONS] URLS...
Gamdl 支援以下類型的 URL:
gamdl " https://music.apple.com/us/album/never-gonna-give-you-up-2022-remaster/1624945511?i=1624945512 "
gamdl " https://music.apple.com/us/album/whenever-you-need-somebody-2022-remaster/1624945511 "
gamdl " https://music.apple.com/us/artist/rick-astley/669771 "
可以使用命令列參數或設定檔來設定 Gamdl。
當您首次執行 Gamdl 時,會自動建立設定文件,在 Linux 上位於~/.gamdl/config.json
,在 Windows 上位於%USERPROFILE%.gamdlconfig.json
。
可以使用命令列參數覆蓋設定檔值。
命令列參數/設定檔密鑰 | 描述 | 預設值 |
---|---|---|
--disable-music-video-skip / disable_music_video_skip | 不要跳過下載專輯/播放清單中的音樂影片。 | false |
--save-cover , -s / save_cover | 將封面另存為單獨的文件。 | false |
--overwrite / overwrite | 覆蓋現有文件。 | false |
--read-urls-as-txt , -r / - | 將 URL 解釋為包含由換行符號分隔的 URL 的文字檔案的路徑。 | false |
--save-playlist save_playlist | 下載播放清單時儲存 M3U8 播放清單檔案。 | false |
--synced-lyrics-only / synced_lyrics_only | 僅下載同步的歌詞。 | false |
--no-synced-lyrics / no_synced_lyrics | 不要下載同步的歌詞。 | false |
--config-path /- | 設定檔的路徑。 | <home>/.gamdl/config.json |
--log-level / log_level | 日誌等級。 | INFO |
--no-exceptions / no_exceptions | 不要列印異常。 | false |
--cookies-path , -c / cookies_path | .txt cookies 檔案的路徑。 | ./cookies.txt |
--language , -l / language | 元資料語言作為 ISO-2A 語言代碼(並非總是適用於影片)。 | en-US |
--output-path , -o / output_path | 輸出目錄的路徑。 | ./Apple Music |
--temp-path / temp_path | 暫存目錄的路徑。 | ./temp |
--wvd-path / wvd_path | .wvd 檔案的路徑。 | null |
--nm3u8dlre-path / nm3u8dlre_path | N_m3u8DL-RE 二進位檔案的路徑。 | N_m3u8DL-RE |
--mp4decrypt-path / mp4decrypt_path | mp4decrypt 二進位檔案的路徑。 | mp4decrypt |
--ffmpeg-path / ffmpeg_path | FFmpeg 二進位檔案的路徑。 | ffmpeg |
--mp4box-path / mp4box_path | MP4Box 二進位檔案的路徑。 | MP4Box |
--download-mode / download_mode | 下載模式。 | ytdlp |
--remux-mode / remux_mode | 混用模式。 | ffmpeg |
--cover-format / cover_format | 封面格式。 | jpg |
--template-folder-album / template_folder_album | 專輯中曲目的範本資料夾。 | {album_artist}/{album} |
--template-folder-compilation / template_folder_compilation | 包含合輯專輯中曲目的範本資料夾。 | Compilations/{album} |
--template-file-single-disc / template_file_single_disc | 單光盤專輯中曲目的範本檔案。 | {track:02d} {title} |
--template-file-multi-disc / template_file_multi_disc | 多光盤專輯中曲目的範本檔案。 | {disc}-{track:02d} {title} |
--template-folder-no-album / template_folder_no_album | 不屬於專輯的曲目的模板資料夾。 | {artist}/Unknown Album |
--template-file-no-album / template_file_no_album | 不屬於專輯的曲目的範本檔案。 | {title} |
--template-file-playlist / template_file_playlist | M3U8 播放清單的範本檔案。 | Playlists/{playlist_title} |
--template-date / template_date | 日期標籤模板。 | %Y-%m-%dT%H:%M:%SZ |
--exclude-tags / exclude_tags | 要排除的以逗號分隔的標籤。 | null |
--cover-size / cover_size | 封面尺寸。 | 1200 |
--truncate / truncate | 文件/資料夾名稱的最大長度。 | null |
--codec-song / codec_song 歌曲 | 歌曲編解碼器。 | aac-legacy |
--synced-lyrics-format / synced_lyrics_format | 同步歌詞格式。 | lrc |
--codec-music-video / codec_music_video | 音樂影片編解碼器。 | h264 |
--quality-post / quality_post | 發布影片品質。 | best |
--no-config-file , -n / - | 不要使用設定檔。 | false |
以下變數可以在範本資料夾/檔案和/或exclude_tags
清單中使用:
album
album_artist
album_id
album_sort
artist
artist_id
artist_sort
comment
compilation
composer
composer_id
composer_sort
copyright
cover
date
disc
disc_total
gapless
genre
genre_id
lyrics
media_type
playlist_artist
playlist_id
playlist_title
playlist_track
rating
storefront
title
title_id
title_sort
track
track_total
xid
可以使用以下再復用模式:
ffmpeg
mp4box
可以使用以下下載模式:
ytdlp
nm3u8dlre
ytdlp
快以下編解碼器可用:
aac-legacy
aac-he-legacy
以下編解碼器也可用,但不保證正常工作,因為目前大多數(或全部)歌曲在使用它們時無法下載:
aac
aac-he
aac-binaural
aac-downmix
aac-he-binaural
aac-he-downmix
atmos
ac3
alac
ask
以下編解碼器可用:
h264
(高達 1080p,AAC 256kbps)h265
(高達 2160p,AAC 256kpbs)ask
具有以下品質:
best
(高達 1080p,AAC 256kbps)ask
發布影片不需要重新混合,並且僅限於ytdlp
下載模式。
可以使用以下同步歌詞格式:
lrc
srt
ttml
可使用以下封面格式:
jpg
png
raw
save_cover
選項將封面儲存為單獨的檔案。