Skip to content

Add support for YouTube Shorts URLs#4

Merged
TomHipsh-genway merged 3 commits intomainfrom
support-shorts
Oct 23, 2025
Merged

Add support for YouTube Shorts URLs#4
TomHipsh-genway merged 3 commits intomainfrom
support-shorts

Conversation

@TomHipsh-genway
Copy link
Copy Markdown
Contributor

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

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Performance improvement
  • Code refactoring

Related Issue

Fixes #[issue number] (if applicable)

Testing

  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have tested the changes in different environments (Node.js, browser)

Documentation

  • I have updated the README.md if needed
  • I have added JSDoc comments to new public functions
  • I have updated TypeScript type definitions if needed
  • I have updated the CHANGELOG.md

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I have checked my code and corrected any misspellings

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.
fix
Copilot AI review requested due to automatic review settings October 23, 2025 09:29
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 SHORTS URL 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.

fix
@TomHipsh-genway TomHipsh-genway merged commit af22fec into main Oct 23, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants