Fix #8: jq: error: null (null) cannot be matched, as it is not a string
This commit is contained in:
parent
0046879d08
commit
885219acd1
|
@ -20,9 +20,9 @@ url="https://www.reddit.com/r/$subreddit/$sort/.json?raw_json=1&t=$top_time"
|
||||||
content=`wget -T $timeout -U "$useragent" -q -O - $url`
|
content=`wget -T $timeout -U "$useragent" -q -O - $url`
|
||||||
mkdir -p $subreddit
|
mkdir -p $subreddit
|
||||||
while : ; do
|
while : ; do
|
||||||
urls=$(echo -n "$content"| jq -r '.data.children[]|select(.data.post_hint|test("image")) | .data.preview.images[0].source.url')
|
urls=$(echo -n "$content"| jq -r '.data.children[]|select(.data.post_hint|test("image")?) | .data.preview.images[0].source.url')
|
||||||
names=$(echo -n "$content"| jq -r '.data.children[]|select(.data.post_hint|test("image")) | .data.title')
|
names=$(echo -n "$content"| jq -r '.data.children[]|select(.data.post_hint|test("image")?) | .data.title')
|
||||||
ids=$(echo -n "$content"| jq -r '.data.children[]|select(.data.post_hint|test("image")) | .data.id')
|
ids=$(echo -n "$content"| jq -r '.data.children[]|select(.data.post_hint|test("image")?) | .data.id')
|
||||||
a=1
|
a=1
|
||||||
wait # prevent spawning too many processes
|
wait # prevent spawning too many processes
|
||||||
for url in $urls; do
|
for url in $urls; do
|
||||||
|
|
Loading…
Reference in New Issue