Repository: yt-dlp/yt-dlp
File: yt_dlp/extractor/redgifs.py (Python)

Code before:
            video_id,
            query=api_query
        )
        if 'error' in data:
            raise ExtractorError(f'RedGifs said: {data["error"]}', expected=True)

        return [self._parse_gif_data(entry) for entry in data['gifs']]

    def _real_extract(self, url):
        query_str = self._match_valid_url(url).group('query')

        query = compat_parse_qs(query_str)
        if not query.get('tags'):
            raise ExtractorError('Invalid query tags', expected=True)

        tags = query.get('tags')[0]
        order = query.get('order', ('trending',))[0]
        api_query = {
            'search_text': tags,
            'order': order,
        }
        if query.get('type'):
            api_query['type'] = query.get('type')[0]

        if query.get('page'):
            page = query.get('page', (1,))[0]
            entries = self._fetch_page(query_str, api_query, page)
        else:
            entries = OnDemandPagedList(
                functools.partial(self._fetch_page, query_str, api_query),
                self._PAGE_SIZE)
        title = tags
        description = f'RedGifs search for {tags}, ordered by {order}'

        return self.playlist_result(
            entries,
            playlist_id=query_str,
            playlist_title=title,
            playlist_description=description
        )


Review comment (suggestion):
Since its inside if, no default is needed
```suggestion
            page = query.get('page')[0]
```

Code after:
        {
            'url': 'https://www.redgifs.com/browse?type=g&order=latest&tags=Lesbian',
            'info_dict': {
                'id': 'type=g&order=latest&tags=Lesbian',
                'title': 'Lesbian',
                'description': 'RedGifs search for Lesbian, ordered by latest'
            },
            'playlist_mincount': 100,
        },
        {
            'url': 'https://www.redgifs.com/browse?type=g&order=latest&tags=Lesbian&page=2',
            'info_dict': {
                'id': 'type=g&order=latest&tags=Lesbian&page=2',
                'title': 'Lesbian',
                'description': 'RedGifs search for Lesbian, ordered by latest'
            },
            'playlist_count': 80,
        }
    ]

    def _real_extract(self, url):
        query_str = self._match_valid_url(url).group('query')
        query = compat_parse_qs(query_str)
        if not query.get('tags'):
            raise ExtractorError('Invalid query tags', expected=True)

        tags = query.get('tags')[0]
        order = query.get('order', ('trending',))[0]

        query['search_text'] = [tags]
        entries = self._paged_entries('gifs/search', query_str, query, {
            'search_text': None,
            'order': 'trending',
            'type': None,
        })

        return self.playlist_result(
            entries, query_str, tags, f'RedGifs search for {tags}, ordered by {order}')


class RedGifsUserIE(RedGifsBaseInfoExtractor):
    IE_DESC = 'Redgifs user'
    _VALID_URL = r'https?://(?:www\.)?redgifs\.com/users/(?P<username>[^/?#]+)(?:\?(?P<query>[^#]+))?'
    _PAGE_SIZE = 30
    _TESTS = [
        {
            'url': 'https://www.redgifs.com/users/lamsinka89',
            'info_dict': {
                'id': 'lamsinka89',
                'title': 'lamsinka89',
                'description': 'RedGifs user lamsinka89, ordered by recent'