This commit is contained in:
Eliezer Croitoru 2024-08-18 05:14:09 +03:00
parent 703f276458
commit 3dd3d30a96
11 changed files with 65554 additions and 12 deletions

5
Makefile Normal file
View File

@ -0,0 +1,5 @@
all:
echo OK
collect:
bash scripts/collect-vids.sh

8187
allowed-channels/@7up545.txt Normal file

File diff suppressed because it is too large Load Diff

57315
allowed.txt

File diff suppressed because it is too large Load Diff

View File

View File

@ -1,6 +0,0 @@
https://i.ytimg.com/vi/3rbcPeJPXTg
https://i.ytimg.com/an_webp/3rbcPeJPXTg
https://i.ytimg.com/sb/3rbcPeJPXTg
https://youtu.be/3rbcPeJPXTg
https://www.youtube.com/watch?v=3rbcPeJPXTg
https://youtube.com/watch?v=3rbcPeJPXTg

View File

@ -0,0 +1 @@
https://www.youtube.com/@7up545/videos

View File

33
scripts/collect-vids.sh Normal file
View File

@ -0,0 +1,33 @@
#!/usr/bin/env bash
function collect () {
PREFIX="$1"
VID_TEMPLATE_FILE="templates/vid-template.txt"
TMP_FILE=$( mktemp )
echo "${TMP_FILE}"
cat ${PREFIX}-vids/*.txt | xargs -I{} sed -e "s@###VID###@{}@g" "${VID_TEMPLATE_FILE}" >> "${TMP_FILE}"
cat ${PREFIX}-channels/*.txt | xargs -I{} sed -e "s@###VID###@{}@g" "${VID_TEMPLATE_FILE}" >> "${TMP_FILE}"
diff "${PREFIX}.txt" "${TMP_FILE}"
RES="$?"
if [ "${RES}" -gt "0" ]
then
mv -vf "${PREFIX}.txt" "${PREFIX}.txt.old" && \
cp -vf "${TMP_FILE}" "${PREFIX}.txt" && \
rm -vf "${PREFIX}.txt.old"
fi
rm -vf "${TMP_FILE}"
}
arr=("allowed" "blocked")
for i in "${arr[@]}"
do
collect "$i"
done

View File

@ -9,6 +9,7 @@ patterns << "https://i.ytimg.com/sb/###VID###"
patterns << "https://youtu.be/###VID###" patterns << "https://youtu.be/###VID###"
patterns << "https://www.youtube.com/watch?v=###VID###" patterns << "https://www.youtube.com/watch?v=###VID###"
patterns << "https://youtube.com/watch?v=###VID###" patterns << "https://youtube.com/watch?v=###VID###"
patterns << "https://music.youtube.com/watch?v=###VID###"
patterns.each do |p| patterns.each do |p|
puts("#{p.gsub("###VID###", vid)}") puts("#{p.gsub("###VID###", vid)}")

11
scripts/get-channel-vids.sh Executable file
View File

@ -0,0 +1,11 @@
#!/usr/bin/env bash
CHANNEL_URL="$1"
echo "${CHANNEL_URL}" |grep "^https\:\/\/www\.youtube\.com\/" >/dev/null
if [ "$?" -eq "0" ]
then
yt-dlp -v --flat-playlist --print id "${CHANNEL_URL}"
else
echo "Missing a valid channel URL" >&2
fi

7
templates/vid-template.txt Executable file
View File

@ -0,0 +1,7 @@
https://i.ytimg.com/vi/###VID###
https://i.ytimg.com/an_webp/###VID###
https://i.ytimg.com/sb/###VID###
https://youtu.be/###VID###
https://www.youtube.com/watch?v=###VID###
https://youtube.com/watch?v=###VID###
https://music.youtube.com/watch?v=###VID###