mY9Yd2 / yt-channel-watcher

Like 'Subscriptions' youtube page, but without subscription and live streams
https://ytcw.pages.dev/
MIT License
0 stars 0 forks source link

Unique handle name change(s) or non-existent #7

Open mY9Yd2 opened 1 month ago

mY9Yd2 commented 1 month ago

What happens if someone changes their unique @ handle name? How should we handle this?

Or should it be checked regularly and separately by the user?

mY9Yd2 commented 1 month ago

Slow, but separate solution:

#!/usr/bin/env bash

mapfile -t file_data < "channels.yaml"

for data in "${file_data[@]}"; do
    # Remove whitespaces from the string
    data="$(echo -e "${data}" | tr -d '[:space:]')"

    # We are only interested in data that starts with -"@
    if [[ $data == '-"@'* ]]; then
        # Remove -" from the beginning of the string
        data="${data#'-"'}"

        # Remove " from the ending of the string
        data="${data%'"'}"

        url="https://www.youtube.com/$data"

        yt-dlp --simulate --quiet --no-warnings --max-downloads 1 --print channel "$url"
    fi
done

yt-dlp will tell you if there is an error.