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

Code before:
                    'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
                    'Referer': playlist_url,
                    'X-Requested-With': 'XMLHttpRequest',
                    'Cookie': 'csrftoken=%s' % self._TOKEN,
                })
            if data.get('success') is not True:
                break
            html = data.get('html')
            results = []
            class_name = self.HTML_CLASS_NAMES[playlist_type]
            for video_html in get_elements_html_by_class(class_name['container'], html):
                match = re.search(r'<a\b[^>]+\bhref=["\']/video/(?P<id>[^"\'/]+)', video_html)
                if not match:
                    continue
                video_id = match.group('id')
                results.append(self.url_result(
                    'https://www.bitchute.com/video/%s' % video_id,
                    ie=BitChuteIE.ie_key(), video_id=video_id, url_transparent=True,
                    title=clean_html(get_element_by_class(class_name['title'], video_html)),
                    description=clean_html(
                        get_element_by_class(class_name['description'], video_html)
                    ),
                    duration=parse_duration(get_element_by_class('video-duration', video_html)),
                    view_count=parse_count(clean_html(
                        get_element_by_class('video-views', video_html))
                    ),
                ))
            if not results:
                break
            offset += len(results)
            for result in results:
                yield result

    def _real_extract(self, url):
        playlist_type, playlist_id = self._match_valid_url(url).groups()
        return self.playlist_result(
            self._entries(playlist_type, playlist_id), playlist_id=playlist_id)


Review comment (suggestion):
coding convention
```suggestion
                    description=clean_html(get_element_by_class(class_name['description'], video_html)),
                    duration=parse_duration(get_element_by_class('video-duration', video_html)),
                    view_count=parse_count(clean_html(get_element_by_class('video-views', video_html))),
```

Code after:
                    'view_count': int,
                },
            }
        ],
        'params': {
            'skip_download': True,
            'playlist_items': '-1',
        },
    }, {
        'url': 'https://www.bitchute.com/playlist/wV9Imujxasw9/',
        'playlist_mincount': 20,
        'info_dict': {
            'id': 'wV9Imujxasw9',
            'title': 'Bruce MacDonald and "The Light of Darkness"',
            'description': 'md5:04913227d2714af1d36d804aa2ab6b1e',
        }
    }]

    _TOKEN = 'zyG6tQcGPE5swyAEFLqKUwMuMMuF6IO2DZ6ZDQjGfsL0e4dcTLwqkTTul05Jdve7'
    PAGE_SIZE = 25
    HTML_CLASS_NAMES = {
        'channel': {
            'container': 'channel-videos-container',
            'title': 'channel-videos-title',
            'description': 'channel-videos-text',
        },
        'playlist': {
            'container': 'playlist-video',
            'title': 'title',
            'description': 'description',
        }

    }

    @staticmethod
    def _make_url(playlist_id, playlist_type):
        return f'https://www.bitchute.com/{playlist_type}/{playlist_id}/'

    def _fetch_page(self, playlist_id, playlist_type, page_num):
        playlist_url = self._make_url(playlist_id, playlist_type)
        data = self._download_json(
            f'{playlist_url}extend/', playlist_id, f'Downloading page {page_num}',
            data=urlencode_postdata({
                'csrfmiddlewaretoken': self._TOKEN,
                'name': '',
                'offset': page_num * self.PAGE_SIZE,
            }), headers={
                'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
                'Referer': playlist_url,
                'X-Requested-With': 'XMLHttpRequest',
                'Cookie': f'csrftoken={self._TOKEN}',