Add support for YouTube Shorts URLs#4
Merged
TomHipsh-genway merged 3 commits intomainfrom Oct 23, 2025
Merged
Conversation
Introduces handling for YouTube Shorts URLs by adding a SHORTS constant, updating URL patterns, and extending validation and parsing logic. Comprehensive tests were added to ensure correct extraction and validation of Shorts URLs.
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for YouTube Shorts URLs, enabling the library to validate and parse URLs in the format https://www.youtube.com/shorts/VIDEO_ID. The implementation includes pattern matching, validation logic, and comprehensive test coverage.
Key Changes:
- Added
SHORTSURL constant and corresponding regex pattern for YouTube Shorts - Extended validation and parsing functions to handle Shorts URLs
- Added comprehensive test cases for Shorts URL validation and video ID extraction
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/consts.ts | Added SHORTS constant and regex pattern for matching Shorts URLs |
| tests/consts.ts | Added test URL constants for valid and invalid Shorts URLs |
| tests/utils/validate.test.ts | Added test cases to verify Shorts URL validation |
| tests/utils/parse.test.ts | Added test cases to verify video ID extraction from Shorts URLs |
| README.md | Updated documentation to include Shorts URL format |
| CHANGELOG.md | Documented the new feature in version 1.2.0 |
| package.json | Bumped version to 1.2.0 |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
DweikAnas
approved these changes
Oct 23, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Introduces handling for YouTube Shorts URLs by adding a SHORTS constant, updating URL patterns, and extending validation and parsing logic. Comprehensive tests were added to ensure correct extraction and validation of Shorts URLs.
Type of change
Related Issue
Fixes #[issue number] (if applicable)
Testing
Documentation
Checklist