ignore no id
This commit is contained in:
parent
fe9cea388f
commit
cc90dbd974
1 changed files with 15 additions and 13 deletions
|
@ -1,6 +1,7 @@
|
|||
#!/bin/bash
|
||||
while read -r video_id
|
||||
do
|
||||
if [ -n "${video_id}" ]; then
|
||||
echo "Video ID: '${video_id}'"
|
||||
channel=$(yt-dlp -J "${video_id}" | jq '.channel' | sed 's/"//g' | head -n1)
|
||||
if [ -n "${channel}" ] && [ "${channel}" != "null" ]; then
|
||||
|
@ -15,4 +16,5 @@ do
|
|||
mv -- "${file}" "${channel}/"
|
||||
done <<< "$(find . -mindepth 1 -maxdepth 1 -type f -name \*"${video_id}"\*)"
|
||||
fi
|
||||
fi
|
||||
done <<< "$(find . -mindepth 1 -maxdepth 1 -type f| grep -Eo '\[[0-9a-zA-Z\-_]{11}\]' | tr -d '[]' | sort | uniq)"
|
||||
|
|
Loading…
Reference in a new issue