aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorV.Krishn <vkrishn4@gmail.com>2021-11-30 12:02:56 +0530
committerV.Krishn <vkrishn4@gmail.com>2021-11-30 12:02:56 +0530
commit467365f772bd879f36afc25f9eb3abeea10e65bf (patch)
treebab6b5285c17846d1fe3f028a4a4fe25bc78b912
parent035daa20d319ab446fc74f2fa4c5b2b1e6b84e58 (diff)
downloadnbreader-467365f772bd879f36afc25f9eb3abeea10e65bf.tar.bz2
fix minor bug in dirname url loop
-rw-r--r--scripts/feedicon.sh14
1 files changed, 8 insertions, 6 deletions
diff --git a/scripts/feedicon.sh b/scripts/feedicon.sh
index 2eb7f3a..e3b6270 100644
--- a/scripts/feedicon.sh
+++ b/scripts/feedicon.sh
@@ -170,13 +170,15 @@ get_feedicon() {
BURL=${proto}${host}
if [ ! "$BURL" ]; then return; fi
+ BURL=$(echo $url | sed -e "s,?.*$,," -e "s,/*$,,")
+
# 1. Use RSS url dirname variants (direct guess and fetch)
- local u1=$(echo $url | sed -e "s,?.*$,,")
+ local u1=$BURL
local fs=$(echo $u1 | grep -o '/' | wc -l)
seq $fs | while read s; do
- echo $s --- $u1
- u1=$(dirname $u1)
+ echo " $s --- $u1"
fetch_feedicon "${proto}$u1/favicon.ico"
+ u1=$(dirname $u1)
done
if is_file_ico $localIco; then
echo -e ${cYELLOW}' msg: favicon.ico is available - '${cGREEN}'download success'${cNORMAL};
@@ -185,14 +187,14 @@ get_feedicon() {
echo -e ${cRED}' msg: favicon.ico not available, retrying ...'${cNORMAL};
fi
+ clean_temp_icon
# 2. Try to extract from RSS url dirname variant pages
- BURL=$(echo $url | sed -e "s,?.*$,,")
seq $fs | while read s; do
if [ ! "$ICONURL" ]; then
- echo $s --- $BURL
- BURL=${proto}$(dirname $BURL)
+ echo " $s --- $BURL"
get_site_base "$BURL"
parse_feed_icon_url
+ BURL=${proto}$(dirname $BURL)
fi
done