Skip to content

Commit

Permalink
Maj GitHub Sync - Friday, 03 November, 2023 07:28:54 AM +07
Browse files Browse the repository at this point in the history
  • Loading branch information
majal committed Nov 3, 2023
1 parent 6408604 commit da7099d
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions SL/sl_findlang
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ verse="${3}"

[ -z "${3}" ] && errx "Usage: $(basename ${0}) <book_num> <chapter> <verse>" 1

mpv_count=2

dir='/home/maj/._nosnapshot/Videos/SL/Publications/nwt/nwt_info'
cd "${dir}"

Expand All @@ -19,7 +21,7 @@ for file in videos_nwt_*.json; do
lang=${file#videos_nwt_}
lang=${lang%.json}

vid_lang=$(jq -rn 'input | .languages.'${lang}'.name' "${file}" 2>/dev/null)
vid_sl=$(jq -rn 'input | .languages.'${lang}'.name' "${file}" 2>/dev/null)
vid_marker=$(jq '.files.'${lang}'.MP4[] | select(.label == "720p") | .markers | select(.bibleBookNumber == '${book}' and .bibleBookChapter == '${chapter}') | .markers[] | select(.verseNumber == '${verse}')' "${file}" 2>/dev/null)
vid_url=$(jq -r '.files.'${lang}'.MP4[] | select(.label=="720p" and .markers.bibleBookNumber == '${book}' and .markers.bibleBookChapter == '${chapter}') | .file.url' "${file}" 2>/dev/null)
start_time=$(echo "${vid_marker}" | jq -r '.startTime')
Expand All @@ -28,13 +30,19 @@ for file in videos_nwt_*.json; do
[ -n "${vid_marker}" ] && {

echo "${file}"
echo-r "${vid_lang}"
echo-r "${vid_sl}"
echo "${vid_marker}" | jq
echo-g "${vid_url}"
echo-y " mpv --keep-open=always --resume-playback=no --save-position-on-quit=no --start=${start_time} --length=${duration} ${vid_url}"

echo

mpv --pause=yes --keep-open=always --resume-playback=no --focus-on-open=no --window-minimized=yes --osd-playing-msg="${vid_sl}" --osd-duration=3600000 --save-position-on-quit=no --start=${start_time} --length=${duration} ${vid_url} &

while [ $(jobs -r -p | wc -l) -ge ${mpv_count} ]; do sleep 1; done

echo

}

done

0 comments on commit da7099d

Please sign in to comment.