diff options
author | Case Duckworth | 2022-07-18 11:24:19 -0500 |
---|---|---|
committer | Case Duckworth | 2022-07-18 11:24:19 -0500 |
commit | 9846f1f6719763c104180c2574b11c040d3a4e1d (patch) | |
tree | 9d0828d2753ba29bcf80ef22357acfa7bdfc217b | |
parent | Add more links to each feed (diff) | |
download | sfeed-9846f1f6719763c104180c2574b11c040d3a4e1d.tar.gz sfeed-9846f1f6719763c104180c2574b11c040d3a4e1d.zip |
Add NOFETCH option
-rwxr-xr-x | runsfeed | 4 | ||||
-rw-r--r-- | sfeedrc | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/runsfeed b/runsfeed index da43529..0e076d1 100755 --- a/runsfeed +++ b/runsfeed | |||
@@ -4,6 +4,9 @@ | |||
4 | # set -euo pipefail | 4 | # set -euo pipefail |
5 | 5 | ||
6 | main() { | 6 | main() { |
7 | NOFETCH=false | ||
8 | [ "x$1" = "x-n" ] && NOFETCH=true | ||
9 | export NOFETCH | ||
7 | export SFEED_CONFIG="$HOME/.sfeed" | 10 | export SFEED_CONFIG="$HOME/.sfeed" |
8 | # SFEED_CONFIG="${XDG_CONFIG_HOME:-$HOME/.config}/sfeed" | 11 | # SFEED_CONFIG="${XDG_CONFIG_HOME:-$HOME/.config}/sfeed" |
9 | export SFEED_DATA="$HOME/.sfeed" | 12 | export SFEED_DATA="$HOME/.sfeed" |
@@ -46,6 +49,7 @@ update_urls() { | |||
46 | } | 49 | } |
47 | 50 | ||
48 | get_invidious_url() { | 51 | get_invidious_url() { |
52 | "${NOFETCH:-false}" && return | ||
49 | curl -sL "$1" | | 53 | curl -sL "$1" | |
50 | jq -r .[][1].uri | | 54 | jq -r .[][1].uri | |
51 | grep -v onion | | 55 | grep -v onion | |
diff --git a/sfeedrc b/sfeedrc index a86b3e1..cc1f5f5 100644 --- a/sfeedrc +++ b/sfeedrc | |||
@@ -226,7 +226,7 @@ filter_html_entities() { | |||
226 | # Fetch ######################################################### | 226 | # Fetch ######################################################### |
227 | 227 | ||
228 | fetch() { # fetch(name, url, feedfile) | 228 | fetch() { # fetch(name, url, feedfile) |
229 | # return | 229 | "${NOFETCH:-false}" && return |
230 | curl -s -L \ | 230 | curl -s -L \ |
231 | --max-redirs 3 \ | 231 | --max-redirs 3 \ |
232 | --header "'User-Agent: $USER_AGENT'" \ | 232 | --header "'User-Agent: $USER_AGENT'" \ |