Search code examples
python-3.xtwitter

Sleep when requesting profile pictures from Twitter?


quite a noob in Python here. For a project, I need to download profile pictures of a list of twitter accounts. I already requested from the API the URLs of the pictures and now I should download them. I was just wondering whether I should make my script sleep and if so how much.


Solution

  • It will be faster to use threads. Then, pictures will download concurrently. If you have all the urls in an array you could use a ThreadPool, as in this example

    https://markhneedham.com/blog/2018/07/15/python-parallel-download-files-requests/