Skip to content
This repository was archived by the owner on Jul 25, 2023. It is now read-only.

Commit 7f006ee

Browse files
committed
Strip unsafe characters from filenames
1 parent efd6c1c commit 7f006ee

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

bin/yt_splitter.dart

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,5 +189,11 @@ String renderDuration(int x) {
189189
}
190190

191191
String stripUnsafeCharacters(String text) {
192-
return text.trim().replaceAll(RegExp(r'\|\/\\\?":\*<>'), '_');
192+
if (Platform.isLinux) {
193+
return text.trim().replaceAll('/', '_');
194+
} else if (Platform.isMacOS) {
195+
return text.trim().replaceAll(RegExp(r'[\/:]'), '_');
196+
} else {
197+
return text.trim().replaceAll(RegExp(r'[\|\/\\\?":\*<>]'), '_');
198+
}
193199
}

0 commit comments

Comments
 (0)