Replace # with _ in filenames.

Some media players don't like # in M3U playlists.
This commit is contained in:
tastytea 2020-12-25 18:21:01 +01:00
parent 94ab72a6ec
commit 0cf9f65894
1 changed files with 5 additions and 0 deletions

View File

@ -78,6 +78,11 @@ function main()
[[ "${file}" =~ "\.vtt$" ]] && continue # Skip subtitle files.
# https://stackoverflow.com/a/8811800/5965450
if [[ "${files_before#*${file}}" == "${files_before}" ]]; then
if [[ "${file}" =~ "#" ]]; then
local file_new="${file:gs/#/_}"
mv "${file}" "${file_new}"
file="${file_new}"
fi
echo "${file/${download_dir}\//}" \
>> "${download_dir}/New_${time}.m3u"
fi