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
299 stars 122 forks source link

[BUG] Getting error in fetching Channel videos #265

Closed Davidboga4 closed 8 months ago

Davidboga4 commented 9 months ago

Can some one help me to fix this issue.

Code

 YoutubeExplode yt = YoutubeExplode();
    try {
      Stream<Video> videoStream = yt.channels.getUploads("channelID");
      List<Video> videos = noLimit
          ? await videoStream.toList()
          : await (videoStream.take(count)).toList();
      return videos;
    } catch (e) {
      debugPrint('***GetChannelContent Error $e');
      return [];
    }

console output:

E/flutter (10567): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: 'package:youtube_explode_dart/src/extensions/helpers_extension.dart': Failed assertion: line 175 pos 12: 'parts.length == 3': is not true. E/flutter (10567): #0 _AssertionError._doThrowNew (dart:core-patch/errors_patch.dart:51:61) E/flutter (10567): #1 _AssertionError._throwNew (dart:core-patch/errors_patch.dart:40:5) E/flutter (10567): #2 StringUtility2.toDateTime (package:youtube_explode_dart/src/extensions/helpers_extension.dart:175:12) E/flutter (10567): #3 PlaylistClient.getVideos (package:youtube_explode_dart/src/playlists/playlist_client.dart:60:31) E/flutter (10567): E/flutter (10567): #4 Stream.length. (dart:async/stream.dart:1297:9) E/flutter (10567): E/flutter (10567):

package version: youtube_explode_dart: ^2.0.3

Hexer10 commented 8 months ago

There is probably an error while parsing some datetime, can you provide a channelid that gives this error?

Davidboga4 commented 8 months ago

Sample channel ID's for reference Channel ID: UCZ84wv5errdn_lYSwJgy0Yw Channel ID: UC14Hm1imURnngpNVx3uw-FQ

Hexer10 commented 8 months ago

Should be fixed in the lastest version, try to update the library