Explorar el Código

Support multiple video IDs in one command

master
JustAnotherArchivist hace 4 años
padre
commit
4fbe7261eb
Se han modificado 2 ficheros con 7 adiciones y 4 borrados
  1. +1
    -0
      README.md
  2. +6
    -4
      livechatreplay

+ 1
- 0
README.md Ver fichero

@@ -2,4 +2,5 @@ A method to grab the live chat replay from YouTube

* Requires qwarc and realpath from GNU coreutils 8.23+.
* Execute as `livechatreplay VIDEOID` where `VIDEOID` is the 11-character video ID from YouTube.
* You can pass multiple video IDs at once as well: `livechatreplay VIDEOID1 VIDEOID2 ...`. They get executed sequentially.
* All live chats (i.e. "top" and "all") are grabbed.

+ 6
- 4
livechatreplay Ver fichero

@@ -1,5 +1,7 @@
#!/bin/bash
videoId="$1"
prefix="youtube-livechatreplay-${videoId}"
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"
for videoId in "$@"
do
prefix="youtube-livechatreplay-${videoId}"
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"
done

Cargando…
Cancelar
Guardar