From 27b75b6edd17e04355a8f44606dcffd63cf2caeb Mon Sep 17 00:00:00 2001 From: Malloc Voidstar <1284317+AlyoshaVasilieva@users.noreply.github.com> Date: Sat, 10 Jul 2021 10:51:44 -0700 Subject: [PATCH] Possibly improve the GFW evasion --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/main.rs | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0838f16..418c50a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -116,7 +116,7 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "city17" -version = "0.5.3" +version = "0.5.4" dependencies = [ "once_cell", "pcg_rand", diff --git a/Cargo.toml b/Cargo.toml index fb686fa..da6cebc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "city17" -version = "0.5.3" +version = "0.5.4" authors = ["Malloc Voidstar <1284317+AlyoshaVasilieva@users.noreply.github.com>"] edition = "2018" resolver = "2" diff --git a/src/main.rs b/src/main.rs index e22f379..954edff 100644 --- a/src/main.rs +++ b/src/main.rs @@ -42,8 +42,7 @@ impl ClientBuilderExt for ClientBuilder { /// Doing this appears to reduce latency variation even when the DNS is working. fn insert_resolve_overrides(self) -> Self { self.resolve("fastly.net", socket_addr_v4([151, 101, 110, 167], 443)) - .resolve("usher.ttvnw.net", socket_addr_v4([192, 108, 239, 254], 443)) - // Usher override is unused due to bypass. + .resolve("www.fastly.com", socket_addr_v4([192, 108, 239, 254], 443)) // if these IPs start changing, make it part of the build process // note alternative usher IP: [23, 160, 0, 254], 443 } @@ -141,9 +140,10 @@ async fn process(var: Variables) -> Result { async fn get_m3u8(url: &str, token: PlaybackAccessToken) -> Result { let mut pcg = get_rng(); let p = pcg.gen_range(0..=9_999_999).to_string(); - // Pretty sure the GFW thinks this is suspicious, but it's not 100% blocked. + // This isn't 100% unblocked but it seems to be more reliable than a bare IP. + // Also: I'm pretty sure Usher is being weirdly permissive, here. CLIENT - .get(url.replace("usher.ttvnw.net", "192.108.239.254")) + .get(url.replace("usher.ttvnw.net", "www.fastly.com")) .query(&token.gen_query(&p, &generate_id().to_lowercase())) .header("Host", "usher.ttvnw.net") .send()