bbolli / tumblr-utils

Utilities for dealing with Tumblr blogs, Tumblr backup
GNU General Public License v3.0
667 stars 124 forks source link

added options to normalize text, escape text, and optimize for disk v… #196

Open thisismycontributionaccount opened 5 years ago

thisismycontributionaccount commented 5 years ago

…iewing

This is for issue #159 . I was having a similar issue with special characters as well as with tag upper/lower case.

I have added three new options and the code to implement the options.

--normalize-tags - sets the text to lower case and creates a unique set to remove duplicates --escape-tags - uses urllib.quote_plus to escape special characters in the tags --fix-for-disk - adds an extra urllib.quote_plus when the urls are being built to account for browsing from disk weirdness in windows

cebtenzzre commented 5 years ago

So, why would you not want to escape special characters in tags? I think we should unconditionally avoid things that crash tumblr-utils, like trying to create directories with invalid names.
Also, I think this could still create filenames that are invalid on Windows, e.g anything ending in a period.

thisismycontributionaccount commented 5 years ago

There is only so much you can code for. :-)

I would agree about creating directories without special characters. The only place I see that happening is in the tag creation.