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

Code before:
            'url': 'https://www.redgifs.com/users/lamsinka89?page=3',
            'info_dict': {
                'id': 'lamsinka89?page=3',
                'title': 'lamsinka89',
                'description': 'RedGifs user lamsinka89, ordered by recent',
            },
            'playlist_mincount': 31,
        },
        {
            'url': 'https://www.redgifs.com/users/lamsinka89?order=best&type=g',
            'info_dict': {
                'id': 'lamsinka89?order=best&type=g',
                'title': 'lamsinka89',
                'description': 'RedGifs user lamsinka89, ordered by best',
            },
            'playlist_mincount': 391,
        },
        {
            'url': 'https://www.redgifs.com/users/ignored52',
            'note': 'Issues #7382 and #9131; _PAGE_SIZE was set to a value that was too low',
            'info_dict': {
                'id': 'ignored52',
                'title': 'ignored52',
                'description': 'RedGifs user ignored52, ordered by recent',
            },
            'playlist_mincount': 31,
        },
    ]

    def _real_extract(self, url):
        username, query_str = self._match_valid_url(url).group('username', 'query')
        playlist_id = f'{username}?{query_str}' if query_str else username

        query = urllib.parse.parse_qs(query_str)
        order = query.get('order', ('recent',))[0]

        entries = self._paged_entries(f'users/{username}/search', playlist_id, query, {
            'order': 'recent',
            'type': None,
        })

        return self.playlist_result(
            entries, playlist_id, username, f'RedGifs user {username}, ordered by {order}')


Review comment (suggestion):
better to use a mincount closer to the actual count
```suggestion
            'playlist_mincount': 121,
```

Code after:
            'url': 'https://www.redgifs.com/users/lamsinka89?page=3',
            'info_dict': {
                'id': 'lamsinka89?page=3',
                'title': 'lamsinka89',
                'description': 'RedGifs user lamsinka89, ordered by recent',
            },
            'playlist_count': 80,
        },
        {
            'url': 'https://www.redgifs.com/users/lamsinka89?order=best&type=g',
            'info_dict': {
                'id': 'lamsinka89?order=best&type=g',
                'title': 'lamsinka89',
                'description': 'RedGifs user lamsinka89, ordered by best',
            },
            'playlist_mincount': 391,
        },
        {
            'url': 'https://www.redgifs.com/users/ignored52',
            'note': 'https://github.com/yt-dlp/yt-dlp/issues/7382',
            'info_dict': {
                'id': 'ignored52',
                'title': 'ignored52',
                'description': 'RedGifs user ignored52, ordered by recent',
            },
            'playlist_mincount': 121,
        },
    ]

    def _real_extract(self, url):
        username, query_str = self._match_valid_url(url).group('username', 'query')
        playlist_id = f'{username}?{query_str}' if query_str else username

        query = urllib.parse.parse_qs(query_str)
        order = query.get('order', ('recent',))[0]

        entries = self._paged_entries(f'users/{username}/search', playlist_id, query, {
            'order': 'recent',
            'type': None,
        })

        return self.playlist_result(
            entries, playlist_id, username, f'RedGifs user {username}, ordered by {order}')