Replace # with _ in filenames.
Some media players don't like # in M3U playlists.
This commit is contained in:
parent
94ab72a6ec
commit
0cf9f65894
|
@ -78,6 +78,11 @@ function main()
|
||||||
[[ "${file}" =~ "\.vtt$" ]] && continue # Skip subtitle files.
|
[[ "${file}" =~ "\.vtt$" ]] && continue # Skip subtitle files.
|
||||||
# https://stackoverflow.com/a/8811800/5965450
|
# https://stackoverflow.com/a/8811800/5965450
|
||||||
if [[ "${files_before#*${file}}" == "${files_before}" ]]; then
|
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}\//}" \
|
echo "${file/${download_dir}\//}" \
|
||||||
>> "${download_dir}/New_${time}.m3u"
|
>> "${download_dir}/New_${time}.m3u"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue