fix: Correct creation of temporary file

This commit is contained in:
Carlos Solís 2025-06-16 14:45:16 +00:00
parent 9b7e9c9553
commit ec130de205

View file

@ -120,7 +120,7 @@ total=$(find "${temporary}" -type f -iname "*.info.json" | wc -l)
find "${temporary}" -type f -iname "*.info.json" | while read -r x; do
count=$((count + 1))
(
jq '.formats="" | .automatic_captions="" | .thumbnails="" | .tags=""' "${x}" >"${temporary}/${x}.tmp" && mv "${temporary}/${x}.tmp" "${x}"
touch "${temporary}/${x}.tmp" && jq '.formats="" | .automatic_captions="" | .thumbnails="" | .tags=""' "${x}" >"${temporary}/${x}.tmp" && mv "${temporary}/${x}.tmp" "${x}"
if [[ -f "${x}" && "${channel}" != "subscriptions" && $(jq -rc ".uploader_id" "${x}") != "@${channel}" ]]; then
echo "Video ${x} not uploaded from ${channel}, removing..." && rm "${x}"
fi