twitter GetFavorites function throws error

twitter GetFavorites function throws error,twitter,Twitter,I am fetching data from twitter API 1.1. When I use GetFavorites function is get following error: In [16]: fav_list = api.GetFavorites(screen_name='cshikhardua') --------------------------------------------------------------------------- TwitterError Traceback (most recent call last) <ipython-input-16-f9bfd7deaf24> in <module>() ----> 1 fav_list = api.GetFavorites(screen_name='cshikhardua') <ipython-input-2-2df6e498a699> in GetFavorites(self, u

I am fetching data from twitter API 1.1. When I use GetFavorites function is get following error:

In [16]: fav_list = api.GetFavorites(screen_name='cshikhardua')
---------------------------------------------------------------------------
TwitterError                              Traceback (most recent call last)
<ipython-input-16-f9bfd7deaf24> in <module>()
----> 1 fav_list = api.GetFavorites(screen_name='cshikhardua')

<ipython-input-2-2df6e498a699> in GetFavorites(self, user_id, screen_name, count, since_id, max_id, include_entities)
   4241 
   4242     json = self._FetchUrl(url, parameters=parameters)
-> 4243     data = self._ParseAndCheckTwitter(json)
   4244     return [Status.NewFromJsonDict(x) for x in data]
   4245 

<ipython-input-2-2df6e498a699> in _ParseAndCheckTwitter(self, json)
   4917     try:
   4918       data = simplejson.loads(json)
-> 4919       self._CheckForTwitterError(data)
   4920     except ValueError:
   4921       if "<title>Twitter / Over capacity</title>" in json:

<ipython-input-2-2df6e498a699> in _CheckForTwitterError(self, data)
   4944     # to check first, rather than try and catch the exception
   4945     if 'error' in data:
-> 4946       raise TwitterError(data['error'])
   4947     if 'errors' in data:
   4948       raise TwitterError(data['errors'])

TwitterError: Not authorized

But if I use GetFollowers function with same screen name and same instance of Api, I get appropriate response:

In [18]: fav_list
Out[18]: 
([<__main__.User at 0x2ffa450>,
  <__main__.User at 0x2ffa850>,
  <__main__.User at 0x2ffa750>],
 0,
 0)

Could anyone help me understand what's going wrong ?


#1

The probable reason:the user 'cshikhardua' account is protected。