utils upgrade
This commit is contained in:
@@ -1,12 +1,38 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eo pipefail
|
||||
|
||||
curl "https://r.jina.ai/$1" \
|
||||
-sS \
|
||||
-H "DNT: 1" \
|
||||
-H "X-Base: final" \
|
||||
-H "X-Engine: direct" \
|
||||
-H "X-Md-Em-Delimiter: *" \
|
||||
-H "X-Md-Heading-Style: setext" \
|
||||
-H "X-Md-Link-Reference-Style: collapsed" \
|
||||
-H "X-Md-Link-Style: referenced"
|
||||
if [[ "$1" == "-h" || "$1" == "--help" ]]; then
|
||||
cat <<EOF
|
||||
Usage: $(basename "$0") [-h] <url>
|
||||
|
||||
Convert webpage URL to markdown using jina.ai.
|
||||
|
||||
Options:
|
||||
-h, --help Show this help message
|
||||
|
||||
Arguments:
|
||||
url URL of webpage to convert
|
||||
|
||||
EOF
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# More details: https://jina.ai/reader/
|
||||
|
||||
url="$1"; shift
|
||||
curl "https://r.jina.ai/$url" \
|
||||
-sS \
|
||||
-H "DNT: 1" \
|
||||
-H "X-Md-Hr: ---" \
|
||||
-H "X-Base: final" \
|
||||
-H "X-Timeout: 10" \
|
||||
-H "X-Locale: ru-RU" \
|
||||
-H "X-No-Cache: true" \
|
||||
-H "X-Engine: browser" \
|
||||
-H "X-User-Agent: url2md" \
|
||||
-H "X-Md-Em-Delimiter: *" \
|
||||
-H "X-Md-Link-Style: inlined" \
|
||||
-H "X-Return-Format: markdown" \
|
||||
-H "X-Keep-Img-Data-Url: true" \
|
||||
-H "X-Md-Link-Reference-Style: collapsed" \
|
||||
"$@"
|
||||
|
||||
Reference in New Issue
Block a user