From 1027596791db5f4854bc417410fa5437eb766997 Mon Sep 17 00:00:00 2001 From: JustAnotherArchivist Date: Tue, 17 Dec 2019 03:15:23 +0000 Subject: [PATCH] Use relative instead of absolute path --- README.md | 3 +-- livechatreplay | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 3e36e83..34f68b5 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,5 @@ A method to grab the live chat replay from YouTube -* Requires qwarc. +* Requires qwarc and realpath from GNU coreutils 8.23+. * Execute as `livechatreplay VIDEOID` where `VIDEOID` is the 11-character video ID from YouTube. * All live chats (i.e. "top" and "all") are grabbed. -* Note that the absolute path to livechatreplay.py gets written to the meta WARC. diff --git a/livechatreplay b/livechatreplay index 6faa23e..8b45de2 100755 --- a/livechatreplay +++ b/livechatreplay @@ -1,5 +1,5 @@ #!/bin/bash videoId="$1" prefix="youtube-livechatreplay-${videoId}" -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" +DIR="$(realpath --relative-to=. "$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )")" YOUTUBE_VIDEOID="$videoId" qwarc --log "${prefix}.log" --database "${prefix}.db" --warc "${prefix}" "${DIR}/livechatreplay.py"