RedditDownloader
RedditDownloader copied to clipboard
Options to sanitize filename
Is your feature request related to a problem? Please describe.
I have been running into an issue with people using emoji's and the way RMD names it files.
Example:
I have the output option for file name pattern set like so: "file_name_pattern": "[subreddit]/[subreddit] - [title] - ([author])",
From within Ubuntu, after RMD Scrapes a subreddit, if I do an ls I get...
Subredit - Title of Post '$'\360\237\244\215'' - (Name of poster).jpg
if I echo out the file I get
Subredit - Title of Post 🤍 - (Name of poster).jpg
This causes issues with moving these files around the OS.
Describe the solution you'd like:
I would love to see an option to sanitize the file names either during or after download. Currently I am using a small bash script that includes this code snipit below.
# Sanitize filenames to remove invalid characters
for f in ./download/*.*;
do mv "$f" "${f//[^0-9A-Za-z.()\ ’\[\]\-!\/]}";
done