# Changelog of Youtube Channel Scrapper (`deeper/youtube-channel-scrapper`) Actor

- **URL**: https://apify.com/deeper/youtube-channel-scrapper/changelog.md
- **Full Actor documentation**: https://apify.com/deeper/youtube-channel-scrapper.md

## Changelog

### \[Unreleased] - 2026-06-26

#### Fixed

- **YouTube structure changes (May-June 2026)**: Fixed issue where actor was unable to retrieve regular long-form videos from channel `/videos` tabs
  - **Root cause**: YouTube changed their HTML structure multiple times:
    - **May 2026**: Videos wrapped in `richItemRenderer/content/videoRenderer` instead of direct `videoRenderer`
    - **June 2026**: Further change to `richItemRenderer/content/lockupViewModel` for many channels (e.g., @Mrwhosetheboss)
  - **Symptoms**:
    - With `scrap_shorts: false`: Only channel metadata returned, no videos (all video fields null)
    - With `scrap_shorts: true`: Only Shorts returned, no long-form videos
    - Channels like @Mrwhosetheboss, @drewisgooden showing 0 videos despite having hundreds
  - **Solution**:
    - Updated `collect_channel_items()` to automatically try multiple search patterns:
      - `**/videoRenderer` (pre-May 2026 - original structure)
      - `**/richItemRenderer/content/lockupViewModel` (June 2026+ - newest structure)
      - `**/richItemRenderer/content/videoRenderer` (May 2026 - transitional structure)
      - `**/gridVideoRenderer` (alternate structure)
    - Added extraction logic for `lockupViewModel` structure with different field paths:
      - Video ID: `contentId` (instead of `videoId`)
      - Title: `metadata/lockupMetadataViewModel/title/content`
      - Views & Date: `metadata/.../metadataRows[0]/metadataParts[]/text/content`
      - Duration: `contentImage/thumbnailViewModel/overlays/.../thumbnailBadgeViewModel/text`
      - Thumbnail: `contentImage/thumbnailViewModel/image/sources[-1]/url`
  - Improved short video detection to be more robust (checks path pattern rather than exact string match)
  - Updated date extraction logic to work with all structure variants

#### Technical Details

Modified files:

- `src/main.py`:
  - `collect_channel_items()`: Added automatic fallback pattern detection with 3 alternate patterns
  - `_extract_item_date()`: Improved short detection logic
  - Video processing loop: Added `is_lockup_view` detection and extraction logic for new `lockupViewModel` structure
  - Enhanced `is_short` detection to check for "shorts" in path (case-insensitive)

The fix is fully backward compatible - channels using any of the old structures will continue to work, while channels on the newest structure will now be properly scraped.

#### Testing

Tested with:

- ✅ @Mrwhosetheboss (lockupViewModel structure) - Successfully extracts 30+ videos with all metadata
- ✅ @ASBYT (mixed structure) - Successfully extracts both videos and shorts
- ✅ Extraction of: videoId, title, views, duration, date, thumbnail

Recommended test cases:

1. Channel with long-form videos only (e.g., @drewisgooden, @Mrwhosetheboss)
2. Channel with both videos and shorts (e.g., @ASBYT, @UrAvgConsumer)
3. Channel with shorts only
4. Set `scrap_shorts: false` and verify long-form videos are returned
5. Set `scrap_shorts: true` and verify both video types are properly labeled with `video_is_short`
6. Verify `video_date` is populated for long-form videos
7. Verify `video_duration` is populated for long-form videos
