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

Code before:
                if error_code == 2204:
                    self._verify_video_password(event_id, path='event')
                    continue
                if error_code == 3200:
                    raise ExtractorError(self._REFERER_HINT, expected=True)
                if error_msg := response.get('error'):
                    raise ExtractorError(f'Vimeo says: {error_msg}', expected=True)
                raise

        # stream_privacy.view can be: 'anybody', 'embed_only', 'nobody', 'password', 'unlisted'
        view_policy = live_event_data['stream_privacy']['view']
        if view_policy == 'nobody':
            raise ExtractorError('This event has not been made available to anyone', expected=True)

        clip_data = traverse_obj(live_event_data, ('clip_to_play', {dict})) or {}
        # live.status can be: 'streaming' (is_live), 'done' (was_live), 'unavailable' (is_upcoming OR dead)
        clip_status = traverse_obj(clip_data, ('live', 'status', {str}))
        start_time = traverse_obj(live_event_data, ('schedule', 'start_time', {str}))
        release_timestamp = parse_iso8601(start_time)

        if clip_status == 'unavailable' and release_timestamp and release_timestamp > time.time():
            live_status = 'is_upcoming'
            if start_time:
                self.raise_no_formats(f'This live event is scheduled for {start_time}', expected=True)
            else:
                self.raise_no_formats('This live event has not yet started', expected=True)
            config_url = None

        elif view_policy == 'embed_only':
            webpage = self._download_webpage(
                join_nonempty('https://vimeo.com/event', event_id, 'embed', unlisted_hash, delim='/'),
                event_id, 'Downloading embed iframe webpage', impersonate=True, headers=headers)
            # The _parse_config result will overwrite live_status w/ 'is_live' if livestream is active
            live_status = 'was_live'
            config_url = self._extract_config_url(webpage)

        else:  # view_policy in ('anybody', 'password', 'unlisted')
            if video_id:
                clip_id, clip_hash = self._extract_video_id_and_unlisted_hash(clip_data)
                if video_id == clip_id and clip_status == 'done' and (clip_hash or view_policy != 'unlisted'):
                    return self._vimeo_url_result(clip_id, clip_hash, event_id)

                video_filter = lambda _, v: self._extract_video_id_and_unlisted_hash(v)[0] == video_id
            else:
                video_filter = lambda _, v: v['live']['status'] in ('streaming', 'done')

            for page in itertools.count(1):
                videos_data = self._call_events_api(
                    event_id, 'videos', unlisted_hash=unlisted_hash, note=f'page {page}',
                    fields=self._VIDEOS_FIELDS, referrer=referrer, query={'page': page},
                    headers={'Accept': 'application/vnd.vimeo.*;version=3.4.1'})

Review comment (refactor):
missed this when refactoring; if we have `release_timestamp` then we know we have `start_time` too
```suggestion
            self.raise_no_formats(f'This live event is scheduled for {start_time}', expected=True)
```

Code after:
                    raise
                response = traverse_obj(e.cause.response.read(), ({json.loads}, {dict})) or {}
                error_code = response.get('error_code')
                if error_code == 2204:
                    self._verify_video_password(event_id, path='event')
                    continue
                if error_code == 3200:
                    raise ExtractorError(self._REFERER_HINT, expected=True)
                if error_msg := response.get('error'):
                    raise ExtractorError(f'Vimeo says: {error_msg}', expected=True)
                raise

        # stream_privacy.view can be: 'anybody', 'embed_only', 'nobody', 'password', 'unlisted'
        view_policy = live_event_data['stream_privacy']['view']
        if view_policy == 'nobody':
            raise ExtractorError('This event has not been made available to anyone', expected=True)

        clip_data = traverse_obj(live_event_data, ('clip_to_play', {dict})) or {}
        # live.status can be: 'streaming' (is_live), 'done' (was_live), 'unavailable' (is_upcoming OR dead)
        clip_status = traverse_obj(clip_data, ('live', 'status', {str}))
        start_time = traverse_obj(live_event_data, ('schedule', 'start_time', {str}))
        release_timestamp = parse_iso8601(start_time)

        if clip_status == 'unavailable' and release_timestamp and release_timestamp > time.time():
            self.raise_no_formats(f'This live event is scheduled for {start_time}', expected=True)
            live_status = 'is_upcoming'
            config_url = None

        elif view_policy == 'embed_only':
            webpage = self._download_webpage(
                join_nonempty('https://vimeo.com/event', event_id, 'embed', unlisted_hash, delim='/'),
                event_id, 'Downloading embed iframe webpage', impersonate=True, headers=headers)
            # The _parse_config result will overwrite live_status w/ 'is_live' if livestream is active
            live_status = 'was_live'
            config_url = self._extract_config_url(webpage)

        else:  # view_policy in ('anybody', 'password', 'unlisted')
            if video_id:
                clip_id, clip_hash = self._extract_video_id_and_unlisted_hash(clip_data)
                if video_id == clip_id and clip_status == 'done' and (clip_hash or view_policy != 'unlisted'):
                    return self._vimeo_url_result(clip_id, clip_hash, event_id)

                video_filter = lambda _, v: self._extract_video_id_and_unlisted_hash(v)[0] == video_id
            else:
                video_filter = lambda _, v: v['live']['status'] in ('streaming', 'done')

            for page in itertools.count(1):
                videos_data = self._call_events_api(
                    event_id, 'videos', unlisted_hash=unlisted_hash, note=f'page {page}',
                    fields=self._VIDEOS_FIELDS, referrer=referrer, query={'page': page},
                    headers={'Accept': 'application/vnd.vimeo.*;version=3.4.1'})