def __init__(self, spider_dir_name):
        if not spider_dir_name:
            raise RuntimeError('必须指定图组名称')

        # 准备好爬虫目录
        self.spider_dir = IOUtils.merge_dir(self.__home_dir__, spider_dir_name)
        IOUtils.create_dir_force(self.spider_dir)
        # 创建目录缓存
        self.path_cache = PathCacheUtils(self.spider_dir)
    def create_group_dir(self, group_name, group_url):
        group_code = self.get_group_code_and_title(group_name)[0]
        group_dir = self.path_cache.get_path(group_code)
        if group_dir is not None:
            return group_dir

        # 创建目录
        group_dir = IOUtils.merge_dir(self.spider_dir, group_name)
        IOUtils.create_dir_force(group_dir)
        self.path_cache.add_cache(group_name)
        # 保存超链接
        self.save_url_link(group_dir, group_url)
        return group_dir