Aslain 399 Posted December 10, 2015 (edited) Hi, So you guys have developed this: https://bitbucket.org/XVM/xvm/src/31bfce2b2c96/addons/clanicons/?at=default But it seem to be outdated, I cannot make it work at all. In windows it's downloading icons super slow, and nothing is created, I receive 0 bytes files and no icons at all. What I want to do is to download is all clan icons for every region. Any help appreciated. Ty. Edited December 10, 2015 by Aslain Quote Share this post Link to post Short link Share on other sites
Aslain 399 #304515 Posted December 14, 2015 Nobody can help? :( Quote Share this post Link to post Short link Share on other sites
C.. 14 #305571 Posted December 18, 2015 (edited) Checking on EU, i see wargaming has changed the URL style: it's no longer http://worldoftanks.eu/community/clans/$1/, this now redirects to http://eu.wargaming.net/clans/$1/... I didn't check other regions. Edited December 18, 2015 by C.. 1 Quote Share this post Link to post Short link Share on other sites
Okxa 1 #315627 Posted February 29, 2016 (edited) I found out that clanicon location for eu is now: http://eu.wargaming.net/clans/media/clans/emblems/cl_001/500000001/emblem_64x64.png So Should this work if host=eu.wargaming.net ? (modified scripts-allclans\.update.sh) #!/bin/sh [ "$host" = "" ] && exit # main main() { id=$startclan mkdir -p ../icons/$dir/ echo "Started at `date +%T_%F`" while [ $id -le $lastclan ]; do update $id id=$((id+1)) done optimize echo "Finished at `date +%T_%F`" } # update # $1 - clanId update() { echo -n "$1 - " errors=0 while [ 1 ]; do clan=`wget -qc -t 5 -T 10s "http://$host/clans/$1/" -O - 2>/dev/null | \ grep "<title>" | \ cut -d[ -f2 | \ cut -d] -f1` #Clan removed or does not exist if [ "$clan" = " <title>" ]; then echo "REMOVED" return #Error handling - server maintenance elif [ "$clan" = "" ]; then errors=$((errors+1)) if [ $errors -lt 2 ]; then echo -n "EMPTY `date +%T_%F` $errors.. " sleep 10m continue elif [ $errors -lt 6 ]; then echo -n "$errors.. " sleep 10m continue else echo "ERROR" return fi fi break done echo -n "[$clan] => $clan.png" wget -qc -t 5 -T 10s http://$host/clans/media/clans/emblems/cl_${1:(-3)}/$1/emblem_64x64.png \ -O ../icons/$dir/$clan.png 2>/dev/null echo " OK" } optimize() { echo "Optimizing PNGs..." ( cd ../icons/$dir pngoptimizer -file:*.png ) } EDIT: Doesnt work for me as it is. I think it hangs when getting from clanname from <title> for the $clan as the format of title has changed? Im not much of a coder myself so im not sure.... clan=`wget -qc -t 5 -T 10s "http://$host/clans/$1/" -O - 2>/dev/null | \ grep "<title>" | \ cut -d[ -f2 | \ cut -d] -f1` Edited February 29, 2016 by Okxa Quote Share this post Link to post Short link Share on other sites
Okxa 1 #315689 Posted March 1, 2016 (edited) Made a working update.sh! This Works atleas for me on git for windows, i had to download wget because git for win doesnt have it. And works on EU, but havent tested for other regions Also be wary that this is really crudely done but it works for now #!/bin/sh [ "$host" = "" ] && exit # main main() { id=$startclan mkdir -p ../icons/$dir/ echo "Started at `date +%T_%F`" while [ $id -le $lastclan ]; do update $id id=$((id+1)) done optimize echo "Finished at `date +%T_%F`" } # update # $1 - clanId update() { echo -n "$1 - " errors=0 while [ 1 ]; do clanraw=$(wget -qO- "http://$host/clans/$id" | gawk -v IGNORECASE=1 -v RS='</title' 'RT{gsub(/.*<title[^>]*>/,"");print;exit}') IFS='[' clan=( $clanraw ) IFS=']' clan2=( ${clan[1]} ) #Clan removed or does not exist if [ "$clanraw" = " | World of Tanks and World of Warplanes Clans " ]; then echo "REMOVED" return #Error handling - server maintenance elif [ "$clan2" = "" ]; then errors=$((errors+1)) if [ $errors -lt 2 ]; then echo -n "EMPTY `date +%T_%F` $errors.. " sleep 10m continue elif [ $errors -lt 6 ]; then echo -n "$errors.. " sleep 10m continue else echo "ERROR" return fi fi break done echo -n "[$clan2] => $clan2.png" mkdir -p $dir wget -q -O $dir/$clan2.png "http://$host/clans/media/clans/emblems/cl_${id:(-3)}/$id/emblem_64x64.png" echo " OK" } optimize() { echo "Optimizing PNGs..." ( cd ../icons/$dir pngoptimizer -file:*.png ) } EDIT: also as of 2.3.2016 last clan created is ID:500072742 to end at this, simply edit update-eu.sh => lastclan:500072742 Edited March 2, 2016 by Okxa 1 Quote Share this post Link to post Short link Share on other sites