def collection_medias_v1(
        self, collection_pk: str, amount: int = 21, last_media_pk: int = 0
    ) -> List[Media]:
        """
        Get media in a collection by collection_pk

        Parameters
        ----------
        collection_pk: str
            Unique identifier of a Collection
        amount: int, optional
            Maximum number of media to return, default is 21
        last_media_pk: int, optional
            Last PK user has seen, function will return medias after this pk. Default is 0

        Returns
        -------
        List[Media]
            A list of objects of Media
        """
        last_media_pk = last_media_pk and int(last_media_pk)
        total_items = []
        next_max_id = ""
        amount = int(amount)
        found_last_media_pk = False
        while True:
            items, next_max_id = self.collection_medias_v1_chunk(
                collection_pk, max_id=next_max_id
            )
            for item in items:
                if last_media_pk and last_media_pk == item.pk:
                    found_last_media_pk = True
                    break
                total_items.append(item)
            if (amount and len(total_items) >= amount) or found_last_media_pk:
                break
            if not items or not next_max_id:
                break
        return total_items[:amount] if amount else total_items

        Get media in a collection by collection_pk

        Parameters
        ----------
        collection_pk: str
            Unique identifier of a Collection
        amount: int, optional
            Maximum number of media to return, default is 21
        last_media_pk: int, optional
            Last PK user has seen, function will return medias after this pk. Default is 0

        Returns
        -------
        List[Media]
            A list of objects of Media
        
instagrapi/mixins/collection.py