mirror of
https://github.com/etienne-hd/lbc.git
synced 2026-04-27 09:15:43 +02:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c891e593c5 | ||
|
|
e8cb0a9f5d | ||
|
|
48b83c0c9d | ||
|
|
671fb291f1 |
@@ -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
|
||||
|
||||
@@ -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"}
|
||||
|
||||
@@ -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}"
|
||||
@@ -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"]:
|
||||
|
||||
@@ -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"]:
|
||||
|
||||
@@ -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"]:
|
||||
|
||||
Reference in New Issue
Block a user