4 Commits
1.1.0 ... 1.1.1

Author SHA1 Message Date
etienne-hd
c891e593c5 Update: CHANGELOG and pyproject.toml (v1.1.1) 2025-12-28 15:57:51 +01:00
etienne-hd
e8cb0a9f5d fix: set impersonate to chrome_android in utils 2025-12-28 15:53:47 +01:00
Étienne Hodé
48b83c0c9d Merge pull request #7 from HamletDuFromage/main 2025-12-28 15:28:56 +01:00
flb
671fb291f1 add optional scheme from proxy dataclass 2025-12-28 14:28:04 +01:00
6 changed files with 12 additions and 7 deletions

View File

@@ -1,3 +1,7 @@
## 1.1.1
### Added
* Optional `scheme` attribute on the Proxy dataclass, allowing custom proxy URL schemes (#7)
## 1.1.0
### Changed
* Project structure reorganized: features such as **search**, **user**, and **ad** are now separated using mixins.
@@ -65,4 +69,4 @@
* Realistic `Sec-Fetch-*` headers to prevent 403 errors
## 1.0.0
* Initial release
* Initial release

View File

@@ -1,6 +1,6 @@
[project]
name = "lbc"
version = "1.1.0"
version = "1.1.1"
description = "Unofficial client for Leboncoin API"
readme = "README.md"
license = {text = "MIT"}

View File

@@ -7,10 +7,11 @@ class Proxy:
port: Union[str, int]
username: Optional[str] = None
password: Optional[str] = None
scheme: Optional[str] = "http"
@property
def url(self):
if self.username and self.password:
return f"http://{self.username}:{self.password}@{self.host}:{self.port}"
return f"{self.scheme}://{self.username}:{self.password}@{self.host}:{self.port}"
else:
return f"http://{self.host}:{self.port}"
return f"{self.scheme}://{self.host}:{self.port}"

View File

@@ -11,7 +11,7 @@ def print_category(category_data: dict, category_name: Optional[str] = None) ->
print(f'{f"{category_name}_" if category_name else ""}{label} = "{category_data['catId']}"')
def main() -> None:
client = lbc.Client()
client = lbc.Client(impersonate="chrome_android")
body = client._fetch(method="GET", url="https://api.leboncoin.fr/api/frontend/v1/data/v7/fdata")
for category in body["categories"]:

View File

@@ -9,7 +9,7 @@ def print_department(department_data: dict, region: dict) -> None:
print(f'{name} = ("{region['rId']}", "{transform_str(region['rName'])}", "{department_data["dId"]}", "{name}")')
def main() -> None:
client = lbc.Client()
client = lbc.Client(impersonate="chrome_android")
body = client._fetch(method="GET", url="https://api.leboncoin.fr/api/frontend/v1/data/v7/fdata")
for region in body["regions"]:

View File

@@ -9,7 +9,7 @@ def print_region(region_data: dict) -> None:
print(f'{name} = ("{region_data['rId']}", "{name}")')
def main() -> None:
client = lbc.Client()
client = lbc.Client(impersonate="chrome_android")
body = client._fetch(method="GET", url="https://api.leboncoin.fr/api/frontend/v1/data/v7/fdata")
for region in body["regions"]: