Merge branch 'redlib-org:main' into fix_preview_captions

This commit is contained in:
Butter Cat 2024-05-29 18:42:39 -04:00 committed by GitHub
commit 34692359cf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 280 additions and 299 deletions

445
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -3,7 +3,7 @@ name = "redlib"
description = " Alternative private front-end to Reddit" description = " Alternative private front-end to Reddit"
license = "AGPL-3.0" license = "AGPL-3.0"
repository = "https://github.com/redlib-org/redlib" repository = "https://github.com/redlib-org/redlib"
version = "0.31.2" version = "0.33.0"
authors = [ authors = [
"Matthew Esposito <matt+cargo@matthew.science>", "Matthew Esposito <matt+cargo@matthew.science>",
"spikecodes <19519553+spikecodes@users.noreply.github.com>", "spikecodes <19519553+spikecodes@users.noreply.github.com>",

View File

@ -170,7 +170,7 @@ fn request(method: &'static Method, path: String, redirect: bool, quarantine: bo
// Construct the hyper client from the HTTPS connector. // Construct the hyper client from the HTTPS connector.
let client: Client<_, Body> = CLIENT.clone(); let client: Client<_, Body> = CLIENT.clone();
let (token, vendor_id, device_id, user_agent, loid) = { let (token, vendor_id, device_id, mut user_agent, loid) = {
let client = block_on(OAUTH_CLIENT.read()); let client = block_on(OAUTH_CLIENT.read());
( (
client.token.clone(), client.token.clone(),
@ -180,6 +180,12 @@ fn request(method: &'static Method, path: String, redirect: bool, quarantine: bo
client.headers_map.get("x-reddit-loid").cloned().unwrap_or_default(), client.headers_map.get("x-reddit-loid").cloned().unwrap_or_default(),
) )
}; };
// Check if multi sub requested. If so, replace "Android" with a tricky word.
if path.contains("+") {
user_agent = user_agent.replace("Android", "Android");
}
// Build request to Reddit. When making a GET, request gzip compression. // Build request to Reddit. When making a GET, request gzip compression.
// (Reddit doesn't do brotli yet.) // (Reddit doesn't do brotli yet.)
let builder = Request::builder() let builder = Request::builder()

View File

@ -4,6 +4,44 @@
// Filled in with real app versions // Filled in with real app versions
pub static _IOS_APP_VERSION_LIST: &[&str; 1] = &[""]; pub static _IOS_APP_VERSION_LIST: &[&str; 1] = &[""];
pub static ANDROID_APP_VERSION_LIST: &[&str; 150] = &[ pub static ANDROID_APP_VERSION_LIST: &[&str; 150] = &[
"Version 2023.48.0/Build 1319123",
"Version 2023.49.0/Build 1321715",
"Version 2023.49.1/Build 1322281",
"Version 2023.50.0/Build 1332338",
"Version 2023.50.1/Build 1345844",
"Version 2024.02.0/Build 1368985",
"Version 2024.03.0/Build 1379408",
"Version 2024.04.0/Build 1391236",
"Version 2024.05.0/Build 1403584",
"Version 2024.06.0/Build 1418489",
"Version 2024.07.0/Build 1429651",
"Version 2024.08.0/Build 1439531",
"Version 2024.10.0/Build 1470045",
"Version 2024.10.1/Build 1478645",
"Version 2024.11.0/Build 1480707",
"Version 2024.12.0/Build 1494694",
"Version 2024.13.0/Build 1505187",
"Version 2024.14.0/Build 1520556",
"Version 2024.15.0/Build 1536823",
"Version 2024.16.0/Build 1551366",
"Version 2024.17.0/Build 1568106",
"Version 2024.18.0/Build 1577901",
"Version 2024.18.1/Build 1585304",
"Version 2024.19.0/Build 1593346",
"Version 2024.20.0/Build 1612800",
"Version 2024.20.1/Build 1615586",
"Version 2024.20.2/Build 1624969",
"Version 2024.21.0/Build 1631686",
"Version 2024.22.0/Build 1645257",
"Version 2024.22.1/Build 1652272",
"Version 2023.21.0/Build 956283",
"Version 2023.22.0/Build 968223",
"Version 2023.23.0/Build 983896",
"Version 2023.24.0/Build 998541",
"Version 2023.25.0/Build 1014750",
"Version 2023.25.1/Build 1018737",
"Version 2023.26.0/Build 1019073",
"Version 2023.27.0/Build 1031923",
"Version 2023.28.0/Build 1046887", "Version 2023.28.0/Build 1046887",
"Version 2023.29.0/Build 1059855", "Version 2023.29.0/Build 1059855",
"Version 2023.30.0/Build 1078734", "Version 2023.30.0/Build 1078734",
@ -26,14 +64,14 @@ pub static ANDROID_APP_VERSION_LIST: &[&str; 150] = &[
"Version 2023.44.0/Build 1268622", "Version 2023.44.0/Build 1268622",
"Version 2023.45.0/Build 1281371", "Version 2023.45.0/Build 1281371",
"Version 2023.47.0/Build 1303604", "Version 2023.47.0/Build 1303604",
"Version 2023.48.0/Build 1319123", "Version 2022.42.0/Build 638508",
"Version 2023.49.0/Build 1321715", "Version 2022.43.0/Build 648277",
"Version 2023.49.1/Build 1322281", "Version 2022.44.0/Build 664348",
"Version 2023.50.0/Build 1332338", "Version 2022.45.0/Build 677985",
"Version 2023.50.1/Build 1345844", "Version 2023.01.0/Build 709875",
"Version 2024.02.0/Build 1368985", "Version 2023.02.0/Build 717912",
"Version 2024.03.0/Build 1379408", "Version 2023.03.0/Build 729220",
"Version 2024.04.0/Build 1391236", "Version 2023.04.0/Build 744681",
"Version 2023.05.0/Build 755453", "Version 2023.05.0/Build 755453",
"Version 2023.06.0/Build 775017", "Version 2023.06.0/Build 775017",
"Version 2023.07.0/Build 788827", "Version 2023.07.0/Build 788827",
@ -56,14 +94,14 @@ pub static ANDROID_APP_VERSION_LIST: &[&str; 150] = &[
"Version 2023.19.0/Build 927681", "Version 2023.19.0/Build 927681",
"Version 2023.20.0/Build 943980", "Version 2023.20.0/Build 943980",
"Version 2023.20.1/Build 946732", "Version 2023.20.1/Build 946732",
"Version 2023.21.0/Build 956283", "Version 2022.20.0/Build 487703",
"Version 2023.22.0/Build 968223", "Version 2022.21.0/Build 492436",
"Version 2023.23.0/Build 983896", "Version 2022.22.0/Build 498700",
"Version 2023.24.0/Build 998541", "Version 2022.23.0/Build 502374",
"Version 2023.25.0/Build 1014750", "Version 2022.23.1/Build 506606",
"Version 2023.25.1/Build 1018737", "Version 2022.24.0/Build 510950",
"Version 2023.26.0/Build 1019073", "Version 2022.24.1/Build 513462",
"Version 2023.27.0/Build 1031923", "Version 2022.25.0/Build 515072",
"Version 2022.25.1/Build 516394", "Version 2022.25.1/Build 516394",
"Version 2022.25.2/Build 519915", "Version 2022.25.2/Build 519915",
"Version 2022.26.0/Build 521193", "Version 2022.26.0/Build 521193",
@ -86,14 +124,14 @@ pub static ANDROID_APP_VERSION_LIST: &[&str; 150] = &[
"Version 2022.40.0/Build 624782", "Version 2022.40.0/Build 624782",
"Version 2022.41.0/Build 630468", "Version 2022.41.0/Build 630468",
"Version 2022.41.1/Build 634168", "Version 2022.41.1/Build 634168",
"Version 2022.42.0/Build 638508", "Version 2021.39.1/Build 372418",
"Version 2022.43.0/Build 648277", "Version 2021.41.0/Build 376052",
"Version 2022.44.0/Build 664348", "Version 2021.42.0/Build 378193",
"Version 2022.45.0/Build 677985", "Version 2021.43.0/Build 382019",
"Version 2023.01.0/Build 709875", "Version 2021.44.0/Build 385129",
"Version 2023.02.0/Build 717912", "Version 2021.45.0/Build 387663",
"Version 2023.03.0/Build 729220", "Version 2021.46.0/Build 392043",
"Version 2023.04.0/Build 744681", "Version 2021.47.0/Build 394342",
"Version 2022.10.0/Build 429896", "Version 2022.10.0/Build 429896",
"Version 2022.1.0/Build 402829", "Version 2022.1.0/Build 402829",
"Version 2022.11.0/Build 433004", "Version 2022.11.0/Build 433004",
@ -106,15 +144,7 @@ pub static ANDROID_APP_VERSION_LIST: &[&str; 150] = &[
"Version 2022.17.0/Build 468480", "Version 2022.17.0/Build 468480",
"Version 2022.18.0/Build 473740", "Version 2022.18.0/Build 473740",
"Version 2022.19.1/Build 482464", "Version 2022.19.1/Build 482464",
"Version 2022.20.0/Build 487703",
"Version 2022.2.0/Build 405543", "Version 2022.2.0/Build 405543",
"Version 2022.21.0/Build 492436",
"Version 2022.22.0/Build 498700",
"Version 2022.23.0/Build 502374",
"Version 2022.23.1/Build 506606",
"Version 2022.24.0/Build 510950",
"Version 2022.24.1/Build 513462",
"Version 2022.25.0/Build 515072",
"Version 2022.3.0/Build 408637", "Version 2022.3.0/Build 408637",
"Version 2022.4.0/Build 411368", "Version 2022.4.0/Build 411368",
"Version 2022.5.0/Build 414731", "Version 2022.5.0/Build 414731",
@ -124,35 +154,5 @@ pub static ANDROID_APP_VERSION_LIST: &[&str; 150] = &[
"Version 2022.7.0/Build 420849", "Version 2022.7.0/Build 420849",
"Version 2022.8.0/Build 423906", "Version 2022.8.0/Build 423906",
"Version 2022.9.0/Build 426592", "Version 2022.9.0/Build 426592",
"Version 2021.20.0/Build 326964",
"Version 2021.21.0/Build 327703",
"Version 2021.21.1/Build 328461",
"Version 2021.22.0/Build 329696",
"Version 2021.23.0/Build 331631",
"Version 2021.24.0/Build 333951",
"Version 2021.25.0/Build 335451",
"Version 2021.26.0/Build 336739",
"Version 2021.27.0/Build 338857",
"Version 2021.28.0/Build 340747",
"Version 2021.29.0/Build 342342",
"Version 2021.30.0/Build 343820",
"Version 2021.31.0/Build 346485",
"Version 2021.32.0/Build 349507",
"Version 2021.33.0/Build 351843",
"Version 2021.34.0/Build 353911",
"Version 2021.35.0/Build 355878",
"Version 2021.36.0/Build 359254",
"Version 2021.36.1/Build 360572",
"Version 2021.37.0/Build 361905",
"Version 2021.38.0/Build 365032",
"Version 2021.39.0/Build 369068",
"Version 2021.39.1/Build 372418",
"Version 2021.41.0/Build 376052",
"Version 2021.42.0/Build 378193",
"Version 2021.43.0/Build 382019",
"Version 2021.44.0/Build 385129",
"Version 2021.45.0/Build 387663",
"Version 2021.46.0/Build 392043",
"Version 2021.47.0/Build 394342",
]; ];
pub static _IOS_OS_VERSION_LIST: &[&str; 1] = &[""]; pub static _IOS_OS_VERSION_LIST: &[&str; 1] = &[""];