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
322 stars 141 forks source link

[BUG] No Muxed streams #291

Closed jelle-limpens closed 3 weeks ago

jelle-limpens commented 3 weeks ago

Since the 2.2.3 update there are no Muxed streams returning from Youtube video's. Is this final? No other clients succesful in returning muxed streams? As its highly inefficient to download video and audio and combine with FFMPEG. Tested this out and video is still downloading after 5 minutes

Hexer10 commented 3 weeks ago

Most likely yes, unless someone is able to find a client that still provides muxed streams; unfortunately currently it seems like removed all the clients the provide muxed streams.

I can't reproduce the issue regarding the download speed, I was able to download a 10minutes 1080p video in around 5 seconds (128 MiB)

jelle-limpens commented 3 weeks ago

So you got a working video with combining the video and audio using FFMPEG? As of now I got no working video by using FFMPEg

jelle-limpens commented 3 weeks ago

For others trying to implement a Youtube Video, https://pub.dev/packages/youtube_player_flutter, is an good (temporary) alternative. Player is not so good as pod_player combined with youtube explode, but very easy to implement and works like a charm

ijashuzain commented 3 weeks ago

I have developed a simple youtube player by fixing this youtube explode issue with muxed stream deperication. you can check it and i am welcoming contributions to make it better.

https://pub.dev/packages/y_player

Hexer10 commented 3 weeks ago

I've published a new version that partially is able to provide one muxed stream (360p) by using the android_music client, tough that works only for music videos.

I've had some success also using an android client, tough reading only seems like it might require a po_token so I'm not really sure if it's feasible to implement

Purehi commented 3 weeks ago

Changed this. It's working for me.

Stream _getStreams(VideoId videoId, {required bool fullManifest}) async* { try {

  if (fullManifest) {
    await for (final stream
        in _getStream(videoId, VideoController.androidClient)) {
      yield stream;
    }
  }else{
    // Use await for instead of yield* to catch exceptions
    await for (final stream
    in _getStream(videoId, VideoController.iosClient)) {
      yield stream;
    }
  }
} on VideoUnplayableException catch (e) {
  if (e is VideoRequiresPurchaseException) {
    rethrow;
  }
  yield* _getCipherStream(videoId);
}

}

How to use final manifest = await yt.videos.streamsClient.getManifest(youtubeIdOrUrl, fullManifest: true);

I have updated my app, you can check it out. WeTube:Video&Music

examvishwa commented 3 weeks ago

@Purehi Can you Please share the solution & Where to change ? Please Provide solution

anilslabs commented 3 weeks ago

Changed this. It's working for me.

Stream _getStreams(VideoId videoId, {required bool fullManifest}) async* { try {

  if (fullManifest) {
    await for (final stream
        in _getStream(videoId, VideoController.androidClient)) {
      yield stream;
    }
  }else{
    // Use await for instead of yield* to catch exceptions
    await for (final stream
    in _getStream(videoId, VideoController.iosClient)) {
      yield stream;
    }
  }
} on VideoUnplayableException catch (e) {
  if (e is VideoRequiresPurchaseException) {
    rethrow;
  }
  yield* _getCipherStream(videoId);
}

}

How to use final manifest = await yt.videos.streamsClient.getManifest(youtubeIdOrUrl, fullManifest: true);

I have updated my app, you can check it out. WeTube:Video&Music

Thanks for the solution. It worked for me with most YouTube videos but failed for some. 

Following are some of the YouTube video URLs that are not working for me. I am not getting the muxed streams for these URls and also the getManifest(youtubeIdOrUrl, fullManifest: true) function is taking so long to return the Stream Manifest data.

  1. https://www.youtube.com/watch?v=ntJ-Q6EXpJA
  2. https://youtu.be/GgnOz8d82aI
HKTareen commented 3 weeks ago

on my side , other than muxed, Every List is working, audio only, video only, video but without audio, Stream but without audio

HKTareen commented 3 weeks ago

I have developed a simple youtube player by fixing this youtube explode issue with muxed stream deperication. you can check it and i am welcoming contributions to make it better.

https://pub.dev/packages/y_player

i reviewed your code, your way of adding audio to mute video is impressive.

Hexer10 commented 3 weeks ago

Please update to the latest version, which includes a client (android) that should support low quality 360p muxed streams, however the most reliable solution is still downloading video and audio separately.

ijashuzain commented 3 weeks ago

I have developed a simple youtube player by fixing this youtube explode issue with muxed stream deperication. you can check it and i am welcoming contributions to make it better.

https://pub.dev/packages/y_player

i reviewed your code, your way of adding audio to mute video is impressive.

Thanks😍