{"record":{"id":"637dbff24562033d","repo":"NanmiCoder/MediaCrawler","slug":"get-containerid-failed","errorCode":null,"errorMessage":"get containerid failed","messagePattern":"get containerid failed","errorType":"exception","errorClass":"DataFetchError","httpStatus":null,"severity":"error","filePath":"media_platform/weibo/client.py","lineNumber":322,"sourceCode":"            except httpx.HTTPError as exc:  # some wrong when call httpx.request method, such as connection error, client error, server error or response status code is not 2xx\n                utils.logger.error(f\"[DouYinClient.get_aweme_media] {exc.__class__.__name__} for {exc.request.url} - {exc}\")    # Keep original exception type name for developer debugging\n                return None\n\n    async def get_creator_container_info(self, creator_id: str) -> Dict:\n        \"\"\"\n        Get user's container ID, container information represents the real API request path\n            fid_container_id: Container ID for user's Weibo detail API\n            lfid_container_id: Container ID for user's Weibo list API\n        Args:\n            creator_id: User ID\n\n        Returns: Dictionary with container IDs\n\n        \"\"\"\n        response = await self.get(f\"/u/{creator_id}\", return_response=True)\n        m_weibocn_params = response.cookies.get(\"M_WEIBOCN_PARAMS\")\n        if not m_weibocn_params:\n            raise DataFetchError(\"get containerid failed\")\n        m_weibocn_params_dict = parse_qs(unquote(m_weibocn_params))\n        return {\"fid_container_id\": m_weibocn_params_dict.get(\"fid\", [\"\"])[0], \"lfid_container_id\": m_weibocn_params_dict.get(\"lfid\", [\"\"])[0]}\n\n    async def get_creator_info_by_id(self, creator_id: str) -> Dict:\n        \"\"\"\n        Get user details by user ID\n        Args:\n            creator_id:\n\n        Returns:\n\n        \"\"\"\n        uri = \"/api/container/getIndex\"\n        containerid = f\"100505{creator_id}\"\n        params = {\n            \"jumpfrom\": \"weibocom\",\n            \"type\": \"uid\",\n            \"value\": creator_id,","sourceCodeStart":304,"sourceCodeEnd":340,"githubUrl":"https://github.com/NanmiCoder/MediaCrawler/blob/d6f7c5bb906b6dac40ddf343ef9e26438a3de092/media_platform/weibo/client.py#L304-L340","documentation":"Raised by WeiboClient.get_container_id when the GET /u/{creator_id} profile page response contains no M_WEIBOCN_PARAMS cookie. That cookie is the only source of the fid/lfid container IDs that the detail and list APIs require, so its absence means the profile page was not served normally (redirected to a verification/login page). It is a DataFetchError.","triggerScenarios":"Fetching a weibo user profile while not logged in or with expired cookies, an invalid/deactivated creator_id in WEIBO_CREATOR_ID_LIST, or an anti-bot response that sets no M_WEIBOCN_PARAMS cookie.","commonSituations":"WEIBO_CREATOR_ID_LIST contains a wrong or banned UID; the shared cookie string in config has gone stale; the crawler IP is flagged and weibo serves a security page instead of the profile.","solutions":["Verify the creator_id values in WEIBO_CREATOR_ID_LIST are real, active weibo UIDs (open https://weibo.com/u/{id} in a browser).","Re-login to weibo to refresh cookies before crawling creators.","Enable the proxy pool or slow down requests so the profile page is served normally.","Wrap the call and skip creators that consistently fail rather than aborting the whole creator loop."],"exampleFix":"// before\ncontainer = await wb_client.get_container_id(creator_id)\n// after\ntry:\n    container = await wb_client.get_container_id(creator_id)\nexcept DataFetchError:\n    utils.logger.warning(f\"creator {creator_id} unreachable, skipping\")\n    continue","handlingStrategy":"try-catch","validationCode":"async def can_get_container(wb_client, creator_id: str) -> bool:\n    try:\n        await wb_client.get_container_id(creator_id)\n        return True\n    except DataFetchError:\n        return False","typeGuard":null,"tryCatchPattern":"for user_id in config.WEIBO_CREATOR_ID_LIST:\n    try:\n        container = await wb_client.get_container_id(user_id)\n    except DataFetchError as e:\n        utils.logger.warning(f\"creator {user_id}: {e}; skipping\")\n        continue","preventionTips":["Verify each UID opens a live profile in a browser before adding to WEIBO_CREATOR_ID_LIST.","Refresh login cookies when profile pages stop setting M_WEIBOCN_PARAMS.","Crawl creators at low concurrency to avoid risk-control responses."],"tags":["weibo","cookies","creator","data-fetch"],"backgroundTag":null,"analyzedSha":"d6f7c5bb906b6dac40ddf343ef9e26438a3de092","analyzedAt":"2026-08-15T01:39:07.505Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}