This commit is contained in:
Gvidas Juknevičius 2024-10-22 21:54:32 +03:00
commit d9b23d4a24
Signed by: MCorange
GPG Key ID: 12B1346D720B7FBB
24 changed files with 507 additions and 0 deletions

3
.cargo/config.toml Normal file
View File

@ -0,0 +1,3 @@
[target.aarch64-unknown-linux-gnu]
linker="aarch64-linux-gnu-gcc"

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/target/

256
Cargo.lock generated Normal file
View File

@ -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"

47
Cargo.toml Normal file
View File

@ -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 <mcorange@mcorangehq.xyz>",
"xomf <xomf@the-atf-shot-my.dog>"
]
[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"

46
README.md Normal file
View File

@ -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

BIN
assets/app_icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

19
assets/note.svg Normal file
View File

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
<svg width="800px" height="800px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>music [#1005]</title>
<desc>Created with Sketch.</desc>
<defs>
</defs>
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Dribbble-Light-Preview" transform="translate(-260.000000, -3759.000000)" fill="#ffffff">
<g id="icons" transform="translate(56.000000, 160.000000)">
<path d="M224,3601.05129 L224,3610.55901 C224,3612.90979 222.17612,3614.95492 219.888035,3614.89646 C217.266519,3614.82877 215.248971,3612.1662 216.234285,3609.31593 C216.777356,3607.74464 218.297755,3606.71797 219.920978,3606.69233 C220.695653,3606.68105 220.976173,3606.88208 222.003416,3607.24105 L222.003416,3604.12822 C222.003416,3603.56207 221.556181,3603.10258 221.005124,3603.10258 L213.018786,3603.10258 C212.467729,3603.10258 212.020494,3603.56207 212.020494,3604.12822 L212.020494,3614.65851 C212.020494,3617.02057 210.179644,3619.07289 207.881575,3618.99801 C205.681339,3618.92622 203.914362,3617.02775 204.00321,3614.73031 C204.090061,3612.51594 205.989811,3610.84209 208.147121,3610.79081 C209.166377,3610.76619 209.352059,3610.92619 210.02391,3611.34363 L210.02391,3601.05129 C210.02391,3599.91795 210.91838,3599 212.020494,3599 L222.003416,3599 C223.106529,3599 224,3599.91795 224,3601.05129" id="music-[#1005]">
</path>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

4
assets/search.svg Normal file
View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?><!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
<svg width="800px" height="800px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M11 6C13.7614 6 16 8.23858 16 11M16.6588 16.6549L21 21M19 11C19 15.4183 15.4183 19 11 19C6.58172 19 3 15.4183 3 11C3 6.58172 6.58172 3 11 3C15.4183 3 19 6.58172 19 11Z" stroke="#ffffff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 493 B

3
rust-toolchain.toml Normal file
View File

@ -0,0 +1,3 @@
[toolchain]
channel="nightly"

20
xmpd-cli/Cargo.toml Normal file
View File

@ -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]

0
xmpd-cli/README.md Normal file
View File

3
xmpd-cli/src/lib.rs Normal file
View File

@ -0,0 +1,3 @@
pub fn test() {
println!("Hello, world!");
}

27
xmpd-core/Cargo.toml Normal file
View File

@ -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 }

0
xmpd-core/README.md Normal file
View File

9
xmpd-core/src/main.rs Normal file
View File

@ -0,0 +1,9 @@
fn main() {
let args = std::env::args();
if args.len() > 1 {
// gui
} else {
// cli
}
}

20
xmpd-dl/Cargo.toml Normal file
View File

@ -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]

0
xmpd-dl/README.md Normal file
View File

3
xmpd-dl/src/lib.rs Normal file
View File

@ -0,0 +1,3 @@
fn main() {
println!("Hello, world!");
}

20
xmpd-gui/Cargo.toml Normal file
View File

@ -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]

0
xmpd-gui/README.md Normal file
View File

3
xmpd-gui/src/lib.rs Normal file
View File

@ -0,0 +1,3 @@
pub fn test() {
println!("Hello, world!");
}

20
xmpd-manifest/Cargo.toml Normal file
View File

@ -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]

0
xmpd-manifest/README.md Normal file
View File

3
xmpd-manifest/src/lib.rs Normal file
View File

@ -0,0 +1,3 @@
pub fn test() {
println!("Hello, world!");
}