Skip to content
pubscout

youtube_parser

2.1.4, released 3 years ago by vimuser.com

Extracts YouTube video IDs from all kinds of valid YouTube URLs.

WASM-ready
$ flutter pub add youtube_parser
Source repository

What it does

A minimalist Dart library that parses various forms of YouTube URLs and extracts the underlying video ID. It supports standard watch URLs, short links, embed URLs, and shorts.

AI-written summary of version 2.1.4, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to extract YouTube video IDs from user-provided URLs
  • You are building an app that embeds YouTube videos and needs to parse links

Skip it when

  • You need a full-featured YouTube API client for fetching playlists, comments, or uploading videos

Strengths

  • Zero dependencies
  • Supports multiple YouTube URL formats including shorts and embeds
  • Cross-platform support

Weaknesses

  • Performs only a single specialized parsing task

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
0
import 'package:youtube_parser/youtube_parser.dart';

String? a = getIdFromUrl('https://www.youtube.com/watch?v=dQw4w9WgXcQ');

Alternatives

Packages that do the same job and could replace youtube_parser.

  • sqids

    Generate short YouTube-looking IDs from numbers and decode them back.

  • hashids2

    Generate short, unique, decryptable YouTube-like hashes from numbers.

  • shortid

    Generates short, non‑sequential, URL‑friendly unique strings.

  • slugify

    Converts a string into a URL‑friendly slug with configurable delimiter and case options.