Hexer10 / youtube_explode_dart

Dart library to interact with many Youtube APIs
https://pub.dev/packages/youtube_explode_dart
BSD 3-Clause "New" or "Revised" License
325 stars 143 forks source link

Resolve Available Thumbnails from Player Response #249

Open codedbycurtis opened 1 year ago

codedbycurtis commented 1 year ago

Is your feature request related to a problem? Please describe. The ThumbnailSet class provides five different hard-coded URLs for each thumbnail that a video can have, these being LowResUrl, MediumResUrl, HighResUrl, StandardResUrl, and MaxResUrl, however, as the class states, only some of these thumbnails may be available. Currently, there is no way of determining which thumbnails are available until we send an HTTP request to one of the URLs, at which point the request will return a 404 error if the thumbnail is not available in that quality.

Describe the solution you'd like The YoutubeExplode library circumvents this by resolving the available thumbnails from the player response, as can be seen here:

PlayerResponse.cs VideoClient.cs

This allows us to tell exactly which thumbnails are available for a specific video, and their resolution.

Describe alternatives you've considered N/A

How should this be implemented I imagine the solution used in YoutubeExplode could be ported with relative ease.

Additional context N/A