Advertisement
Guest User

holochat.sh

a guest
Jun 18th, 2021
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.77 KB | None | 0 0
  1. #!/bin/bash
  2. # download the chat log corresponding to an existing youtube-dl description file
  3. # usage: holochat.sh [youtube-dl .description file]
  4.  
  5. # activate chat_downloader virtualenv
  6. source /home/anon/src/chat-replay-downloader/venv/bin/activate
  7. # extract the base filename
  8. base_filename=`echo "$1" | awk -F. '{print $(NF-1)}'`
  9. # extract youtube video ID from base filename
  10. video_id=`echo "${base_filename}" | awk '{print substr( $0, length($0) - 10 , length($0) ) }'`
  11. # download log
  12. /home/anon/src/chat-replay-downloader/venv/bin/chat_downloader --message_type all --chat_type live "https://youtube.com/watch?v=${video_id}" | tee "${base_filename}".log &&
  13. # update file modification date to match description file
  14. touch -r "${base_filename}".description "${base_filename}".log
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement