direct_link
URL से सीधे लिंक निकालें और सीधे प्रसारित और डाउनलोड करें।
URL से सीधे लिंक निकालें और सीधे प्रसारित और डाउनलोड करें
यह अंग्रेज़ी मूल स्नैपशॉट है। नवीनतम सामग्री GitHub पर देखें।
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.
check method.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.
This package currently depends on Flutter and flutter_inappwebview, so it is intended for Flutter apps.
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';
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);
}
DirectLink.checkFuture<SiteModel?> check(String url, {double? timeoutInterval});
Resolves a supported public page URL into a SiteModel.
Returns null when no media link can be extracted.
SiteModelclass SiteModel {
final String? title;
final String? thumbnail;
final String? duration;
final List<Link>? links;
}
Linkclass Link {
final String quality;
final String link;
final String? type;
}
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.
Issues and pull requests are welcome.
integration_test/.This package is released under the MIT License.
निर्भरता सूची 5 आइटम
{"sdk":"flutter"}^6.1.5^0.15.6{"sdk":"flutter"}^6.0.0उपयोग के अनुसार छाँटें, गतिविधि की तुलना करें और अपनाने से पहले मूल प्रोजेक्ट की आवश्यकताएँ जाँचें।
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗