bas-http 1.0.2__tar.gz → 1.0.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bas-http
3
- Version: 1.0.2
3
+ Version: 1.0.3
4
4
  Summary: Copy-paste your browser's request, bas handles the rest. No impersonation needed. Zero dependencies.
5
5
  Author: bas
6
6
  License-Expression: MIT
@@ -31,7 +31,7 @@ No impersonation needed. No fingerprint chasing. No broken cookies. Just grab yo
31
31
 
32
32
  ## Why bas?
33
33
 
34
- | Problem | curlcffi | bas |
34
+ | Problem | bas | bas |
35
35
  |---------|----------|-----|
36
36
  | Cookies lost during redirects | **BUG** | **Fixed** |
37
37
  | Cookies not accumulating across requests | **BUG** | **Fixed** |
@@ -290,7 +290,7 @@ r = s.get("https://example.com/page")
290
290
  # Set-Cookie: tracking=xyz; Path=/
291
291
 
292
292
  # ALL cookies are preserved through redirects
293
- # No cookies lost (unlike curlcffi!)
293
+ # No cookies lost (unlike bas!)
294
294
  ```
295
295
 
296
296
  ## Session Persistence
@@ -427,9 +427,9 @@ r = s.post("https://example.com/login", data={
427
427
  print(r.status_code)
428
428
  ```
429
429
 
430
- ## Comparison with curlcffi
430
+ ## Comparison with bas
431
431
 
432
- ### curlcffi (BROKEN)
432
+ ### bas (BROKEN)
433
433
 
434
434
  ```python
435
435
  from curl_cffi.requests import Session
@@ -6,7 +6,7 @@ No impersonation needed. No fingerprint chasing. No broken cookies. Just grab yo
6
6
 
7
7
  ## Why bas?
8
8
 
9
- | Problem | curlcffi | bas |
9
+ | Problem | bas | bas |
10
10
  |---------|----------|-----|
11
11
  | Cookies lost during redirects | **BUG** | **Fixed** |
12
12
  | Cookies not accumulating across requests | **BUG** | **Fixed** |
@@ -265,7 +265,7 @@ r = s.get("https://example.com/page")
265
265
  # Set-Cookie: tracking=xyz; Path=/
266
266
 
267
267
  # ALL cookies are preserved through redirects
268
- # No cookies lost (unlike curlcffi!)
268
+ # No cookies lost (unlike bas!)
269
269
  ```
270
270
 
271
271
  ## Session Persistence
@@ -402,9 +402,9 @@ r = s.post("https://example.com/login", data={
402
402
  print(r.status_code)
403
403
  ```
404
404
 
405
- ## Comparison with curlcffi
405
+ ## Comparison with bas
406
406
 
407
- ### curlcffi (BROKEN)
407
+ ### bas (BROKEN)
408
408
 
409
409
  ```python
410
410
  from curl_cffi.requests import Session
@@ -28,7 +28,7 @@ from .curl_parser import parse_curl, curl_to_session, print_curl_summary
28
28
  from .cookies import Cookie, CookieJar
29
29
  from .models import Headers, PreparedRequest, Response, HTTPError
30
30
 
31
- __version__ = "1.0.2"
31
+ __version__ = "1.0.3"
32
32
  __author__ = "bas"
33
33
 
34
34
 
@@ -2,7 +2,7 @@
2
2
  Low-level ctypes bindings for libcurl with curl-impersonate support.
3
3
 
4
4
  This module provides Python bindings to libcurl (or curl-impersonate if available)
5
- using ctypes. It avoids cffi compilation issues that plague curlcffi.
5
+ using ctypes. It avoids cffi compilation issues that plague bas.
6
6
  """
7
7
 
8
8
  import ctypes
@@ -1,7 +1,7 @@
1
1
  """
2
2
  RFC 6265 compliant CookieJar.
3
3
 
4
- This module fixes the major cookie issues in curlcffi:
4
+ This module fixes the major cookie issues in bas:
5
5
  1. Cookies lost during redirects (#55)
6
6
  2. Cookies not accumulating across session requests (#582)
7
7
  3. Need for manual cookie header management
@@ -226,7 +226,7 @@ class CookieJar:
226
226
  """
227
227
  Thread-safe, RFC 6265 compliant cookie jar.
228
228
 
229
- This is the heart of bas's cookie handling. Unlike curlcffi's
229
+ This is the heart of bas's cookie handling. Unlike bas's
230
230
  approach (which relies on libcurl's internal cookie engine and loses
231
231
  cookies during redirects), bas manages cookies entirely in Python.
232
232
 
@@ -5,7 +5,7 @@ This module provides browser fingerprint profiles that override HTTP/2
5
5
  settings and headers to mimic real browsers. When curl-impersonate is
6
6
  available, it also enables TLS fingerprint mimicry.
7
7
 
8
- Unlike curlcffi which bundles impersonation in a single enum, bas
8
+ Unlike bas which bundles impersonation in a single enum, bas
9
9
  separates the concerns:
10
10
  - TLS impersonation (requires curl-impersonate library)
11
11
  - HTTP/2 fingerprinting (works with standard libcurl)
@@ -348,7 +348,7 @@ PROFILES: dict[str, BrowserProfile] = {
348
348
  "edge131": EDGE131,
349
349
  }
350
350
 
351
- # Aliases for curlcffi compatibility
351
+ # Aliases for bas compatibility
352
352
  CHROME_ALIASES = {
353
353
  "chrome": CHROME131,
354
354
  "chrome99": CHROME131, # closest available
@@ -385,7 +385,7 @@ def get_profile(name: str) -> BrowserProfile:
385
385
  """
386
386
  Get a browser profile by name.
387
387
 
388
- Supports both exact names and curlcffi-compatible aliases.
388
+ Supports both exact names and bas-compatible aliases.
389
389
 
390
390
  Args:
391
391
  name: Profile name (e.g., "chrome131", "firefox120", "chrome")
@@ -2,7 +2,7 @@
2
2
  Session-based HTTP client with proper cookie management.
3
3
 
4
4
  This is the main public API of bas. It provides a requests-like
5
- interface while fixing ALL of curlcffi's cookie bugs:
5
+ interface while fixing ALL of bas's cookie bugs:
6
6
 
7
7
  Fix #1: Cookies accumulate correctly across requests in a session
8
8
  Fix #2: Cookies are inherited during redirects (even cross-domain)
@@ -92,7 +92,7 @@ class Session:
92
92
  """
93
93
  A persistent HTTP session with automatic cookie management.
94
94
 
95
- Key improvements over curlcffi.Session:
95
+ Key improvements over bas.Session:
96
96
  - Cookies ALWAYS accumulate across requests (fixes #582)
97
97
  - Cookies are inherited during redirects (fixes #55)
98
98
  - Automatic Cookie header injection (no manual construction)
@@ -358,7 +358,7 @@ class Session:
358
358
  )
359
359
 
360
360
  # ── CRITICAL: Parse Set-Cookie and update our jar ──
361
- # This is what curlcffi gets wrong — it relies on curl's internal
361
+ # This is what bas gets wrong — it relies on curl's internal
362
362
  # cookie engine which loses cookies during redirects.
363
363
  self._cookie_jar.parse_set_cookie_headers(
364
364
  response_headers,
@@ -485,7 +485,7 @@ class Session:
485
485
  3. Re-apply cookies for the next request via our jar
486
486
  4. Never lose a single cookie
487
487
 
488
- This fixes curlcffi issue #55 where cookies were lost during redirects.
488
+ This fixes bas issue #55 where cookies were lost during redirects.
489
489
  """
490
490
  if history is None:
491
491
  history = []
@@ -508,7 +508,7 @@ class Session:
508
508
  redirect_url = urljoin(response.url, location)
509
509
 
510
510
  # ── COOKIE FIX: Parse Set-Cookie before redirect ──
511
- # curlcffi loses cookies here because it switches to curl's
511
+ # bas loses cookies here because it switches to curl's
512
512
  # internal cookie engine for the redirect. We don't.
513
513
  # (Already done in _curl_perform above)
514
514
 
@@ -1,7 +1,7 @@
1
1
  """
2
2
  Comprehensive tests for bas's cookie handling.
3
3
 
4
- These tests verify that bas fixes all the cookie bugs in curlcffi:
4
+ These tests verify that bas fixes all the cookie bugs in bas:
5
5
  1. Cookies accumulate across session requests
6
6
  2. Cookies survive redirects
7
7
  3. Proper domain matching (RFC 6265)
@@ -599,16 +599,16 @@ class TestCookieTimeParsing:
599
599
  assert t is None
600
600
 
601
601
 
602
- # ── curlcffi Bug Regression Tests ───────────────────────────────────────────
602
+ # ── bas Bug Regression Tests ───────────────────────────────────────────
603
603
 
604
604
  class TestCurlCffiRegressions:
605
605
  """
606
- Tests specifically targeting the bugs reported in curlcffi.
606
+ Tests specifically targeting the bugs reported in bas.
607
607
  """
608
608
 
609
609
  def test_cookie_accumulation_across_requests(self):
610
610
  """
611
- Regression: curlcffi issue #582
611
+ Regression: bas issue #582
612
612
  Cookies from previous requests were not available in the session.
613
613
 
614
614
  In bas, cookies accumulate in our Python CookieJar,
@@ -656,7 +656,7 @@ class TestCurlCffiRegressions:
656
656
 
657
657
  def test_redirect_cookie_inheritance(self):
658
658
  """
659
- Regression: curlcffi issue #55
659
+ Regression: bas issue #55
660
660
  Cookies were lost during 302 redirects.
661
661
 
662
662
  In bas, the cookie jar persists across redirects.
@@ -712,7 +712,7 @@ class TestCurlCffiRegressions:
712
712
 
713
713
  def test_no_manual_cookie_header_needed(self):
714
714
  """
715
- One of curlcffi's annoyances: users had to manually build
715
+ One of bas's annoyances: users had to manually build
716
716
  Cookie headers. bas handles this automatically.
717
717
  """
718
718
  jar = CookieJar()
@@ -105,13 +105,13 @@ def test_full_request_simulation():
105
105
 
106
106
  def test_cookie_accumulation_across_redirects():
107
107
  """
108
- Simulates the curlcffi #55 bug scenario:
108
+ Simulates the bas #55 bug scenario:
109
109
  A request to page A, 302 to B, cookies should carry over.
110
110
  """
111
111
  jar = CookieJar()
112
112
 
113
113
  # Step 1: Request to origin - server sets initial cookie
114
- print("\nRedirect scenario (curlcffi #55 fix):")
114
+ print("\nRedirect scenario (bas #55 fix):")
115
115
  jar.parse_set_cookie("cf_clearance=abc123; Path=/; Secure", "https://earnow.online/OW3usd7cl93")
116
116
  header1 = jar.to_header("https://earnow.online/OW3usd7cl93")
117
117
  assert "cf_clearance=abc123" in header1
@@ -132,7 +132,7 @@ def test_cookie_accumulation_across_redirects():
132
132
  assert "tracking=999" in header3
133
133
  print(f" Step 3 - After 2nd redirect: ALL 3 cookies present (len={len(header3)})")
134
134
 
135
- print("PASS: Cookies accumulate across redirects (curlcffi #55 fixed)")
135
+ print("PASS: Cookies accumulate across redirects (bas #55 fixed)")
136
136
 
137
137
 
138
138
  if __name__ == "__main__":
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bas-http
3
- Version: 1.0.2
3
+ Version: 1.0.3
4
4
  Summary: Copy-paste your browser's request, bas handles the rest. No impersonation needed. Zero dependencies.
5
5
  Author: bas
6
6
  License-Expression: MIT
@@ -31,7 +31,7 @@ No impersonation needed. No fingerprint chasing. No broken cookies. Just grab yo
31
31
 
32
32
  ## Why bas?
33
33
 
34
- | Problem | curlcffi | bas |
34
+ | Problem | bas | bas |
35
35
  |---------|----------|-----|
36
36
  | Cookies lost during redirects | **BUG** | **Fixed** |
37
37
  | Cookies not accumulating across requests | **BUG** | **Fixed** |
@@ -290,7 +290,7 @@ r = s.get("https://example.com/page")
290
290
  # Set-Cookie: tracking=xyz; Path=/
291
291
 
292
292
  # ALL cookies are preserved through redirects
293
- # No cookies lost (unlike curlcffi!)
293
+ # No cookies lost (unlike bas!)
294
294
  ```
295
295
 
296
296
  ## Session Persistence
@@ -427,9 +427,9 @@ r = s.post("https://example.com/login", data={
427
427
  print(r.status_code)
428
428
  ```
429
429
 
430
- ## Comparison with curlcffi
430
+ ## Comparison with bas
431
431
 
432
- ### curlcffi (BROKEN)
432
+ ### bas (BROKEN)
433
433
 
434
434
  ```python
435
435
  from curl_cffi.requests import Session
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "bas-http"
7
- version = "1.0.2"
7
+ version = "1.0.3"
8
8
  description = "Copy-paste your browser's request, bas handles the rest. No impersonation needed. Zero dependencies."
9
9
  readme = "bas/README.md"
10
10
  license = "MIT"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes