Compare commits
2 commits
edb5ab0abb
...
0b384cee93
Author | SHA1 | Date | |
---|---|---|---|
0b384cee93 | |||
f4f1f1e761 |
7 changed files with 102 additions and 83 deletions
78
Cargo.toml
78
Cargo.toml
|
@ -14,20 +14,7 @@ include = ["/src", "README.md", "LICENSE", "!snapshots"]
|
||||||
[workspace]
|
[workspace]
|
||||||
members = [".", "codegen", "downloader", "cli"]
|
members = [".", "codegen", "downloader", "cli"]
|
||||||
|
|
||||||
[features]
|
[workspace.dependencies]
|
||||||
default = ["default-tls"]
|
|
||||||
|
|
||||||
rss = ["quick-xml"]
|
|
||||||
|
|
||||||
# Reqwest TLS options
|
|
||||||
default-tls = ["reqwest/default-tls"]
|
|
||||||
native-tls = ["reqwest/native-tls"]
|
|
||||||
native-tls-alpn = ["reqwest/native-tls-alpn"]
|
|
||||||
native-tls-vendored = ["reqwest/native-tls-vendored"]
|
|
||||||
rustls-tls-webpki-roots = ["reqwest/rustls-tls-webpki-roots"]
|
|
||||||
rustls-tls-native-roots = ["reqwest/rustls-tls-native-roots"]
|
|
||||||
|
|
||||||
[dependencies]
|
|
||||||
quick-js-dtp = { version = "0.4.1", default-features = false, features = [
|
quick-js-dtp = { version = "0.4.1", default-features = false, features = [
|
||||||
"patch-dateparser",
|
"patch-dateparser",
|
||||||
] }
|
] }
|
||||||
|
@ -36,12 +23,8 @@ regex = "1.6.0"
|
||||||
fancy-regex = "0.13.0"
|
fancy-regex = "0.13.0"
|
||||||
thiserror = "1.0.36"
|
thiserror = "1.0.36"
|
||||||
url = "2.2.2"
|
url = "2.2.2"
|
||||||
reqwest = { version = "0.11.11", default-features = false, features = [
|
reqwest = { version = "0.12.0", default-features = false }
|
||||||
"json",
|
tokio = "1.20.0"
|
||||||
"gzip",
|
|
||||||
"brotli",
|
|
||||||
] }
|
|
||||||
tokio = { version = "1.20.0", features = ["macros", "time"] }
|
|
||||||
serde = { version = "1.0", features = ["derive"] }
|
serde = { version = "1.0", features = ["derive"] }
|
||||||
serde_json = "1.0.82"
|
serde_json = "1.0.82"
|
||||||
serde_with = { version = "3.0.0", default-features = false, features = [
|
serde_with = { version = "3.0.0", default-features = false, features = [
|
||||||
|
@ -58,13 +41,64 @@ time = { version = "0.3.15", features = [
|
||||||
futures = "0.3.21"
|
futures = "0.3.21"
|
||||||
ress = "0.11.4"
|
ress = "0.11.4"
|
||||||
phf = "0.11.1"
|
phf = "0.11.1"
|
||||||
|
phf_codegen = "0.11.1"
|
||||||
base64 = "0.22.0"
|
base64 = "0.22.0"
|
||||||
urlencoding = "2.1.2"
|
urlencoding = "2.1.2"
|
||||||
quick-xml = { version = "0.31.0", features = ["serialize"], optional = true }
|
quick-xml = { version = "0.31.0", features = ["serialize"] }
|
||||||
tracing = { version = "0.1.37", features = ["log"] }
|
tracing = { version = "0.1.37", features = ["log"] }
|
||||||
|
|
||||||
[dev-dependencies]
|
# CLI
|
||||||
|
indicatif = "0.17.0"
|
||||||
|
anyhow = "1.0"
|
||||||
|
clap = { version = "4.0.29", features = ["derive"] }
|
||||||
|
tracing-subscriber = "0.3.17"
|
||||||
|
serde_yaml = "0.9.19"
|
||||||
|
dirs = "5.0.0"
|
||||||
|
filenamify = "0.1.0"
|
||||||
|
|
||||||
|
# Testing
|
||||||
rstest = "0.18.1"
|
rstest = "0.18.1"
|
||||||
tokio-test = "0.4.2"
|
tokio-test = "0.4.2"
|
||||||
insta = { version = "1.17.1", features = ["ron", "redactions"] }
|
insta = { version = "1.17.1", features = ["ron", "redactions"] }
|
||||||
path_macro = "1.0.0"
|
path_macro = "1.0.0"
|
||||||
|
|
||||||
|
[features]
|
||||||
|
default = ["default-tls"]
|
||||||
|
|
||||||
|
rss = ["quick-xml"]
|
||||||
|
|
||||||
|
# Reqwest TLS options
|
||||||
|
default-tls = ["reqwest/default-tls"]
|
||||||
|
native-tls = ["reqwest/native-tls"]
|
||||||
|
native-tls-alpn = ["reqwest/native-tls-alpn"]
|
||||||
|
native-tls-vendored = ["reqwest/native-tls-vendored"]
|
||||||
|
rustls-tls-webpki-roots = ["reqwest/rustls-tls-webpki-roots"]
|
||||||
|
rustls-tls-native-roots = ["reqwest/rustls-tls-native-roots"]
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
quick-js-dtp.workspace = true
|
||||||
|
once_cell.workspace = true
|
||||||
|
regex.workspace = true
|
||||||
|
fancy-regex.workspace = true
|
||||||
|
thiserror.workspace = true
|
||||||
|
url.workspace = true
|
||||||
|
reqwest = { workspace = true, features = ["json", "gzip", "brotli"] }
|
||||||
|
tokio = { workspace = true, features = ["macros", "time"] }
|
||||||
|
serde.workspace = true
|
||||||
|
serde_json.workspace = true
|
||||||
|
serde_with.workspace = true
|
||||||
|
serde_plain.workspace = true
|
||||||
|
rand.workspace = true
|
||||||
|
time.workspace = true
|
||||||
|
ress.workspace = true
|
||||||
|
phf.workspace = true
|
||||||
|
base64.workspace = true
|
||||||
|
urlencoding.workspace = true
|
||||||
|
tracing.workspace = true
|
||||||
|
quick-xml = { workspace = true, optional = true }
|
||||||
|
|
||||||
|
[dev-dependencies]
|
||||||
|
rstest.workspace = true
|
||||||
|
tokio-test.workspace = true
|
||||||
|
insta.workspace = true
|
||||||
|
path_macro.workspace = true
|
||||||
|
|
|
@ -41,14 +41,15 @@ rustls-tls-native-roots = [
|
||||||
[dependencies]
|
[dependencies]
|
||||||
rustypipe = { path = "../", default-features = false }
|
rustypipe = { path = "../", default-features = false }
|
||||||
rustypipe-downloader = { path = "../downloader", default-features = false }
|
rustypipe-downloader = { path = "../downloader", default-features = false }
|
||||||
reqwest = { version = "0.11.11", default_features = false }
|
reqwest.workspace = true
|
||||||
tokio = { version = "1.20.0", features = ["macros", "rt-multi-thread"] }
|
tokio = { workspace = true, features = ["macros", "rt-multi-thread"] }
|
||||||
indicatif = "0.17.0"
|
futures.workspace = true
|
||||||
futures = "0.3.21"
|
serde.workspace = true
|
||||||
anyhow = "1.0"
|
serde_json.workspace = true
|
||||||
clap = { version = "4.0.29", features = ["derive"] }
|
|
||||||
tracing-subscriber = "0.3.17"
|
indicatif.workspace = true
|
||||||
serde = "1.0"
|
anyhow.workspace = true
|
||||||
serde_json = "1.0.82"
|
clap.workspace = true
|
||||||
serde_yaml = "0.9.19"
|
tracing-subscriber.workspace = true
|
||||||
dirs = "5.0.0"
|
serde_yaml.workspace = true
|
||||||
|
dirs.workspace = true
|
||||||
|
|
|
@ -6,24 +6,23 @@ publish = false
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
rustypipe = { path = "../" }
|
rustypipe = { path = "../" }
|
||||||
reqwest = "0.11.11"
|
reqwest.workspace = true
|
||||||
tokio = { version = "1.20.0", features = ["macros", "rt-multi-thread"] }
|
tokio = { workspace = true, features = ["rt-multi-thread"] }
|
||||||
futures = "0.3.21"
|
futures.workspace = true
|
||||||
serde = { version = "1.0", features = ["derive"] }
|
serde.workspace = true
|
||||||
serde_json = "1.0.82"
|
serde_json.workspace = true
|
||||||
serde_with = { version = "3.0.0", default-features = false, features = [
|
serde_with.workspace = true
|
||||||
"macros",
|
once_cell.workspace = true
|
||||||
] }
|
regex.workspace = true
|
||||||
anyhow = "1.0"
|
path_macro.workspace = true
|
||||||
log = "0.4.17"
|
anyhow.workspace = true
|
||||||
env_logger = "0.10.0"
|
tracing.workspace = true
|
||||||
clap = { version = "4.0.29", features = ["derive"] }
|
tracing-subscriber.workspace = true
|
||||||
phf_codegen = "0.11.1"
|
clap.workspace = true
|
||||||
once_cell = "1.12.0"
|
phf_codegen.workspace = true
|
||||||
regex = "1.7.1"
|
indicatif.workspace = true
|
||||||
indicatif = "0.17.0"
|
|
||||||
num_enum = "0.6.1"
|
num_enum = "0.7.2"
|
||||||
path_macro = "1.0.0"
|
|
||||||
intl_pluralrules = "7.0.2"
|
intl_pluralrules = "7.0.2"
|
||||||
unic-langid = "0.9.1"
|
unic-langid = "0.9.1"
|
||||||
ordered_hash_map = { version = "0.2.0", features = ["serde"] }
|
ordered_hash_map = { version = "0.4.0", features = ["serde"] }
|
||||||
|
|
|
@ -46,7 +46,7 @@ enum Commands {
|
||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
async fn main() {
|
async fn main() {
|
||||||
env_logger::init();
|
tracing_subscriber::fmt::init();
|
||||||
let cli = Cli::parse();
|
let cli = Cli::parse();
|
||||||
|
|
||||||
match cli.command {
|
match cli.command {
|
||||||
|
|
|
@ -29,16 +29,14 @@ rustls-tls-native-roots = [
|
||||||
]
|
]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
rustypipe = { path = "..", default-features = false }
|
rustypipe = { path = "../", default-features = false }
|
||||||
once_cell = "1.12.0"
|
once_cell.workspace = true
|
||||||
regex = "1.6.0"
|
regex.workspace = true
|
||||||
thiserror = "1.0.36"
|
thiserror.workspace = true
|
||||||
futures = "0.3.21"
|
futures.workspace = true
|
||||||
indicatif = "0.17.0"
|
reqwest = { workspace = true, features = ["stream"] }
|
||||||
filenamify = "0.1.0"
|
rand.workspace = true
|
||||||
log = "0.4.17"
|
tokio = { workspace = true, features = ["macros", "fs", "process"] }
|
||||||
reqwest = { version = "0.11.11", default-features = false, features = [
|
indicatif.workspace = true
|
||||||
"stream",
|
filenamify.workspace = true
|
||||||
] }
|
tracing.workspace = true
|
||||||
rand = "0.8.5"
|
|
||||||
tokio = { version = "1.20.0", features = ["macros", "fs", "process"] }
|
|
||||||
|
|
|
@ -8,7 +8,6 @@ use std::{borrow::Cow, cmp::Ordering, ffi::OsString, ops::Range, path::PathBuf,
|
||||||
|
|
||||||
use futures::stream::{self, StreamExt};
|
use futures::stream::{self, StreamExt};
|
||||||
use indicatif::{ProgressBar, ProgressStyle};
|
use indicatif::{ProgressBar, ProgressStyle};
|
||||||
use log::{debug, info};
|
|
||||||
use once_cell::sync::Lazy;
|
use once_cell::sync::Lazy;
|
||||||
use rand::Rng;
|
use rand::Rng;
|
||||||
use regex::Regex;
|
use regex::Regex;
|
||||||
|
@ -22,6 +21,7 @@ use tokio::{
|
||||||
io::AsyncWriteExt,
|
io::AsyncWriteExt,
|
||||||
process::Command,
|
process::Command,
|
||||||
};
|
};
|
||||||
|
use tracing::{debug, info};
|
||||||
|
|
||||||
use util::DownloadError;
|
use util::DownloadError;
|
||||||
|
|
||||||
|
|
|
@ -1578,20 +1578,12 @@ async fn music_playlist_not_found(rp: RustyPipe) {
|
||||||
#[case::no_artist("no_artist", "MPREb_bqWA6mAZFWS")]
|
#[case::no_artist("no_artist", "MPREb_bqWA6mAZFWS")]
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn music_album(#[case] name: &str, #[case] id: &str, rp: RustyPipe, unlocalized: bool) {
|
async fn music_album(#[case] name: &str, #[case] id: &str, rp: RustyPipe, unlocalized: bool) {
|
||||||
// TODO: remove visitor data if A/B#13 is stabilized
|
let album = rp.query().music_album(id).await.unwrap();
|
||||||
let album = rp
|
|
||||||
.query()
|
|
||||||
.visitor_data_opt(
|
|
||||||
Some("Cgs1bHFWMlhmM1ZFNCi9jK6vBjIKCgJERRIEEgAgIw%3D%3D")
|
|
||||||
.filter(|_| name == "one_artist"),
|
|
||||||
)
|
|
||||||
.music_album(id)
|
|
||||||
.await
|
|
||||||
.unwrap();
|
|
||||||
|
|
||||||
assert!(!album.cover.is_empty(), "got no cover");
|
assert!(!album.cover.is_empty(), "got no cover");
|
||||||
|
|
||||||
if unlocalized {
|
// TODO: check full snapshot if A/B#13 is stabilized
|
||||||
|
if unlocalized && name != "one_artist" {
|
||||||
insta::assert_ron_snapshot!(format!("music_album_{name}"), album,
|
insta::assert_ron_snapshot!(format!("music_album_{name}"), album,
|
||||||
{".cover" => "[cover]", ".tracks[].view_count" => "[view_count]"}
|
{".cover" => "[cover]", ".tracks[].view_count" => "[view_count]"}
|
||||||
);
|
);
|
||||||
|
@ -2177,11 +2169,6 @@ async fn music_search_playlists_community(rp: RustyPipe) {
|
||||||
assert_eq!(channel.id, "UCs72iRpTEuwV3y6pdWYLgiw");
|
assert_eq!(channel.id, "UCs72iRpTEuwV3y6pdWYLgiw");
|
||||||
assert_eq!(channel.name, "Redlist - Just Hits");
|
assert_eq!(channel.name, "Redlist - Just Hits");
|
||||||
assert!(!playlist.from_ytm);
|
assert!(!playlist.from_ytm);
|
||||||
|
|
||||||
assert!(
|
|
||||||
res.items.items.iter().all(|p| !p.from_ytm),
|
|
||||||
"ytm items found"
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The YouTube Music search sometimes shows genre radio items. They should be skipped.
|
/// The YouTube Music search sometimes shows genre radio items. They should be skipped.
|
||||||
|
|
Loading…
Reference in a new issue