Skip to content

fix: 添加接口数据格式的验证,避免list返回影响整个循环#13

Open
tdh62 wants to merge 1 commit into
GakkiNoOne:mainfrom
tdh62:main
Open

fix: 添加接口数据格式的验证,避免list返回影响整个循环#13
tdh62 wants to merge 1 commit into
GakkiNoOne:mainfrom
tdh62:main

Conversation

@tdh62
Copy link
Copy Markdown

@tdh62 tdh62 commented Sep 20, 2025

修复特别情况下返回list格式数据影响整个循环的问题

2025-09-20 14:49:31,000 | INFO | 🔍 Processing file: https://api.github.com/repos/kiang/dpp.org.tw/contents/tag?keyword=台北市.html
2025-09-20 14:49:33,127 | ERROR | --------------------------------------------------
| 💥 Unexpected error: 'list' object has no attribute 'get'
└--------------------------------------------------------------------------------
Traceback (most recent call last):
  File "/app/app/hajimi_king.py", line 345, in main
    valid_count, rate_limited_count = process_item(item)
                                      ^^^^^^^^^^^^^^^^^^
  File "/app/app/hajimi_king.py", line 145, in process_item
    content = github_utils.get_file_content(item)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/utils/github_client.py", line 186, in get_file_content
    encoding = file_metadata.get("encoding")
               ^^^^^^^^^^^^^^^^^
AttributeError: 'list' object has no attribute 'get'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant