MCPcopy Create free account
hub / github.com/NanmiCoder/MediaCrawler / get_instance

Method get_instance

store/excel_store_base.py:64–79  ·  view source on GitHub ↗

Get or create a singleton instance for the given platform and crawler type Args: platform: Platform name (xhs, dy, ks, etc.) crawler_type: Type of crawler (search, detail, creator) Returns: ExcelStoreBase instance

(cls, platform: str, crawler_type: str)

Source from the content-addressed store, hash-verified

62
63 @classmethod
64 def get_instance(cls, platform: str, crawler_type: str) -> "ExcelStoreBase":
65 """
66 Get or create a singleton instance for the given platform and crawler type
67
68 Args:
69 platform: Platform name (xhs, dy, ks, etc.)
70 crawler_type: Type of crawler (search, detail, creator)
71
72 Returns:
73 ExcelStoreBase instance
74 """
75 key = f"{platform}_{crawler_type}"
76 with cls._lock:
77 if key not in cls._instances:
78 cls._instances[key] = cls(platform, crawler_type)
79 return cls._instances[key]
80
81 @classmethod
82 def flush_all(cls):

Callers 12

__new__Method · 0.80
__new__Method · 0.80
__new__Method · 0.80
__new__Method · 0.80
__new__Method · 0.80
__new__Method · 0.80
__new__Method · 0.80

Calls

no outgoing calls