Reworked downloaded now available. Tagging not working
This commit is contained in:
parent
b499c65ac8
commit
438ccdc9d7
4
.gitignore
vendored
4
.gitignore
vendored
@ -1,5 +1,3 @@
|
||||
login.json
|
||||
release.json
|
||||
cookies.txt
|
||||
config.json
|
||||
mcat_dl*
|
||||
.vscode/*
|
||||
|
||||
7
Makefile
7
Makefile
@ -1,4 +1,9 @@
|
||||
srcs += main.cpp
|
||||
srcs += curl_dl.cpp
|
||||
srcs += monstercat_dl.cpp
|
||||
srcs += common.cpp
|
||||
|
||||
all:
|
||||
g++ main.cpp -o mcat_dl
|
||||
g++ ${srcs} -lcurl -o mcat_dl
|
||||
|
||||
.PHONY: all
|
||||
|
||||
53
README
53
README
@ -1,26 +1,42 @@
|
||||
--- Usage ---
|
||||
There must be a file named "login.json" in the working directory with your monstercat credentials.
|
||||
See example_login.json for the template.
|
||||
# Usage
|
||||
There must be a file named "config.json" in the working directory with your monstercat credentials and other configurations.
|
||||
See config_example.json for the template.
|
||||
|
||||
--- JSON Library Source ---
|
||||
# Download File Structure
|
||||
### Release Folder
|
||||
**download_path/Type/YYYY-MM-DD - CatalogID - Artist - Title**
|
||||
* download_path - Set in config.json
|
||||
* Type - Album/EP/Single
|
||||
* YYYY-MM-DD - Release Date in ISO format for easy sorting
|
||||
* Artist/Title - removed featuring artists from "Artist" and added to "Title"
|
||||
|
||||
### Cover
|
||||
* Cover(.jpg/.png) - Full resolution from Monstercat
|
||||
* Cover_small.jpg - 750x750 added to files
|
||||
|
||||
### MP3 and FLAC folders
|
||||
Separate folders if more than 1 track otherwise put in main folder
|
||||
|
||||
### File Naming
|
||||
* Artist - Title.(mp3/flac) - Used when only 1 track
|
||||
|
||||
* Number - Title.(mp3/flac) - Used when track artist **matches** release artist
|
||||
* Number - Artist - Title.(mp3/flac) - Used when track artist **does not match** release artist
|
||||
|
||||
# JSON Library Source
|
||||
https://github.com/nlohmann/json
|
||||
Release - 3.10.5
|
||||
Commit - 4f8fba14066156b73f1189a2b8bd568bde5284c5
|
||||
|
||||
--- id3edit ---
|
||||
https://github.com/rstemmer/id3edit
|
||||
For MP3 tagging
|
||||
id3edit
|
||||
--set-name "Title"
|
||||
--set-album "Album"
|
||||
--set-artist "Artist"
|
||||
--set-track "Track Number"
|
||||
--set-artwork "/path/to/cover"
|
||||
file.mp3
|
||||
# eyeD3
|
||||
https://eyed3.readthedocs.io/en/latest/
|
||||
* For MP3 tagging
|
||||
* TODO: Add info here
|
||||
|
||||
--- metaflac ---
|
||||
# metaflac
|
||||
https://xiph.org/flac/download.html
|
||||
For FLAC tagging
|
||||
```
|
||||
metaflac
|
||||
// Common
|
||||
--preserve-modtime
|
||||
@ -44,11 +60,14 @@ metaflac
|
||||
--dont-use-padding
|
||||
|
||||
file.flac
|
||||
```
|
||||
|
||||
--- imagemagick ---
|
||||
# imagemagick
|
||||
https://imagemagick.org/script/download.php
|
||||
For Image Resizing
|
||||
magick
|
||||
```
|
||||
convert
|
||||
Cover
|
||||
-resize 750x750
|
||||
Cover_small.jpg
|
||||
```
|
||||
|
||||
4
TODO
4
TODO
@ -0,0 +1,4 @@
|
||||
* Rate limit
|
||||
* Use external tools
|
||||
* Download and resize cover before tracks
|
||||
* Tag tracks
|
||||
@ -124,7 +124,11 @@ bool ensure_folder(const string& main_path, const string& folder)
|
||||
|
||||
if (!path_exists(main_path))
|
||||
{
|
||||
return false;
|
||||
error = mkdir(main_path.c_str(), 0775);
|
||||
if (0 != error)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
full_path = build_fname(main_path, folder, "");
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
{
|
||||
"Email": "user@example.ccom",
|
||||
"Email": "user@example.com",
|
||||
"Pass": "password",
|
||||
"download_path": "/path/to/monstercat",
|
||||
"convert_exec": "convert",
|
||||
|
||||
@ -455,8 +455,7 @@ bool Monstercat_DL::download_cover(const string& catalog_id, const string& path)
|
||||
return false;
|
||||
}
|
||||
|
||||
filepath = path;
|
||||
filepath += "Cover";
|
||||
filepath = build_fname(path, "", "Cover");
|
||||
if (0 == out_headers.count("content-type"))
|
||||
{
|
||||
if (nullptr != m_log)
|
||||
@ -572,7 +571,6 @@ bool Monstercat_DL::download_file(const string& file_id, const string& filepath)
|
||||
CURL_DL& curl = CURL_DL::get_handle();
|
||||
bool ok;
|
||||
string url;
|
||||
string filepath;
|
||||
stringstream out_data;
|
||||
ofstream out_file;
|
||||
|
||||
@ -608,5 +606,5 @@ bool Monstercat_DL::download_file(const string& file_id, const string& filepath)
|
||||
out_file << out_data.rdbuf();
|
||||
out_file.close();
|
||||
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user