mirror of
https://codeberg.org/icewind/ugc-scaper.git
synced 2026-06-03 10:14:11 +02:00
fix non hl match page
This commit is contained in:
parent
94501b4d76
commit
bc9a4bffdd
5 changed files with 15 additions and 7 deletions
2
Cargo.lock
generated
2
Cargo.lock
generated
|
|
@ -1845,7 +1845,7 @@ checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b"
|
|||
|
||||
[[package]]
|
||||
name = "ugc-scraper"
|
||||
version = "0.4.2"
|
||||
version = "0.4.3"
|
||||
dependencies = [
|
||||
"insta",
|
||||
"main_error",
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "ugc-scraper"
|
||||
version = "0.4.2"
|
||||
version = "0.4.3"
|
||||
edition = "2021"
|
||||
rust-version = "1.71.1"
|
||||
description = "Scraper for ugcleague.com"
|
||||
|
|
|
|||
4
api-server/Cargo.lock
generated
4
api-server/Cargo.lock
generated
|
|
@ -2019,9 +2019,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "ugc-scraper"
|
||||
version = "0.4.2"
|
||||
version = "0.4.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "10e71ed553700c0e6dae5eb2bbd9cac6951499273f8b65772c67e1ad12fe646a"
|
||||
checksum = "c4e748e05bd670b1a0bab1c4c66d4e0d0d6e8eb83cad781adeccd4a45e9142d9"
|
||||
dependencies = [
|
||||
"reqwest",
|
||||
"scraper",
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@ edition = "2021"
|
|||
[dependencies]
|
||||
tokio = { version = "1.34.0", features = ["macros", "rt-multi-thread", "rt", "signal"] }
|
||||
main_error = "0.1.2"
|
||||
# ugc-scraper = { version = "0.4.1", path = ".." }
|
||||
ugc-scraper = "0.4.2"
|
||||
#ugc-scraper = { version = "*", path = ".." }
|
||||
ugc-scraper = "0.4.3"
|
||||
axum = "0.7.4"
|
||||
steamid-ng = "1.0.0"
|
||||
thiserror = "1.0.50"
|
||||
|
|
|
|||
10
src/lib.rs
10
src/lib.rs
|
|
@ -41,8 +41,16 @@ impl Default for UgcClient {
|
|||
/// "API client" for ugc by scraping the website
|
||||
impl UgcClient {
|
||||
pub fn new() -> Self {
|
||||
let redirect_policy = Policy::custom(|attempt| {
|
||||
// the different matchpage_* redirect to each other if you use the match id from a different game mode
|
||||
if attempt.url().path().contains("matchpage_") {
|
||||
attempt.follow()
|
||||
} else {
|
||||
attempt.stop()
|
||||
}
|
||||
});
|
||||
UgcClient {
|
||||
client: Client::builder().redirect(Policy::none()).build().unwrap(),
|
||||
client: Client::builder().redirect(redirect_policy).build().unwrap(),
|
||||
player_parser: PlayerParser::new(),
|
||||
player_detail_parser: PlayerDetailsParser::new(),
|
||||
team_parser: TeamParser::new(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue