Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
dc01b36771
|
@@ -1,2 +0,0 @@
|
||||
[target.aarch64-unknown-linux-gnu]
|
||||
linker="aarch64-linux-gnu-gcc"
|
||||
262
Cargo.lock
generated
262
Cargo.lock
generated
@@ -924,7 +924,7 @@ dependencies = [
|
||||
"cocoa-foundation",
|
||||
"core-foundation",
|
||||
"core-graphics",
|
||||
"foreign-types",
|
||||
"foreign-types 0.5.0",
|
||||
"libc",
|
||||
"objc",
|
||||
]
|
||||
@@ -1046,7 +1046,7 @@ dependencies = [
|
||||
"bitflags 1.3.2",
|
||||
"core-foundation",
|
||||
"core-graphics-types",
|
||||
"foreign-types",
|
||||
"foreign-types 0.5.0",
|
||||
"libc",
|
||||
]
|
||||
|
||||
@@ -1315,6 +1315,15 @@ dependencies = [
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "encoding_rs"
|
||||
version = "0.8.34"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "endi"
|
||||
version = "1.1.0"
|
||||
@@ -1514,6 +1523,15 @@ version = "1.0.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
|
||||
|
||||
[[package]]
|
||||
name = "foreign-types"
|
||||
version = "0.3.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1"
|
||||
dependencies = [
|
||||
"foreign-types-shared 0.1.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "foreign-types"
|
||||
version = "0.5.0"
|
||||
@@ -1521,7 +1539,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965"
|
||||
dependencies = [
|
||||
"foreign-types-macros",
|
||||
"foreign-types-shared",
|
||||
"foreign-types-shared 0.3.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -1535,6 +1553,12 @@ dependencies = [
|
||||
"syn 2.0.77",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "foreign-types-shared"
|
||||
version = "0.1.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b"
|
||||
|
||||
[[package]]
|
||||
name = "foreign-types-shared"
|
||||
version = "0.3.1"
|
||||
@@ -2017,7 +2041,22 @@ dependencies = [
|
||||
"tokio",
|
||||
"tokio-rustls",
|
||||
"tower-service",
|
||||
"webpki-roots",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "hyper-tls"
|
||||
version = "0.6.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"http-body-util",
|
||||
"hyper",
|
||||
"hyper-util",
|
||||
"native-tls",
|
||||
"tokio",
|
||||
"tokio-native-tls",
|
||||
"tower-service",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -2385,7 +2424,7 @@ dependencies = [
|
||||
"bitflags 2.6.0",
|
||||
"block",
|
||||
"core-graphics-types",
|
||||
"foreign-types",
|
||||
"foreign-types 0.5.0",
|
||||
"log",
|
||||
"objc",
|
||||
"paste",
|
||||
@@ -2451,13 +2490,30 @@ dependencies = [
|
||||
"indexmap",
|
||||
"log",
|
||||
"num-traits",
|
||||
"rustc-hash 1.1.0",
|
||||
"rustc-hash",
|
||||
"spirv",
|
||||
"termcolor",
|
||||
"thiserror",
|
||||
"unicode-xid",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "native-tls"
|
||||
version = "0.2.12"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"log",
|
||||
"openssl",
|
||||
"openssl-probe",
|
||||
"openssl-sys",
|
||||
"schannel",
|
||||
"security-framework",
|
||||
"security-framework-sys",
|
||||
"tempfile",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ndk"
|
||||
version = "0.8.0"
|
||||
@@ -2775,6 +2831,50 @@ dependencies = [
|
||||
"pathdiff",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "openssl"
|
||||
version = "0.10.66"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1"
|
||||
dependencies = [
|
||||
"bitflags 2.6.0",
|
||||
"cfg-if",
|
||||
"foreign-types 0.3.2",
|
||||
"libc",
|
||||
"once_cell",
|
||||
"openssl-macros",
|
||||
"openssl-sys",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "openssl-macros"
|
||||
version = "0.1.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.77",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "openssl-probe"
|
||||
version = "0.1.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf"
|
||||
|
||||
[[package]]
|
||||
name = "openssl-sys"
|
||||
version = "0.9.103"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6"
|
||||
dependencies = [
|
||||
"cc",
|
||||
"libc",
|
||||
"pkg-config",
|
||||
"vcpkg",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "orbclient"
|
||||
version = "0.3.47"
|
||||
@@ -3039,54 +3139,6 @@ dependencies = [
|
||||
"memchr",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "quinn"
|
||||
version = "0.11.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b22d8e7369034b9a7132bc2008cac12f2013c8132b45e0554e6e20e2617f2156"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"pin-project-lite",
|
||||
"quinn-proto",
|
||||
"quinn-udp",
|
||||
"rustc-hash 2.0.0",
|
||||
"rustls",
|
||||
"socket2 0.5.7",
|
||||
"thiserror",
|
||||
"tokio",
|
||||
"tracing",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "quinn-proto"
|
||||
version = "0.11.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ba92fb39ec7ad06ca2582c0ca834dfeadcaf06ddfc8e635c80aa7e1c05315fdd"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"rand",
|
||||
"ring",
|
||||
"rustc-hash 2.0.0",
|
||||
"rustls",
|
||||
"slab",
|
||||
"thiserror",
|
||||
"tinyvec",
|
||||
"tracing",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "quinn-udp"
|
||||
version = "0.5.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8bffec3605b73c6f1754535084a85229fa8a30f86014e6c81aeec4abb68b0285"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"once_cell",
|
||||
"socket2 0.5.7",
|
||||
"tracing",
|
||||
"windows-sys 0.52.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "quote"
|
||||
version = "1.0.37"
|
||||
@@ -3219,6 +3271,8 @@ checksum = "f8f4955649ef5c38cc7f9e8aa41761d48fb9677197daea9984dc54f56aad5e63"
|
||||
dependencies = [
|
||||
"base64",
|
||||
"bytes",
|
||||
"encoding_rs",
|
||||
"futures-channel",
|
||||
"futures-core",
|
||||
"futures-util",
|
||||
"h2",
|
||||
@@ -3227,30 +3281,29 @@ dependencies = [
|
||||
"http-body-util",
|
||||
"hyper",
|
||||
"hyper-rustls",
|
||||
"hyper-tls",
|
||||
"hyper-util",
|
||||
"ipnet",
|
||||
"js-sys",
|
||||
"log",
|
||||
"mime",
|
||||
"native-tls",
|
||||
"once_cell",
|
||||
"percent-encoding",
|
||||
"pin-project-lite",
|
||||
"quinn",
|
||||
"rustls",
|
||||
"rustls-pemfile",
|
||||
"rustls-pki-types",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"serde_urlencoded",
|
||||
"sync_wrapper",
|
||||
"system-configuration",
|
||||
"tokio",
|
||||
"tokio-rustls",
|
||||
"tokio-native-tls",
|
||||
"tower-service",
|
||||
"url",
|
||||
"wasm-bindgen",
|
||||
"wasm-bindgen-futures",
|
||||
"web-sys",
|
||||
"webpki-roots",
|
||||
"windows-registry",
|
||||
]
|
||||
|
||||
@@ -3281,12 +3334,6 @@ version = "1.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"
|
||||
|
||||
[[package]]
|
||||
name = "rustc-hash"
|
||||
version = "2.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152"
|
||||
|
||||
[[package]]
|
||||
name = "rustix"
|
||||
version = "0.37.27"
|
||||
@@ -3321,7 +3368,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f2dabaac7466917e566adb06783a81ca48944c6898a1b08b9374106dd671f4c8"
|
||||
dependencies = [
|
||||
"once_cell",
|
||||
"ring",
|
||||
"rustls-pki-types",
|
||||
"rustls-webpki",
|
||||
"subtle",
|
||||
@@ -3370,6 +3416,15 @@ dependencies = [
|
||||
"winapi-util",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "schannel"
|
||||
version = "0.1.24"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e9aaafd5a2b6e3d657ff009d82fbd630b6bd54dd4eb06f21693925cdf80f9b8b"
|
||||
dependencies = [
|
||||
"windows-sys 0.59.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "scoped-tls"
|
||||
version = "1.0.1"
|
||||
@@ -3395,6 +3450,29 @@ dependencies = [
|
||||
"tiny-skia",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "security-framework"
|
||||
version = "2.11.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02"
|
||||
dependencies = [
|
||||
"bitflags 2.6.0",
|
||||
"core-foundation",
|
||||
"core-foundation-sys",
|
||||
"libc",
|
||||
"security-framework-sys",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "security-framework-sys"
|
||||
version = "2.11.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "75da29fe9b9b08fe9d6b22b5b4bcbc75d8db3aa31e639aa56bb62e9d46bfceaf"
|
||||
dependencies = [
|
||||
"core-foundation-sys",
|
||||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "serde"
|
||||
version = "1.0.210"
|
||||
@@ -3677,6 +3755,27 @@ dependencies = [
|
||||
"futures-core",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "system-configuration"
|
||||
version = "0.6.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b"
|
||||
dependencies = [
|
||||
"bitflags 2.6.0",
|
||||
"core-foundation",
|
||||
"system-configuration-sys",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "system-configuration-sys"
|
||||
version = "0.6.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4"
|
||||
dependencies = [
|
||||
"core-foundation-sys",
|
||||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tauri-winrt-notification"
|
||||
version = "0.2.1"
|
||||
@@ -3817,6 +3916,16 @@ dependencies = [
|
||||
"syn 2.0.77",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tokio-native-tls"
|
||||
version = "0.3.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2"
|
||||
dependencies = [
|
||||
"native-tls",
|
||||
"tokio",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tokio-rustls"
|
||||
version = "0.26.0"
|
||||
@@ -3945,7 +4054,7 @@ version = "0.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "deb68604048ff8fa93347f02441e4487594adc20bb8a084f9e564d2b827a0a9f"
|
||||
dependencies = [
|
||||
"rustc-hash 1.1.0",
|
||||
"rustc-hash",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -4036,6 +4145,12 @@ version = "0.2.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821"
|
||||
|
||||
[[package]]
|
||||
name = "vcpkg"
|
||||
version = "0.2.15"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426"
|
||||
|
||||
[[package]]
|
||||
name = "version_check"
|
||||
version = "0.9.5"
|
||||
@@ -4311,15 +4426,6 @@ dependencies = [
|
||||
"web-sys",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "webpki-roots"
|
||||
version = "0.26.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0bd24728e5af82c6c4ec1b66ac4844bdf8156257fccda846ec58b42cd0cdbe6a"
|
||||
dependencies = [
|
||||
"rustls-pki-types",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "wgpu"
|
||||
version = "0.19.4"
|
||||
@@ -4362,7 +4468,7 @@ dependencies = [
|
||||
"parking_lot",
|
||||
"profiling",
|
||||
"raw-window-handle 0.6.2",
|
||||
"rustc-hash 1.1.0",
|
||||
"rustc-hash",
|
||||
"smallvec",
|
||||
"thiserror",
|
||||
"web-sys",
|
||||
@@ -4402,7 +4508,7 @@ dependencies = [
|
||||
"profiling",
|
||||
"raw-window-handle 0.6.2",
|
||||
"renderdoc-sys",
|
||||
"rustc-hash 1.1.0",
|
||||
"rustc-hash",
|
||||
"smallvec",
|
||||
"thiserror",
|
||||
"wasm-bindgen",
|
||||
|
||||
@@ -20,7 +20,7 @@ libc = "0.2.153"
|
||||
log = "0.4.21"
|
||||
notify-rust = "4.11.3"
|
||||
open = "5.3.0"
|
||||
reqwest = { version = "0.12.3", features = ["h2", "http2", "rustls-tls"], default-features = false }
|
||||
reqwest = { version = "0.12.3", features = ["blocking"] }
|
||||
serde = { version = "1.0.197", features = ["derive"] }
|
||||
serde_json = "1.0.115"
|
||||
# serde_traitobject = "0.2.8"
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
if [[ -z "$1" ]]; then
|
||||
echo "Please suppy a version: 0.0.0[a | b | rc-0]"
|
||||
exit
|
||||
fi
|
||||
|
||||
set -e
|
||||
|
||||
cargo build --release --target x86_64-pc-windows-gnu
|
||||
cargo build --release --target x86_64-unknown-linux-gnu
|
||||
cargo build --release --target aarch64-unknown-linux-gnu
|
||||
|
||||
cp ./target/x86_64-pc-windows-gnu/release/mcmg.exe ./target/mcmg_win32.exe
|
||||
cp ./target/x86_64-unknown-linux-gnu/release/mcmg ./target/mcmg_linux_x86_64
|
||||
cp ./target/aarch64-unknown-linux-gnu/release/mcmg ./target/mcmg_linux_aarch64
|
||||
cp ./scripts/setup-template.sh "./target/mcmg-setup-$1.sh"
|
||||
cp ./scripts/setup-template.ps1 "./target/mcmg-setup-$1.ps1"
|
||||
@@ -1,23 +0,0 @@
|
||||
|
||||
$MyInvocation.MyCommand.Name -match '([0-9]+\.[0-9]+\.[0-9]+([ab]|(rc[-]*[0-9]*)))'
|
||||
$Ver = $Matches[1]
|
||||
|
||||
|
||||
if (-not (Get-Command ffmpeg -ErrorAction SilentlyContinue)) {
|
||||
winget install Gyan.FFmpeg
|
||||
}
|
||||
|
||||
if (-not (Get-Command "yt-dlp" -ErrorAction SilentlyContinue)) {
|
||||
winget install "yt-dlp.yt-dlp"
|
||||
}
|
||||
|
||||
if (-not (Get-Command spotdl -ErrorAction SilentlyContinue)) {
|
||||
if (-not (Get-Command python -ErrorAction SilentlyContinue)) {
|
||||
winget install "Python.Python.3.12"
|
||||
}
|
||||
python -m pip install spotdl
|
||||
}
|
||||
|
||||
$url = "https://git.mcorangehq.xyz/XOR64/music/releases/download/$Ver/mcmg_win32.exe"
|
||||
|
||||
Invoke-WebRequest -Uri $url -OutFile "mcmg.exe"
|
||||
@@ -1,42 +0,0 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
PROG_VER=$(echo $0 | grep -o -E "[0-9]+\.[0-9]+\.[0-9]+([ab]|(rc[-]*[0-9]*))")
|
||||
|
||||
echo $PROG_VER
|
||||
|
||||
function cmd_exists() {
|
||||
if ! command -v $1 &> /dev/null
|
||||
then
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
fi
|
||||
}
|
||||
|
||||
if cmd_exists "pacman"; then
|
||||
if cmd_exists "yay"; then
|
||||
yay -Sy --needed ffmpeg yt-dlp spotdl curl
|
||||
else
|
||||
sudo pacman -Sy --needed ffmpeg yt-dlp python python-pip python-pipx curl
|
||||
pipx install spotdl
|
||||
fi
|
||||
fi
|
||||
|
||||
if cmd_exists "apt"; then
|
||||
sudo apt-get update
|
||||
sudo apt-get install python3 python3-pip ffmpeg curl
|
||||
|
||||
# updates all python packages, uncomment if you get errors for packages
|
||||
# pip3 freeze | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip3 install -U
|
||||
python3 -m pip install --upgrade pip
|
||||
python3 -m pip install spotdl
|
||||
python3 -m pip install yt-dlp
|
||||
fi
|
||||
|
||||
curl "https://git.mcorangehq.xyz/XOR64/music/releases/download/${PROG_VER}/mcmg_linux_x86_64" -o mcmg
|
||||
|
||||
|
||||
|
||||
|
||||
37
src/config/downloader/links.rs
Normal file
37
src/config/downloader/links.rs
Normal file
@@ -0,0 +1,37 @@
|
||||
|
||||
|
||||
#[cfg(all(target_os="windows", target_arch="x86_64"))]
|
||||
pub const YTDLP: &str = "https://github.com/yt-dlp/yt-dlp/releases/download/2024.08.06/yt-dlp_min.exe";
|
||||
|
||||
#[cfg(all(target_os="linux", target_arch="x86_64"))]
|
||||
pub const YTDLP: &str = "https://github.com/yt-dlp/yt-dlp/releases/download/2024.08.06/yt-dlp_linux";
|
||||
|
||||
#[cfg(all(target_os="linux", target_arch="aarch64"))]
|
||||
pub const YTDLP: &str = "https://github.com/yt-dlp/yt-dlp/releases/download/2024.08.06/yt-dlp_linux_aarch64";
|
||||
|
||||
#[cfg(all(target_os="windows", target_arch="x86_64"))]
|
||||
pub const SPOTDL: &str = "https://github.com/spotDL/spotify-downloader/releases/download/v4.2.8/spotdl-4.2.8-win32.exe";
|
||||
|
||||
#[cfg(all(target_os="linux", target_arch="x86_64"))]
|
||||
pub const SPOTDL: &str = "https://github.com/spotDL/spotify-downloader/releases/download/v4.2.8/spotdl-4.2.8-linux";
|
||||
|
||||
#[cfg(all(target_os="linux", target_arch="aarch64"))]
|
||||
pub const SPOTDL: &str = "";
|
||||
|
||||
#[cfg(all(target_os="windows", target_arch="x86_64"))]
|
||||
pub const FFMPEG: &str = "https://www.gyan.dev/ffmpeg/builds/ffmpeg-release-essentials.zip";
|
||||
|
||||
#[cfg(all(target_os="linux", target_arch="x86_64"))]
|
||||
pub const FFMPEG: &str = "https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz";
|
||||
|
||||
#[cfg(all(target_os="linux", target_arch="aarch64"))]
|
||||
pub const FFMPEG: &str = "https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-arm64-static.tar.xz";
|
||||
|
||||
|
||||
|
||||
#[cfg(not(any(
|
||||
all(target_os="windows", target_arch="x86_64"),
|
||||
all(target_os="linux", target_arch="x86_64"),
|
||||
all(target_os="linux", target_arch="aarch64"),
|
||||
)))]
|
||||
compile_error!("Target and or Architecture is not supported");
|
||||
111
src/config/downloader/mod.rs
Normal file
111
src/config/downloader/mod.rs
Normal file
@@ -0,0 +1,111 @@
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
use crate::constants::EXEC_EXT;
|
||||
|
||||
mod links;
|
||||
|
||||
pub struct DepDownloader {
|
||||
ytdlp: PathBuf,
|
||||
spotdl: PathBuf,
|
||||
ffmpeg: PathBuf,
|
||||
}
|
||||
|
||||
|
||||
impl DepDownloader {
|
||||
pub fn new() -> anyhow::Result<Self> {
|
||||
if !Path::new(".dep").exists() {
|
||||
std::fs::create_dir(".dep")?;
|
||||
}
|
||||
|
||||
let ytdlp = Self::download_ytdlp()?;
|
||||
|
||||
todo!()
|
||||
}
|
||||
|
||||
fn download_ytdlp() -> anyhow::Result<PathBuf> {
|
||||
if let Some(p) = crate::util::is_program_in_path("yt-dlp") {
|
||||
return Ok(p); // Already exists on pc
|
||||
}
|
||||
|
||||
let mut fp = PathBuf::new();
|
||||
fp.push(".dep");
|
||||
fp.push("yt-dlp");
|
||||
fp.set_extension(EXEC_EXT);
|
||||
|
||||
if fp.exists() {
|
||||
return Ok(fp);
|
||||
}
|
||||
|
||||
let mut f = std::fs::OpenOptions::new()
|
||||
.create_new(true)
|
||||
.write(true)
|
||||
.open(&fp)?;
|
||||
|
||||
let mut req = reqwest::blocking::get(links::YTDLP)?;
|
||||
req.copy_to(&mut f)?;
|
||||
|
||||
Ok(fp)
|
||||
}
|
||||
|
||||
fn download_spotdl() -> anyhow::Result<PathBuf> {
|
||||
if let Some(p) = crate::util::is_program_in_path("spotdl") {
|
||||
return Ok(p); // already exists on pc
|
||||
}
|
||||
|
||||
let mut fp = PathBuf::new();
|
||||
fp.push(".dep");
|
||||
fp.push("spotdl");
|
||||
fp.set_extension(EXEC_EXT);
|
||||
|
||||
if fp.exists() {
|
||||
return Ok(fp);
|
||||
}
|
||||
|
||||
if links::SPOTDL.is_empty() {
|
||||
log::error!("spotdl doesnt support this architecture (probably aarch64)");
|
||||
log::error!("please install it manually, if you have installed it, make sure its accessible in path");
|
||||
anyhow::bail!("");
|
||||
}
|
||||
|
||||
let mut f = std::fs::OpenOptions::new()
|
||||
.create_new(true)
|
||||
.write(true)
|
||||
.open(&fp)?;
|
||||
|
||||
let mut req = reqwest::blocking::get(links::SPOTDL)?;
|
||||
req.copy_to(&mut f)?;
|
||||
|
||||
Ok(fp)
|
||||
}
|
||||
|
||||
fn download_ffmpeg() -> anyhow::Result<PathBuf> {
|
||||
if let Some(p) = crate::util::is_program_in_path("ffmpeg") {
|
||||
return Ok(p); // already exists on pc
|
||||
}
|
||||
|
||||
let mut fp = PathBuf::new();
|
||||
fp.push(".dep");
|
||||
fp.push("ffmpeg");
|
||||
fp.set_extension(EXEC_EXT);
|
||||
|
||||
if fp.exists() {
|
||||
return Ok(fp);
|
||||
}
|
||||
|
||||
if links::FFMPEG.is_empty() {
|
||||
log::error!("spotdl doesnt support this architecture (probably aarch64)");
|
||||
log::error!("please install it manually, if you have installed it, make sure its accessible in path");
|
||||
anyhow::bail!("");
|
||||
}
|
||||
|
||||
let mut f = std::fs::OpenOptions::new()
|
||||
.create_new(true)
|
||||
.write(true)
|
||||
.open(&fp)?;
|
||||
|
||||
let mut req = reqwest::blocking::get(links::FFMPEG)?;
|
||||
req.copy_to(&mut f)?;
|
||||
|
||||
Ok(fp)
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,10 @@
|
||||
pub mod cli;
|
||||
|
||||
pub mod downloader;
|
||||
use std::path::PathBuf;
|
||||
|
||||
use clap::Parser;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use anyhow::Result;
|
||||
use crate::util::{self, isatty};
|
||||
|
||||
use self::cli::CliArgs;
|
||||
|
||||
// const YTDLP_DL_URL: &'static str = "https://github.com/yt-dlp/yt-dlp/archive/refs/heads/master.zip";
|
||||
|
||||
Reference in New Issue
Block a user