mirror of
https://github.com/lifegpc/pixiv_downloader.git
synced 2026-07-05 08:10:30 +08:00
use regex::Regex in pixiv link parse
This commit is contained in:
1
Cargo.lock
generated
1
Cargo.lock
generated
@@ -1279,6 +1279,7 @@ dependencies = [
|
||||
"modular-bitfield",
|
||||
"parse-size",
|
||||
"proc_macros",
|
||||
"regex",
|
||||
"reqwest",
|
||||
"tokio",
|
||||
"url",
|
||||
|
||||
@@ -27,6 +27,7 @@ lazy_static = "1.4"
|
||||
modular-bitfield = "0.11"
|
||||
parse-size = "1"
|
||||
proc_macros = { path = "proc_macros" }
|
||||
regex = "1"
|
||||
reqwest = { version = "0.11", features = ["brotli", "deflate", "gzip", "rustls-tls", "socks", "stream"] }
|
||||
RustyXML = "0.3"
|
||||
tokio = { version = "1.19", features = ["rt", "macros", "rt-multi-thread", "time"] }
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use crate::ext::json::ToJson;
|
||||
use fancy_regex::Regex;
|
||||
use regex::Regex;
|
||||
use json::JsonValue;
|
||||
use reqwest::IntoUrl;
|
||||
use std::convert::TryInto;
|
||||
@@ -28,10 +28,6 @@ impl PixivID {
|
||||
return Some(PixivID::Artwork(num.unwrap()));
|
||||
}
|
||||
let re = RE.captures(s);
|
||||
if re.is_err() {
|
||||
return None;
|
||||
}
|
||||
let re = re.unwrap();
|
||||
if re.is_some() {
|
||||
let r = re.unwrap().name("id");
|
||||
if r.is_some() {
|
||||
|
||||
Reference in New Issue
Block a user