-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: get data from etraffic api #8
Conversation
Currently, it doesn't work because the URL has banned me from making more requests, so I can't parse the data for violation details. {
"guid": "ed9999-9999-9999-9999-9999999999",
"code": "CIT_999",
"message": "Số lượt tìm kiếm thông tin phạt nguội đã đạt giới hạn trong ngày.\nVui lòng thử lại sau",
"status": 400,
"path": "/v2/property/deferred/fines",
"method": "GET",
"timestamp": "2025-01-18T16:42:18Z",
"errors": None,
} |
Ok I find the ex of plate data in this api: {
"status": 200,
"message": "OK",
"data": [
{
"violationId": null,
"licensePlate": "29A34809",
"licensePlateType": "Nền màu trắng, chữ và số màu đen",
"vehicleType": "Ô tô con",
"vehicleTypeText": "Ô tô con",
"violationType": null,
"violationTypeText": "Liên hệ địa điểm nộp phạt để nhận hình ảnh VP",
"violationAt": "15:06 21/02/2021",
"violationAtText": "15:06 21/02/2021",
"violationAddress": "Hà Nội",
"handlingAddress": "54 Trần Hưng Đạo - Hoàn Kiếm - Hà Nội",
"propertyName": "Thành phố Hà Nội\nĐịa chỉ: 54 Trần Hưng Đạo - Hoàn Kiếm - Hà Nội\nLiên lạc: 0692196440",
"statusType": "Đã xử phạt",
"statusTypeText": "Đã xử phạt",
"departmentName": "Thành phố Hà Nội\nĐịa chỉ: 54 Trần Hưng Đạo - Hoàn Kiếm - Hà Nội\nLiên lạc: 0692196440",
"contactPhone": "0692196440"
},
{
"violationId": null,
"licensePlate": "29A34809",
"licensePlateType": "Nền màu trắng, chữ và số màu đen",
"vehicleType": "Ô tô con",
"vehicleTypeText": "Ô tô con",
"violationType": null,
"violationTypeText": "Liên hệ địa điểm nộp phạt để nhận hình ảnh VP",
"violationAt": "09:36 21/02/2021",
"violationAtText": "09:36 21/02/2021",
"violationAddress": "Hà Nội",
"handlingAddress": "54 Trần Hưng Đạo - Hoàn Kiếm - Hà Nội",
"propertyName": "Thành phố Hà Nội\nĐịa chỉ: 54 Trần Hưng Đạo - Hoàn Kiếm - Hà Nội\nLiên lạc: 0692196440",
"statusType": "Đã xử phạt",
"statusTypeText": "Đã xử phạt",
"departmentName": "Thành phố Hà Nội\nĐịa chỉ: 54 Trần Hưng Đạo - Hoàn Kiếm - Hà Nội\nLiên lạc: 0692196440",
"contactPhone": "0692196440"
},
{
"violationId": null,
"licensePlate": "29A34809",
"licensePlateType": "Nền màu trắng, chữ và số màu đen",
"vehicleType": "Ô tô con",
"vehicleTypeText": "Ô tô con",
"violationType": null,
"violationTypeText": "Liên hệ địa điểm nộp phạt để nhận hình ảnh VP",
"violationAt": "10:00 12/08/2020",
"violationAtText": "10:00 12/08/2020",
"violationAddress": "Hà Nội",
"handlingAddress": "54 Trần Hưng Đạo - Hoàn Kiếm - Hà Nội",
"propertyName": "Thành phố Hà Nội\nĐịa chỉ: 54 Trần Hưng Đạo - Hoàn Kiếm - Hà Nội\nLiên lạc: 0692196440",
"statusType": "Đã xử phạt",
"statusTypeText": "Đã xử phạt",
"departmentName": "Thành phố Hà Nội\nĐịa chỉ: 54 Trần Hưng Đạo - Hoàn Kiếm - Hà Nội\nLiên lạc: 0692196440",
"contactPhone": "0692196440"
}
]
} |
pyproject.toml
Outdated
@@ -16,7 +16,7 @@ dependencies = [ | |||
[project.optional-dependencies] | |||
discord = ["audioop-lts>=0.2.1", "discord-py>=2.4.0"] | |||
ocr = ["pytesseract>=0.3.13"] | |||
|
|||
etraffic = ["curl-cffi>=0.7.4"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change deps optional name to curl
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change the optional deps name
How ut could be None in the errors field?? :)) it must be null in json? |
- Change to true current version of curl-cffi which available
- Change "Ô tô" to "Ô tô con" because this api return it.
- Make _request return a _Response Typedict class object - Log when _request return None(This request fail)
implement #1