youtube-latest3
Fetch the latest uploads from a YouTube channel URL (including dynamic @handle URLs like https://www.youtube.com/@ludwig/videos).
Why this approach
This tool resolves the channel ID from the exact channel URL, then reads YouTube's official uploads feed:
https://www.youtube.com/feeds/videos.xml?channel_id=<CHANNEL_ID>
That feed is ordered by newest uploads, so fetching the first 3 entries gives the latest 3 videos.
Usage
python3 latest3.py "https://www.youtube.com/@ludwig/videos"
python3 latest3.py "@ludwig" --json
python3 latest3.py "https://www.youtube.com/@ludwig/videos" --limit 3 --json
python3 latest3.py "https://www.youtube.com/@ludwig/videos" --limit 3 --no-shorts
python3 latest3.py "https://www.youtube.com/@ludwig/videos" --limit 3 --no-vods
python3 latest3.py "https://www.youtube.com/@ludwig/videos" --limit 3 --no-shorts --no-vods
Output fields
id- video IDtitle- video titleurl- watch URLpublished- ISO-8601 timestamp from the feed
Flags
--limit Nhow many videos to return (1-20)--jsonoutput as JSON--no-shortsexclude URLs matching/shorts/--no-vodsexclude livestream VODs (isLiveContent=trueon watch page)
Notes
- Works with
@handleURLs and plain@handleinput. - No API key required.
- If YouTube changes page markup for channel ID extraction, update
extract_channel_id().
Description
Languages
Python
100%