aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md6
-rw-r--r--index.js9
-rw-r--r--package.json2
3 files changed, 13 insertions, 4 deletions
diff --git a/README.md b/README.md
index a3b0ca9..c9c04e1 100644
--- a/README.md
+++ b/README.md
@@ -21,14 +21,16 @@ First, go to the folder where you downloaded the source code (the folder where t
On Windows (PowerShell):
```
-node .\index.js <your YouTube playlist ID>
+node .\index.js <your YouTube playlist ID> [album name]
```
On POSIX systems (Linux, macOS, *BSD, ...):
```
-./youtoo <your YouTube playlist ID>
+./youtoo <your YouTube playlist ID> [album name]
```
+> Argument `[album name]` is optional. If used, YouToo will make it so that all the songs belong to the same album rather than the auto-detected albums. Useful to keep playlists organized.
+
After running this command (and after waiting while it runs), you get the final audio files in `./_youtoo/Result`, it is suggested that you keep these here for syncing to work (e.g. use a symbolic link).
## How does it work?
diff --git a/index.js b/index.js
index aa7247e..59679f8 100644
--- a/index.js
+++ b/index.js
@@ -30,6 +30,13 @@
console.log("Please specify playlist ID");
}
+ if (process.argv[3] !== undefined) {
+ global.overrideAlbum = true;
+ global.overrideAlbumName = process.argv[3];
+ } else {
+ global.overrideAlbum = false;
+ }
+
console.log("Preparing folder structure...");
if (!fs.existsSync("./_youtoo")) fs.mkdirSync("./_youtoo");
if (!fs.existsSync("./_youtoo/Dumps")) fs.mkdirSync("./_youtoo/Dumps");
@@ -79,7 +86,7 @@
video: metadata.title,
title: songTitle,
date: metadata.release_year ?? (metadata.upload_date.substring(0, 4) - 1 +1),
- album: metadata.album ?? ((metadata.track ?? metadata.alt_title ?? metadata.title).replace(/^([:\"'a-zA-Z0-9 .\-*\_\/\\,&]*)-( |)(.*)(\[(.*)\]|)/gm, "$3").replace(/(.*)\((feat|ft|with)(\.|:| |)(| |)([:\"'a-zA-Z0-9 .\-*\_\/\\,&]*)\)(.*)/gmi, "$1").replace(/(.*)\[(.*)\](.*)/gm, "$1").replace(/(.*)\((from|in|by)(\.|:| |)(| |)([:\"'a-zA-Z0-9 .\-*\_\/\\,&]*)\)(.*)/gmi, "$1").trim()),
+ album: overrideAlbum ? overrideAlbumName : metadata.album ?? ((metadata.track ?? metadata.alt_title ?? metadata.title).replace(/^([:\"'a-zA-Z0-9 .\-*\_\/\\,&]*)-( |)(.*)(\[(.*)\]|)/gm, "$3").replace(/(.*)\((feat|ft|with)(\.|:| |)(| |)([:\"'a-zA-Z0-9 .\-*\_\/\\,&]*)\)(.*)/gmi, "$1").replace(/(.*)\[(.*)\](.*)/gm, "$1").replace(/(.*)\((from|in|by)(\.|:| |)(| |)([:\"'a-zA-Z0-9 .\-*\_\/\\,&]*)\)(.*)/gmi, "$1").trim()),
potentialArtists: partists,
potentialArtists2: partists2,
artists: artistsList,
diff --git a/package.json b/package.json
index ee3a1ee..c3e3eca 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "youtoo",
- "version": "1.2.25",
+ "version": "1.2.26",
"description": "A program that downloads, sorts and names music from YouTube",
"main": "index.js",
"scripts": {