Skip to content

feat(youtube-import): add validation and error handling for malformed or unlisted YouTube playlist URLs #126

Description

@wyzuk

YouTube Bulk Import Validation & Handling (Feature / Resilience)

Title: feat(youtube-import): add validation and error handling for malformed or unlisted YouTube playlist URLs

Body:

### Description
Following the addition of the bulk YouTube playlist import feature (`#54`), playlist imports can fail or result in unhandled exceptions if:
- A user enters a standard single video URL instead of a playlist URL (missing `list=` parameter).
- The playlist is set to `Private` or contains unavailable/deleted videos.
- Network timeouts occur during bulk metadata fetching via the YouTube API/oEmbed endpoint.

### Suggested Improvements
1. **Frontend / Form Request Regex:** Add validation for YouTube playlist URL formats (`^.*(youtu.be\/|list=)([^#\&\?]*).*`).
2. **Graceful Skipped Items:** Skip deleted or private items and return a flash message indicating how many videos were successfully imported versus skipped.
3. **Queue Processing:** If the playlist has $>20$ videos, offload metadata fetching to a background queue/job to prevent request timeouts on the web server.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions