Thank to @Demential98 for fix problem with "..." on create folder.

This commit is contained in:
Lovi 2024-11-20 11:44:50 +01:00
parent de06526803
commit c288d56b04
2 changed files with 12 additions and 2 deletions

View File

@ -95,13 +95,23 @@ def remove_special_characters(input_string):
if input_string is None:
return "None"
# Check if the string ends with '.mp4'
# If it does, we temporarily remove the '.mp4' extension for processing
ends_with_mp4 = input_string.endswith('.mp4')
if ends_with_mp4:
input_string = input_string[:-4] # Remove the last 4 characters ('.mp4')
# Compile regular expression pattern to match special characters
pattern = re.compile('[' + re.escape(special_chars_to_remove) + ']')
# Use compiled pattern to replace special characters with an empty string
cleaned_string = pattern.sub('', input_string)
return cleaned_string
# If the original string had the '.mp4' extension, re-add it to the cleaned string
if ends_with_mp4:
cleaned_string += '.mp4'
return cleaned_string.strip()

View File

@ -7,7 +7,7 @@
"clean_console": true,
"root_path": "Video",
"map_episode_name": "%(tv_name)_S%(season)E%(episode)_%(episode_name)",
"special_chars_to_remove": "!@#$%^&*()[]{}<>|`~'\";:,?=+\u00e2\u20ac\u00a6",
"special_chars_to_remove": ".-!@#$%^&*()[]{}<>|`~'\";:,?=+\u00e2\u20ac\u00a6",
"config_qbit_tor": {
"host": "192.168.1.59",
"port": "8080",