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

Code before:
                formats.append({
                    **traverse_obj(quality, {
                        'format_id': 'name',
                        'format_note': 'label',
                        'width': ('width', {int}),
                        'height': ('height', {int}),
                    }),
                    **parse_codecs(quality.get('codecs')),
                    'url': url,
                    'ext': determine_ext(url.partition('/chunk.m3u8')[0], 'mp4'),
                })

            items.append({
                'id': media_id,
                **traverse_obj(metadata, {
                    'title': 'title',
                    'duration': ('duration', {int_or_none}),
                    'thumbnail': ('thumbnail', 'path'),
                }),
                'formats': formats,
            })

        uploader_url = format_field(traverse_obj(
            post_data, ('creator', 'urlname')), template='https://www.floatplane.com/channel/%s/home', default=None)
        channel_url = format_field(traverse_obj(
            post_data, ('channel', 'urlname')), template=f'{uploader_url}/%s', default=None)

        post_info = {
            'id': post_id,
            'display_id': post_id,
            **traverse_obj(post_data, {
                'title': 'title',
                'description': ('text', {clean_html}),
                'uploader': ('creator', 'title'),
                'uploader_id': ('creator', 'id'),
                'channel': ('channel', 'title'),
                'channel_id': ('channel', 'id'),
                'like_count': ('likes', {int_or_none}),
                'dislike_count': ('dislikes', {int_or_none}),
                'comment_count': ('comments', {int_or_none}),
                'release_timestamp': ('releaseDate', {parse_iso8601}),
                'thumbnail': ('thumbnail', 'path'),
            }),
            'uploader_url': uploader_url,
            'channel_url': channel_url,
            'availability': self._availability(needs_subscription=True),
        }

        if len(items) > 1:
            return self.playlist_result(items, **post_info)


Review comment (suggestion):
We can shorten the lines a bit by passing both the object and field args
```suggestion
        uploader_url = format_field(traverse_obj(
            post_data, 'creator'), 'urlname', 'https://www.floatplane.com/channel/%s/home', default=None)
        channel_url = format_field(traverse_obj(
            post_data, 'channel'), 'urlname', f'{uploader_url}/%s', default=None)
```
&nbsp;
Maybe urljoin could actually be preferable for `channel_url` though, since with the `format_field` way we could end up with `None/channel`
```suggestion
        uploader_url = format_field(traverse_obj(
            post_data, 'creator'), 'urlname', 'https://www.floatplane.com/channel/%s/home', default=None)
        channel_url = urljoin(f'{uploader_url}/', traverse_obj(post_data, ('channel', 'urlname')))
```

Code after:
                formats.append({
                    **traverse_obj(quality, {
                        'format_id': 'name',
                        'format_note': 'label',
                        'width': ('width', {int}),
                        'height': ('height', {int}),
                    }),
                    **parse_codecs(quality.get('codecs')),
                    'url': url,
                    'ext': determine_ext(url.partition('/chunk.m3u8')[0], 'mp4'),
                })

            items.append({
                'id': media_id,
                **traverse_obj(metadata, {
                    'title': 'title',
                    'duration': ('duration', {int_or_none}),
                    'thumbnail': ('thumbnail', 'path'),
                }),
                'formats': formats,
            })

        uploader_url = format_field(traverse_obj(
            post_data, 'creator'), 'urlname', 'https://www.floatplane.com/channel/%s/home', default=None)
        channel_url = urljoin(f'{uploader_url}/', traverse_obj(post_data, ('channel', 'urlname')))

        post_info = {
            'id': post_id,
            'display_id': post_id,
            **traverse_obj(post_data, {
                'title': 'title',
                'description': ('text', {clean_html}),
                'uploader': ('creator', 'title'),
                'uploader_id': ('creator', 'id'),
                'channel': ('channel', 'title'),
                'channel_id': ('channel', 'id'),
                'like_count': ('likes', {int_or_none}),
                'dislike_count': ('dislikes', {int_or_none}),
                'comment_count': ('comments', {int_or_none}),
                'release_timestamp': ('releaseDate', {parse_iso8601}),
                'thumbnail': ('thumbnail', 'path'),
            }),
            'uploader_url': uploader_url,
            'channel_url': channel_url,
            'availability': self._availability(needs_subscription=True),
        }

        if len(items) > 1:
            return self.playlist_result(items, **post_info)

        post_info.update(items[0])