Compare commits
3 Commits
cb8939a3e3
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| cf21d5cd74 | |||
| 7fd7492dc2 | |||
| 49eb64f589 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,3 +1,4 @@
|
||||
config.json
|
||||
cookies.txt
|
||||
mcat_dl*
|
||||
.vscode/*
|
||||
|
||||
16
README.md
16
README.md
@@ -1,9 +1,23 @@
|
||||
# Prerequisites
|
||||
### Ubuntu
|
||||
`apt install build-essential libcurl4-gnutls-dev imagemagick eyeD3 flac`
|
||||
|
||||
### Other OS
|
||||
* make
|
||||
* g++
|
||||
* libcurl
|
||||
* imagemagick (convert executable)
|
||||
* eyeD3 executable
|
||||
* metaflac executable
|
||||
|
||||
# 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.
|
||||
|
||||
Invoke `make` to compile. Requires libcurl.
|
||||
|
||||
Login via browser and export `cid` cookie to cookies.txt (Netscape format)
|
||||
|
||||
Invoke `mcat_dl` with catalog ID as extra arguments to download.
|
||||
|
||||
# Download File Structure
|
||||
@@ -25,7 +39,7 @@ Separate folders if more than 1 track otherwise put in main folder.
|
||||
This is where extended mixes are put into. They are in their original format.
|
||||
|
||||
### File Naming
|
||||
* Artist - Title.(mp3/flac) - Used when only 1 track
|
||||
* 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
|
||||
|
||||
@@ -185,13 +185,13 @@ bool CURL_DL::download(const string& url, ostream* out,
|
||||
curl_easy_reset(m_handle);
|
||||
|
||||
// Enable cookie engine
|
||||
curl_easy_setopt(m_handle, CURLOPT_COOKIEFILE, "");
|
||||
curl_easy_setopt(m_handle, CURLOPT_COOKIEFILE, "cookies.txt");
|
||||
|
||||
// Enable error messages
|
||||
curl_easy_setopt(m_handle, CURLOPT_ERRORBUFFER, m_error);
|
||||
|
||||
// Set User-Agent
|
||||
curl_easy_setopt(m_handle, CURLOPT_USERAGENT, "Internedko Archiver");
|
||||
curl_easy_setopt(m_handle, CURLOPT_USERAGENT, "Internedko Downloader");
|
||||
|
||||
if ((nullptr == params) || (params->count("no-redir") == 0))
|
||||
{
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
{
|
||||
"comment": "This file will attempt to download MCLP001, MCLP001-X, MCLP002, ... MCLP010-X",
|
||||
"prefix": "MCLP",
|
||||
"suffix_try": "-X",
|
||||
"start": 1,
|
||||
"end": 10
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
{
|
||||
"comment": "This file will attempt to download MCS1091, MCS1195, MCS1425, MCS1426",
|
||||
"releases":
|
||||
[
|
||||
"MCS1091",
|
||||
"MCS1195",
|
||||
"MCS1425",
|
||||
"MCS1426"
|
||||
]
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"Email": "USER",
|
||||
"Password": "PASS"
|
||||
}
|
||||
6
main.cpp
6
main.cpp
@@ -160,12 +160,15 @@ int main(int argc, char **argv)
|
||||
json_extract(config, "eyed3_exec", eyed3_exec);
|
||||
json_extract(config, "metaflac_exec", metaflac_exec);
|
||||
|
||||
// Disable LOGIN
|
||||
#if 0
|
||||
ok = mcat.login(email, pass);
|
||||
if (!ok)
|
||||
{
|
||||
cout << "Could not login" << endl;
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (argc < 2)
|
||||
{
|
||||
@@ -331,11 +334,14 @@ int main(int argc, char **argv)
|
||||
}
|
||||
}
|
||||
|
||||
// Disable LOGOUT
|
||||
#if 0
|
||||
ok = mcat.logout();
|
||||
if (!ok)
|
||||
{
|
||||
cout << "Could not log out" << endl;
|
||||
}
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -389,23 +389,24 @@ string Monstercat_DL::calc_track_filename(const Release& release, int track_num)
|
||||
return "";
|
||||
}
|
||||
|
||||
// Determine what we need
|
||||
// Determine whether number is needed
|
||||
if (1 == release.tracks.size())
|
||||
{
|
||||
use_number = false;
|
||||
use_artist = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
use_number = true;
|
||||
if (track->artist == release.artist)
|
||||
{
|
||||
use_artist = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
use_artist = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Determine whether artist is needed
|
||||
if (track->artist == release.artist)
|
||||
{
|
||||
use_artist = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
use_artist = true;
|
||||
}
|
||||
|
||||
// Build filename
|
||||
|
||||
Reference in New Issue
Block a user