fix: Remove leftover videos from other channels
This commit is contained in:
parent
f301b3ecb8
commit
b91694e1cf
1 changed files with 5 additions and 1 deletions
|
@ -75,7 +75,7 @@ fi
|
|||
find . -type f -iname "*.info.json" -exec ls -t {} + | while read -r xp; do
|
||||
x="${xp##./}"
|
||||
df=$(jq -rc '.timestamp' "${subfolder}/${x}")
|
||||
touch "${subfolder}/${x}" -d "@${df}"
|
||||
touch "${subfolder}/${x}" -d "${df}"
|
||||
#TODO: Read the date directly
|
||||
#df=$(jq -rc '.timestamp' "${subfolder}/${x}")
|
||||
#if [[ "${breaktime}" =~ ^[0-9]+$ ]]; then
|
||||
|
@ -120,6 +120,10 @@ if [[ ${enablecsv} = "1" || ${enabledb} = "1" ]]; then
|
|||
rm "${file}"
|
||||
fi
|
||||
fi
|
||||
if [[ "${channel}" != "subscriptions" && $(jq -rc ".uploader_id" "${file}") != "@${channel}" ]]; then
|
||||
echo "Video ${file} not uploaded from ${channel}, removing..."
|
||||
rm "${file}"
|
||||
fi
|
||||
if [[ ${enabledb} = "1" ]]; then
|
||||
if [[ -f "${file}" ]]; then
|
||||
jq -c "{\"videoId\": .id, \"title\": .title, \"author\": .uploader, \"authorId\": .channel_id, \"lengthSeconds\": .duration, \"published\": ( .timestamp * 1000 ), \"timeAdded\": $(date +%s)$(date +%N | cut -c-3), \"playlistItemId\": \"$(cat /proc/sys/kernel/random/uuid)\", \"type\": \"video\"}" "${subfolder}/${file}" | tee -a "/tmp/${channel}.db"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue