# 怎么用Python下载图片，保留原来的目录结构

**URL:** <https://forum.freemdict.com/t/topic/23238>\
**Category:** 技术交流与词典编修\
**Tags:** mdx\
**Created:** [2023 年9 月 8 日 00:34 UTC](https://forum.freemdict.com/t/topic/23238 "2023-09-08T00:34:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

作者： ![xmg123](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/x/7cd45c/32.png) [@xmg123](https://forum.freemdict.com/u/xmg123)\
发布日期： [2023 年9 月 8 日 00:34 UTC](https://forum.freemdict.com/t/topic/23238/1 "2023-09-08T00:34:45Z")

</div>

怎么用Python下载图片，保留原来的目录结构，就是维基百科的图片，url链接最后一节有很多相同文件名的图片名称，导致直接下载时名称很多重复，都带（1这样的数字编号，），，试了下Teleport Pro导入txt文件，设置保留服务器目录可以实现，还有其他的吗
