{"record":{"id":"f707608ac6ebace5","repo":"NanmiCoder/MediaCrawler","slug":"get-creator-info-error","errorCode":null,"errorMessage":"Get creator info error","messagePattern":"Get creator info error","errorType":"exception","errorClass":"DataFetchError","httpStatus":null,"severity":"error","filePath":"media_platform/weibo/core.py","lineNumber":316,"sourceCode":"            utils.logger.info(f\"[WeiboCrawler.get_note_images] Sleeping for {config.CRAWLER_MAX_SLEEP_SEC} seconds after fetching image\")\n            if content != None:\n                extension_file_name = url.split(\".\")[-1]\n                await weibo_store.update_weibo_note_image(pid, content, extension_file_name)\n\n    async def get_creators_and_notes(self) -> None:\n        \"\"\"\n        Get creator's information and their notes and comments\n        Returns:\n\n        \"\"\"\n        utils.logger.info(\"[WeiboCrawler.get_creators_and_notes] Begin get weibo creators\")\n        for user_id in config.WEIBO_CREATOR_ID_LIST:\n            createor_info_res: Dict = await self.wb_client.get_creator_info_by_id(creator_id=user_id)\n            if createor_info_res:\n                createor_info: Dict = createor_info_res.get(\"userInfo\", {})\n                utils.logger.info(f\"[WeiboCrawler.get_creators_and_notes] creator info: {createor_info}\")\n                if not createor_info:\n                    raise DataFetchError(\"Get creator info error\")\n                await weibo_store.save_creator(user_id, user_info=createor_info)\n\n                # Create a wrapper callback to get full text before saving data\n                async def save_notes_with_full_text(note_list: List[Dict]):\n                    # If full text fetching is enabled, batch get full text first\n                    updated_note_list = await self.batch_get_notes_full_text(note_list)\n                    await weibo_store.batch_update_weibo_notes(updated_note_list)\n\n                # Get all note information of the creator\n                all_notes_list = await self.wb_client.get_all_notes_by_creator_id(\n                    creator_id=user_id,\n                    container_id=f\"107603{user_id}\",\n                    crawl_interval=0,\n                    callback=save_notes_with_full_text,\n                )\n\n                note_ids = [note_item.get(\"mblog\", {}).get(\"id\") for note_item in all_notes_list if note_item.get(\"mblog\", {}).get(\"id\")]\n                await self.batch_get_notes_comments(note_ids)","sourceCodeStart":298,"sourceCodeEnd":334,"githubUrl":"https://github.com/NanmiCoder/MediaCrawler/blob/d6f7c5bb906b6dac40ddf343ef9e26438a3de092/media_platform/weibo/core.py#L298-L334","documentation":"Raised by WeiboCrawler.get_creators_and_notes when get_creator_info_by_id returned a truthy response but its 'userInfo' key is missing or empty. It signals that the weibo user-info API answered without user data - typically because the UID does not exist, was banned, or risk control suppressed the payload. It is a DataFetchError thrown at the orchestration layer.","triggerScenarios":"A UID in WEIBO_CREATOR_ID_LIST that weibo's API does not return userInfo for; the response shape changed (API break); or an anti-bot JSON body without user data.","commonSituations":"Typo'd or outdated creator IDs pasted into config/base_config.py; account deactivated between crawl runs; weibo API contract change after a site update.","solutions":["Check the logged creator info line just above the raise to see what the API actually returned.","Confirm each UID in WEIBO_CREATOR_ID_LIST resolves to a live profile in a browser.","If the empty-userInfo case should not kill the run, catch DataFetchError around the loop body and continue with the next creator.","Refresh login cookies / proxy, since risk-controlled sessions also return empty userInfo."],"exampleFix":"// before\nif not createor_info:\n    raise DataFetchError(\"Get creator info error\")\n// after\nif not createor_info:\n    utils.logger.warning(f\"creator {user_id} returned no userInfo, skipping\")\n    continue","handlingStrategy":"validation","validationCode":"def creator_info_is_usable(createor_info_res: Dict) -> bool:\n    return bool(createor_info_res.get(\"userInfo\"))","typeGuard":"def is_creator_info(value: Dict) -> bool:\n    info = value.get(\"userInfo\") if isinstance(value, dict) else None\n    return isinstance(info, dict) and len(info) > 0","tryCatchPattern":"try:\n    res = await self.wb_client.get_creator_info_by_id(creator_id=user_id)\nexcept DataFetchError as e:\n    utils.logger.warning(f\"creator {user_id} failed: {e}\")\n    continue","preventionTips":["Log the raw get_creator_info_by_id response once per run to catch API-shape changes early.","Treat empty userInfo as skip-worthy, not fatal, when crawling many creators.","Keep creator ID lists curated and periodically re-verified."],"tags":["weibo","creator","config","data-fetch"],"backgroundTag":null,"analyzedSha":"d6f7c5bb906b6dac40ddf343ef9e26438a3de092","analyzedAt":"2026-08-15T01:39:07.505Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}