Write M3U playlist with new videos.
This commit is contained in:
parent
9c083ec36e
commit
442e31d2fd
@ -54,6 +54,7 @@ function main()
|
||||
[[ -z "${ytdl_format}" ]] && local ytdl_format="best"
|
||||
|
||||
mkdir -p "${download_dir}"
|
||||
files_before="$(find "${download_dir}" -type f)"
|
||||
local -a feedlist=("${(@Q)${(z)$(read_feedlist)}}")
|
||||
for feed in ${feedlist}; do
|
||||
youtube-dl \
|
||||
@ -64,6 +65,12 @@ function main()
|
||||
"${ytdl_extra_args}" \
|
||||
"${feed}"
|
||||
done
|
||||
files_after="$(find "${download_dir}" -type f)"
|
||||
while read file; do
|
||||
if [[ ! "${files_before}" =~ "${file}" ]]; then
|
||||
echo "${file}" >> "${download_dir}/New_$(date +'%F_%R').m3u"
|
||||
fi
|
||||
done <<<"${files_after}"
|
||||
|
||||
find "${download_dir}" -type f -mtime +"${keep_for_days}" -delete
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user