aflaag / pokemon-icat

Shows any Pokémon sprite in your terminal!
GNU General Public License v3.0
95 stars 6 forks source link

[improvement] async requests #2

Closed imsamuka closed 2 years ago

imsamuka commented 2 years ago

The setup_icons.py can be considerably faster using asynchronous requests.

The current script takes ~7 minutes (~420 seconds) to run. If you make 10 requests for batch, 1s delay between each batch, it would take ~90 seconds to download everything. The server probably can deal with smaller delays though.

aflaag commented 2 years ago

that's a pretty interesting approach, except for the fact that i've never written anything async in python so i don't really know how to do it ahahahahah, PR are accepted of course