MetadataExtractor class
The main metadata extraction engine
Constructors
- MetadataExtractor.new({Client? client, UrlOptimizer? urlOptimizer, ImageUrlAnalyzer? imageAnalyzer, MetadataCache? cache, Duration timeout = const Duration(seconds: 10), String? userAgent, bool cacheEnabled = true, Duration cacheDuration = const Duration(hours: 4), bool followRedirects = true, bool optimizeUrls = true, int maxRedirects = 5, bool analyzeImages = true, bool extractStructuredData = true, bool extractSocialMetrics = false, bool analyzeContent = false, String? proxyUrl})
- Creates a new instance of MetadataExtractor
Properties
- analyzeContent → bool
-
Whether to analyze content
final
- analyzeImages → bool
-
Whether to analyze images
final
- cacheDuration → Duration
-
How long to cache results
final
- cacheEnabled → bool
-
Whether to use the cache
final
- extractSocialMetrics → bool
-
Whether to extract social engagement metrics
final
- extractStructuredData → bool
-
Whether to extract structured data
final
- followRedirects → bool
-
Whether to follow redirects
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- maxRedirects → int
-
Maximum number of redirects to follow
final
- optimizeUrls → bool
-
Whether to optimize URLs
final
- proxyUrl → String?
-
Optional proxy URL to use for requests (helps with CORS on web)
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- timeout → Duration
-
Timeout duration for HTTP requests
final
- userAgent → String?
-
Custom user agent to use for HTTP requests
final
Methods
-
dispose(
) → void - Closes the HTTP client and other resources
-
extract(
String url, {bool skipCache = false}) → Future< LinkMetadata> - Extracts metadata from the given URL
-
extractMultiple(
List< String> urls, {bool skipCache = false, int concurrentRequests = 3}) → Future<List< LinkMetadata> > - Extracts metadata for multiple URLs in parallel
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
- Creates an instance with a shared cache