Package selection guidance compiled from public package information, community data, and project usage.
A Flutter/Dart package that extracts direct download links from URLs, enabling seamless streaming and downloading of media files across multiple platforms. It simplifies the process of retrieving raw file URLs from various sources, making it ideal for apps requiring offline access or real-time playback. The package supports Android, iOS, Web, macOS, Windows, and Linux, ensuring broad compatibility. Designed for developers building multimedia applications, it streamlines content retrieval without requiring complex parsing logic.
Use cases
Streaming media files directly
Downloading files from shared links
Building offline content apps
Integrating with media players
Fetching resources from social media links
Creating file download managers
Key features
Extracts direct links from URLs
Supports cross-platform deployment
Enables streaming and downloading
Simple API integration
Works with various URL sources
Lightweight and efficient
Suitable for
Media app developers
File downloader tools
Offline content providers
Content aggregation apps
Apps needing direct file access
Considerations
Relies on source URL structure
May require handling rate limits
Not all links may resolve to direct streams
Depends on external service availability
Needs proper error handling for failed requests
Limited to supported URL formats
Original README
Original README snapshot from the linked source repository. Visit the repository for the latest content.
direct_link
direct_link is a Flutter package for extracting direct media links and basic metadata from supported public page URLs.
Use it when you need to build a downloader, media preview, or media utility app that can resolve a shared social/video URL into playable or downloadable links.
Features
Extract direct media links from supported websites.
Return media metadata such as title, thumbnail, and duration when available.
Return multiple qualities or formats when the source provides them.
Simple null-safe API with a single check method.
Supported websites
Facebook
Instagram
YouTube
Twitter/X
Dailymotion
Vimeo
VK
SoundCloud
TikTok
Reddit
Threads
Support depends on the upstream website response and the extraction service used internally. A supported website can still return null when the URL is private, removed, region-blocked, unsupported by the upstream service, or temporarily unavailable.
Platform support
This package currently depends on Flutter and flutter_inappwebview, so it is intended for Flutter apps.
Screenshot
Installation
Add direct_link to your Flutter project's pubspec.yaml:
dependencies:direct_link:^0.3.3
Then run:
flutter pub get
Import the package:
import'package:direct_link/direct_link.dart';
Usage
Create a DirectLink instance and call check with a supported page URL:
final directLink = DirectLink();
final data = await directLink.check(
'https://www.youtube.com/watch?v=kzOO_uplPdk',
);
if (data == null) {
// No media link was found, or the upstream service could not resolve it.return;
}
print(data.title);
print(data.thumbnail);
print(data.duration);
for (final link in data.links ?? []) {
print(link.quality);
print(link.type);
print(link.link);
}
Private, deleted, age-restricted, login-required, or region-blocked content may not resolve.
Website markup and upstream extraction behavior can change without notice.
The returned link list and quality labels depend on the source website and upstream service response.
Network-based social website checks are integration tests and are not run by default.
Testing
Run deterministic unit tests:
flutter test
Run real-site integration tests explicitly:
flutter test integration_test/social_test.dart
Integration tests depend on live third-party websites and may fail because of network issues, rate limits, region restrictions, or upstream website changes.