commit d9b23d4a244fc90bacd5bae8a616508fe0c514e5 Author: MCorange Date: Tue Oct 22 21:54:32 2024 +0300 initial diff --git a/.cargo/config.toml b/.cargo/config.toml new file mode 100644 index 0000000..b807e57 --- /dev/null +++ b/.cargo/config.toml @@ -0,0 +1,3 @@ +[target.aarch64-unknown-linux-gnu] +linker="aarch64-linux-gnu-gcc" + diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b83d222 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/target/ diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..f5030d8 --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,256 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "anstream" +version = "0.6.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" + +[[package]] +name = "anstyle-parse" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" +dependencies = [ + "windows-sys", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8" +dependencies = [ + "anstyle", + "windows-sys", +] + +[[package]] +name = "clap" +version = "4.5.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b97f376d85a664d5837dbae44bf546e6477a679ff6610010f17276f686d867e8" +dependencies = [ + "clap_builder", + "clap_derive", +] + +[[package]] +name = "clap_builder" +version = "4.5.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19bc80abd44e4bed93ca373a0704ccbd1b710dc5749406201bb018272808dc54" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", + "strsim", +] + +[[package]] +name = "clap_derive" +version = "4.5.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ac6a0c7b1a9e9a5186361f67dfa1b88213572f427fb9ab038efb2bd8c582dab" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "clap_lex" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" + +[[package]] +name = "colorchoice" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "is_terminal_polyfill" +version = "1.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" + +[[package]] +name = "proc-macro2" +version = "1.0.89" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "syn" +version = "2.0.82" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83540f837a8afc019423a8edb95b52a8effe46957ee402287f4292fae35be021" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "unicode-ident" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" + +[[package]] +name = "utf8parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "xmpd-cli" +version = "2.0.0" + +[[package]] +name = "xmpd-core" +version = "2.0.0" +dependencies = [ + "clap", + "xmpd-cli", + "xmpd-gui", + "xmpd-manifest", +] + +[[package]] +name = "xmpd-dl" +version = "2.0.0" + +[[package]] +name = "xmpd-gui" +version = "2.0.0" + +[[package]] +name = "xmpd-manifest" +version = "2.0.0" diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..abdd582 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,47 @@ +[workspace] +resolver="2" +members=[ + "xmpd-core", + "xmpd-manifest", + "xmpd-gui", + "xmpd-cli", "xmpd-dl", +# "xmpd-tui" +] + +[workspace.package] +version="2.0.0" +repository="https://git.mcorangehq.xyz/XOR64/xmpd/" +license="GPL-3.0" +authors=[ + "MCorange ", + "xomf " +] + + +[workspace.dependencies] +anstyle = "1.0.6" +anyhow = "1.0.81" +bitflags = { version = "2.6.0", features = ["serde"] } +camino = "1.1.6" +clap = { version = "4.5.4", features = ["derive"] } +eframe = "0.27.2" +egui = { version = "0.27.2", features = ["color-hex"] } +egui_extras = { version = "0.27.2", features = ["all_loaders"] } +env_logger = "0.11.3" +futures = "0.3.30" +html-escape = "0.2.13" +lazy_static = "1.4.0" +libc = "0.2.153" +log = "0.4.21" +notify-rust = "4.11.3" +open = "5.3.0" +regex = "1.11.0" +reqwest = { version = "0.12.3", features = ["blocking", "h2", "http2", "rustls-tls"], default-features = false } +serde = { version = "1.0.197", features = ["derive"] } +serde_json = "1.0.115" +# serde_traitobject = "0.2.8" +tokio = { version = "1.37.0", features = ["macros", "rt-multi-thread", "process", "sync"] } +url = { version = "2.5.0", features = ["serde"] } +uuid = { version = "1.11.0", features = ["serde", "v4"] } +windows = { version = "0.56.0", features = ["Win32_Foundation", "Win32_Storage_FileSystem", "Win32_System_Console"] } +zip-extensions = "0.6.2" diff --git a/README.md b/README.md new file mode 100644 index 0000000..175d631 --- /dev/null +++ b/README.md @@ -0,0 +1,46 @@ +# (XMPD) Xor64 Music Player/Downloader + +An open source music downloader AND player (soon (TM)) + +## Design +Written in rust, it *tries* to be fast, reliable, and actually useful, as it doesnt stream the music from a server where it could be +deleted and lost forever. +It uses [egui](https://www.egui.rs/) for a crossplatform frontend that makes it possible to run almost anywhere. +The music is downloaded via [ytdlp](#Dependencies) and [spotdl](#Dependencies), and converted to your favorite format via [ffmpeg](#Dependencies) + +## Offline usage +Your whole music library is downloaded to your music folder (unless its being ran in standalone mode). Saved in your selected format. +All of the info required to download your songs is stored in 1 file (!). So all you need to backup all of your music is just 1 relatively small file AND you get the added benefit of easily moving your music between devices with just 1 manifest file, 1 executable (and 3 [dependencies](#dependencies)). Just press `download all` and see as all of your playlists appear in your hard drive, powered by Open Source software. + +## Dependencies +[ffmpeg](https://ffmpeg.org/): To convert your music files to your desired format. +[spotdl](https://github.com/spotDL/spotify-downloader): To download music from spotify, because ofcourse spotify had to be the special child +[ytdlp](https://github.com/yt-dlp/yt-dlp): To download music from every single other source + +The rust dependencies can be found in the [Cargo.toml](/Cargo.toml) file. + +## Installation +Just run `xmpd-setup-{version}.sh` for GNU/Linux or `xmpd-setup-{version}.ps1` for Windows! + +## Compilation +Building the amazing xmpd executable is really simple: + - make sure rust is installed by running `cargo --help` + - clone the git repo by running `git clone https://git.mcorangehq.xyz/XOR64/xmpd.git` in your desired directory + - run `cargo build --release` + - The executable should be in `./target/release/xmpd` + +NOTE: If you run the executable from the terminal it will start downloading all of your songs, to open the gui run `xmpd gui`, +for more info run `xmpd --help` + +## Contributing +Fork and clone your repo, you will probably want to use ssh for cloning. +After adding your features or bugfixes push the changes to your fork. +After making sure xmpd works fine, and you havent found any bugs, make a pull request on `https://git.mcorangehq.xyz/XOR64/xmpd/pulls` +If we approve your changes it will be pushed to the main branch, and added to the contributors! + +Current todos are stored in [DEV.md](/DEV.md) + +## Licensing +See [LICENSE.md](/LICENSE.md) for the licensing terms + + diff --git a/assets/app_icon.png b/assets/app_icon.png new file mode 100644 index 0000000..6008cea Binary files /dev/null and b/assets/app_icon.png differ diff --git a/assets/note.svg b/assets/note.svg new file mode 100644 index 0000000..2703d28 --- /dev/null +++ b/assets/note.svg @@ -0,0 +1,19 @@ + + + + + music [#1005] + Created with Sketch. + + + + + + + + + + + + + diff --git a/assets/search.svg b/assets/search.svg new file mode 100644 index 0000000..254407f --- /dev/null +++ b/assets/search.svg @@ -0,0 +1,4 @@ + + + + diff --git a/rust-toolchain.toml b/rust-toolchain.toml new file mode 100644 index 0000000..f02e76c --- /dev/null +++ b/rust-toolchain.toml @@ -0,0 +1,3 @@ +[toolchain] +channel="nightly" + diff --git a/xmpd-cli/Cargo.toml b/xmpd-cli/Cargo.toml new file mode 100644 index 0000000..22df51b --- /dev/null +++ b/xmpd-cli/Cargo.toml @@ -0,0 +1,20 @@ +[package] +name = "xmpd-cli" +edition = "2021" +readme="README.md" +version.workspace = true +authors.workspace = true +repository.workspace = true +license.workspace = true +autobins = false +autotests = false +autoexamples = false + +[features] +default = [] + +[lib] +crate-type = ["rlib"] +bench = false + +[dependencies] diff --git a/xmpd-cli/README.md b/xmpd-cli/README.md new file mode 100644 index 0000000..e69de29 diff --git a/xmpd-cli/src/lib.rs b/xmpd-cli/src/lib.rs new file mode 100644 index 0000000..9815d27 --- /dev/null +++ b/xmpd-cli/src/lib.rs @@ -0,0 +1,3 @@ +pub fn test() { + println!("Hello, world!"); +} diff --git a/xmpd-core/Cargo.toml b/xmpd-core/Cargo.toml new file mode 100644 index 0000000..bfaf2f4 --- /dev/null +++ b/xmpd-core/Cargo.toml @@ -0,0 +1,27 @@ +[package] +name = "xmpd-core" +edition = "2021" +readme="README.md" +version.workspace = true +authors.workspace = true +repository.workspace = true +license.workspace = true +autobins = false +autotests = false +autoexamples = false + +[features] +default=["cli", "gui"] +cli=[] +gui=[] + + +[[bin]] +name="xmpd" +path="src/main.rs" + +[dependencies] +xmpd-cli={ path="../xmpd-cli" } +xmpd-gui={ path="../xmpd-gui" } +xmpd-manifest={ path="../xmpd-manifest" } +clap = { workspace=true } diff --git a/xmpd-core/README.md b/xmpd-core/README.md new file mode 100644 index 0000000..e69de29 diff --git a/xmpd-core/src/main.rs b/xmpd-core/src/main.rs new file mode 100644 index 0000000..83296ff --- /dev/null +++ b/xmpd-core/src/main.rs @@ -0,0 +1,9 @@ + +fn main() { + let args = std::env::args(); + if args.len() > 1 { + // gui + } else { + // cli + } +} diff --git a/xmpd-dl/Cargo.toml b/xmpd-dl/Cargo.toml new file mode 100644 index 0000000..2e6ee85 --- /dev/null +++ b/xmpd-dl/Cargo.toml @@ -0,0 +1,20 @@ +[package] +name = "xmpd-dl" +edition = "2021" +readme="README.md" +authors.workspace = true +version.workspace = true +repository.workspace = true +license.workspace = true +autobins = false +autotests = false +autoexamples = false + +[features] +default = [] + +[lib] +crate-type = ["rlib"] +bench = false + +[dependencies] diff --git a/xmpd-dl/README.md b/xmpd-dl/README.md new file mode 100644 index 0000000..e69de29 diff --git a/xmpd-dl/src/lib.rs b/xmpd-dl/src/lib.rs new file mode 100644 index 0000000..e7a11a9 --- /dev/null +++ b/xmpd-dl/src/lib.rs @@ -0,0 +1,3 @@ +fn main() { + println!("Hello, world!"); +} diff --git a/xmpd-gui/Cargo.toml b/xmpd-gui/Cargo.toml new file mode 100644 index 0000000..bed45e5 --- /dev/null +++ b/xmpd-gui/Cargo.toml @@ -0,0 +1,20 @@ +[package] +name = "xmpd-gui" +edition = "2021" +readme="README.md" +authors.workspace = true +version.workspace = true +repository.workspace = true +license.workspace = true +autobins = false +autotests = false +autoexamples = false + +[features] +default = [] + +[lib] +crate-type = ["rlib"] +bench = false + +[dependencies] diff --git a/xmpd-gui/README.md b/xmpd-gui/README.md new file mode 100644 index 0000000..e69de29 diff --git a/xmpd-gui/src/lib.rs b/xmpd-gui/src/lib.rs new file mode 100644 index 0000000..9815d27 --- /dev/null +++ b/xmpd-gui/src/lib.rs @@ -0,0 +1,3 @@ +pub fn test() { + println!("Hello, world!"); +} diff --git a/xmpd-manifest/Cargo.toml b/xmpd-manifest/Cargo.toml new file mode 100644 index 0000000..8d7bb42 --- /dev/null +++ b/xmpd-manifest/Cargo.toml @@ -0,0 +1,20 @@ +[package] +name = "xmpd-manifest" +edition = "2021" +readme="README.md" +authors.workspace = true +version.workspace = true +repository.workspace = true +license.workspace = true +autobins = false +autotests = false +autoexamples = false + +[features] +default = [] + +[lib] +crate-type = ["rlib"] +bench = false + +[dependencies] diff --git a/xmpd-manifest/README.md b/xmpd-manifest/README.md new file mode 100644 index 0000000..e69de29 diff --git a/xmpd-manifest/src/lib.rs b/xmpd-manifest/src/lib.rs new file mode 100644 index 0000000..9815d27 --- /dev/null +++ b/xmpd-manifest/src/lib.rs @@ -0,0 +1,3 @@ +pub fn test() { + println!("Hello, world!"); +}