diff options
author | Case Duckworth | 2022-07-18 09:33:09 -0500 |
---|---|---|
committer | Case Duckworth | 2022-07-18 09:33:09 -0500 |
commit | 99dd02979bd263b80fad9b4859ddcaed58e46cc0 (patch) | |
tree | 4a901ee5f925a1ef5ac4836ff06e1bf66ca88973 /sfeed_html.sh | |
parent | Filter titles and things (diff) | |
download | sfeed-99dd02979bd263b80fad9b4859ddcaed58e46cc0.tar.gz sfeed-99dd02979bd263b80fad9b4859ddcaed58e46cc0.zip |
Convert youtube -> invidious
Diffstat (limited to 'sfeed_html.sh')
-rwxr-xr-x | sfeed_html.sh | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sfeed_html.sh b/sfeed_html.sh index 86aad43..321d451 100755 --- a/sfeed_html.sh +++ b/sfeed_html.sh | |||
@@ -67,6 +67,12 @@ $(for file in "$@"; do html_feed "$file"; done) | |||
67 | EOF | 67 | EOF |
68 | } | 68 | } |
69 | 69 | ||
70 | filter_invidious() { | ||
71 | # Convert youtube links to invidious links | ||
72 | host="$(cat /tmp/invidious.host)" | ||
73 | sed "s@https://www\.youtube\.com@${host}@" | ||
74 | } | ||
75 | |||
70 | html_feed() { # html_feed FEED(file) => HTML | 76 | html_feed() { # html_feed FEED(file) => HTML |
71 | filename="$(basename "$1")" | 77 | filename="$(basename "$1")" |
72 | now="$(date +%s)" | 78 | now="$(date +%s)" |
@@ -136,7 +142,7 @@ html_feed() { # html_feed FEED(file) => HTML | |||
136 | printf "<a href=\"#%s\">%s</a></li>\n", NAME, NAME >> ASIDE | 142 | printf "<a href=\"#%s\">%s</a></li>\n", NAME, NAME >> ASIDE |
137 | } | 143 | } |
138 | printf "%s", (stamp ? stamp : ".") > "/dev/stderr" | 144 | printf "%s", (stamp ? stamp : ".") > "/dev/stderr" |
139 | }' "$1")" | 145 | }' "$1" | filter_invidious)" |
140 | if [ -z "$entries" ]; then return 1; fi | 146 | if [ -z "$entries" ]; then return 1; fi |
141 | echo "<section id=\"$filename\">" | 147 | echo "<section id=\"$filename\">" |
142 | # TODO: Include a link back to the website | 148 | # TODO: Include a link back to the website |