thejandroman / bing-wallpaper

Bing.com wallpaper for OS X, and any Unix like desktop (eg. Ubuntu).
GNU General Public License v3.0
328 stars 83 forks source link

File result incorrect #24

Closed ruben-p closed 5 years ago

ruben-p commented 5 years ago

Now download files not correct, has: th?id=OHR.SeptimiusSeverus_ROW8081151443_1920x1080.jpg&rf=NorthMale_1920x1080.jpg&pid=hp

parnote commented 5 years ago

I, too, was having this issue. It seems the issue started March 9, 2019. To fix it, I replaced the following:

for p in "${urls[@]}"; do
    if [ -z "$FILENAME" ]; then
        filename=$(echo "$p"|sed -e "s/.*\/\(.*\)/\1/")
    else
        filename="$FILENAME"
    fi
    if [ $FORCE ] || [ ! -f "$PICTURE_DIR/$filename" ]; then
        print_message "Downloading: $filename..."
        curl $CURL_QUIET -Lo "$PICTURE_DIR/$filename" "$p"
    else
        print_message "Skipping: $filename..."
    fi
done

with this:

for p in ${urls[@]}; do
filename=$(echo $p|sed -e "s/.*\/\(.*\)/\1/")
filename1=$(echo $filename|cut -d "." -f 2)
FILE=$(date "+%F")"-"$filename1".jpg"
    if [ ! -f $PICTURE_DIR/$FILE ]; then
echo "Downloading: $filename1.jpg ..."
        curl -Lo "$PICTURE_DIR/$FILE" $p
    else
echo "Skipping: $filename1.jpg ..."
    fi
done

This has worked perfectly for me.

I hope this helps!

annrie commented 5 years ago

Great! solved. Thank you very much.