Skip to content

Commit 91731c9

Browse files
committed
Adds handling for photo sets with the path name separator in the name
1 parent 5f2a8e5 commit 91731c9

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

flickr_download/flick_download.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,13 @@ def download_set(set_id, get_filename, size_label=None):
104104
break
105105
raise
106106

107-
if not os.path.exists(pset.title):
108-
os.mkdir(pset.title)
107+
# we need to convert pathname separator to something else to create a valid directory
108+
dirname = pset.title.replace(os.sep, "_")
109+
if not os.path.exists(dirname):
110+
os.mkdir(dirname)
109111

110112
for photo in photos:
111-
fname = get_full_path(pset.title, get_filename(pset, photo, suffix))
113+
fname = get_full_path(dirname, get_filename(pset, photo, suffix))
112114
if os.path.exists(fname):
113115
# TODO: Ideally we should check for file size / md5 here
114116
# to handle failed downloads.

0 commit comments

Comments
 (0)