'Tweepy : How to get user id who liked(fav) the specified tweet

I wonder how to get user-id list who liked the specified tweet id.

I can see the number of favorites of the tweet by using 'favorite count', but would like to know WHO liked the tweet.

The same question as Twitter API - Getting list of users who favorited a status , which was written in python2, so I re-write in python3. However it seems it does not work any longer.

def get_user_ids_who_likes(post_id):
    try:
        url = 'https://twitter.com/i/activity/favorited_popup?id=' + str(post_id)
        json_data = urllib.request.urlopen(url).read()
        found_ids = re.findall(r'data-user-id=\\"+\d+', json_data.decode('utf-8'))
        unique_ids = list(set([re.findall(r'\d+', match)[0] for match in found_ids]))
        return unique_ids
    except urllib.error.HTTPError:
        return False

Are there any solutions?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source