Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 55 additions & 36 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 7 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,14 @@ tikv-jemallocator = { version = "0.7.0", default-features = false, features = [
"disable_initial_exec_tls",
], optional = true }

# Keep the Chrome 150–153 profiles and their required TLS support in sync.
# Keep the latest emulation profiles and their required TLS support in sync.
[patch.crates-io]
wreq-util = { git = "https://github.com/0x676e67/wreq-util", rev = "e3922a2b2d976487cb4cf4e7b0ac290b3ce77f66" }
wreq = { git = "https://github.com/0x676e67/wreq", rev = "cd76bcdf1307153de289d34e072528bdf0510a3b" }
btls = { git = "https://github.com/0x676e67/btls", rev = "129887582a538b8f4dcf371d15c953335312ca37" }
btls-sys = { git = "https://github.com/0x676e67/btls", rev = "129887582a538b8f4dcf371d15c953335312ca37" }
wreq-util = { git = "https://github.com/0x676e67/wreq-util", rev = "5715529002738f46eea86a7271f918f9374d3582" }
wreq = { git = "https://github.com/0x676e67/wreq", rev = "4f2342aba1b33cc3534e8e2a853b21945edf6cef" }
# demo/tokio-btls-vectored-write
btls = { git = "https://github.com/0x676e67/btls", rev = "ffaf0e8c23d455af4e306986ce81bb57ebd03bc2" }
btls-sys = { git = "https://github.com/0x676e67/btls", rev = "ffaf0e8c23d455af4e306986ce81bb57ebd03bc2" }
tokio-btls = { git = "https://github.com/0x676e67/btls", rev = "ffaf0e8c23d455af4e306986ce81bb57ebd03bc2" }

[profile.release]
codegen-units = 1
Expand Down
4 changes: 2 additions & 2 deletions docs/source/getting-started/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ Due to the complexity of **TLS** encryption and the widespread adoption of **HTT

---

`Chrome100` `Chrome101` `Chrome104` `Chrome105` `Chrome106` `Chrome107` `Chrome108` `Chrome109` `Chrome110` `Chrome114` `Chrome116` `Chrome117` `Chrome118` `Chrome119` `Chrome120` `Chrome123` `Chrome124` `Chrome126` `Chrome127` `Chrome128` `Chrome129` `Chrome130` `Chrome131` `Chrome132` `Chrome133` `Chrome134` `Chrome135` `Chrome136` `Chrome137` `Chrome138` `Chrome139` `Chrome140` `Chrome141` `Chrome142` `Chrome143` `Chrome144` `Chrome145` `Chrome146` `Chrome147` `Chrome148` `Chrome149` `Chrome150` `Chrome151` `Chrome152` `Chrome153`
`Chrome100` `Chrome101` `Chrome104` `Chrome105` `Chrome106` `Chrome107` `Chrome108` `Chrome109` `Chrome110` `Chrome114` `Chrome116` `Chrome117` `Chrome118` `Chrome119` `Chrome120` `Chrome123` `Chrome124` `Chrome126` `Chrome127` `Chrome128` `Chrome129` `Chrome130` `Chrome131` `Chrome132` `Chrome133` `Chrome134` `Chrome135` `Chrome136` `Chrome137` `Chrome138` `Chrome139` `Chrome140` `Chrome141` `Chrome142` `Chrome143` `Chrome144` `Chrome145` `Chrome146` `Chrome147` `Chrome148` `Chrome149` `Chrome150` `Chrome151` `Chrome152` `Chrome153` `Chrome154`

- :fontawesome-brands-edge: **Edge**

Expand All @@ -86,7 +86,7 @@ Due to the complexity of **TLS** encryption and the widespread adoption of **HTT

---

`Firefox109` `Firefox117` `Firefox128` `Firefox133` `Firefox135` `FirefoxPrivate135` `FirefoxAndroid135` `Firefox136` `FirefoxPrivate136` `Firefox139` `Firefox142` `Firefox143` `Firefox144` `Firefox145` `Firefox146` `Firefox147` `Firefox148` `Firefox149` `Firefox150` `Firefox151`
`Firefox109` `Firefox117` `Firefox128` `Firefox133` `Firefox135` `FirefoxPrivate135` `FirefoxAndroid135` `Firefox136` `FirefoxPrivate136` `Firefox139` `Firefox142` `Firefox143` `Firefox144` `Firefox145` `Firefox146` `Firefox147` `Firefox148` `Firefox149` `Firefox150` `Firefox151` `Firefox152`

- :fontawesome-brands-safari: **Safari**

Expand Down
7 changes: 5 additions & 2 deletions docs/source/guide/emulation.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
- Firefox/Chrome/Android
- Custom TLS/HTTP2

The built-in profiles include `Profile.Chrome154` and `Profile.Firefox152`.
Use a profile directly, or combine it with a platform using `Emulation`.

### Simple Firefox Emulation

```python
Expand All @@ -14,7 +17,7 @@ from wreq.emulation import Emulation

async def main():
client = Client(
emulation=Emulation.Firefox135,
emulation=Emulation.Firefox152,
)
resp = await client.get("https://tls.peet.ws/api/all")
print(f"Status: {resp.status}")
Expand All @@ -38,7 +41,7 @@ async def main():
resp = await client.get(
"https://tls.peet.ws/api/all",
emulation=Emulation(
profile=Profile.Chrome134,
profile=Profile.Chrome154,
platform=Platform.Android,
),
# Disable client default headers
Expand Down
4 changes: 4 additions & 0 deletions python/wreq/emulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ class Profile(Enum):
Chrome151 = auto()
Chrome152 = auto()
Chrome153 = auto()
Chrome154 = auto()

# Microsoft Edge versions
Edge101 = auto()
Expand Down Expand Up @@ -113,6 +114,7 @@ class Profile(Enum):
Firefox149 = auto()
Firefox150 = auto()
Firefox151 = auto()
Firefox152 = auto()

# Safari versions
SafariIos17_2 = auto()
Expand Down Expand Up @@ -247,6 +249,7 @@ class Emulation:
Chrome151: ClassVar[Profile] = Profile.Chrome151
Chrome152: ClassVar[Profile] = Profile.Chrome152
Chrome153: ClassVar[Profile] = Profile.Chrome153
Chrome154: ClassVar[Profile] = Profile.Chrome154

# Microsoft Edge versions
Edge101: ClassVar[Profile] = Profile.Edge101
Expand Down Expand Up @@ -290,6 +293,7 @@ class Emulation:
Firefox149: ClassVar[Profile] = Profile.Firefox149
Firefox150: ClassVar[Profile] = Profile.Firefox150
Firefox151: ClassVar[Profile] = Profile.Firefox151
Firefox152: ClassVar[Profile] = Profile.Firefox152

# Safari versions
SafariIos17_2: ClassVar[Profile] = Profile.SafariIos17_2
Expand Down
2 changes: 2 additions & 0 deletions src/emulate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ define_enum!(
Chrome151,
Chrome152,
Chrome153,
Chrome154,

Edge101,
Edge122,
Expand Down Expand Up @@ -95,6 +96,7 @@ define_enum!(
Firefox149,
Firefox150,
Firefox151,
Firefox152,

SafariIos17_2,
SafariIos17_4_1,
Expand Down
Loading