![]() Thread = Thread(target=download_file, args=(url, name, path))ĭef main(dir_path: str, download_dir: str):Įmoji_dir = Path(download_dir) / dataĮmoji_dir.mkdir(parents=True, exist_ok=True) ![]() With requests.get(url, stream=True) as response:ĭef create_download_thread(url: str, name: str, path: Path) -> Thread: from argparse import ArgumentParserĭef download_file(url: str, filename: str, parent: Path):ĭownloads the file from `url` and saves to `filename` inside the `parent` directory. It downloads the files as threads, and saves to disk with the shutil's copyfileobj method.įeel free to nitpick each and everything which could be improved. I wrote a script which goes over the pack file details as specified by the emojipacks project, and downloads (and saves) to the local drive. The script relies on ruamel-yaml and requests packages
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |