instabot/api/api.py
def see_reels(self, reels):
        """
            Input - the list of reels jsons
            They can be aquired by using get_users_reel() or get_user_reel() methods
        """
        if not isinstance(reels, list):
            reels = [reels]

        story_seen = {}
        now = int(time.time())
        for i, story in enumerate(sorted(reels, key=lambda m: m['taken_at'], reverse=True)):
            story_seen_at = now - min(i + 1 + random.randint(0, 2), max(0, now - story['taken_at']))
            story_seen[
                '{0!s}_{1!s}'.format(story['id'], story['user']['pk'])
            ] = [
                '{0!s}_{1!s}'.format(story['taken_at'], story_seen_at)
            ]

        data = self.json_data({
            'reels': story_seen,
            '_csrftoken': self.token,
            '_uuid': self.uuid,
            '_uid': self.user_id
        })
        data = self.generate_signature(data)
        return self.session.post('https://i.instagram.com/api/v2/' + 'media/seen/', data=data).ok
def see_reels(self, reels):
        """
            Input - the list of reels jsons
            They can be aquired by using get_users_reel() or get_user_reel() methods
        """
        if not isinstance(reels, list):
            reels = [reels]

        story_seen = {}
        now = int(time.time())
        for i, story in enumerate(sorted(reels, key=lambda m: m['taken_at'], reverse=True)):
            story_seen_at = now - min(i + 1 + random.randint(0, 2), max(0, now - story['taken_at']))
            story_seen[
                '{0!s}_{1!s}'.format(story['id'], story['user']['pk'])
            ] = [
                '{0!s}_{1!s}'.format(story['taken_at'], story_seen_at)
            ]

        data = self.json_data({
            'reels': story_seen,
            '_csrftoken': self.token,
            '_uuid': self.uuid,
            '_uid': self.user_id
        })
        data = self.generate_signature(data)
        return self.session.post('https://i.instagram.com/api/v2/' + 'media/seen/', data=data).ok
Input - the list of reels jsons
            They can be aquired by using get_users_reel() or get_user_reel() methods