From 5ed750ee71cbec81ba6951291761ee4ee45f0164 Mon Sep 17 00:00:00 2001 From: Jordan Wong Date: Fri, 15 Nov 2024 16:53:09 -1000 Subject: [PATCH] fix: Parsing JSON response for shorts --- CHANGELOG.md | 3 +++ lib/src/channels/video_type.dart | 2 +- lib/src/reverse_engineering/pages/channel_upload_page.dart | 6 ++++++ pubspec.yaml | 2 +- 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cc71f4f..7093cb4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## 2.3.7 +- Fixes JSON parsing for shorts data + ## 2.3.6 - Update search playlists parsing due to yt changes. - Implement >,<,== operators for `VideoResolution`. diff --git a/lib/src/channels/video_type.dart b/lib/src/channels/video_type.dart index 0f312da..60ab683 100644 --- a/lib/src/channels/video_type.dart +++ b/lib/src/channels/video_type.dart @@ -6,7 +6,7 @@ enum VideoType { normal('videos', 'videoRenderer'), /// Youtube shorts video - shorts('shorts', 'reelItemRenderer'); + shorts('shorts', 'shortsLockupViewModel'); final String name; diff --git a/lib/src/reverse_engineering/pages/channel_upload_page.dart b/lib/src/reverse_engineering/pages/channel_upload_page.dart index 82f898d..669ee36 100644 --- a/lib/src/reverse_engineering/pages/channel_upload_page.dart +++ b/lib/src/reverse_engineering/pages/channel_upload_page.dart @@ -185,6 +185,12 @@ class _InitialData extends InitialData { .get('richItemRenderer') ?.get('content') ?.get(type.youtubeRenderText); + if (type == VideoType.shorts) { + video = video + ?.get('onTap') + ?.get('innertubeCommand') + ?.get('reelWatchEndpoint'); + } } if (video == null) { diff --git a/pubspec.yaml b/pubspec.yaml index c9b06f1..79aa0ce 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: youtube_explode_dart description: A port in dart of the youtube explode library. Supports several API functions without the need of Youtube API Key. -version: 2.3.6 +version: 2.3.7 homepage: https://github.com/Hexer10/youtube_explode_dart topics: