def user_medias_paginated(
        self, user_id: str, amount: int = 0, end_cursor: str = ""
    ) -> Tuple[List[Media], str]:
        """
        Get a page of user's media

        Parameters
        ----------
        user_id: str
        amount: int, optional
            Maximum number of media to return, default is 0 (all medias)
        end_cursor: str, optional
            Cursor value to start at, obtained from previous call to this method

        Returns
        -------
        Tuple[List[Media], str]
            A tuple containing a list of medias and the next end_cursor value
        """

        class EndCursorIsV1(Exception):
            pass

        try:
            if end_cursor and "_" in end_cursor:
                # end_cursor is a v1 next_max_id, so we need to use v1 API
                raise EndCursorIsV1
            try:
                medias, end_cursor = self.user_medias_paginated_gql(
                    user_id, amount, end_cursor=end_cursor
                )
            except ClientLoginRequired as e:
                if not self.inject_sessionid_to_public():
                    raise e
                medias, end_cursor = self.user_medias_paginated_gql(
                    user_id, amount, end_cursor=end_cursor
                )
        except PrivateError as e:
            raise e
        except Exception as e:
            if isinstance(e, EndCursorIsV1):
                pass
            elif not isinstance(e, ClientError):
                self.logger.exception(e)
            medias, end_cursor = self.user_medias_paginated_v1(
                user_id, amount, end_cursor=end_cursor
            )
        return medias, end_cursor

        Get a page of user's media

        Parameters
        ----------
        user_id: str
        amount: int, optional
            Maximum number of media to return, default is 0 (all medias)
        end_cursor: str, optional
            Cursor value to start at, obtained from previous call to this method

        Returns
        -------
        Tuple[List[Media], str]
            A tuple containing a list of medias and the next end_cursor value
        
instagrapi/mixins/media.py