def pull_dir(self, src: str, dst: typing.Union[str, pathlib.Path], exist_ok: bool = True) -> int:
        """Pull directory from device:src into local:dst

        Returns:
            total files size pulled
        """

        def rec_pull_contents(src: str, dst: typing.Union[str, pathlib.Path], exist_ok: bool = True) -> int:
            s = 0
            items = list(self.iter_directory(src))

            items = list(filter(
                lambda i: i.path != '.' and i.path != '..',
                items
            ))

            dirs = list(
                filter(
                    lambda f: stat.S_IFDIR & f.mode != 0,
                    items
                ))
            files = list(
                filter(
                    lambda f: stat.S_IFREG & f.mode != 0,
                    items
                ))
            
            for dir in dirs:
                new_src:str = append_path(src, dir.path) 
                new_dst:pathlib.Path = pathlib.Path(append_path(dst, dir.path)) 
                os.makedirs(new_dst, exist_ok=exist_ok)
                s += rec_pull_contents(new_src, new_dst ,exist_ok=exist_ok)

            for file in files:
                new_src:str = append_path(src, file.path) 
                new_dst:str = append_path(dst, file.path) 
                s += self.pull_file(new_src, new_dst)

            return s


        if isinstance(dst, str):
            dst = pathlib.Path(dst)
        os.makedirs(dst, exist_ok=exist_ok)

        return rec_pull_contents(src, dst, exist_ok=exist_ok)
Pull directory from device:src into local:dst

        Returns:
            total files size pulled
        
adbutils/sync.py