Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug Report: Error Fetching Video Streams #312

Open
ssss500 opened this issue Nov 14, 2024 · 3 comments
Open

Bug Report: Error Fetching Video Streams #312

ssss500 opened this issue Nov 14, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@ssss500
Copy link

ssss500 commented Nov 14, 2024

Describe the bug

An error occurs when trying to fetch video streams using youtube_explode. The video is unavailable due to restrictions that require both logins. Note that they can work randomly. It can work once every 5 times, for example this is error :

Error fetching video qualities: VideoUnplayableException: Video 'PRPnNf-MoBw' is unplayable.
Streams are not available for this video.
Reason: Please sign in

[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: No video qualities found

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

import 'package:youtube_explode_dart/youtube_explode_dart.dart';

void fetchVideoStream(String videoId) async {
  var yt = YoutubeExplode();
  try {
    StreamManifest manifest = await yt.videos.streamsClient.getManifest(
      videoId,
      ytClients: [
        YoutubeApiClient.safari,
        YoutubeApiClient.mediaConnect,
      ],
    );
    // Process the manifest as needed
  } catch (e) {
    print('Error fetching video qualities: $e');
  }
}

Enviroment:

  • flutter: 3.24.3
  • dart :3.5.3
  • YoutubeExplode Version : ^2.3.5
@ssss500 ssss500 added the bug Something isn't working label Nov 14, 2024
@Hexer10
Copy link
Owner

Hexer10 commented Nov 14, 2024

Hi, unfortunately youtube lately has been limiting most clients, could you try adding YoutubeApiClient.tv and check if it helps?

@ssss500
Copy link
Author

ssss500 commented Nov 14, 2024

Yes, it works and shows only 360 quality.

This is nice as a temporary solution.

Can we get a quality like 1080, for example, as before, soon?

Or should I look for a different way? Do you suggest an alternative solution that helps me upload a large number of videos and is free?

@Hexer10
Copy link
Owner

Hexer10 commented Nov 15, 2024

Unfortunately if you need muxed streams there is no other way to obtain them, YouTube has been blocking most clients that used to provide them.

You should get separate audio and video streams and merge them together if you need high quality streams.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants