fix illegal chars in title
parent
7c06268f8e
commit
69a2003398
10
scrape.sh
10
scrape.sh
|
|
@ -94,7 +94,15 @@ scrape_book() {
|
|||
fi
|
||||
scrape_book_chapter "$chapter" > "$f"
|
||||
log scraping book title from $f
|
||||
local title="$(grep '^\#' "$f" | head -n 1 | sed 's/^\#*//' | sed 's/^[ ]*//' | sed 's/[ ]*$//')"
|
||||
local title="$(
|
||||
grep '^\#' "$f" \
|
||||
| head -n 1 \
|
||||
| sed 's/^\#*//' \
|
||||
| sed 's/^[ ]*//' \
|
||||
| sed 's/[ ]*$//' \
|
||||
| sed 's/[ ][ ]*/ /g' \
|
||||
| sed 's/[^a-zA-Z0-9]/_/g' \
|
||||
)"
|
||||
if [ -z "$title" ]; then
|
||||
title="${chapter%/}"
|
||||
title="${title##*/}"
|
||||
|
|
|
|||
Loading…
Reference in New Issue