Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- read -p "What channel URL? (/videos): " channel
- read -p "Date? (YYYYMMDD?): " date
- read -p "What are you looking for?: " question
- mkdir -p ~/test/yt-dlp/ || exit 1
- cd ~/test/yt-dlp/ || exit 1
- mkdir -p /dev/shm/llm-youtube-review/ || exit 1
- temp="0.7"
- mapfile -t ids < <(yt-dlp --date "${date}" --flat-playlist -J "${channel}" | jq -r '.entries[].id' )
- for id in "${ids[@]}" ; do
- url="https://www.youtube.com/watch?v=${id}"
- yt-dlp --no-warnings -q --skip-download --sub-format srv3 --write-auto-subs "${url}" -o video || exit 1
- title=$(yt-dlp --no-warnings -q --skip-download --get-title "${url}")
- cat video.en.srv3 | html2text > /dev/shm/llm-youtube-review/video.txt
- echo -n "${url}: " | tee -a /dev/shm/channel.txt
- llm-python-file.py /dev/shm/llm-youtube-review/video.txt "You are a helpful assistant." "The following is a youtube video transcription for a video named \`${title}\`." "Does this help answer the question or topic of \`${question}\`? Start your answer with \`Yes\` or \`No\`." "${temp}" | sed -e 's/\\n/\n/g' -e "s/\\'/'/g" -e "s/^'$//g" -e 's/\\//g' -e "s/'$//g" | tee -a /dev/shm/channel.txt
- done | grep "Yes"
Advertisement
Add Comment
Please, Sign In to add comment