Skip to content

Commit

Permalink
修复淘宝搜索问题
Browse files Browse the repository at this point in the history
  • Loading branch information
ShilongLee committed Aug 13, 2024
1 parent 2c9431f commit fb90192
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions docs/api/taobao/taobao.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@
| 参数 | 必选 | 类型 | 说明 |
|:---:|:---:|:---:|:---:|
| id | true | string | 商品id |
| offset | false | int | 评论翻页偏移量, 默认0 |
| limit | false | int | 评论数量, 默认20 |

- **Success Response**

Expand Down
4 changes: 2 additions & 2 deletions service/taobao/logic/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ async def request_search(keyword: str, cookie: str, offset: int = 0, limit: int
total = 0

tasks = [search(keyword, cookie, page) for page in range(start_page, end_page + 1)]
results = await asyncio.gather(*tasks)
for data in results:
task_results = await asyncio.gather(*tasks)
for data in task_results:
results.extend(data.get('itemsArray', []))
total = data.get('mainInfo', {}).get('totalResults', 0)

Expand Down

0 comments on commit fb90192

Please sign in to comment.