title: Twitter Python API: Get all posts from a specific user containing media
body: <p>I want to get all tweets from a specific user containing media. I am currently using this library: <a href="https://pypi.org/project/twitter/" rel="nofollow noreferrer">https://pypi.org/project/twitter/</a></p>
  <pre><code>from twitter import *
  
  
  def get_posts(user:str):
      bearer_token = &quot;a_super_secret_string&quot;
      twitter: Twitter = None
      twitter = Twitter(auth=OAuth2(bearer_token=bearer_token))
      results = self.__twitter.statuses.user_timeline(screen_name=user)
      for r in results:  # For each result
          if &quot;media&quot; in r[&quot;entities&quot;]:  # That has some media in it
              do_something()
  
  </code></pre>
  <p>This works fine, but it doesn't show me very many tweets. Since the users that I am trying to target with this don't post media with every tweet, by the time the filtering is done I end up with around 10-15 images (where as the account may have posted over 100 total).</p>
  <p>Is there a better way to accomplish this?</p>