youtube_explode_dart icon indicating copy to clipboard operation
youtube_explode_dart copied to clipboard

[BUG] Explicit titles aka Videos that show "Viewer discretion is advised" results in streams are not available Error

Open KRTirtho opened this issue 1 year ago • 2 comments

Describe the bug Explicit titles or videos that show "Viewer discretion is advised" results in Streams not available error. e.g. Jake Hill & Josh A - Suicidal Thoughts does not work.

To Reproduce Include the code which doesn't work in the code markdown..

final yt = YoutubeExplode();

await yt.videos.streamsClient.getManifest("VFSg01HDqAk");

Stacktrace

----------------------------------------
[2024-10-17 12:03:33.819436]---------------------
VideoUnplayableException: Video 'VFSg01HDqAk' is unplayable.
Streams are not available for this video.
In most cases, this error indicates that there are 
some restrictions in place that prevent watching this video.
Reason: Please sign in
#0      StreamClient._getCipherStream (package:youtube_explode_dart/src/videos/streams/stream_client.dart:179)
<asynchronous suspension>
#1      StreamClient._getStreams (package:youtube_explode_dart/src/videos/streams/stream_client.dart:137)
<asynchronous suspension>
#2      Stream.toList.<anonymous closure> (dart:async/stream.dart:1351)
<asynchronous suspension>
#3      StreamClient.getManifest.<anonymous closure> (package:youtube_explode_dart/src/videos/streams/stream_client.dart:37)
<asynchronous suspension>
#4      retry (package:youtube_explode_dart/src/retry.dart:16)
<asynchronous suspension>
#5      Future.timeout.<anonymous closure> (dart:async/future_impl.dart:963)
<asynchronous suspension>
#6      YoutubeSourcedTrack.toSiblingType (package:spotube/services/sourced_track/sources/youtube.dart:145)
<asynchronous suspension>
#7      YoutubeSourcedTrack.fetchSiblings (package:spotube/services/sourced_track/sources/youtube.dart:239)
<asynchronous suspension>
#8      YoutubeSourcedTrack.fetchFromTrack (package:spotube/services/sourced_track/sources/youtube.dart:63)
<asynchronous suspension>
#9      SourcedTrack.fetchFromTrack (package:spotube/services/sourced_track/sourced_track.dart:117)
<asynchronous suspension>
#10     sourcedTrackProvider.<anonymous closure> (package:spotube/provider/server/sourced_track.dart:25)
<asynchronous suspension>
#11     FutureHandlerProviderElementMixin.handleFuture.<anonymous closure>.<anonymous closure> (package:riverpod/src/async_notifier/base.dart:348)
<asynchronous suspension>

Enviroment: (please complete the following information):

  • Enviroment: Flutter
  • Version 3.24.3
  • YoutubeExplode Version: ^2.3.1 Additional context Add any other context about the problem here.

KRTirtho avatar Oct 17 '24 14:10 KRTirtho

Invidious API is able to get the streams of these types of videos. So, I guess there's a way around this. May be pretending to be different client device? https://inv.nadeko.net/watch?v=VFSg01HDqAk

KRTirtho avatar Oct 17 '24 14:10 KRTirtho

I've just released a new version (2.3.2) which implements the tv client that should bypass that restriction, it should be used automatically. If the extraction fails the library automatically retries with the new client otherwise you can manually specify it:

  final manifest = await yt.videos.streams.getManifest('VFSg01HDqAk',
      ytClients: [
        YoutubeApiClient.tv
  ]);

Hexer10 avatar Oct 18 '24 15:10 Hexer10

here's one that won't work

flutter: VideoUnplayableException: Video 'x8VYWazR5mE' is unplayable. Streams are not available for this video. In most cases, this error indicates that there are some restrictions in place that prevent watching this video. Reason: Sign in to confirm your age

khaled-0 avatar Nov 05 '24 06:11 khaled-0