패키지, 저장소 및 앱 카테고리 검색

GitHub 저장소thitlwincoder/direct_link

direct_link

URL에서 직접 링크를 추출하여 스트리밍 및 직접 다운로드

direct_link 프로젝트 이미지
스타
36
포크
21
최근 푸시(UTC)
2026. 8. 18.
프로젝트 상태
활성

원본 README

아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.

direct_link

pub package Last Commits GitHub repo size License
Uploaded By

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

direct_link example 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);
}

API

DirectLink.check
Future<SiteModel?> check(String url, {double? timeoutInterval});

Resolves a supported public page URL into a SiteModel.

Returns null when no media link can be extracted.

SiteModel
class SiteModel {
  final String? title;
  final String? thumbnail;
  final String? duration;
  final List<Link>? links;
}
Link
class Link {
  final String quality;
  final String link;
  final String? type;
}

Notes and limitations

  • This package resolves public media URLs only.
  • 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.

Contributing

Issues and pull requests are welcome.

  • Report bugs on the issue tracker.
  • Include a reproducible URL when reporting extraction failures.
  • Keep unit tests deterministic. Put live website checks in integration_test/.

License

This package is released under the MIT License.

Thit Lwin GitHub avatar
GitHub 작성자

Thit Lwin ↗

Flutter Developer

RemoteYangon, Myanmar(Burma)
언어DartC++CMakeRubySwiftCHTMLKotlinObjective-C

분류

이 저장소가 배포한 패키지

사용 중인 의존성

의존성 목록 5 개

프로젝트에 맞는 저장소를 선택하려면?

사용 목적에 따라 검색하고 개발 활동을 비교한 뒤 원본 저장소에서 요구 사항을 확인하세요.

  1. 이름, 작성자 또는 설명으로 검색하고 기술 주제로 범위를 좁힙니다.
  2. 스타, 포크, 최근 푸시를 함께 비교하세요. 스타는 관심의 지표이며 품질을 보장하지 않습니다.
  3. 사용하기 전에 GitHub에서 README, 라이선스, Issues를 확인하세요.

출처 및 관리

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗