Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # download the chat log corresponding to a given .description file from youtube-dl
- # usage: holochat.sh [youtube-dl description file]
- # activate chat_downloader virtualenv
- source /home/anon/src/chat-replay-downloader/venv/bin/activate
- # extract base filename, used to name log file and probe video file
- base_filename=`echo "$1" | sed -e 's/\.description$//'`
- # extract youtube video ID from base filename
- video_id=`echo "${base_filename}" | grep -o ".\{11\}$"`
- # download chat log
- /home/anon/src/chat-replay-downloader/venv/bin/chat_downloader --cookies /path/to/cookies.txt --message_type all --chat_type live "https://youtube.com/watch?v=${video_id}" > "${base_filename}".log &&
- # update log timestamp to match description
- touch -r "${base_filename}".description "${base_filename}".log
- # print last lines of log and duration of corresponding video, to verify log was completely downloaded
- tail "${base_filename}".log
- # this is incredibly crude, and exploits the fact that 'jpg' and 'description' don't contain 'm',
- # but mkv, webm, and mp4 videos all do.
- ffprobe -i "${base_filename}".*m* 2>&1 |grep Duration
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement