From dcedede9e967c3ca3bc488e9801a0a7e41a15a4c Mon Sep 17 00:00:00 2001 From: Mattia Date: Tue, 12 Sep 2023 14:18:14 +0200 Subject: [PATCH 01/36] Better performance for iterating through closed captions elements. Closes #251 . Version bump --- CHANGELOG.md | 4 ++++ .../closed_caption_client.dart | 20 ++++++++++--------- pubspec.yaml | 2 +- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 998caca..f82679a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.0.3 +- Better performance for iterating through closed captions elements. #251 + + ## 2.0.2 - Implement YT Handles. - Deprecated ChannelLink icon's uri, they are no longer provided by YT. diff --git a/lib/src/videos/closed_captions/closed_caption_client.dart b/lib/src/videos/closed_captions/closed_caption_client.dart index 80a79e6..39803de 100644 --- a/lib/src/videos/closed_captions/closed_caption_client.dart +++ b/lib/src/videos/closed_captions/closed_caption_client.dart @@ -59,15 +59,17 @@ class ClosedCaptionClient { final response = await re.ClosedCaptionClient.get(_httpClient, trackInfo.url); - final captions = - response.closedCaptions.where((e) => !e.text.isNullOrWhiteSpace).map( - (e) => ClosedCaption( - e.text, - e.offset, - e.duration, - e.parts.map((f) => ClosedCaptionPart(f.text, f.offset)), - ), - ); + final captions = [ + for (final e in response.closedCaptions) + if (!e.text.isNullOrWhiteSpace) + ClosedCaption( + e.text, + e.offset, + e.duration, + e.parts.map((f) => ClosedCaptionPart(f.text, f.offset)), + ), + ]; + return ClosedCaptionTrack(captions); } diff --git a/pubspec.yaml b/pubspec.yaml index e1741c3..6206da8 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.0.2 +version: 2.0.3 homepage: https://github.com/Hexer10/youtube_explode_dart topics: From fcae86c170dff4755a2eeb118f446c34429c3997 Mon Sep 17 00:00:00 2001 From: Matt Date: Fri, 3 Nov 2023 22:28:12 +0100 Subject: [PATCH 02/36] Update test playlist url --- test/playlist_test.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/playlist_test.dart b/test/playlist_test.dart index f52f275..b832656 100644 --- a/test/playlist_test.dart +++ b/test/playlist_test.dart @@ -49,7 +49,7 @@ void main() { final videos = await yt!.playlists .getVideos( PlaylistId( - 'https://www.youtube.com/playlist?list=PLCSusC_jlo14J0uBgFqfHsKu7gc5W2HyM', + 'https://www.youtube.com/playlist?list=PLn4GvABOzCQursVQ7qMU9CkNaKz4RgrVM', ), ) .toList(); From 289b8ddac2732bd4c95b09688e22190f21fd302f Mon Sep 17 00:00:00 2001 From: Matt Date: Fri, 3 Nov 2023 23:42:20 +0100 Subject: [PATCH 03/36] Add publishDate and viewCount for playlists. Fixes #240 --- lib/src/extensions/helpers_extension.dart | 25 +++++++++++++++++++ lib/src/playlists/playlist_client.dart | 5 ++-- .../pages/playlist_page.dart | 12 ++++++++- 3 files changed, 39 insertions(+), 3 deletions(-) diff --git a/lib/src/extensions/helpers_extension.dart b/lib/src/extensions/helpers_extension.dart index 2899611..eb61871 100644 --- a/lib/src/extensions/helpers_extension.dart +++ b/lib/src/extensions/helpers_extension.dart @@ -86,6 +86,31 @@ extension StringUtility on String { } DateTime parseDateTime() => DateTime.parse(this); + + static final _viewCountExp = RegExp(r'^(\d+\.?\d+?)([KMB])? views$'); + + /// Parse view count from a string formatted as an integer and its magnitude. + /// Example: 5 views, 1.5K views, 2.3M views, 3.4B views. + /// If this fails returns null. + int? parseViewCount() { + final match = _viewCountExp.firstMatch(this); + if (match == null) { + return null; + } + if (match.groupCount != 2) { + return null; + } + final count = double.tryParse(match.group(1) ?? '1'); + final unitStr = match.group(2); + + final unit = switch (unitStr) { + 'B' => 1000000000, + 'M' => 1000000, + 'K' => 1000, + _ => 1 + }; + return (count! * unit).toInt(); + } } /// Utility for Strings. diff --git a/lib/src/playlists/playlist_client.dart b/lib/src/playlists/playlist_client.dart index 682cb3a..eb57647 100644 --- a/lib/src/playlists/playlist_client.dart +++ b/lib/src/playlists/playlist_client.dart @@ -1,5 +1,6 @@ import '../channels/channel_id.dart'; import '../common/common.dart'; +import '../extensions/helpers_extension.dart'; import '../reverse_engineering/pages/playlist_page.dart'; import '../reverse_engineering/youtube_http_client.dart'; import '../videos/video.dart'; @@ -56,8 +57,8 @@ class PlaylistClient { video.title, video.author, ChannelId(video.channelId), - null, - null, + video.uploadDateRaw.toDateTime(), + video.uploadDateRaw, null, video.description, video.duration, diff --git a/lib/src/reverse_engineering/pages/playlist_page.dart b/lib/src/reverse_engineering/pages/playlist_page.dart index f9efbbe..164ca07 100644 --- a/lib/src/reverse_engineering/pages/playlist_page.dart +++ b/lib/src/reverse_engineering/pages/playlist_page.dart @@ -215,5 +215,15 @@ class _Video { root.get('lengthText')?.getT('simpleText')?.toDuration(); int get viewCount => - root.get('viewCountText')?.getT('simpleText').parseInt() ?? 0; + root.get('viewCountText')?.getT('simpleText').parseInt() ?? + _videoInfo?.split('•').elementAtSafe(0)?.stripNonDigits().parseInt() ?? + 0; + + String? get uploadDateRaw => _videoInfo?.split('•').elementAtSafe(1); + + String? get _videoInfo => root + .get('videoInfo') + ?.getT>('runs')! + .cast>() + .parseRuns(); } From cc8c05ab0d0aaab14e66c05d72c1fdfebc0f9cfe Mon Sep 17 00:00:00 2001 From: Matt Date: Fri, 3 Nov 2023 23:42:38 +0100 Subject: [PATCH 04/36] Refactor else-if into switch expression --- lib/src/extensions/helpers_extension.dart | 31 +++++++++-------------- 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/lib/src/extensions/helpers_extension.dart b/lib/src/extensions/helpers_extension.dart index eb61871..905f5de 100644 --- a/lib/src/extensions/helpers_extension.dart +++ b/lib/src/extensions/helpers_extension.dart @@ -178,25 +178,18 @@ extension StringUtility2 on String? { // Try to get the unit final unit = parts[1]; - Duration time; - if (unit.startsWith('second')) { - time = Duration(seconds: qty); - } else if (unit.startsWith('minute')) { - time = Duration(minutes: qty); - } else if (unit.startsWith('hour')) { - time = Duration(hours: qty); - } else if (unit.startsWith('day')) { - time = Duration(days: qty); - } else if (unit.startsWith('week')) { - time = Duration(days: qty * 7); - } else if (unit.startsWith('month')) { - time = Duration(days: qty * 30); - } else if (unit.startsWith('year')) { - time = Duration(days: qty * 365); - } else { - throw StateError("Couldn't parse $unit unit of time. " - 'Please report this to the project page!'); - } + + final time = switch (unit) { + _ when unit.startsWith('second') => Duration(seconds: qty), + _ when unit.startsWith('minute') => Duration(minutes: qty), + _ when unit.startsWith('hour') => Duration(hours: qty), + _ when unit.startsWith('day') => Duration(days: qty), + _ when unit.startsWith('week') => Duration(days: qty * 7), + _ when unit.startsWith('month') => Duration(days: qty * 30), + _ when unit.startsWith('year') => Duration(days: qty * 365), + _ => throw StateError("Couldn't parse $unit unit of time. " + 'Please report this to the project page!') + }; return DateTime.now().subtract(time); } From 55442278049507f0d91b3bf6633198a57ce36511 Mon Sep 17 00:00:00 2001 From: Matt Date: Fri, 3 Nov 2023 23:43:07 +0100 Subject: [PATCH 05/36] Update changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f82679a..0a7a9dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ ## 2.0.3 - Better performance for iterating through closed captions elements. #251 - +- Refactor else-if into switch expression. #240 ## 2.0.2 - Implement YT Handles. From 457c105fd0b8d855a49cc8b605f7ffd60363aebd Mon Sep 17 00:00:00 2001 From: Mattia Date: Sun, 10 Dec 2023 20:34:09 +0100 Subject: [PATCH 06/36] Move from `lint` to `lints` and update collection package. --- analysis_options.yaml | 2 +- pubspec.yaml | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/analysis_options.yaml b/analysis_options.yaml index 5c678c2..2582bf5 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -1,4 +1,4 @@ -include: package:lint/strict.yaml +include: package:lints/recommended.yaml analyzer: errors: diff --git a/pubspec.yaml b/pubspec.yaml index 6206da8..957cf13 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -13,7 +13,7 @@ environment: sdk: '>=3.0.0 <4.0.0' dependencies: - collection: ^1.16.0 + collection: ^1.18.0 freezed_annotation: ^2.2.0 html: ^0.15.0 http: ^1.0.0 @@ -24,10 +24,9 @@ dependencies: dev_dependencies: build_runner: ^2.1.11 - console: ^4.1.0 freezed: ^2.3.2 json_serializable: ^6.2.0 - lint: ^2.1.2 + lints: ^3.0.0 source_gen: ^1.4.0 test: ^1.21.1 From 0867b9e9ed5c5797ff32c2e390138790422fb9fe Mon Sep 17 00:00:00 2001 From: Mattia Date: Sun, 10 Dec 2023 20:53:06 +0100 Subject: [PATCH 07/36] Implement YT api to fetch playlists. Fixes #261 --- CHANGELOG.md | 2 +- lib/src/channels/channel_client.dart | 1 - .../clients/comments_client.dart | 6 +- .../pages/channel_upload_page.dart | 2 +- .../pages/playlist_page.dart | 74 +++++++++++++++---- .../pages/search_page.dart | 2 +- .../youtube_http_client.dart | 24 ++++-- test/playlist_test.dart | 10 ++- 8 files changed, 91 insertions(+), 30 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f82679a..bae72af 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ ## 2.0.3 - Better performance for iterating through closed captions elements. #251 - +- Fix fetching of YT music playlists. #261 ## 2.0.2 - Implement YT Handles. diff --git a/lib/src/channels/channel_client.dart b/lib/src/channels/channel_client.dart index 1aa719d..fe78374 100644 --- a/lib/src/channels/channel_client.dart +++ b/lib/src/channels/channel_client.dart @@ -8,7 +8,6 @@ import '../reverse_engineering/pages/watch_page.dart'; import '../reverse_engineering/youtube_http_client.dart'; import '../videos/video.dart'; import '../videos/video_id.dart'; -import 'channel_handle.dart'; import 'channels.dart'; /// Queries related to YouTube channels. diff --git a/lib/src/reverse_engineering/clients/comments_client.dart b/lib/src/reverse_engineering/clients/comments_client.dart index f62ee8c..95d5905 100644 --- a/lib/src/reverse_engineering/clients/comments_client.dart +++ b/lib/src/reverse_engineering/clients/comments_client.dart @@ -35,7 +35,7 @@ class CommentsClient { return null; } - final data = await httpClient.sendPost('next', continuation); + final data = await httpClient.sendContinuation('next', continuation); return CommentsClient(data); } @@ -44,7 +44,7 @@ class CommentsClient { YoutubeHttpClient httpClient, String token, ) async { - final data = await httpClient.sendPost('next', token); + final data = await httpClient.sendContinuation('next', token); return CommentsClient(data); } @@ -129,7 +129,7 @@ onResponseReceivedEndpoints[1].reloadContinuationItemsCommand.continuationItems[ return null; } - final data = await httpClient.sendPost('next', _continuationToken!); + final data = await httpClient.sendContinuation('next', _continuationToken!); return CommentsClient(data); } } diff --git a/lib/src/reverse_engineering/pages/channel_upload_page.dart b/lib/src/reverse_engineering/pages/channel_upload_page.dart index d0dcfd3..1963c82 100644 --- a/lib/src/reverse_engineering/pages/channel_upload_page.dart +++ b/lib/src/reverse_engineering/pages/channel_upload_page.dart @@ -27,7 +27,7 @@ class ChannelUploadPage extends YoutubePage<_InitialData> { return null; } - final data = await httpClient.sendPost('browse', initialData.token); + final data = await httpClient.sendContinuation('browse', initialData.token); return ChannelUploadPage.id(channelId, _InitialData(data)); } diff --git a/lib/src/reverse_engineering/pages/playlist_page.dart b/lib/src/reverse_engineering/pages/playlist_page.dart index f9efbbe..f92f486 100644 --- a/lib/src/reverse_engineering/pages/playlist_page.dart +++ b/lib/src/reverse_engineering/pages/playlist_page.dart @@ -13,6 +13,8 @@ class PlaylistPage extends YoutubePage<_InitialData> { /// final String playlistId; + final String? _visitorData; + late final List<_Video> videos = initialData.playlistVideos; late final String? title = initialData.title; @@ -26,19 +28,29 @@ class PlaylistPage extends YoutubePage<_InitialData> { late final int? videoCount = initialData.videoCount; /// InitialData - PlaylistPage.id(this.playlistId, _InitialData initialData) + PlaylistPage.id(this.playlistId, _InitialData initialData, + [this._visitorData]) : super.fromInitialData(initialData); /// Future nextPage(YoutubeHttpClient httpClient) async { - if (initialData.continuationToken?.isEmpty == null) { + if (initialData.continuationToken?.isEmpty ?? true) { return null; } - final data = - await httpClient.sendPost('browse', initialData.continuationToken!); + final data = await httpClient.sendContinuation( + 'browse', initialData.continuationToken!, headers: { + 'x-youtube-client-name': '1', + 'x-goog-visitor-id': _visitorData ?? '' + }); + final newInitialData = _InitialData(data); + if (newInitialData.continuationToken != null && + newInitialData.continuationToken == initialData.continuationToken) { + // Avoid sending always the same request. + return null; + } - return PlaylistPage.id(playlistId, _InitialData(data)); + return PlaylistPage.id(playlistId, _InitialData(data), _visitorData); } /// @@ -49,18 +61,54 @@ class PlaylistPage extends YoutubePage<_InitialData> { final url = 'https://www.youtube.com/playlist?list=$id&hl=en&persist_hl=1'; return retry(httpClient, () async { final raw = await httpClient.getString(url); - return PlaylistPage.parse(raw, id); + final page = PlaylistPage.parse(raw, id); + if (page.initialData.exists) { + return page; + } + + // Try to fetch using the browse API + final data = await httpClient.sendPost('browse', { + 'browseId': page.initialData.browseId!, + }, headers: { + 'x-youtube-client-name': '1', + 'x-goog-visitor-id': page.initialData.visitorData ?? '', + }); + return PlaylistPage.id( + id, _InitialData(data), page.initialData.visitorData); }); } /// PlaylistPage.parse(String raw, this.playlistId) - : super(parser.parse(raw), (root) => _InitialData(root)); + : _visitorData = null, + super(parser.parse(raw), (root) => _InitialData(root)); } class _InitialData extends InitialData { _InitialData(super.root); + String? get visitorData => root + .get('responseContext') + ?.get('webResponseContextExtensionData') + ?.get('ytConfigData') + ?.getT('visitorData'); + + String? get browseId => root + .get('responseContext') + ?.getList('serviceTrackingParams') + ?.firstWhereOrNull((e) => e['service'] == 'GFEEDBACK') + ?.getList('params') + ?.firstWhereOrNull((e) => e['key'] == 'browse_id') + ?.getT('value'); + + bool get exists => + root + .getList('alerts') + ?.firstOrNull + ?.get('alertRenderer') + ?.getT('type') != + 'ERROR'; + late final String? title = root .get('metadata') ?.get('playlistMetadataRenderer') @@ -118,6 +166,11 @@ class _InitialData extends InitialData { ?.getT('token'); List? get playlistVideosContent => + root + .getList('onResponseReceivedActions') + ?.firstOrNull + ?.get('appendContinuationItemsAction') + ?.getList('continuationItems') ?? root .get('contents') ?.get('twoColumnBrowseResultsRenderer') @@ -132,12 +185,7 @@ class _InitialData extends InitialData { ?.getList('contents') ?.firstOrNull ?.get('playlistVideoListRenderer') - ?.getList('contents') ?? - root - .getList('onResponseReceivedActions') - ?.firstOrNull - ?.get('appendContinuationItemsAction') - ?.getList('continuationItems'); + ?.getList('contents'); late final List? videosContent = root .get('contents') diff --git a/lib/src/reverse_engineering/pages/search_page.dart b/lib/src/reverse_engineering/pages/search_page.dart index 0b8afc5..2527fcd 100644 --- a/lib/src/reverse_engineering/pages/search_page.dart +++ b/lib/src/reverse_engineering/pages/search_page.dart @@ -29,7 +29,7 @@ class SearchPage extends YoutubePage<_InitialData> { } final data = - await httpClient.sendPost('search', initialData.continuationToken!); + await httpClient.sendContinuation('search', initialData.continuationToken!); return SearchPage.id(queryString, _InitialData(data)); } diff --git a/lib/src/reverse_engineering/youtube_http_client.dart b/lib/src/reverse_engineering/youtube_http_client.dart index 5a54e99..7611343 100644 --- a/lib/src/reverse_engineering/youtube_http_client.dart +++ b/lib/src/reverse_engineering/youtube_http_client.dart @@ -253,10 +253,22 @@ class YoutubeHttpClient extends http.BaseClient { return int.tryParse(response.headers['content-length'] ?? ''); } + Future sendContinuation( + String action, + String token, { + Map? headers, + }) async => + sendPost(action, {'continuation': token}, headers: headers); + /// Sends a call to the youtube api endpoint. - Future sendPost(String action, String token) async { + Future sendPost(String action, Map data, + {Map? headers}) { assert(action == 'next' || action == 'browse' || action == 'search'); + final url = Uri.parse( + 'https://www.youtube.com/youtubei/v1/$action?key=AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8', + ); + final body = { 'context': const { 'client': { @@ -267,15 +279,11 @@ class YoutubeHttpClient extends http.BaseClient { 'clientVersion': "2.20220921.00.00", }, }, - 'continuation': token, + ...data, }; - final url = Uri.parse( - 'https://www.youtube.com/youtubei/v1/$action?key=AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8', - ); - return retry(this, () async { - final raw = await post(url, body: json.encode(body)); + final raw = await post(url, body: json.encode(body), headers: headers); if (_closed) throw HttpClientClosedException(); //final now = DateTime.now(); @@ -309,7 +317,7 @@ class YoutubeHttpClient extends http.BaseClient { }); //print(request); - //print(StackTrace.current); + // print(StackTrace.current); return _httpClient.send(request); } } diff --git a/test/playlist_test.dart b/test/playlist_test.dart index f52f275..85c5025 100644 --- a/test/playlist_test.dart +++ b/test/playlist_test.dart @@ -49,7 +49,7 @@ void main() { final videos = await yt!.playlists .getVideos( PlaylistId( - 'https://www.youtube.com/playlist?list=PLCSusC_jlo14J0uBgFqfHsKu7gc5W2HyM', + 'https://www.youtube.com/playlist?list=PLUpIWHnoHbGwSEJlDFpo9c5v3wk2DXLqo', ), ) .toList(); @@ -67,8 +67,14 @@ void main() { PlaylistId('PL601B2E69B03FAB9D'), }) { test('PlaylistID - ${val.value}', () async { - expect(yt!.playlists.getVideos(val), emits(isNotNull)); + expect(yt!. playlists.getVideos(val), emits(isNotNull)); }); } }); + + test('Get videos of YT music playlist', () async { + final playlistVideosCount = await yt!.playlists.getVideos('RDCLAK5uy_m9Rw_g5eCJtMhuRgP1eqU3H-XW7UL6uWQ').length; + print('OK'); + expect(playlistVideosCount, greaterThan(100)); + }); } From e00b98c0ba5fde6f355c7199fd53f535f6c82f4c Mon Sep 17 00:00:00 2001 From: Mattia Date: Sun, 10 Dec 2023 20:55:28 +0100 Subject: [PATCH 08/36] Code cleanup --- example/video_download.dart | 5 +---- lib/src/reverse_engineering/pages/search_page.dart | 4 ++-- test/playlist_test.dart | 7 ++++--- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/example/video_download.dart b/example/video_download.dart index a4723b5..36cbdbe 100644 --- a/example/video_download.dart +++ b/example/video_download.dart @@ -3,7 +3,6 @@ import 'dart:async'; import 'dart:io'; -import 'package:console/console.dart'; import 'package:youtube_explode_dart/youtube_explode_dart.dart'; // Initialize the YoutubeExplode instance. @@ -65,7 +64,6 @@ Future download(String id) async { stdout.writeln(msg); // Listen for data received. - final progressBar = ProgressBar(); await for (final data in audioStream) { // Keep track of the current downloaded data. count += data.length; @@ -73,8 +71,7 @@ Future download(String id) async { // Calculate the current progress. final progress = ((count / len) * 100).ceil(); - // Update the progressbar. - progressBar.update(progress); + print(progress.toStringAsFixed(2)); // Write to file. output.add(data); diff --git a/lib/src/reverse_engineering/pages/search_page.dart b/lib/src/reverse_engineering/pages/search_page.dart index 2527fcd..9886291 100644 --- a/lib/src/reverse_engineering/pages/search_page.dart +++ b/lib/src/reverse_engineering/pages/search_page.dart @@ -28,8 +28,8 @@ class SearchPage extends YoutubePage<_InitialData> { return null; } - final data = - await httpClient.sendContinuation('search', initialData.continuationToken!); + final data = await httpClient.sendContinuation( + 'search', initialData.continuationToken!); return SearchPage.id(queryString, _InitialData(data)); } diff --git a/test/playlist_test.dart b/test/playlist_test.dart index 85c5025..4ce09a5 100644 --- a/test/playlist_test.dart +++ b/test/playlist_test.dart @@ -67,14 +67,15 @@ void main() { PlaylistId('PL601B2E69B03FAB9D'), }) { test('PlaylistID - ${val.value}', () async { - expect(yt!. playlists.getVideos(val), emits(isNotNull)); + expect(yt!.playlists.getVideos(val), emits(isNotNull)); }); } }); test('Get videos of YT music playlist', () async { - final playlistVideosCount = await yt!.playlists.getVideos('RDCLAK5uy_m9Rw_g5eCJtMhuRgP1eqU3H-XW7UL6uWQ').length; - print('OK'); + final playlistVideosCount = await yt!.playlists + .getVideos('RDCLAK5uy_m9Rw_g5eCJtMhuRgP1eqU3H-XW7UL6uWQ') + .length; expect(playlistVideosCount, greaterThan(100)); }); } From d0535f71c94a9ed8962ad8119cbbfba6a200ab9b Mon Sep 17 00:00:00 2001 From: Mattia Date: Sun, 10 Dec 2023 20:57:33 +0100 Subject: [PATCH 09/36] Update changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1cd154b..b525e51 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ ## 2.0.3 - Better performance for iterating through closed captions elements. #251 -- Refactor else-if into switch expression. #240 +- Add publishDate and viewCount for playlists. #240 - Fix fetching of YT music playlists. #261 ## 2.0.2 From 784347684321084025a68bfc6b194432418a29f1 Mon Sep 17 00:00:00 2001 From: Mattia Date: Sun, 10 Dec 2023 21:19:29 +0100 Subject: [PATCH 10/36] Fix like count extraction --- CHANGELOG.md | 1 + .../reverse_engineering/pages/watch_page.dart | 23 ++++++++++++++++--- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b525e51..f13e165 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ - Better performance for iterating through closed captions elements. #251 - Add publishDate and viewCount for playlists. #240 - Fix fetching of YT music playlists. #261 +- Fix like count extraction. ## 2.0.2 - Implement YT Handles. diff --git a/lib/src/reverse_engineering/pages/watch_page.dart b/lib/src/reverse_engineering/pages/watch_page.dart index 840752b..42977a6 100644 --- a/lib/src/reverse_engineering/pages/watch_page.dart +++ b/lib/src/reverse_engineering/pages/watch_page.dart @@ -1,3 +1,6 @@ +import 'dart:convert'; +import 'dart:io'; + import 'package:collection/collection.dart'; import 'package:html/dom.dart'; import 'package:html/parser.dart' as parser; @@ -176,7 +179,7 @@ class _InitialData extends InitialData { int? _getLikes() { if (root['contents'] != null) { - final likes = root + final topLevelButtons = root .get('contents') ?.get('twoColumnWatchNextResults') ?.get('results') @@ -186,8 +189,22 @@ class _InitialData extends InitialData { ?.get('videoPrimaryInfoRenderer') ?.get('videoActions') ?.get('menuRenderer') - ?.getList('topLevelButtons') - ?.firstWhereOrNull((e) => e['toggleButtonRenderer'] != null) + ?.getList('topLevelButtons'); + + if (topLevelButtons == null) { + return null; + } + + final likes = topLevelButtons + .elementAtOrNull(0) + ?.get('segmentedLikeDislikeButtonViewModel') + ?.get('likeButtonViewModel') + ?.get('likeButtonViewModel') + ?.get('toggleButtonViewModel') + ?.get('toggleButtonViewModel') + ?.get('defaultButtonViewModel') + ?.get('buttonViewModel')?.getT('accessibilityText') ?? topLevelButtons + .firstWhereOrNull((e) => e['toggleButtonRenderer'] != null) ?.get('toggleButtonRenderer') ?.get('defaultText') ?.get('accessibility') From 012489aece9786d670c06dc086ccdd20befaac00 Mon Sep 17 00:00:00 2001 From: Mattia Date: Sun, 10 Dec 2023 21:20:04 +0100 Subject: [PATCH 11/36] Remove debugging artifacts --- lib/src/reverse_engineering/pages/watch_page.dart | 3 --- 1 file changed, 3 deletions(-) diff --git a/lib/src/reverse_engineering/pages/watch_page.dart b/lib/src/reverse_engineering/pages/watch_page.dart index 42977a6..9703177 100644 --- a/lib/src/reverse_engineering/pages/watch_page.dart +++ b/lib/src/reverse_engineering/pages/watch_page.dart @@ -1,6 +1,3 @@ -import 'dart:convert'; -import 'dart:io'; - import 'package:collection/collection.dart'; import 'package:html/dom.dart'; import 'package:html/parser.dart' as parser; From fb41e2c668f1ec93f810b582eb84ccc5210fdfe6 Mon Sep 17 00:00:00 2001 From: Mattia Date: Sun, 10 Dec 2023 21:20:26 +0100 Subject: [PATCH 12/36] dartfmt --- .../reverse_engineering/pages/watch_page.dart | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/lib/src/reverse_engineering/pages/watch_page.dart b/lib/src/reverse_engineering/pages/watch_page.dart index 9703177..8aed0b2 100644 --- a/lib/src/reverse_engineering/pages/watch_page.dart +++ b/lib/src/reverse_engineering/pages/watch_page.dart @@ -193,20 +193,22 @@ class _InitialData extends InitialData { } final likes = topLevelButtons - .elementAtOrNull(0) - ?.get('segmentedLikeDislikeButtonViewModel') - ?.get('likeButtonViewModel') - ?.get('likeButtonViewModel') - ?.get('toggleButtonViewModel') - ?.get('toggleButtonViewModel') - ?.get('defaultButtonViewModel') - ?.get('buttonViewModel')?.getT('accessibilityText') ?? topLevelButtons - .firstWhereOrNull((e) => e['toggleButtonRenderer'] != null) - ?.get('toggleButtonRenderer') - ?.get('defaultText') - ?.get('accessibility') - ?.get('accessibilityData') - ?.getT('label'); + .elementAtOrNull(0) + ?.get('segmentedLikeDislikeButtonViewModel') + ?.get('likeButtonViewModel') + ?.get('likeButtonViewModel') + ?.get('toggleButtonViewModel') + ?.get('toggleButtonViewModel') + ?.get('defaultButtonViewModel') + ?.get('buttonViewModel') + ?.getT('accessibilityText') ?? + topLevelButtons + .firstWhereOrNull((e) => e['toggleButtonRenderer'] != null) + ?.get('toggleButtonRenderer') + ?.get('defaultText') + ?.get('accessibility') + ?.get('accessibilityData') + ?.getT('label'); return likes.parseInt(); } From 62f4bf4eaee7d3b4d29f9beacade52888274da8f Mon Sep 17 00:00:00 2001 From: Mattia Date: Sun, 10 Dec 2023 21:23:45 +0100 Subject: [PATCH 13/36] Increate test timeout --- test/playlist_test.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/playlist_test.dart b/test/playlist_test.dart index 4ce09a5..4855d58 100644 --- a/test/playlist_test.dart +++ b/test/playlist_test.dart @@ -77,5 +77,5 @@ void main() { .getVideos('RDCLAK5uy_m9Rw_g5eCJtMhuRgP1eqU3H-XW7UL6uWQ') .length; expect(playlistVideosCount, greaterThan(100)); - }); + }, timeout: const Timeout(Duration(minutes: 2))); } From dfbd944feda336c7ce44992f21159b5b0410c477 Mon Sep 17 00:00:00 2001 From: Mattia Date: Sun, 10 Dec 2023 21:27:46 +0100 Subject: [PATCH 14/36] Update YT music test --- test/playlist_test.dart | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/playlist_test.dart b/test/playlist_test.dart index 4855d58..dd0f342 100644 --- a/test/playlist_test.dart +++ b/test/playlist_test.dart @@ -73,9 +73,9 @@ void main() { }); test('Get videos of YT music playlist', () async { - final playlistVideosCount = await yt!.playlists + final videos = await yt!.playlists .getVideos('RDCLAK5uy_m9Rw_g5eCJtMhuRgP1eqU3H-XW7UL6uWQ') - .length; - expect(playlistVideosCount, greaterThan(100)); + .toList(); + expect(videos.length, greaterThan(100)); }, timeout: const Timeout(Duration(minutes: 2))); } From 07569767f60e68d407bba9d19c7f9ddda6b6f45f Mon Sep 17 00:00:00 2001 From: Mattia Date: Thu, 21 Dec 2023 14:11:01 +0100 Subject: [PATCH 15/36] Fix issue when parsing dates formatted as "Streamed ago". Closes #265 . --- CHANGELOG.md | 3 +++ lib/src/extensions/helpers_extension.dart | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f13e165..4c1dacb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## 2.0.4 +- Fix issue when parsing dates formatted as "Streamed ago" due to a leading whitespace. #265 + ## 2.0.3 - Better performance for iterating through closed captions elements. #251 - Add publishDate and viewCount for playlists. #240 diff --git a/lib/src/extensions/helpers_extension.dart b/lib/src/extensions/helpers_extension.dart index 905f5de..7986f5d 100644 --- a/lib/src/extensions/helpers_extension.dart +++ b/lib/src/extensions/helpers_extension.dart @@ -167,7 +167,7 @@ extension StringUtility2 on String? { return null; } - var parts = this!.split(' '); + var parts = this!.trim().split(' '); if (parts.length == 4) { // Streamed x y ago parts = parts.skip(1).toList(); From 80523b9f22ef01c21b3d616f4423abbc7dc65857 Mon Sep 17 00:00:00 2001 From: Mattia Date: Thu, 21 Dec 2023 14:11:22 +0100 Subject: [PATCH 16/36] New version: v2.0.4 --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 957cf13..f2e5e71 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.0.3 +version: 2.0.4 homepage: https://github.com/Hexer10/youtube_explode_dart topics: From 08bcff488b3bb79cea78a4fd7a1d229ac7ec1d15 Mon Sep 17 00:00:00 2001 From: Igor Date: Wed, 10 Jan 2024 17:02:29 -0300 Subject: [PATCH 17/36] Shorts filter added --- CHANGELOG.md | 5 ++++ lib/src/channels/channel_client.dart | 8 ++++-- lib/src/channels/channels.dart | 1 + lib/src/channels/video_type.dart | 14 ++++++++++ lib/src/extensions/helpers_extension.dart | 5 +++- .../pages/channel_upload_page.dart | 26 ++++++++++++------- pubspec.yaml | 2 +- 7 files changed, 48 insertions(+), 13 deletions(-) create mode 100644 lib/src/channels/video_type.dart diff --git a/CHANGELOG.md b/CHANGELOG.md index 4c1dacb..5e4d07f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## 2.1.0 +- BREAKING CHANGE: + - In `getUploadsFromPage`: the `videoSorting` parameter is now a named parameter +- Shorts filter possibility added in `getUploadsFromPage`. + ## 2.0.4 - Fix issue when parsing dates formatted as "Streamed ago" due to a leading whitespace. #265 diff --git a/lib/src/channels/channel_client.dart b/lib/src/channels/channel_client.dart index fe78374..6737e24 100644 --- a/lib/src/channels/channel_client.dart +++ b/lib/src/channels/channel_client.dart @@ -1,3 +1,5 @@ +import 'video_type.dart'; + import '../common/common.dart'; import '../extensions/helpers_extension.dart'; import '../playlists/playlists.dart'; @@ -137,14 +139,16 @@ class ChannelClient { /// /// Use .nextPage() to fetch the next batch of videos. Future getUploadsFromPage( - dynamic channelId, [ + dynamic channelId, { VideoSorting videoSorting = VideoSorting.newest, - ]) async { + VideoType videoType = VideoType.normal, + }) async { channelId = ChannelId.fromString(channelId); final page = await ChannelUploadPage.get( _httpClient, (channelId as ChannelId).value, videoSorting.code, + videoType, ); final channel = await get(channelId); diff --git a/lib/src/channels/channels.dart b/lib/src/channels/channels.dart index c882cb2..aabeac6 100644 --- a/lib/src/channels/channels.dart +++ b/lib/src/channels/channels.dart @@ -13,3 +13,4 @@ export 'channel_uploads_list.dart'; export 'channel_video.dart'; export 'username.dart'; export 'video_sorting.dart'; +export 'video_type.dart'; diff --git a/lib/src/channels/video_type.dart b/lib/src/channels/video_type.dart new file mode 100644 index 0000000..fad7446 --- /dev/null +++ b/lib/src/channels/video_type.dart @@ -0,0 +1,14 @@ +/// The type of the video you want to get. +/// +/// Will filter only by the type you want. +enum VideoType { + /// Default horizontal video + normal('videos', 'videoRenderer'), + + /// Youtube shorts video + shorts('shorts', 'reelItemRenderer'); + + final String name; + final String youtubeRenderText; + const VideoType(this.name, this.youtubeRenderText); +} diff --git a/lib/src/extensions/helpers_extension.dart b/lib/src/extensions/helpers_extension.dart index 7986f5d..15f0139 100644 --- a/lib/src/extensions/helpers_extension.dart +++ b/lib/src/extensions/helpers_extension.dart @@ -172,7 +172,10 @@ extension StringUtility2 on String? { // Streamed x y ago parts = parts.skip(1).toList(); } - assert(parts.length == 3); + + if (parts.length != 3) { + return null; + } final qty = int.parse(parts.first); diff --git a/lib/src/reverse_engineering/pages/channel_upload_page.dart b/lib/src/reverse_engineering/pages/channel_upload_page.dart index 1963c82..3675eb1 100644 --- a/lib/src/reverse_engineering/pages/channel_upload_page.dart +++ b/lib/src/reverse_engineering/pages/channel_upload_page.dart @@ -1,5 +1,6 @@ import 'package:collection/collection.dart'; import 'package:html/parser.dart' as parser; +import '../../channels/video_type.dart'; import '../../channels/channel_video.dart'; import '../../exceptions/exceptions.dart'; @@ -15,10 +16,12 @@ class ChannelUploadPage extends YoutubePage<_InitialData> { /// final String channelId; + final VideoType type; + late final List uploads = initialData.uploads; /// InitialData - ChannelUploadPage.id(this.channelId, super.initialData) + ChannelUploadPage.id(this.channelId, this.type, super.initialData) : super.fromInitialData(); /// @@ -28,7 +31,7 @@ class ChannelUploadPage extends YoutubePage<_InitialData> { } final data = await httpClient.sendContinuation('browse', initialData.token); - return ChannelUploadPage.id(channelId, _InitialData(data)); + return ChannelUploadPage.id(channelId, type, _InitialData(data, type)); } /// @@ -36,22 +39,25 @@ class ChannelUploadPage extends YoutubePage<_InitialData> { YoutubeHttpClient httpClient, String channelId, String sorting, + VideoType type, ) { final url = - 'https://www.youtube.com/channel/$channelId/videos?view=0&sort=$sorting&flow=grid'; + 'https://www.youtube.com/channel/$channelId/${type.name}?view=0&sort=$sorting&flow=grid'; return retry(httpClient, () async { final raw = await httpClient.getString(url); - return ChannelUploadPage.parse(raw, channelId); + return ChannelUploadPage.parse(raw, channelId, type); }); } /// - ChannelUploadPage.parse(String raw, this.channelId) - : super(parser.parse(raw), (root) => _InitialData(root)); + ChannelUploadPage.parse(String raw, this.channelId, this.type) + : super(parser.parse(raw), (root) => _InitialData(root, type)); } class _InitialData extends InitialData { - _InitialData(super.root); + _InitialData(super.root, this.type); + + final VideoType type; late final JsonMap? continuationContext = getContinuationContext(); @@ -175,8 +181,10 @@ class _InitialData extends InitialData { if (content.containsKey('gridVideoRenderer')) { video = content.get('gridVideoRenderer'); } else if (content.containsKey('richItemRenderer')) { - video = - content.get('richItemRenderer')?.get('content')?.get('videoRenderer'); + video = content + .get('richItemRenderer') + ?.get('content') + ?.get(type.youtubeRenderText); } if (video == null) { diff --git a/pubspec.yaml b/pubspec.yaml index f2e5e71..f4b6881 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.0.4 +version: 2.1.0 homepage: https://github.com/Hexer10/youtube_explode_dart topics: From ec2f72a60cbb06ef87bdbd444987c96f53513b23 Mon Sep 17 00:00:00 2001 From: Matt Date: Mon, 15 Jan 2024 19:35:29 +0100 Subject: [PATCH 18/36] Code cleanup --- lib/src/channels/channel_client.dart | 3 +-- lib/src/channels/video_sorting.dart | 3 +++ lib/src/channels/video_type.dart | 9 ++++++--- pubspec.yaml | 1 - 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/lib/src/channels/channel_client.dart b/lib/src/channels/channel_client.dart index 6737e24..084d380 100644 --- a/lib/src/channels/channel_client.dart +++ b/lib/src/channels/channel_client.dart @@ -1,5 +1,3 @@ -import 'video_type.dart'; - import '../common/common.dart'; import '../extensions/helpers_extension.dart'; import '../playlists/playlists.dart'; @@ -136,6 +134,7 @@ class ChannelClient { /// Enumerates videos uploaded by the specified channel. /// This fetches thru all the uploads pages of the channel. + /// The content by default is sorted by time of upload. /// /// Use .nextPage() to fetch the next batch of videos. Future getUploadsFromPage( diff --git a/lib/src/channels/video_sorting.dart b/lib/src/channels/video_sorting.dart index 898c1f3..3033a27 100644 --- a/lib/src/channels/video_sorting.dart +++ b/lib/src/channels/video_sorting.dart @@ -1,3 +1,5 @@ +import 'package:meta/meta.dart'; + /// Metadata about video are sorted with [ChannelClient.getUploadsFromPage] enum VideoSorting { newest._('dd'), @@ -6,6 +8,7 @@ enum VideoSorting { /// Code used to fetch the video. /// Used internally. + @internal final String code; const VideoSorting._(this.code); diff --git a/lib/src/channels/video_type.dart b/lib/src/channels/video_type.dart index fad7446..0f312da 100644 --- a/lib/src/channels/video_type.dart +++ b/lib/src/channels/video_type.dart @@ -1,6 +1,6 @@ -/// The type of the video you want to get. -/// -/// Will filter only by the type you want. +import 'package:meta/meta.dart'; + +/// Video types provided by Youtube enum VideoType { /// Default horizontal video normal('videos', 'videoRenderer'), @@ -9,6 +9,9 @@ enum VideoType { shorts('shorts', 'reelItemRenderer'); final String name; + + @internal final String youtubeRenderText; + const VideoType(this.name, this.youtubeRenderText); } diff --git a/pubspec.yaml b/pubspec.yaml index f4b6881..01ba109 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -5,7 +5,6 @@ homepage: https://github.com/Hexer10/youtube_explode_dart topics: - youtube - - lints - video - streams From 2d7b19c7897c37f97d61101b937767ff0cbb6939 Mon Sep 17 00:00:00 2001 From: Mattia Date: Tue, 12 Mar 2024 21:17:27 +0100 Subject: [PATCH 19/36] Update generated files --- lib/src/channels/channel.freezed.dart | 37 +++--- lib/src/channels/channel_about.freezed.dart | 38 +++--- lib/src/channels/channel_handle.freezed.dart | 38 +++--- lib/src/channels/channel_id.freezed.dart | 39 +++--- lib/src/channels/channel_link.freezed.dart | 38 +++--- lib/src/channels/channel_video.freezed.dart | 38 +++--- lib/src/channels/username.freezed.dart | 39 +++--- lib/src/common/engagement.freezed.dart | 38 +++--- lib/src/common/thumbnail.freezed.dart | 39 +++--- lib/src/common/thumbnail_set.freezed.dart | 38 +++--- lib/src/playlists/playlist.freezed.dart | 39 +++--- lib/src/playlists/playlist_id.freezed.dart | 38 +++--- lib/src/search/search_result.freezed.dart | 112 +++++++++--------- .../closed_caption_track_info.freezed.dart | 55 +++++---- .../closed_caption_track_info.g.dart | 8 +- .../closed_captions/language.freezed.dart | 49 ++++---- .../videos/closed_captions/language.g.dart | 5 +- lib/src/videos/comments/comment.freezed.dart | 37 +++--- lib/src/videos/streams/bitrate.freezed.dart | 45 +++---- lib/src/videos/streams/bitrate.g.dart | 5 +- lib/src/videos/streams/filesize.freezed.dart | 48 ++++---- lib/src/videos/streams/filesize.g.dart | 5 +- lib/src/videos/streams/framerate.freezed.dart | 47 ++++---- lib/src/videos/streams/framerate.g.dart | 5 +- .../streams/stream_container.freezed.dart | 47 ++++---- .../videos/streams/stream_container.g.dart | 8 +- lib/src/videos/video.freezed.dart | 35 +++--- lib/src/videos/video_id.freezed.dart | 37 +++--- 28 files changed, 518 insertions(+), 489 deletions(-) diff --git a/lib/src/channels/channel.freezed.dart b/lib/src/channels/channel.freezed.dart index 2a9b282..c159904 100644 --- a/lib/src/channels/channel.freezed.dart +++ b/lib/src/channels/channel.freezed.dart @@ -12,7 +12,7 @@ part of 'channel.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); /// @nodoc mixin _$Channel { @@ -103,10 +103,10 @@ class _$ChannelCopyWithImpl<$Res, $Val extends Channel> } /// @nodoc -abstract class _$$_ChannelCopyWith<$Res> implements $ChannelCopyWith<$Res> { - factory _$$_ChannelCopyWith( - _$_Channel value, $Res Function(_$_Channel) then) = - __$$_ChannelCopyWithImpl<$Res>; +abstract class _$$ChannelImplCopyWith<$Res> implements $ChannelCopyWith<$Res> { + factory _$$ChannelImplCopyWith( + _$ChannelImpl value, $Res Function(_$ChannelImpl) then) = + __$$ChannelImplCopyWithImpl<$Res>; @override @useResult $Res call( @@ -121,10 +121,11 @@ abstract class _$$_ChannelCopyWith<$Res> implements $ChannelCopyWith<$Res> { } /// @nodoc -class __$$_ChannelCopyWithImpl<$Res> - extends _$ChannelCopyWithImpl<$Res, _$_Channel> - implements _$$_ChannelCopyWith<$Res> { - __$$_ChannelCopyWithImpl(_$_Channel _value, $Res Function(_$_Channel) _then) +class __$$ChannelImplCopyWithImpl<$Res> + extends _$ChannelCopyWithImpl<$Res, _$ChannelImpl> + implements _$$ChannelImplCopyWith<$Res> { + __$$ChannelImplCopyWithImpl( + _$ChannelImpl _value, $Res Function(_$ChannelImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -136,7 +137,7 @@ class __$$_ChannelCopyWithImpl<$Res> Object? bannerUrl = null, Object? subscribersCount = freezed, }) { - return _then(_$_Channel( + return _then(_$ChannelImpl( null == id ? _value.id : id // ignore: cast_nullable_to_non_nullable @@ -163,8 +164,8 @@ class __$$_ChannelCopyWithImpl<$Res> /// @nodoc -class _$_Channel extends _Channel { - const _$_Channel( +class _$ChannelImpl extends _Channel { + const _$ChannelImpl( this.id, this.title, this.logoUrl, this.bannerUrl, this.subscribersCount) : super._(); @@ -194,10 +195,10 @@ class _$_Channel extends _Channel { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$_Channel && + other is _$ChannelImpl && (identical(other.id, id) || other.id == id) && (identical(other.title, title) || other.title == title) && (identical(other.logoUrl, logoUrl) || other.logoUrl == logoUrl) && @@ -214,8 +215,8 @@ class _$_Channel extends _Channel { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$_ChannelCopyWith<_$_Channel> get copyWith => - __$$_ChannelCopyWithImpl<_$_Channel>(this, _$identity); + _$$ChannelImplCopyWith<_$ChannelImpl> get copyWith => + __$$ChannelImplCopyWithImpl<_$ChannelImpl>(this, _$identity); } abstract class _Channel extends Channel { @@ -224,7 +225,7 @@ abstract class _Channel extends Channel { final String title, final String logoUrl, final String bannerUrl, - final int? subscribersCount) = _$_Channel; + final int? subscribersCount) = _$ChannelImpl; const _Channel._() : super._(); @override @@ -249,6 +250,6 @@ abstract class _Channel extends Channel { int? get subscribersCount; @override @JsonKey(ignore: true) - _$$_ChannelCopyWith<_$_Channel> get copyWith => + _$$ChannelImplCopyWith<_$ChannelImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/src/channels/channel_about.freezed.dart b/lib/src/channels/channel_about.freezed.dart index d83666d..faeb0aa 100644 --- a/lib/src/channels/channel_about.freezed.dart +++ b/lib/src/channels/channel_about.freezed.dart @@ -12,7 +12,7 @@ part of 'channel_about.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); /// @nodoc mixin _$ChannelAbout { @@ -114,11 +114,11 @@ class _$ChannelAboutCopyWithImpl<$Res, $Val extends ChannelAbout> } /// @nodoc -abstract class _$$_ChannelAboutCopyWith<$Res> +abstract class _$$ChannelAboutImplCopyWith<$Res> implements $ChannelAboutCopyWith<$Res> { - factory _$$_ChannelAboutCopyWith( - _$_ChannelAbout value, $Res Function(_$_ChannelAbout) then) = - __$$_ChannelAboutCopyWithImpl<$Res>; + factory _$$ChannelAboutImplCopyWith( + _$ChannelAboutImpl value, $Res Function(_$ChannelAboutImpl) then) = + __$$ChannelAboutImplCopyWithImpl<$Res>; @override @useResult $Res call( @@ -132,11 +132,11 @@ abstract class _$$_ChannelAboutCopyWith<$Res> } /// @nodoc -class __$$_ChannelAboutCopyWithImpl<$Res> - extends _$ChannelAboutCopyWithImpl<$Res, _$_ChannelAbout> - implements _$$_ChannelAboutCopyWith<$Res> { - __$$_ChannelAboutCopyWithImpl( - _$_ChannelAbout _value, $Res Function(_$_ChannelAbout) _then) +class __$$ChannelAboutImplCopyWithImpl<$Res> + extends _$ChannelAboutCopyWithImpl<$Res, _$ChannelAboutImpl> + implements _$$ChannelAboutImplCopyWith<$Res> { + __$$ChannelAboutImplCopyWithImpl( + _$ChannelAboutImpl _value, $Res Function(_$ChannelAboutImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -150,7 +150,7 @@ class __$$_ChannelAboutCopyWithImpl<$Res> Object? country = freezed, Object? channelLinks = null, }) { - return _then(_$_ChannelAbout( + return _then(_$ChannelAboutImpl( freezed == description ? _value.description : description // ignore: cast_nullable_to_non_nullable @@ -185,8 +185,8 @@ class __$$_ChannelAboutCopyWithImpl<$Res> /// @nodoc -class _$_ChannelAbout implements _ChannelAbout { - const _$_ChannelAbout( +class _$ChannelAboutImpl implements _ChannelAbout { + const _$ChannelAboutImpl( this.description, this.viewCount, this.joinDate, @@ -246,10 +246,10 @@ class _$_ChannelAbout implements _ChannelAbout { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$_ChannelAbout && + other is _$ChannelAboutImpl && (identical(other.description, description) || other.description == description) && (identical(other.viewCount, viewCount) || @@ -278,8 +278,8 @@ class _$_ChannelAbout implements _ChannelAbout { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$_ChannelAboutCopyWith<_$_ChannelAbout> get copyWith => - __$$_ChannelAboutCopyWithImpl<_$_ChannelAbout>(this, _$identity); + _$$ChannelAboutImplCopyWith<_$ChannelAboutImpl> get copyWith => + __$$ChannelAboutImplCopyWithImpl<_$ChannelAboutImpl>(this, _$identity); } abstract class _ChannelAbout implements ChannelAbout { @@ -290,7 +290,7 @@ abstract class _ChannelAbout implements ChannelAbout { final String title, final List thumbnails, final String? country, - final List channelLinks) = _$_ChannelAbout; + final List channelLinks) = _$ChannelAboutImpl; @override @@ -323,6 +323,6 @@ abstract class _ChannelAbout implements ChannelAbout { List get channelLinks; @override @JsonKey(ignore: true) - _$$_ChannelAboutCopyWith<_$_ChannelAbout> get copyWith => + _$$ChannelAboutImplCopyWith<_$ChannelAboutImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/src/channels/channel_handle.freezed.dart b/lib/src/channels/channel_handle.freezed.dart index a4501e6..7d2f291 100644 --- a/lib/src/channels/channel_handle.freezed.dart +++ b/lib/src/channels/channel_handle.freezed.dart @@ -12,7 +12,7 @@ part of 'channel_handle.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); /// @nodoc mixin _$ChannelHandle { @@ -58,22 +58,22 @@ class _$ChannelHandleCopyWithImpl<$Res, $Val extends ChannelHandle> } /// @nodoc -abstract class _$$_ChannelHandleCopyWith<$Res> +abstract class _$$ChannelHandleImplCopyWith<$Res> implements $ChannelHandleCopyWith<$Res> { - factory _$$_ChannelHandleCopyWith( - _$_ChannelHandle value, $Res Function(_$_ChannelHandle) then) = - __$$_ChannelHandleCopyWithImpl<$Res>; + factory _$$ChannelHandleImplCopyWith( + _$ChannelHandleImpl value, $Res Function(_$ChannelHandleImpl) then) = + __$$ChannelHandleImplCopyWithImpl<$Res>; @override @useResult $Res call({String value}); } /// @nodoc -class __$$_ChannelHandleCopyWithImpl<$Res> - extends _$ChannelHandleCopyWithImpl<$Res, _$_ChannelHandle> - implements _$$_ChannelHandleCopyWith<$Res> { - __$$_ChannelHandleCopyWithImpl( - _$_ChannelHandle _value, $Res Function(_$_ChannelHandle) _then) +class __$$ChannelHandleImplCopyWithImpl<$Res> + extends _$ChannelHandleCopyWithImpl<$Res, _$ChannelHandleImpl> + implements _$$ChannelHandleImplCopyWith<$Res> { + __$$ChannelHandleImplCopyWithImpl( + _$ChannelHandleImpl _value, $Res Function(_$ChannelHandleImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -81,7 +81,7 @@ class __$$_ChannelHandleCopyWithImpl<$Res> $Res call({ Object? value = null, }) { - return _then(_$_ChannelHandle( + return _then(_$ChannelHandleImpl( null == value ? _value.value : value // ignore: cast_nullable_to_non_nullable @@ -92,8 +92,8 @@ class __$$_ChannelHandleCopyWithImpl<$Res> /// @nodoc -class _$_ChannelHandle implements _ChannelHandle { - const _$_ChannelHandle(this.value); +class _$ChannelHandleImpl implements _ChannelHandle { + const _$ChannelHandleImpl(this.value); /// Handle as string. @override @@ -105,10 +105,10 @@ class _$_ChannelHandle implements _ChannelHandle { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$_ChannelHandle && + other is _$ChannelHandleImpl && (identical(other.value, value) || other.value == value)); } @@ -118,12 +118,12 @@ class _$_ChannelHandle implements _ChannelHandle { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$_ChannelHandleCopyWith<_$_ChannelHandle> get copyWith => - __$$_ChannelHandleCopyWithImpl<_$_ChannelHandle>(this, _$identity); + _$$ChannelHandleImplCopyWith<_$ChannelHandleImpl> get copyWith => + __$$ChannelHandleImplCopyWithImpl<_$ChannelHandleImpl>(this, _$identity); } abstract class _ChannelHandle implements ChannelHandle { - const factory _ChannelHandle(final String value) = _$_ChannelHandle; + const factory _ChannelHandle(final String value) = _$ChannelHandleImpl; @override @@ -131,6 +131,6 @@ abstract class _ChannelHandle implements ChannelHandle { String get value; @override @JsonKey(ignore: true) - _$$_ChannelHandleCopyWith<_$_ChannelHandle> get copyWith => + _$$ChannelHandleImplCopyWith<_$ChannelHandleImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/src/channels/channel_id.freezed.dart b/lib/src/channels/channel_id.freezed.dart index 48bfef3..4aa9b50 100644 --- a/lib/src/channels/channel_id.freezed.dart +++ b/lib/src/channels/channel_id.freezed.dart @@ -12,7 +12,7 @@ part of 'channel_id.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); /// @nodoc mixin _$ChannelId { @@ -57,21 +57,22 @@ class _$ChannelIdCopyWithImpl<$Res, $Val extends ChannelId> } /// @nodoc -abstract class _$$_ChannelIdCopyWith<$Res> implements $ChannelIdCopyWith<$Res> { - factory _$$_ChannelIdCopyWith( - _$_ChannelId value, $Res Function(_$_ChannelId) then) = - __$$_ChannelIdCopyWithImpl<$Res>; +abstract class _$$ChannelIdImplCopyWith<$Res> + implements $ChannelIdCopyWith<$Res> { + factory _$$ChannelIdImplCopyWith( + _$ChannelIdImpl value, $Res Function(_$ChannelIdImpl) then) = + __$$ChannelIdImplCopyWithImpl<$Res>; @override @useResult $Res call({String value}); } /// @nodoc -class __$$_ChannelIdCopyWithImpl<$Res> - extends _$ChannelIdCopyWithImpl<$Res, _$_ChannelId> - implements _$$_ChannelIdCopyWith<$Res> { - __$$_ChannelIdCopyWithImpl( - _$_ChannelId _value, $Res Function(_$_ChannelId) _then) +class __$$ChannelIdImplCopyWithImpl<$Res> + extends _$ChannelIdCopyWithImpl<$Res, _$ChannelIdImpl> + implements _$$ChannelIdImplCopyWith<$Res> { + __$$ChannelIdImplCopyWithImpl( + _$ChannelIdImpl _value, $Res Function(_$ChannelIdImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -79,7 +80,7 @@ class __$$_ChannelIdCopyWithImpl<$Res> $Res call({ Object? value = null, }) { - return _then(_$_ChannelId( + return _then(_$ChannelIdImpl( null == value ? _value.value : value // ignore: cast_nullable_to_non_nullable @@ -90,18 +91,18 @@ class __$$_ChannelIdCopyWithImpl<$Res> /// @nodoc -class _$_ChannelId extends _ChannelId { - const _$_ChannelId(this.value) : super._(); +class _$ChannelIdImpl extends _ChannelId { + const _$ChannelIdImpl(this.value) : super._(); /// ID as a string. @override final String value; @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$_ChannelId && + other is _$ChannelIdImpl && (identical(other.value, value) || other.value == value)); } @@ -111,12 +112,12 @@ class _$_ChannelId extends _ChannelId { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$_ChannelIdCopyWith<_$_ChannelId> get copyWith => - __$$_ChannelIdCopyWithImpl<_$_ChannelId>(this, _$identity); + _$$ChannelIdImplCopyWith<_$ChannelIdImpl> get copyWith => + __$$ChannelIdImplCopyWithImpl<_$ChannelIdImpl>(this, _$identity); } abstract class _ChannelId extends ChannelId { - const factory _ChannelId(final String value) = _$_ChannelId; + const factory _ChannelId(final String value) = _$ChannelIdImpl; const _ChannelId._() : super._(); @override @@ -125,6 +126,6 @@ abstract class _ChannelId extends ChannelId { String get value; @override @JsonKey(ignore: true) - _$$_ChannelIdCopyWith<_$_ChannelId> get copyWith => + _$$ChannelIdImplCopyWith<_$ChannelIdImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/src/channels/channel_link.freezed.dart b/lib/src/channels/channel_link.freezed.dart index 17f4948..5a4835f 100644 --- a/lib/src/channels/channel_link.freezed.dart +++ b/lib/src/channels/channel_link.freezed.dart @@ -12,7 +12,7 @@ part of 'channel_link.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); /// @nodoc mixin _$ChannelLink { @@ -82,11 +82,11 @@ class _$ChannelLinkCopyWithImpl<$Res, $Val extends ChannelLink> } /// @nodoc -abstract class _$$_ChannelLinkCopyWith<$Res> +abstract class _$$ChannelLinkImplCopyWith<$Res> implements $ChannelLinkCopyWith<$Res> { - factory _$$_ChannelLinkCopyWith( - _$_ChannelLink value, $Res Function(_$_ChannelLink) then) = - __$$_ChannelLinkCopyWithImpl<$Res>; + factory _$$ChannelLinkImplCopyWith( + _$ChannelLinkImpl value, $Res Function(_$ChannelLinkImpl) then) = + __$$ChannelLinkImplCopyWithImpl<$Res>; @override @useResult $Res call( @@ -98,11 +98,11 @@ abstract class _$$_ChannelLinkCopyWith<$Res> } /// @nodoc -class __$$_ChannelLinkCopyWithImpl<$Res> - extends _$ChannelLinkCopyWithImpl<$Res, _$_ChannelLink> - implements _$$_ChannelLinkCopyWith<$Res> { - __$$_ChannelLinkCopyWithImpl( - _$_ChannelLink _value, $Res Function(_$_ChannelLink) _then) +class __$$ChannelLinkImplCopyWithImpl<$Res> + extends _$ChannelLinkCopyWithImpl<$Res, _$ChannelLinkImpl> + implements _$$ChannelLinkImplCopyWith<$Res> { + __$$ChannelLinkImplCopyWithImpl( + _$ChannelLinkImpl _value, $Res Function(_$ChannelLinkImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -112,7 +112,7 @@ class __$$_ChannelLinkCopyWithImpl<$Res> Object? url = null, Object? icon = null, }) { - return _then(_$_ChannelLink( + return _then(_$ChannelLinkImpl( null == title ? _value.title : title // ignore: cast_nullable_to_non_nullable @@ -131,8 +131,8 @@ class __$$_ChannelLinkCopyWithImpl<$Res> /// @nodoc -class _$_ChannelLink implements _ChannelLink { - const _$_ChannelLink( +class _$ChannelLinkImpl implements _ChannelLink { + const _$ChannelLinkImpl( this.title, this.url, @Deprecated( @@ -160,10 +160,10 @@ class _$_ChannelLink implements _ChannelLink { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$_ChannelLink && + other is _$ChannelLinkImpl && (identical(other.title, title) || other.title == title) && (identical(other.url, url) || other.url == url) && (identical(other.icon, icon) || other.icon == icon)); @@ -175,8 +175,8 @@ class _$_ChannelLink implements _ChannelLink { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$_ChannelLinkCopyWith<_$_ChannelLink> get copyWith => - __$$_ChannelLinkCopyWithImpl<_$_ChannelLink>(this, _$identity); + _$$ChannelLinkImplCopyWith<_$ChannelLinkImpl> get copyWith => + __$$ChannelLinkImplCopyWithImpl<_$ChannelLinkImpl>(this, _$identity); } abstract class _ChannelLink implements ChannelLink { @@ -185,7 +185,7 @@ abstract class _ChannelLink implements ChannelLink { final Uri url, @Deprecated( 'As of at least 26-08-2023 YT no longer provides icons for links, so this URI is always empty') - final Uri icon) = _$_ChannelLink; + final Uri icon) = _$ChannelLinkImpl; @override @@ -204,6 +204,6 @@ abstract class _ChannelLink implements ChannelLink { Uri get icon; @override @JsonKey(ignore: true) - _$$_ChannelLinkCopyWith<_$_ChannelLink> get copyWith => + _$$ChannelLinkImplCopyWith<_$ChannelLinkImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/src/channels/channel_video.freezed.dart b/lib/src/channels/channel_video.freezed.dart index 78da33f..6788ead 100644 --- a/lib/src/channels/channel_video.freezed.dart +++ b/lib/src/channels/channel_video.freezed.dart @@ -12,7 +12,7 @@ part of 'channel_video.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); /// @nodoc mixin _$ChannelVideo { @@ -115,11 +115,11 @@ class _$ChannelVideoCopyWithImpl<$Res, $Val extends ChannelVideo> } /// @nodoc -abstract class _$$_ChannelVideoCopyWith<$Res> +abstract class _$$ChannelVideoImplCopyWith<$Res> implements $ChannelVideoCopyWith<$Res> { - factory _$$_ChannelVideoCopyWith( - _$_ChannelVideo value, $Res Function(_$_ChannelVideo) then) = - __$$_ChannelVideoCopyWithImpl<$Res>; + factory _$$ChannelVideoImplCopyWith( + _$ChannelVideoImpl value, $Res Function(_$ChannelVideoImpl) then) = + __$$ChannelVideoImplCopyWithImpl<$Res>; @override @useResult $Res call( @@ -135,11 +135,11 @@ abstract class _$$_ChannelVideoCopyWith<$Res> } /// @nodoc -class __$$_ChannelVideoCopyWithImpl<$Res> - extends _$ChannelVideoCopyWithImpl<$Res, _$_ChannelVideo> - implements _$$_ChannelVideoCopyWith<$Res> { - __$$_ChannelVideoCopyWithImpl( - _$_ChannelVideo _value, $Res Function(_$_ChannelVideo) _then) +class __$$ChannelVideoImplCopyWithImpl<$Res> + extends _$ChannelVideoCopyWithImpl<$Res, _$ChannelVideoImpl> + implements _$$ChannelVideoImplCopyWith<$Res> { + __$$ChannelVideoImplCopyWithImpl( + _$ChannelVideoImpl _value, $Res Function(_$ChannelVideoImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -152,7 +152,7 @@ class __$$_ChannelVideoCopyWithImpl<$Res> Object? videoUploadDate = null, Object? videoViews = null, }) { - return _then(_$_ChannelVideo( + return _then(_$ChannelVideoImpl( null == videoId ? _value.videoId : videoId // ignore: cast_nullable_to_non_nullable @@ -183,8 +183,8 @@ class __$$_ChannelVideoCopyWithImpl<$Res> /// @nodoc -class _$_ChannelVideo implements _ChannelVideo { - const _$_ChannelVideo(this.videoId, this.videoTitle, this.videoDuration, +class _$ChannelVideoImpl implements _ChannelVideo { + const _$ChannelVideoImpl(this.videoId, this.videoTitle, this.videoDuration, this.videoThumbnail, this.videoUploadDate, this.videoViews); /// Video ID. @@ -218,10 +218,10 @@ class _$_ChannelVideo implements _ChannelVideo { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$_ChannelVideo && + other is _$ChannelVideoImpl && (identical(other.videoId, videoId) || other.videoId == videoId) && (identical(other.videoTitle, videoTitle) || other.videoTitle == videoTitle) && @@ -242,8 +242,8 @@ class _$_ChannelVideo implements _ChannelVideo { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$_ChannelVideoCopyWith<_$_ChannelVideo> get copyWith => - __$$_ChannelVideoCopyWithImpl<_$_ChannelVideo>(this, _$identity); + _$$ChannelVideoImplCopyWith<_$ChannelVideoImpl> get copyWith => + __$$ChannelVideoImplCopyWithImpl<_$ChannelVideoImpl>(this, _$identity); } abstract class _ChannelVideo implements ChannelVideo { @@ -253,7 +253,7 @@ abstract class _ChannelVideo implements ChannelVideo { final Duration videoDuration, final String videoThumbnail, final String videoUploadDate, - final int videoViews) = _$_ChannelVideo; + final int videoViews) = _$ChannelVideoImpl; @override @@ -282,6 +282,6 @@ abstract class _ChannelVideo implements ChannelVideo { int get videoViews; @override @JsonKey(ignore: true) - _$$_ChannelVideoCopyWith<_$_ChannelVideo> get copyWith => + _$$ChannelVideoImplCopyWith<_$ChannelVideoImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/src/channels/username.freezed.dart b/lib/src/channels/username.freezed.dart index 05afe75..cb040ef 100644 --- a/lib/src/channels/username.freezed.dart +++ b/lib/src/channels/username.freezed.dart @@ -12,7 +12,7 @@ part of 'username.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); /// @nodoc mixin _$Username { @@ -57,21 +57,22 @@ class _$UsernameCopyWithImpl<$Res, $Val extends Username> } /// @nodoc -abstract class _$$_UsernameCopyWith<$Res> implements $UsernameCopyWith<$Res> { - factory _$$_UsernameCopyWith( - _$_Username value, $Res Function(_$_Username) then) = - __$$_UsernameCopyWithImpl<$Res>; +abstract class _$$UsernameImplCopyWith<$Res> + implements $UsernameCopyWith<$Res> { + factory _$$UsernameImplCopyWith( + _$UsernameImpl value, $Res Function(_$UsernameImpl) then) = + __$$UsernameImplCopyWithImpl<$Res>; @override @useResult $Res call({String value}); } /// @nodoc -class __$$_UsernameCopyWithImpl<$Res> - extends _$UsernameCopyWithImpl<$Res, _$_Username> - implements _$$_UsernameCopyWith<$Res> { - __$$_UsernameCopyWithImpl( - _$_Username _value, $Res Function(_$_Username) _then) +class __$$UsernameImplCopyWithImpl<$Res> + extends _$UsernameCopyWithImpl<$Res, _$UsernameImpl> + implements _$$UsernameImplCopyWith<$Res> { + __$$UsernameImplCopyWithImpl( + _$UsernameImpl _value, $Res Function(_$UsernameImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -79,7 +80,7 @@ class __$$_UsernameCopyWithImpl<$Res> $Res call({ Object? value = null, }) { - return _then(_$_Username( + return _then(_$UsernameImpl( null == value ? _value.value : value // ignore: cast_nullable_to_non_nullable @@ -90,8 +91,8 @@ class __$$_UsernameCopyWithImpl<$Res> /// @nodoc -class _$_Username implements _Username { - const _$_Username(this.value); +class _$UsernameImpl implements _Username { + const _$UsernameImpl(this.value); /// User name as string. @override @@ -103,10 +104,10 @@ class _$_Username implements _Username { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$_Username && + other is _$UsernameImpl && (identical(other.value, value) || other.value == value)); } @@ -116,12 +117,12 @@ class _$_Username implements _Username { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$_UsernameCopyWith<_$_Username> get copyWith => - __$$_UsernameCopyWithImpl<_$_Username>(this, _$identity); + _$$UsernameImplCopyWith<_$UsernameImpl> get copyWith => + __$$UsernameImplCopyWithImpl<_$UsernameImpl>(this, _$identity); } abstract class _Username implements Username { - const factory _Username(final String value) = _$_Username; + const factory _Username(final String value) = _$UsernameImpl; @override @@ -129,6 +130,6 @@ abstract class _Username implements Username { String get value; @override @JsonKey(ignore: true) - _$$_UsernameCopyWith<_$_Username> get copyWith => + _$$UsernameImplCopyWith<_$UsernameImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/src/common/engagement.freezed.dart b/lib/src/common/engagement.freezed.dart index 5773540..e2251a0 100644 --- a/lib/src/common/engagement.freezed.dart +++ b/lib/src/common/engagement.freezed.dart @@ -12,7 +12,7 @@ part of 'engagement.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); /// @nodoc mixin _$Engagement { @@ -74,22 +74,22 @@ class _$EngagementCopyWithImpl<$Res, $Val extends Engagement> } /// @nodoc -abstract class _$$_EngagementCopyWith<$Res> +abstract class _$$EngagementImplCopyWith<$Res> implements $EngagementCopyWith<$Res> { - factory _$$_EngagementCopyWith( - _$_Engagement value, $Res Function(_$_Engagement) then) = - __$$_EngagementCopyWithImpl<$Res>; + factory _$$EngagementImplCopyWith( + _$EngagementImpl value, $Res Function(_$EngagementImpl) then) = + __$$EngagementImplCopyWithImpl<$Res>; @override @useResult $Res call({int viewCount, int? likeCount, int? dislikeCount}); } /// @nodoc -class __$$_EngagementCopyWithImpl<$Res> - extends _$EngagementCopyWithImpl<$Res, _$_Engagement> - implements _$$_EngagementCopyWith<$Res> { - __$$_EngagementCopyWithImpl( - _$_Engagement _value, $Res Function(_$_Engagement) _then) +class __$$EngagementImplCopyWithImpl<$Res> + extends _$EngagementCopyWithImpl<$Res, _$EngagementImpl> + implements _$$EngagementImplCopyWith<$Res> { + __$$EngagementImplCopyWithImpl( + _$EngagementImpl _value, $Res Function(_$EngagementImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -99,7 +99,7 @@ class __$$_EngagementCopyWithImpl<$Res> Object? likeCount = freezed, Object? dislikeCount = freezed, }) { - return _then(_$_Engagement( + return _then(_$EngagementImpl( null == viewCount ? _value.viewCount : viewCount // ignore: cast_nullable_to_non_nullable @@ -118,8 +118,8 @@ class __$$_EngagementCopyWithImpl<$Res> /// @nodoc -class _$_Engagement extends _Engagement { - const _$_Engagement(this.viewCount, this.likeCount, this.dislikeCount) +class _$EngagementImpl extends _Engagement { + const _$EngagementImpl(this.viewCount, this.likeCount, this.dislikeCount) : super._(); /// View count. @@ -140,10 +140,10 @@ class _$_Engagement extends _Engagement { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$_Engagement && + other is _$EngagementImpl && (identical(other.viewCount, viewCount) || other.viewCount == viewCount) && (identical(other.likeCount, likeCount) || @@ -159,14 +159,14 @@ class _$_Engagement extends _Engagement { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$_EngagementCopyWith<_$_Engagement> get copyWith => - __$$_EngagementCopyWithImpl<_$_Engagement>(this, _$identity); + _$$EngagementImplCopyWith<_$EngagementImpl> get copyWith => + __$$EngagementImplCopyWithImpl<_$EngagementImpl>(this, _$identity); } abstract class _Engagement extends Engagement { const factory _Engagement( final int viewCount, final int? likeCount, final int? dislikeCount) = - _$_Engagement; + _$EngagementImpl; const _Engagement._() : super._(); @override @@ -183,6 +183,6 @@ abstract class _Engagement extends Engagement { int? get dislikeCount; @override @JsonKey(ignore: true) - _$$_EngagementCopyWith<_$_Engagement> get copyWith => + _$$EngagementImplCopyWith<_$EngagementImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/src/common/thumbnail.freezed.dart b/lib/src/common/thumbnail.freezed.dart index 1ea8f5f..7068493 100644 --- a/lib/src/common/thumbnail.freezed.dart +++ b/lib/src/common/thumbnail.freezed.dart @@ -12,7 +12,7 @@ part of 'thumbnail.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); /// @nodoc mixin _$Thumbnail { @@ -73,21 +73,22 @@ class _$ThumbnailCopyWithImpl<$Res, $Val extends Thumbnail> } /// @nodoc -abstract class _$$_ThumbnailCopyWith<$Res> implements $ThumbnailCopyWith<$Res> { - factory _$$_ThumbnailCopyWith( - _$_Thumbnail value, $Res Function(_$_Thumbnail) then) = - __$$_ThumbnailCopyWithImpl<$Res>; +abstract class _$$ThumbnailImplCopyWith<$Res> + implements $ThumbnailCopyWith<$Res> { + factory _$$ThumbnailImplCopyWith( + _$ThumbnailImpl value, $Res Function(_$ThumbnailImpl) then) = + __$$ThumbnailImplCopyWithImpl<$Res>; @override @useResult $Res call({Uri url, int height, int width}); } /// @nodoc -class __$$_ThumbnailCopyWithImpl<$Res> - extends _$ThumbnailCopyWithImpl<$Res, _$_Thumbnail> - implements _$$_ThumbnailCopyWith<$Res> { - __$$_ThumbnailCopyWithImpl( - _$_Thumbnail _value, $Res Function(_$_Thumbnail) _then) +class __$$ThumbnailImplCopyWithImpl<$Res> + extends _$ThumbnailCopyWithImpl<$Res, _$ThumbnailImpl> + implements _$$ThumbnailImplCopyWith<$Res> { + __$$ThumbnailImplCopyWithImpl( + _$ThumbnailImpl _value, $Res Function(_$ThumbnailImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -97,7 +98,7 @@ class __$$_ThumbnailCopyWithImpl<$Res> Object? height = null, Object? width = null, }) { - return _then(_$_Thumbnail( + return _then(_$ThumbnailImpl( null == url ? _value.url : url // ignore: cast_nullable_to_non_nullable @@ -116,8 +117,8 @@ class __$$_ThumbnailCopyWithImpl<$Res> /// @nodoc -class _$_Thumbnail implements _Thumbnail { - const _$_Thumbnail(this.url, this.height, this.width); +class _$ThumbnailImpl implements _Thumbnail { + const _$ThumbnailImpl(this.url, this.height, this.width); /// Image url. @override @@ -137,10 +138,10 @@ class _$_Thumbnail implements _Thumbnail { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$_Thumbnail && + other is _$ThumbnailImpl && (identical(other.url, url) || other.url == url) && (identical(other.height, height) || other.height == height) && (identical(other.width, width) || other.width == width)); @@ -152,13 +153,13 @@ class _$_Thumbnail implements _Thumbnail { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$_ThumbnailCopyWith<_$_Thumbnail> get copyWith => - __$$_ThumbnailCopyWithImpl<_$_Thumbnail>(this, _$identity); + _$$ThumbnailImplCopyWith<_$ThumbnailImpl> get copyWith => + __$$ThumbnailImplCopyWithImpl<_$ThumbnailImpl>(this, _$identity); } abstract class _Thumbnail implements Thumbnail { const factory _Thumbnail(final Uri url, final int height, final int width) = - _$_Thumbnail; + _$ThumbnailImpl; @override @@ -174,6 +175,6 @@ abstract class _Thumbnail implements Thumbnail { int get width; @override @JsonKey(ignore: true) - _$$_ThumbnailCopyWith<_$_Thumbnail> get copyWith => + _$$ThumbnailImplCopyWith<_$ThumbnailImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/src/common/thumbnail_set.freezed.dart b/lib/src/common/thumbnail_set.freezed.dart index 2dc24e6..1d6eeff 100644 --- a/lib/src/common/thumbnail_set.freezed.dart +++ b/lib/src/common/thumbnail_set.freezed.dart @@ -12,7 +12,7 @@ part of 'thumbnail_set.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); /// @nodoc mixin _$ThumbnailSet { @@ -58,22 +58,22 @@ class _$ThumbnailSetCopyWithImpl<$Res, $Val extends ThumbnailSet> } /// @nodoc -abstract class _$$_ThumbnailSetCopyWith<$Res> +abstract class _$$ThumbnailSetImplCopyWith<$Res> implements $ThumbnailSetCopyWith<$Res> { - factory _$$_ThumbnailSetCopyWith( - _$_ThumbnailSet value, $Res Function(_$_ThumbnailSet) then) = - __$$_ThumbnailSetCopyWithImpl<$Res>; + factory _$$ThumbnailSetImplCopyWith( + _$ThumbnailSetImpl value, $Res Function(_$ThumbnailSetImpl) then) = + __$$ThumbnailSetImplCopyWithImpl<$Res>; @override @useResult $Res call({String videoId}); } /// @nodoc -class __$$_ThumbnailSetCopyWithImpl<$Res> - extends _$ThumbnailSetCopyWithImpl<$Res, _$_ThumbnailSet> - implements _$$_ThumbnailSetCopyWith<$Res> { - __$$_ThumbnailSetCopyWithImpl( - _$_ThumbnailSet _value, $Res Function(_$_ThumbnailSet) _then) +class __$$ThumbnailSetImplCopyWithImpl<$Res> + extends _$ThumbnailSetCopyWithImpl<$Res, _$ThumbnailSetImpl> + implements _$$ThumbnailSetImplCopyWith<$Res> { + __$$ThumbnailSetImplCopyWithImpl( + _$ThumbnailSetImpl _value, $Res Function(_$ThumbnailSetImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -81,7 +81,7 @@ class __$$_ThumbnailSetCopyWithImpl<$Res> $Res call({ Object? videoId = null, }) { - return _then(_$_ThumbnailSet( + return _then(_$ThumbnailSetImpl( null == videoId ? _value.videoId : videoId // ignore: cast_nullable_to_non_nullable @@ -92,8 +92,8 @@ class __$$_ThumbnailSetCopyWithImpl<$Res> /// @nodoc -class _$_ThumbnailSet extends _ThumbnailSet { - const _$_ThumbnailSet(this.videoId) : super._(); +class _$ThumbnailSetImpl extends _ThumbnailSet { + const _$ThumbnailSetImpl(this.videoId) : super._(); /// Video id. @override @@ -105,10 +105,10 @@ class _$_ThumbnailSet extends _ThumbnailSet { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$_ThumbnailSet && + other is _$ThumbnailSetImpl && (identical(other.videoId, videoId) || other.videoId == videoId)); } @@ -118,12 +118,12 @@ class _$_ThumbnailSet extends _ThumbnailSet { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$_ThumbnailSetCopyWith<_$_ThumbnailSet> get copyWith => - __$$_ThumbnailSetCopyWithImpl<_$_ThumbnailSet>(this, _$identity); + _$$ThumbnailSetImplCopyWith<_$ThumbnailSetImpl> get copyWith => + __$$ThumbnailSetImplCopyWithImpl<_$ThumbnailSetImpl>(this, _$identity); } abstract class _ThumbnailSet extends ThumbnailSet { - const factory _ThumbnailSet(final String videoId) = _$_ThumbnailSet; + const factory _ThumbnailSet(final String videoId) = _$ThumbnailSetImpl; const _ThumbnailSet._() : super._(); @override @@ -132,6 +132,6 @@ abstract class _ThumbnailSet extends ThumbnailSet { String get videoId; @override @JsonKey(ignore: true) - _$$_ThumbnailSetCopyWith<_$_ThumbnailSet> get copyWith => + _$$ThumbnailSetImplCopyWith<_$ThumbnailSetImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/src/playlists/playlist.freezed.dart b/lib/src/playlists/playlist.freezed.dart index 51fbc0d..e1105ad 100644 --- a/lib/src/playlists/playlist.freezed.dart +++ b/lib/src/playlists/playlist.freezed.dart @@ -12,7 +12,7 @@ part of 'playlist.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); /// @nodoc mixin _$Playlist { @@ -142,10 +142,11 @@ class _$PlaylistCopyWithImpl<$Res, $Val extends Playlist> } /// @nodoc -abstract class _$$_PlaylistCopyWith<$Res> implements $PlaylistCopyWith<$Res> { - factory _$$_PlaylistCopyWith( - _$_Playlist value, $Res Function(_$_Playlist) then) = - __$$_PlaylistCopyWithImpl<$Res>; +abstract class _$$PlaylistImplCopyWith<$Res> + implements $PlaylistCopyWith<$Res> { + factory _$$PlaylistImplCopyWith( + _$PlaylistImpl value, $Res Function(_$PlaylistImpl) then) = + __$$PlaylistImplCopyWithImpl<$Res>; @override @useResult $Res call( @@ -166,11 +167,11 @@ abstract class _$$_PlaylistCopyWith<$Res> implements $PlaylistCopyWith<$Res> { } /// @nodoc -class __$$_PlaylistCopyWithImpl<$Res> - extends _$PlaylistCopyWithImpl<$Res, _$_Playlist> - implements _$$_PlaylistCopyWith<$Res> { - __$$_PlaylistCopyWithImpl( - _$_Playlist _value, $Res Function(_$_Playlist) _then) +class __$$PlaylistImplCopyWithImpl<$Res> + extends _$PlaylistCopyWithImpl<$Res, _$PlaylistImpl> + implements _$$PlaylistImplCopyWith<$Res> { + __$$PlaylistImplCopyWithImpl( + _$PlaylistImpl _value, $Res Function(_$PlaylistImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -184,7 +185,7 @@ class __$$_PlaylistCopyWithImpl<$Res> Object? engagement = null, Object? videoCount = freezed, }) { - return _then(_$_Playlist( + return _then(_$PlaylistImpl( null == id ? _value.id : id // ignore: cast_nullable_to_non_nullable @@ -219,8 +220,8 @@ class __$$_PlaylistCopyWithImpl<$Res> /// @nodoc -class _$_Playlist extends _Playlist { - const _$_Playlist(this.id, this.title, this.author, this.description, +class _$PlaylistImpl extends _Playlist { + const _$PlaylistImpl(this.id, this.title, this.author, this.description, this.thumbnails, this.engagement, this.videoCount) : super._(); @@ -260,10 +261,10 @@ class _$_Playlist extends _Playlist { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$_Playlist && + other is _$PlaylistImpl && (identical(other.id, id) || other.id == id) && (identical(other.title, title) || other.title == title) && (identical(other.author, author) || other.author == author) && @@ -284,8 +285,8 @@ class _$_Playlist extends _Playlist { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$_PlaylistCopyWith<_$_Playlist> get copyWith => - __$$_PlaylistCopyWithImpl<_$_Playlist>(this, _$identity); + _$$PlaylistImplCopyWith<_$PlaylistImpl> get copyWith => + __$$PlaylistImplCopyWithImpl<_$PlaylistImpl>(this, _$identity); } abstract class _Playlist extends Playlist { @@ -296,7 +297,7 @@ abstract class _Playlist extends Playlist { final String description, final ThumbnailSet thumbnails, final Engagement engagement, - final int? videoCount) = _$_Playlist; + final int? videoCount) = _$PlaylistImpl; const _Playlist._() : super._(); @override @@ -331,6 +332,6 @@ abstract class _Playlist extends Playlist { int? get videoCount; @override @JsonKey(ignore: true) - _$$_PlaylistCopyWith<_$_Playlist> get copyWith => + _$$PlaylistImplCopyWith<_$PlaylistImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/src/playlists/playlist_id.freezed.dart b/lib/src/playlists/playlist_id.freezed.dart index 321e766..dbdc304 100644 --- a/lib/src/playlists/playlist_id.freezed.dart +++ b/lib/src/playlists/playlist_id.freezed.dart @@ -12,7 +12,7 @@ part of 'playlist_id.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); /// @nodoc mixin _$PlaylistId { @@ -58,22 +58,22 @@ class _$PlaylistIdCopyWithImpl<$Res, $Val extends PlaylistId> } /// @nodoc -abstract class _$$_PlaylistIdCopyWith<$Res> +abstract class _$$PlaylistIdImplCopyWith<$Res> implements $PlaylistIdCopyWith<$Res> { - factory _$$_PlaylistIdCopyWith( - _$_PlaylistId value, $Res Function(_$_PlaylistId) then) = - __$$_PlaylistIdCopyWithImpl<$Res>; + factory _$$PlaylistIdImplCopyWith( + _$PlaylistIdImpl value, $Res Function(_$PlaylistIdImpl) then) = + __$$PlaylistIdImplCopyWithImpl<$Res>; @override @useResult $Res call({String value}); } /// @nodoc -class __$$_PlaylistIdCopyWithImpl<$Res> - extends _$PlaylistIdCopyWithImpl<$Res, _$_PlaylistId> - implements _$$_PlaylistIdCopyWith<$Res> { - __$$_PlaylistIdCopyWithImpl( - _$_PlaylistId _value, $Res Function(_$_PlaylistId) _then) +class __$$PlaylistIdImplCopyWithImpl<$Res> + extends _$PlaylistIdCopyWithImpl<$Res, _$PlaylistIdImpl> + implements _$$PlaylistIdImplCopyWith<$Res> { + __$$PlaylistIdImplCopyWithImpl( + _$PlaylistIdImpl _value, $Res Function(_$PlaylistIdImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -81,7 +81,7 @@ class __$$_PlaylistIdCopyWithImpl<$Res> $Res call({ Object? value = null, }) { - return _then(_$_PlaylistId( + return _then(_$PlaylistIdImpl( null == value ? _value.value : value // ignore: cast_nullable_to_non_nullable @@ -92,18 +92,18 @@ class __$$_PlaylistIdCopyWithImpl<$Res> /// @nodoc -class _$_PlaylistId extends _PlaylistId { - const _$_PlaylistId(this.value) : super._(); +class _$PlaylistIdImpl extends _PlaylistId { + const _$PlaylistIdImpl(this.value) : super._(); /// The playlist id as string. @override final String value; @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$_PlaylistId && + other is _$PlaylistIdImpl && (identical(other.value, value) || other.value == value)); } @@ -113,12 +113,12 @@ class _$_PlaylistId extends _PlaylistId { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$_PlaylistIdCopyWith<_$_PlaylistId> get copyWith => - __$$_PlaylistIdCopyWithImpl<_$_PlaylistId>(this, _$identity); + _$$PlaylistIdImplCopyWith<_$PlaylistIdImpl> get copyWith => + __$$PlaylistIdImplCopyWithImpl<_$PlaylistIdImpl>(this, _$identity); } abstract class _PlaylistId extends PlaylistId { - const factory _PlaylistId(final String value) = _$_PlaylistId; + const factory _PlaylistId(final String value) = _$PlaylistIdImpl; const _PlaylistId._() : super._(); @override @@ -127,6 +127,6 @@ abstract class _PlaylistId extends PlaylistId { String get value; @override @JsonKey(ignore: true) - _$$_PlaylistIdCopyWith<_$_PlaylistId> get copyWith => + _$$PlaylistIdImplCopyWith<_$PlaylistIdImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/src/search/search_result.freezed.dart b/lib/src/search/search_result.freezed.dart index 3ad7dae..c982db9 100644 --- a/lib/src/search/search_result.freezed.dart +++ b/lib/src/search/search_result.freezed.dart @@ -12,7 +12,7 @@ part of 'search_result.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); /// @nodoc mixin _$SearchResult { @@ -128,10 +128,10 @@ class _$SearchResultCopyWithImpl<$Res, $Val extends SearchResult> } /// @nodoc -abstract class _$$SearchVideoCopyWith<$Res> { - factory _$$SearchVideoCopyWith( - _$SearchVideo value, $Res Function(_$SearchVideo) then) = - __$$SearchVideoCopyWithImpl<$Res>; +abstract class _$$SearchVideoImplCopyWith<$Res> { + factory _$$SearchVideoImplCopyWith( + _$SearchVideoImpl value, $Res Function(_$SearchVideoImpl) then) = + __$$SearchVideoImplCopyWithImpl<$Res>; @useResult $Res call( {VideoId id, @@ -149,11 +149,11 @@ abstract class _$$SearchVideoCopyWith<$Res> { } /// @nodoc -class __$$SearchVideoCopyWithImpl<$Res> - extends _$SearchResultCopyWithImpl<$Res, _$SearchVideo> - implements _$$SearchVideoCopyWith<$Res> { - __$$SearchVideoCopyWithImpl( - _$SearchVideo _value, $Res Function(_$SearchVideo) _then) +class __$$SearchVideoImplCopyWithImpl<$Res> + extends _$SearchResultCopyWithImpl<$Res, _$SearchVideoImpl> + implements _$$SearchVideoImplCopyWith<$Res> { + __$$SearchVideoImplCopyWithImpl( + _$SearchVideoImpl _value, $Res Function(_$SearchVideoImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -170,7 +170,7 @@ class __$$SearchVideoCopyWithImpl<$Res> Object? isLive = null, Object? channelId = null, }) { - return _then(_$SearchVideo( + return _then(_$SearchVideoImpl( null == id ? _value.id : id // ignore: cast_nullable_to_non_nullable @@ -225,8 +225,8 @@ class __$$SearchVideoCopyWithImpl<$Res> /// @nodoc -class _$SearchVideo extends SearchVideo { - const _$SearchVideo( +class _$SearchVideoImpl extends SearchVideo { + const _$SearchVideoImpl( this.id, this.title, this.author, @@ -293,10 +293,10 @@ class _$SearchVideo extends SearchVideo { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$SearchVideo && + other is _$SearchVideoImpl && (identical(other.id, id) || other.id == id) && (identical(other.title, title) || other.title == title) && (identical(other.author, author) || other.author == author) && @@ -332,8 +332,8 @@ class _$SearchVideo extends SearchVideo { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$SearchVideoCopyWith<_$SearchVideo> get copyWith => - __$$SearchVideoCopyWithImpl<_$SearchVideo>(this, _$identity); + _$$SearchVideoImplCopyWith<_$SearchVideoImpl> get copyWith => + __$$SearchVideoImplCopyWithImpl<_$SearchVideoImpl>(this, _$identity); @override @optionalTypeArgs @@ -463,7 +463,7 @@ abstract class SearchVideo extends SearchResult { final List thumbnails, final String? uploadDate, final bool isLive, - final String channelId) = _$SearchVideo; + final String channelId) = _$SearchVideoImpl; const SearchVideo._() : super._(); @override @@ -498,15 +498,15 @@ abstract class SearchVideo extends SearchResult { /// Channel id String get channelId; @JsonKey(ignore: true) - _$$SearchVideoCopyWith<_$SearchVideo> get copyWith => + _$$SearchVideoImplCopyWith<_$SearchVideoImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$SearchPlaylistCopyWith<$Res> { - factory _$$SearchPlaylistCopyWith( - _$SearchPlaylist value, $Res Function(_$SearchPlaylist) then) = - __$$SearchPlaylistCopyWithImpl<$Res>; +abstract class _$$SearchPlaylistImplCopyWith<$Res> { + factory _$$SearchPlaylistImplCopyWith(_$SearchPlaylistImpl value, + $Res Function(_$SearchPlaylistImpl) then) = + __$$SearchPlaylistImplCopyWithImpl<$Res>; @useResult $Res call( {PlaylistId id, @@ -518,11 +518,11 @@ abstract class _$$SearchPlaylistCopyWith<$Res> { } /// @nodoc -class __$$SearchPlaylistCopyWithImpl<$Res> - extends _$SearchResultCopyWithImpl<$Res, _$SearchPlaylist> - implements _$$SearchPlaylistCopyWith<$Res> { - __$$SearchPlaylistCopyWithImpl( - _$SearchPlaylist _value, $Res Function(_$SearchPlaylist) _then) +class __$$SearchPlaylistImplCopyWithImpl<$Res> + extends _$SearchResultCopyWithImpl<$Res, _$SearchPlaylistImpl> + implements _$$SearchPlaylistImplCopyWith<$Res> { + __$$SearchPlaylistImplCopyWithImpl( + _$SearchPlaylistImpl _value, $Res Function(_$SearchPlaylistImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -533,7 +533,7 @@ class __$$SearchPlaylistCopyWithImpl<$Res> Object? videoCount = null, Object? thumbnails = null, }) { - return _then(_$SearchPlaylist( + return _then(_$SearchPlaylistImpl( null == id ? _value.id : id // ignore: cast_nullable_to_non_nullable @@ -564,8 +564,8 @@ class __$$SearchPlaylistCopyWithImpl<$Res> /// @nodoc -class _$SearchPlaylist extends SearchPlaylist { - const _$SearchPlaylist( +class _$SearchPlaylistImpl extends SearchPlaylist { + const _$SearchPlaylistImpl( this.id, this.title, this.videoCount, final List thumbnails) : _thumbnails = thumbnails, super._(); @@ -599,10 +599,10 @@ class _$SearchPlaylist extends SearchPlaylist { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$SearchPlaylist && + other is _$SearchPlaylistImpl && (identical(other.id, id) || other.id == id) && (identical(other.title, title) || other.title == title) && (identical(other.videoCount, videoCount) || @@ -618,8 +618,9 @@ class _$SearchPlaylist extends SearchPlaylist { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$SearchPlaylistCopyWith<_$SearchPlaylist> get copyWith => - __$$SearchPlaylistCopyWithImpl<_$SearchPlaylist>(this, _$identity); + _$$SearchPlaylistImplCopyWith<_$SearchPlaylistImpl> get copyWith => + __$$SearchPlaylistImplCopyWithImpl<_$SearchPlaylistImpl>( + this, _$identity); @override @optionalTypeArgs @@ -740,7 +741,7 @@ abstract class SearchPlaylist extends SearchResult { final PlaylistId id, final String title, final int videoCount, - final List thumbnails) = _$SearchPlaylist; + final List thumbnails) = _$SearchPlaylistImpl; const SearchPlaylist._() : super._(); @override @@ -757,15 +758,15 @@ abstract class SearchPlaylist extends SearchResult { /// Video thumbnail List get thumbnails; @JsonKey(ignore: true) - _$$SearchPlaylistCopyWith<_$SearchPlaylist> get copyWith => + _$$SearchPlaylistImplCopyWith<_$SearchPlaylistImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$SearchChannelCopyWith<$Res> { - factory _$$SearchChannelCopyWith( - _$SearchChannel value, $Res Function(_$SearchChannel) then) = - __$$SearchChannelCopyWithImpl<$Res>; +abstract class _$$SearchChannelImplCopyWith<$Res> { + factory _$$SearchChannelImplCopyWith( + _$SearchChannelImpl value, $Res Function(_$SearchChannelImpl) then) = + __$$SearchChannelImplCopyWithImpl<$Res>; @useResult $Res call({ChannelId id, String name, String description, int videoCount}); @@ -773,11 +774,11 @@ abstract class _$$SearchChannelCopyWith<$Res> { } /// @nodoc -class __$$SearchChannelCopyWithImpl<$Res> - extends _$SearchResultCopyWithImpl<$Res, _$SearchChannel> - implements _$$SearchChannelCopyWith<$Res> { - __$$SearchChannelCopyWithImpl( - _$SearchChannel _value, $Res Function(_$SearchChannel) _then) +class __$$SearchChannelImplCopyWithImpl<$Res> + extends _$SearchResultCopyWithImpl<$Res, _$SearchChannelImpl> + implements _$$SearchChannelImplCopyWith<$Res> { + __$$SearchChannelImplCopyWithImpl( + _$SearchChannelImpl _value, $Res Function(_$SearchChannelImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -788,7 +789,7 @@ class __$$SearchChannelCopyWithImpl<$Res> Object? description = null, Object? videoCount = null, }) { - return _then(_$SearchChannel( + return _then(_$SearchChannelImpl( null == id ? _value.id : id // ignore: cast_nullable_to_non_nullable @@ -819,8 +820,9 @@ class __$$SearchChannelCopyWithImpl<$Res> /// @nodoc -class _$SearchChannel extends SearchChannel { - const _$SearchChannel(this.id, this.name, this.description, this.videoCount) +class _$SearchChannelImpl extends SearchChannel { + const _$SearchChannelImpl( + this.id, this.name, this.description, this.videoCount) : super._(); /// Channel id. @@ -846,10 +848,10 @@ class _$SearchChannel extends SearchChannel { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$SearchChannel && + other is _$SearchChannelImpl && (identical(other.id, id) || other.id == id) && (identical(other.name, name) || other.name == name) && (identical(other.description, description) || @@ -865,8 +867,8 @@ class _$SearchChannel extends SearchChannel { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$SearchChannelCopyWith<_$SearchChannel> get copyWith => - __$$SearchChannelCopyWithImpl<_$SearchChannel>(this, _$identity); + _$$SearchChannelImplCopyWith<_$SearchChannelImpl> get copyWith => + __$$SearchChannelImplCopyWithImpl<_$SearchChannelImpl>(this, _$identity); @override @optionalTypeArgs @@ -984,7 +986,7 @@ class _$SearchChannel extends SearchChannel { abstract class SearchChannel extends SearchResult { const factory SearchChannel(final ChannelId id, final String name, - final String description, final int videoCount) = _$SearchChannel; + final String description, final int videoCount) = _$SearchChannelImpl; const SearchChannel._() : super._(); @override @@ -1002,6 +1004,6 @@ abstract class SearchChannel extends SearchResult { /// Channel uploaded videos. int get videoCount; @JsonKey(ignore: true) - _$$SearchChannelCopyWith<_$SearchChannel> get copyWith => + _$$SearchChannelImplCopyWith<_$SearchChannelImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/src/videos/closed_captions/closed_caption_track_info.freezed.dart b/lib/src/videos/closed_captions/closed_caption_track_info.freezed.dart index 7f77f52..01e07fa 100644 --- a/lib/src/videos/closed_captions/closed_caption_track_info.freezed.dart +++ b/lib/src/videos/closed_captions/closed_caption_track_info.freezed.dart @@ -12,7 +12,7 @@ part of 'closed_caption_track_info.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); ClosedCaptionTrackInfo _$ClosedCaptionTrackInfoFromJson( Map json) { @@ -103,11 +103,12 @@ class _$ClosedCaptionTrackInfoCopyWithImpl<$Res, } /// @nodoc -abstract class _$$_ClosedCaptionTrackInfoCopyWith<$Res> +abstract class _$$ClosedCaptionTrackInfoImplCopyWith<$Res> implements $ClosedCaptionTrackInfoCopyWith<$Res> { - factory _$$_ClosedCaptionTrackInfoCopyWith(_$_ClosedCaptionTrackInfo value, - $Res Function(_$_ClosedCaptionTrackInfo) then) = - __$$_ClosedCaptionTrackInfoCopyWithImpl<$Res>; + factory _$$ClosedCaptionTrackInfoImplCopyWith( + _$ClosedCaptionTrackInfoImpl value, + $Res Function(_$ClosedCaptionTrackInfoImpl) then) = + __$$ClosedCaptionTrackInfoImplCopyWithImpl<$Res>; @override @useResult $Res call( @@ -121,12 +122,13 @@ abstract class _$$_ClosedCaptionTrackInfoCopyWith<$Res> } /// @nodoc -class __$$_ClosedCaptionTrackInfoCopyWithImpl<$Res> +class __$$ClosedCaptionTrackInfoImplCopyWithImpl<$Res> extends _$ClosedCaptionTrackInfoCopyWithImpl<$Res, - _$_ClosedCaptionTrackInfo> - implements _$$_ClosedCaptionTrackInfoCopyWith<$Res> { - __$$_ClosedCaptionTrackInfoCopyWithImpl(_$_ClosedCaptionTrackInfo _value, - $Res Function(_$_ClosedCaptionTrackInfo) _then) + _$ClosedCaptionTrackInfoImpl> + implements _$$ClosedCaptionTrackInfoImplCopyWith<$Res> { + __$$ClosedCaptionTrackInfoImplCopyWithImpl( + _$ClosedCaptionTrackInfoImpl _value, + $Res Function(_$ClosedCaptionTrackInfoImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -137,7 +139,7 @@ class __$$_ClosedCaptionTrackInfoCopyWithImpl<$Res> Object? isAutoGenerated = null, Object? format = null, }) { - return _then(_$_ClosedCaptionTrackInfo( + return _then(_$ClosedCaptionTrackInfoImpl( null == url ? _value.url : url // ignore: cast_nullable_to_non_nullable @@ -160,13 +162,13 @@ class __$$_ClosedCaptionTrackInfoCopyWithImpl<$Res> /// @nodoc @JsonSerializable() -class _$_ClosedCaptionTrackInfo extends _ClosedCaptionTrackInfo { - const _$_ClosedCaptionTrackInfo(this.url, this.language, +class _$ClosedCaptionTrackInfoImpl extends _ClosedCaptionTrackInfo { + const _$ClosedCaptionTrackInfoImpl(this.url, this.language, {this.isAutoGenerated = false, required this.format}) : super._(); - factory _$_ClosedCaptionTrackInfo.fromJson(Map json) => - _$$_ClosedCaptionTrackInfoFromJson(json); + factory _$ClosedCaptionTrackInfoImpl.fromJson(Map json) => + _$$ClosedCaptionTrackInfoImplFromJson(json); /// Manifest URL of the associated track. @override @@ -186,10 +188,10 @@ class _$_ClosedCaptionTrackInfo extends _ClosedCaptionTrackInfo { final ClosedCaptionFormat format; @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$_ClosedCaptionTrackInfo && + other is _$ClosedCaptionTrackInfoImpl && (identical(other.url, url) || other.url == url) && (identical(other.language, language) || other.language == language) && @@ -206,13 +208,13 @@ class _$_ClosedCaptionTrackInfo extends _ClosedCaptionTrackInfo { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$_ClosedCaptionTrackInfoCopyWith<_$_ClosedCaptionTrackInfo> get copyWith => - __$$_ClosedCaptionTrackInfoCopyWithImpl<_$_ClosedCaptionTrackInfo>( - this, _$identity); + _$$ClosedCaptionTrackInfoImplCopyWith<_$ClosedCaptionTrackInfoImpl> + get copyWith => __$$ClosedCaptionTrackInfoImplCopyWithImpl< + _$ClosedCaptionTrackInfoImpl>(this, _$identity); @override Map toJson() { - return _$$_ClosedCaptionTrackInfoToJson( + return _$$ClosedCaptionTrackInfoImplToJson( this, ); } @@ -220,12 +222,13 @@ class _$_ClosedCaptionTrackInfo extends _ClosedCaptionTrackInfo { abstract class _ClosedCaptionTrackInfo extends ClosedCaptionTrackInfo { const factory _ClosedCaptionTrackInfo(final Uri url, final Language language, - {final bool isAutoGenerated, - required final ClosedCaptionFormat format}) = _$_ClosedCaptionTrackInfo; + {final bool isAutoGenerated, + required final ClosedCaptionFormat format}) = + _$ClosedCaptionTrackInfoImpl; const _ClosedCaptionTrackInfo._() : super._(); factory _ClosedCaptionTrackInfo.fromJson(Map json) = - _$_ClosedCaptionTrackInfo.fromJson; + _$ClosedCaptionTrackInfoImpl.fromJson; @override @@ -245,6 +248,6 @@ abstract class _ClosedCaptionTrackInfo extends ClosedCaptionTrackInfo { ClosedCaptionFormat get format; @override @JsonKey(ignore: true) - _$$_ClosedCaptionTrackInfoCopyWith<_$_ClosedCaptionTrackInfo> get copyWith => - throw _privateConstructorUsedError; + _$$ClosedCaptionTrackInfoImplCopyWith<_$ClosedCaptionTrackInfoImpl> + get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/src/videos/closed_captions/closed_caption_track_info.g.dart b/lib/src/videos/closed_captions/closed_caption_track_info.g.dart index dfec6d1..81a137a 100644 --- a/lib/src/videos/closed_captions/closed_caption_track_info.g.dart +++ b/lib/src/videos/closed_captions/closed_caption_track_info.g.dart @@ -8,9 +8,9 @@ part of 'closed_caption_track_info.dart'; // JsonSerializableGenerator // ************************************************************************** -_$_ClosedCaptionTrackInfo _$$_ClosedCaptionTrackInfoFromJson( +_$ClosedCaptionTrackInfoImpl _$$ClosedCaptionTrackInfoImplFromJson( Map json) => - _$_ClosedCaptionTrackInfo( + _$ClosedCaptionTrackInfoImpl( Uri.parse(json['url'] as String), Language.fromJson(json['language'] as Map), isAutoGenerated: json['isAutoGenerated'] as bool? ?? false, @@ -18,8 +18,8 @@ _$_ClosedCaptionTrackInfo _$$_ClosedCaptionTrackInfoFromJson( ClosedCaptionFormat.fromJson(json['format'] as Map), ); -Map _$$_ClosedCaptionTrackInfoToJson( - _$_ClosedCaptionTrackInfo instance) => +Map _$$ClosedCaptionTrackInfoImplToJson( + _$ClosedCaptionTrackInfoImpl instance) => { 'url': instance.url.toString(), 'language': instance.language, diff --git a/lib/src/videos/closed_captions/language.freezed.dart b/lib/src/videos/closed_captions/language.freezed.dart index 0c8e59e..abe4924 100644 --- a/lib/src/videos/closed_captions/language.freezed.dart +++ b/lib/src/videos/closed_captions/language.freezed.dart @@ -12,7 +12,7 @@ part of 'language.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); Language _$LanguageFromJson(Map json) { return _Language.fromJson(json); @@ -70,21 +70,22 @@ class _$LanguageCopyWithImpl<$Res, $Val extends Language> } /// @nodoc -abstract class _$$_LanguageCopyWith<$Res> implements $LanguageCopyWith<$Res> { - factory _$$_LanguageCopyWith( - _$_Language value, $Res Function(_$_Language) then) = - __$$_LanguageCopyWithImpl<$Res>; +abstract class _$$LanguageImplCopyWith<$Res> + implements $LanguageCopyWith<$Res> { + factory _$$LanguageImplCopyWith( + _$LanguageImpl value, $Res Function(_$LanguageImpl) then) = + __$$LanguageImplCopyWithImpl<$Res>; @override @useResult $Res call({String code, String name}); } /// @nodoc -class __$$_LanguageCopyWithImpl<$Res> - extends _$LanguageCopyWithImpl<$Res, _$_Language> - implements _$$_LanguageCopyWith<$Res> { - __$$_LanguageCopyWithImpl( - _$_Language _value, $Res Function(_$_Language) _then) +class __$$LanguageImplCopyWithImpl<$Res> + extends _$LanguageCopyWithImpl<$Res, _$LanguageImpl> + implements _$$LanguageImplCopyWith<$Res> { + __$$LanguageImplCopyWithImpl( + _$LanguageImpl _value, $Res Function(_$LanguageImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -93,7 +94,7 @@ class __$$_LanguageCopyWithImpl<$Res> Object? code = null, Object? name = null, }) { - return _then(_$_Language( + return _then(_$LanguageImpl( null == code ? _value.code : code // ignore: cast_nullable_to_non_nullable @@ -108,11 +109,11 @@ class __$$_LanguageCopyWithImpl<$Res> /// @nodoc @JsonSerializable() -class _$_Language extends _Language { - const _$_Language(this.code, this.name) : super._(); +class _$LanguageImpl extends _Language { + const _$LanguageImpl(this.code, this.name) : super._(); - factory _$_Language.fromJson(Map json) => - _$$_LanguageFromJson(json); + factory _$LanguageImpl.fromJson(Map json) => + _$$LanguageImplFromJson(json); /// ISO 639-1 code of this language. @override @@ -128,10 +129,10 @@ class _$_Language extends _Language { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$_Language && + other is _$LanguageImpl && (identical(other.code, code) || other.code == code) && (identical(other.name, name) || other.name == name)); } @@ -143,22 +144,24 @@ class _$_Language extends _Language { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$_LanguageCopyWith<_$_Language> get copyWith => - __$$_LanguageCopyWithImpl<_$_Language>(this, _$identity); + _$$LanguageImplCopyWith<_$LanguageImpl> get copyWith => + __$$LanguageImplCopyWithImpl<_$LanguageImpl>(this, _$identity); @override Map toJson() { - return _$$_LanguageToJson( + return _$$LanguageImplToJson( this, ); } } abstract class _Language extends Language { - const factory _Language(final String code, final String name) = _$_Language; + const factory _Language(final String code, final String name) = + _$LanguageImpl; const _Language._() : super._(); - factory _Language.fromJson(Map json) = _$_Language.fromJson; + factory _Language.fromJson(Map json) = + _$LanguageImpl.fromJson; @override @@ -170,6 +173,6 @@ abstract class _Language extends Language { String get name; @override @JsonKey(ignore: true) - _$$_LanguageCopyWith<_$_Language> get copyWith => + _$$LanguageImplCopyWith<_$LanguageImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/src/videos/closed_captions/language.g.dart b/lib/src/videos/closed_captions/language.g.dart index 3f83e87..c2b6374 100644 --- a/lib/src/videos/closed_captions/language.g.dart +++ b/lib/src/videos/closed_captions/language.g.dart @@ -8,12 +8,13 @@ part of 'language.dart'; // JsonSerializableGenerator // ************************************************************************** -_$_Language _$$_LanguageFromJson(Map json) => _$_Language( +_$LanguageImpl _$$LanguageImplFromJson(Map json) => + _$LanguageImpl( json['code'] as String, json['name'] as String, ); -Map _$$_LanguageToJson(_$_Language instance) => +Map _$$LanguageImplToJson(_$LanguageImpl instance) => { 'code': instance.code, 'name': instance.name, diff --git a/lib/src/videos/comments/comment.freezed.dart b/lib/src/videos/comments/comment.freezed.dart index 0deae70..e4f5fe0 100644 --- a/lib/src/videos/comments/comment.freezed.dart +++ b/lib/src/videos/comments/comment.freezed.dart @@ -12,7 +12,7 @@ part of 'comment.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); /// @nodoc mixin _$Comment { @@ -133,10 +133,10 @@ class _$CommentCopyWithImpl<$Res, $Val extends Comment> } /// @nodoc -abstract class _$$_CommentCopyWith<$Res> implements $CommentCopyWith<$Res> { - factory _$$_CommentCopyWith( - _$_Comment value, $Res Function(_$_Comment) then) = - __$$_CommentCopyWithImpl<$Res>; +abstract class _$$CommentImplCopyWith<$Res> implements $CommentCopyWith<$Res> { + factory _$$CommentImplCopyWith( + _$CommentImpl value, $Res Function(_$CommentImpl) then) = + __$$CommentImplCopyWithImpl<$Res>; @override @useResult $Res call( @@ -154,10 +154,11 @@ abstract class _$$_CommentCopyWith<$Res> implements $CommentCopyWith<$Res> { } /// @nodoc -class __$$_CommentCopyWithImpl<$Res> - extends _$CommentCopyWithImpl<$Res, _$_Comment> - implements _$$_CommentCopyWith<$Res> { - __$$_CommentCopyWithImpl(_$_Comment _value, $Res Function(_$_Comment) _then) +class __$$CommentImplCopyWithImpl<$Res> + extends _$CommentCopyWithImpl<$Res, _$CommentImpl> + implements _$$CommentImplCopyWith<$Res> { + __$$CommentImplCopyWithImpl( + _$CommentImpl _value, $Res Function(_$CommentImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -172,7 +173,7 @@ class __$$_CommentCopyWithImpl<$Res> Object? isHearted = null, Object? continuation = freezed, }) { - return _then(_$_Comment( + return _then(_$CommentImpl( null == author ? _value.author : author // ignore: cast_nullable_to_non_nullable @@ -211,8 +212,8 @@ class __$$_CommentCopyWithImpl<$Res> /// @nodoc -class _$_Comment implements _Comment { - const _$_Comment( +class _$CommentImpl implements _Comment { + const _$CommentImpl( this.author, this.channelId, this.text, @@ -263,10 +264,10 @@ class _$_Comment implements _Comment { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$_Comment && + other is _$CommentImpl && (identical(other.author, author) || other.author == author) && (identical(other.channelId, channelId) || other.channelId == channelId) && @@ -290,8 +291,8 @@ class _$_Comment implements _Comment { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$_CommentCopyWith<_$_Comment> get copyWith => - __$$_CommentCopyWithImpl<_$_Comment>(this, _$identity); + _$$CommentImplCopyWith<_$CommentImpl> get copyWith => + __$$CommentImplCopyWithImpl<_$CommentImpl>(this, _$identity); } abstract class _Comment implements Comment { @@ -303,7 +304,7 @@ abstract class _Comment implements Comment { final String publishedTime, final int replyCount, final bool isHearted, - @internal final String? continuation) = _$_Comment; + @internal final String? continuation) = _$CommentImpl; @override @@ -342,6 +343,6 @@ abstract class _Comment implements Comment { String? get continuation; @override @JsonKey(ignore: true) - _$$_CommentCopyWith<_$_Comment> get copyWith => + _$$CommentImplCopyWith<_$CommentImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/src/videos/streams/bitrate.freezed.dart b/lib/src/videos/streams/bitrate.freezed.dart index 0b90948..b1b758d 100644 --- a/lib/src/videos/streams/bitrate.freezed.dart +++ b/lib/src/videos/streams/bitrate.freezed.dart @@ -12,7 +12,7 @@ part of 'bitrate.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); Bitrate _$BitrateFromJson(Map json) { return _Bitrate.fromJson(json); @@ -61,20 +61,21 @@ class _$BitrateCopyWithImpl<$Res, $Val extends Bitrate> } /// @nodoc -abstract class _$$_BitrateCopyWith<$Res> implements $BitrateCopyWith<$Res> { - factory _$$_BitrateCopyWith( - _$_Bitrate value, $Res Function(_$_Bitrate) then) = - __$$_BitrateCopyWithImpl<$Res>; +abstract class _$$BitrateImplCopyWith<$Res> implements $BitrateCopyWith<$Res> { + factory _$$BitrateImplCopyWith( + _$BitrateImpl value, $Res Function(_$BitrateImpl) then) = + __$$BitrateImplCopyWithImpl<$Res>; @override @useResult $Res call({int bitsPerSecond}); } /// @nodoc -class __$$_BitrateCopyWithImpl<$Res> - extends _$BitrateCopyWithImpl<$Res, _$_Bitrate> - implements _$$_BitrateCopyWith<$Res> { - __$$_BitrateCopyWithImpl(_$_Bitrate _value, $Res Function(_$_Bitrate) _then) +class __$$BitrateImplCopyWithImpl<$Res> + extends _$BitrateCopyWithImpl<$Res, _$BitrateImpl> + implements _$$BitrateImplCopyWith<$Res> { + __$$BitrateImplCopyWithImpl( + _$BitrateImpl _value, $Res Function(_$BitrateImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -82,7 +83,7 @@ class __$$_BitrateCopyWithImpl<$Res> $Res call({ Object? bitsPerSecond = null, }) { - return _then(_$_Bitrate( + return _then(_$BitrateImpl( null == bitsPerSecond ? _value.bitsPerSecond : bitsPerSecond // ignore: cast_nullable_to_non_nullable @@ -93,21 +94,21 @@ class __$$_BitrateCopyWithImpl<$Res> /// @nodoc @JsonSerializable() -class _$_Bitrate extends _Bitrate { - const _$_Bitrate(this.bitsPerSecond) : super._(); +class _$BitrateImpl extends _Bitrate { + const _$BitrateImpl(this.bitsPerSecond) : super._(); - factory _$_Bitrate.fromJson(Map json) => - _$$_BitrateFromJson(json); + factory _$BitrateImpl.fromJson(Map json) => + _$$BitrateImplFromJson(json); /// Bits per second. @override final int bitsPerSecond; @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$_Bitrate && + other is _$BitrateImpl && (identical(other.bitsPerSecond, bitsPerSecond) || other.bitsPerSecond == bitsPerSecond)); } @@ -119,22 +120,22 @@ class _$_Bitrate extends _Bitrate { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$_BitrateCopyWith<_$_Bitrate> get copyWith => - __$$_BitrateCopyWithImpl<_$_Bitrate>(this, _$identity); + _$$BitrateImplCopyWith<_$BitrateImpl> get copyWith => + __$$BitrateImplCopyWithImpl<_$BitrateImpl>(this, _$identity); @override Map toJson() { - return _$$_BitrateToJson( + return _$$BitrateImplToJson( this, ); } } abstract class _Bitrate extends Bitrate { - const factory _Bitrate(final int bitsPerSecond) = _$_Bitrate; + const factory _Bitrate(final int bitsPerSecond) = _$BitrateImpl; const _Bitrate._() : super._(); - factory _Bitrate.fromJson(Map json) = _$_Bitrate.fromJson; + factory _Bitrate.fromJson(Map json) = _$BitrateImpl.fromJson; @override @@ -142,6 +143,6 @@ abstract class _Bitrate extends Bitrate { int get bitsPerSecond; @override @JsonKey(ignore: true) - _$$_BitrateCopyWith<_$_Bitrate> get copyWith => + _$$BitrateImplCopyWith<_$BitrateImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/src/videos/streams/bitrate.g.dart b/lib/src/videos/streams/bitrate.g.dart index 66aeb1e..cbcb520 100644 --- a/lib/src/videos/streams/bitrate.g.dart +++ b/lib/src/videos/streams/bitrate.g.dart @@ -8,11 +8,12 @@ part of 'bitrate.dart'; // JsonSerializableGenerator // ************************************************************************** -_$_Bitrate _$$_BitrateFromJson(Map json) => _$_Bitrate( +_$BitrateImpl _$$BitrateImplFromJson(Map json) => + _$BitrateImpl( json['bitsPerSecond'] as int, ); -Map _$$_BitrateToJson(_$_Bitrate instance) => +Map _$$BitrateImplToJson(_$BitrateImpl instance) => { 'bitsPerSecond': instance.bitsPerSecond, }; diff --git a/lib/src/videos/streams/filesize.freezed.dart b/lib/src/videos/streams/filesize.freezed.dart index 967a3c1..fb96665 100644 --- a/lib/src/videos/streams/filesize.freezed.dart +++ b/lib/src/videos/streams/filesize.freezed.dart @@ -12,7 +12,7 @@ part of 'filesize.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); FileSize _$FileSizeFromJson(Map json) { return _FileSize.fromJson(json); @@ -62,21 +62,22 @@ class _$FileSizeCopyWithImpl<$Res, $Val extends FileSize> } /// @nodoc -abstract class _$$_FileSizeCopyWith<$Res> implements $FileSizeCopyWith<$Res> { - factory _$$_FileSizeCopyWith( - _$_FileSize value, $Res Function(_$_FileSize) then) = - __$$_FileSizeCopyWithImpl<$Res>; +abstract class _$$FileSizeImplCopyWith<$Res> + implements $FileSizeCopyWith<$Res> { + factory _$$FileSizeImplCopyWith( + _$FileSizeImpl value, $Res Function(_$FileSizeImpl) then) = + __$$FileSizeImplCopyWithImpl<$Res>; @override @useResult $Res call({int totalBytes}); } /// @nodoc -class __$$_FileSizeCopyWithImpl<$Res> - extends _$FileSizeCopyWithImpl<$Res, _$_FileSize> - implements _$$_FileSizeCopyWith<$Res> { - __$$_FileSizeCopyWithImpl( - _$_FileSize _value, $Res Function(_$_FileSize) _then) +class __$$FileSizeImplCopyWithImpl<$Res> + extends _$FileSizeCopyWithImpl<$Res, _$FileSizeImpl> + implements _$$FileSizeImplCopyWith<$Res> { + __$$FileSizeImplCopyWithImpl( + _$FileSizeImpl _value, $Res Function(_$FileSizeImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -84,7 +85,7 @@ class __$$_FileSizeCopyWithImpl<$Res> $Res call({ Object? totalBytes = null, }) { - return _then(_$_FileSize( + return _then(_$FileSizeImpl( null == totalBytes ? _value.totalBytes : totalBytes // ignore: cast_nullable_to_non_nullable @@ -95,21 +96,21 @@ class __$$_FileSizeCopyWithImpl<$Res> /// @nodoc @JsonSerializable() -class _$_FileSize extends _FileSize { - const _$_FileSize(this.totalBytes) : super._(); +class _$FileSizeImpl extends _FileSize { + const _$FileSizeImpl(this.totalBytes) : super._(); - factory _$_FileSize.fromJson(Map json) => - _$$_FileSizeFromJson(json); + factory _$FileSizeImpl.fromJson(Map json) => + _$$FileSizeImplFromJson(json); /// Total bytes. @override final int totalBytes; @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$_FileSize && + other is _$FileSizeImpl && (identical(other.totalBytes, totalBytes) || other.totalBytes == totalBytes)); } @@ -121,22 +122,23 @@ class _$_FileSize extends _FileSize { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$_FileSizeCopyWith<_$_FileSize> get copyWith => - __$$_FileSizeCopyWithImpl<_$_FileSize>(this, _$identity); + _$$FileSizeImplCopyWith<_$FileSizeImpl> get copyWith => + __$$FileSizeImplCopyWithImpl<_$FileSizeImpl>(this, _$identity); @override Map toJson() { - return _$$_FileSizeToJson( + return _$$FileSizeImplToJson( this, ); } } abstract class _FileSize extends FileSize { - const factory _FileSize(final int totalBytes) = _$_FileSize; + const factory _FileSize(final int totalBytes) = _$FileSizeImpl; const _FileSize._() : super._(); - factory _FileSize.fromJson(Map json) = _$_FileSize.fromJson; + factory _FileSize.fromJson(Map json) = + _$FileSizeImpl.fromJson; @override @@ -144,6 +146,6 @@ abstract class _FileSize extends FileSize { int get totalBytes; @override @JsonKey(ignore: true) - _$$_FileSizeCopyWith<_$_FileSize> get copyWith => + _$$FileSizeImplCopyWith<_$FileSizeImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/src/videos/streams/filesize.g.dart b/lib/src/videos/streams/filesize.g.dart index 51e57ba..ab10ec0 100644 --- a/lib/src/videos/streams/filesize.g.dart +++ b/lib/src/videos/streams/filesize.g.dart @@ -8,11 +8,12 @@ part of 'filesize.dart'; // JsonSerializableGenerator // ************************************************************************** -_$_FileSize _$$_FileSizeFromJson(Map json) => _$_FileSize( +_$FileSizeImpl _$$FileSizeImplFromJson(Map json) => + _$FileSizeImpl( json['totalBytes'] as int, ); -Map _$$_FileSizeToJson(_$_FileSize instance) => +Map _$$FileSizeImplToJson(_$FileSizeImpl instance) => { 'totalBytes': instance.totalBytes, }; diff --git a/lib/src/videos/streams/framerate.freezed.dart b/lib/src/videos/streams/framerate.freezed.dart index 5f09da9..b89d596 100644 --- a/lib/src/videos/streams/framerate.freezed.dart +++ b/lib/src/videos/streams/framerate.freezed.dart @@ -12,7 +12,7 @@ part of 'framerate.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); Framerate _$FramerateFromJson(Map json) { return _Framerate.fromJson(json); @@ -62,21 +62,22 @@ class _$FramerateCopyWithImpl<$Res, $Val extends Framerate> } /// @nodoc -abstract class _$$_FramerateCopyWith<$Res> implements $FramerateCopyWith<$Res> { - factory _$$_FramerateCopyWith( - _$_Framerate value, $Res Function(_$_Framerate) then) = - __$$_FramerateCopyWithImpl<$Res>; +abstract class _$$FramerateImplCopyWith<$Res> + implements $FramerateCopyWith<$Res> { + factory _$$FramerateImplCopyWith( + _$FramerateImpl value, $Res Function(_$FramerateImpl) then) = + __$$FramerateImplCopyWithImpl<$Res>; @override @useResult $Res call({num framesPerSecond}); } /// @nodoc -class __$$_FramerateCopyWithImpl<$Res> - extends _$FramerateCopyWithImpl<$Res, _$_Framerate> - implements _$$_FramerateCopyWith<$Res> { - __$$_FramerateCopyWithImpl( - _$_Framerate _value, $Res Function(_$_Framerate) _then) +class __$$FramerateImplCopyWithImpl<$Res> + extends _$FramerateCopyWithImpl<$Res, _$FramerateImpl> + implements _$$FramerateImplCopyWith<$Res> { + __$$FramerateImplCopyWithImpl( + _$FramerateImpl _value, $Res Function(_$FramerateImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -84,7 +85,7 @@ class __$$_FramerateCopyWithImpl<$Res> $Res call({ Object? framesPerSecond = null, }) { - return _then(_$_Framerate( + return _then(_$FramerateImpl( null == framesPerSecond ? _value.framesPerSecond : framesPerSecond // ignore: cast_nullable_to_non_nullable @@ -95,21 +96,21 @@ class __$$_FramerateCopyWithImpl<$Res> /// @nodoc @JsonSerializable() -class _$_Framerate extends _Framerate { - const _$_Framerate(this.framesPerSecond) : super._(); +class _$FramerateImpl extends _Framerate { + const _$FramerateImpl(this.framesPerSecond) : super._(); - factory _$_Framerate.fromJson(Map json) => - _$$_FramerateFromJson(json); + factory _$FramerateImpl.fromJson(Map json) => + _$$FramerateImplFromJson(json); /// Framerate as frames per second @override final num framesPerSecond; @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$_Framerate && + other is _$FramerateImpl && (identical(other.framesPerSecond, framesPerSecond) || other.framesPerSecond == framesPerSecond)); } @@ -121,23 +122,23 @@ class _$_Framerate extends _Framerate { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$_FramerateCopyWith<_$_Framerate> get copyWith => - __$$_FramerateCopyWithImpl<_$_Framerate>(this, _$identity); + _$$FramerateImplCopyWith<_$FramerateImpl> get copyWith => + __$$FramerateImplCopyWithImpl<_$FramerateImpl>(this, _$identity); @override Map toJson() { - return _$$_FramerateToJson( + return _$$FramerateImplToJson( this, ); } } abstract class _Framerate extends Framerate { - const factory _Framerate(final num framesPerSecond) = _$_Framerate; + const factory _Framerate(final num framesPerSecond) = _$FramerateImpl; const _Framerate._() : super._(); factory _Framerate.fromJson(Map json) = - _$_Framerate.fromJson; + _$FramerateImpl.fromJson; @override @@ -145,6 +146,6 @@ abstract class _Framerate extends Framerate { num get framesPerSecond; @override @JsonKey(ignore: true) - _$$_FramerateCopyWith<_$_Framerate> get copyWith => + _$$FramerateImplCopyWith<_$FramerateImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/src/videos/streams/framerate.g.dart b/lib/src/videos/streams/framerate.g.dart index b504a87..c9b4fdf 100644 --- a/lib/src/videos/streams/framerate.g.dart +++ b/lib/src/videos/streams/framerate.g.dart @@ -8,11 +8,12 @@ part of 'framerate.dart'; // JsonSerializableGenerator // ************************************************************************** -_$_Framerate _$$_FramerateFromJson(Map json) => _$_Framerate( +_$FramerateImpl _$$FramerateImplFromJson(Map json) => + _$FramerateImpl( json['framesPerSecond'] as num, ); -Map _$$_FramerateToJson(_$_Framerate instance) => +Map _$$FramerateImplToJson(_$FramerateImpl instance) => { 'framesPerSecond': instance.framesPerSecond, }; diff --git a/lib/src/videos/streams/stream_container.freezed.dart b/lib/src/videos/streams/stream_container.freezed.dart index d957552..f9a59b4 100644 --- a/lib/src/videos/streams/stream_container.freezed.dart +++ b/lib/src/videos/streams/stream_container.freezed.dart @@ -12,7 +12,7 @@ part of 'stream_container.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); StreamContainer _$StreamContainerFromJson(Map json) { return _StreamContainer.fromJson(json); @@ -64,22 +64,22 @@ class _$StreamContainerCopyWithImpl<$Res, $Val extends StreamContainer> } /// @nodoc -abstract class _$$_StreamContainerCopyWith<$Res> +abstract class _$$StreamContainerImplCopyWith<$Res> implements $StreamContainerCopyWith<$Res> { - factory _$$_StreamContainerCopyWith( - _$_StreamContainer value, $Res Function(_$_StreamContainer) then) = - __$$_StreamContainerCopyWithImpl<$Res>; + factory _$$StreamContainerImplCopyWith(_$StreamContainerImpl value, + $Res Function(_$StreamContainerImpl) then) = + __$$StreamContainerImplCopyWithImpl<$Res>; @override @useResult $Res call({String name}); } /// @nodoc -class __$$_StreamContainerCopyWithImpl<$Res> - extends _$StreamContainerCopyWithImpl<$Res, _$_StreamContainer> - implements _$$_StreamContainerCopyWith<$Res> { - __$$_StreamContainerCopyWithImpl( - _$_StreamContainer _value, $Res Function(_$_StreamContainer) _then) +class __$$StreamContainerImplCopyWithImpl<$Res> + extends _$StreamContainerCopyWithImpl<$Res, _$StreamContainerImpl> + implements _$$StreamContainerImplCopyWith<$Res> { + __$$StreamContainerImplCopyWithImpl( + _$StreamContainerImpl _value, $Res Function(_$StreamContainerImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -87,7 +87,7 @@ class __$$_StreamContainerCopyWithImpl<$Res> $Res call({ Object? name = null, }) { - return _then(_$_StreamContainer( + return _then(_$StreamContainerImpl( null == name ? _value.name : name // ignore: cast_nullable_to_non_nullable @@ -98,11 +98,11 @@ class __$$_StreamContainerCopyWithImpl<$Res> /// @nodoc @JsonSerializable() -class _$_StreamContainer extends _StreamContainer { - const _$_StreamContainer(this.name) : super._(); +class _$StreamContainerImpl extends _StreamContainer { + const _$StreamContainerImpl(this.name) : super._(); - factory _$_StreamContainer.fromJson(Map json) => - _$$_StreamContainerFromJson(json); + factory _$StreamContainerImpl.fromJson(Map json) => + _$$StreamContainerImplFromJson(json); /// Container name. /// Can be used as file extension @@ -110,10 +110,10 @@ class _$_StreamContainer extends _StreamContainer { final String name; @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$_StreamContainer && + other is _$StreamContainerImpl && (identical(other.name, name) || other.name == name)); } @@ -124,23 +124,24 @@ class _$_StreamContainer extends _StreamContainer { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$_StreamContainerCopyWith<_$_StreamContainer> get copyWith => - __$$_StreamContainerCopyWithImpl<_$_StreamContainer>(this, _$identity); + _$$StreamContainerImplCopyWith<_$StreamContainerImpl> get copyWith => + __$$StreamContainerImplCopyWithImpl<_$StreamContainerImpl>( + this, _$identity); @override Map toJson() { - return _$$_StreamContainerToJson( + return _$$StreamContainerImplToJson( this, ); } } abstract class _StreamContainer extends StreamContainer { - const factory _StreamContainer(final String name) = _$_StreamContainer; + const factory _StreamContainer(final String name) = _$StreamContainerImpl; const _StreamContainer._() : super._(); factory _StreamContainer.fromJson(Map json) = - _$_StreamContainer.fromJson; + _$StreamContainerImpl.fromJson; @override @@ -149,6 +150,6 @@ abstract class _StreamContainer extends StreamContainer { String get name; @override @JsonKey(ignore: true) - _$$_StreamContainerCopyWith<_$_StreamContainer> get copyWith => + _$$StreamContainerImplCopyWith<_$StreamContainerImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/src/videos/streams/stream_container.g.dart b/lib/src/videos/streams/stream_container.g.dart index 2963f72..525efd3 100644 --- a/lib/src/videos/streams/stream_container.g.dart +++ b/lib/src/videos/streams/stream_container.g.dart @@ -8,12 +8,14 @@ part of 'stream_container.dart'; // JsonSerializableGenerator // ************************************************************************** -_$_StreamContainer _$$_StreamContainerFromJson(Map json) => - _$_StreamContainer( +_$StreamContainerImpl _$$StreamContainerImplFromJson( + Map json) => + _$StreamContainerImpl( json['name'] as String, ); -Map _$$_StreamContainerToJson(_$_StreamContainer instance) => +Map _$$StreamContainerImplToJson( + _$StreamContainerImpl instance) => { 'name': instance.name, }; diff --git a/lib/src/videos/video.freezed.dart b/lib/src/videos/video.freezed.dart index c3a3e67..5579f0c 100644 --- a/lib/src/videos/video.freezed.dart +++ b/lib/src/videos/video.freezed.dart @@ -12,7 +12,7 @@ part of 'video.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); /// @nodoc mixin _$Video { @@ -215,9 +215,10 @@ class _$VideoCopyWithImpl<$Res, $Val extends Video> } /// @nodoc -abstract class _$$_VideoCopyWith<$Res> implements $VideoCopyWith<$Res> { - factory _$$_VideoCopyWith(_$_Video value, $Res Function(_$_Video) then) = - __$$_VideoCopyWithImpl<$Res>; +abstract class _$$VideoImplCopyWith<$Res> implements $VideoCopyWith<$Res> { + factory _$$VideoImplCopyWith( + _$VideoImpl value, $Res Function(_$VideoImpl) then) = + __$$VideoImplCopyWithImpl<$Res>; @override @useResult $Res call( @@ -247,9 +248,11 @@ abstract class _$$_VideoCopyWith<$Res> implements $VideoCopyWith<$Res> { } /// @nodoc -class __$$_VideoCopyWithImpl<$Res> extends _$VideoCopyWithImpl<$Res, _$_Video> - implements _$$_VideoCopyWith<$Res> { - __$$_VideoCopyWithImpl(_$_Video _value, $Res Function(_$_Video) _then) +class __$$VideoImplCopyWithImpl<$Res> + extends _$VideoCopyWithImpl<$Res, _$VideoImpl> + implements _$$VideoImplCopyWith<$Res> { + __$$VideoImplCopyWithImpl( + _$VideoImpl _value, $Res Function(_$VideoImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -270,7 +273,7 @@ class __$$_VideoCopyWithImpl<$Res> extends _$VideoCopyWithImpl<$Res, _$_Video> Object? isLive = null, Object? watchPage = freezed, }) { - return _then(_$_Video( + return _then(_$VideoImpl( null == id ? _value.id : id // ignore: cast_nullable_to_non_nullable @@ -333,8 +336,8 @@ class __$$_VideoCopyWithImpl<$Res> extends _$VideoCopyWithImpl<$Res, _$_Video> /// @nodoc -class _$_Video extends _Video { - const _$_Video( +class _$VideoImpl extends _Video { + const _$VideoImpl( this.id, this.title, this.author, @@ -416,10 +419,10 @@ class _$_Video extends _Video { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$_Video && + other is _$VideoImpl && (identical(other.id, id) || other.id == id) && (identical(other.title, title) || other.title == title) && (identical(other.author, author) || other.author == author) && @@ -466,8 +469,8 @@ class _$_Video extends _Video { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$_VideoCopyWith<_$_Video> get copyWith => - __$$_VideoCopyWithImpl<_$_Video>(this, _$identity); + _$$VideoImplCopyWith<_$VideoImpl> get copyWith => + __$$VideoImplCopyWithImpl<_$VideoImpl>(this, _$identity); } abstract class _Video extends Video { @@ -485,7 +488,7 @@ abstract class _Video extends Video { final UnmodifiableListView keywords, final Engagement engagement, final bool isLive, - [@internal final WatchPage? watchPage]) = _$_Video; + [@internal final WatchPage? watchPage]) = _$VideoImpl; const _Video._() : super._(); @override @@ -549,6 +552,6 @@ abstract class _Video extends Video { WatchPage? get watchPage; @override @JsonKey(ignore: true) - _$$_VideoCopyWith<_$_Video> get copyWith => + _$$VideoImplCopyWith<_$VideoImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/src/videos/video_id.freezed.dart b/lib/src/videos/video_id.freezed.dart index ff83c7f..7f13ced 100644 --- a/lib/src/videos/video_id.freezed.dart +++ b/lib/src/videos/video_id.freezed.dart @@ -12,7 +12,7 @@ part of 'video_id.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); /// @nodoc mixin _$VideoId { @@ -56,20 +56,21 @@ class _$VideoIdCopyWithImpl<$Res, $Val extends VideoId> } /// @nodoc -abstract class _$$_VideoIdCopyWith<$Res> implements $VideoIdCopyWith<$Res> { - factory _$$_VideoIdCopyWith( - _$_VideoId value, $Res Function(_$_VideoId) then) = - __$$_VideoIdCopyWithImpl<$Res>; +abstract class _$$VideoIdImplCopyWith<$Res> implements $VideoIdCopyWith<$Res> { + factory _$$VideoIdImplCopyWith( + _$VideoIdImpl value, $Res Function(_$VideoIdImpl) then) = + __$$VideoIdImplCopyWithImpl<$Res>; @override @useResult $Res call({String value}); } /// @nodoc -class __$$_VideoIdCopyWithImpl<$Res> - extends _$VideoIdCopyWithImpl<$Res, _$_VideoId> - implements _$$_VideoIdCopyWith<$Res> { - __$$_VideoIdCopyWithImpl(_$_VideoId _value, $Res Function(_$_VideoId) _then) +class __$$VideoIdImplCopyWithImpl<$Res> + extends _$VideoIdCopyWithImpl<$Res, _$VideoIdImpl> + implements _$$VideoIdImplCopyWith<$Res> { + __$$VideoIdImplCopyWithImpl( + _$VideoIdImpl _value, $Res Function(_$VideoIdImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -77,7 +78,7 @@ class __$$_VideoIdCopyWithImpl<$Res> $Res call({ Object? value = null, }) { - return _then(_$_VideoId( + return _then(_$VideoIdImpl( null == value ? _value.value : value // ignore: cast_nullable_to_non_nullable @@ -88,18 +89,18 @@ class __$$_VideoIdCopyWithImpl<$Res> /// @nodoc -class _$_VideoId extends _VideoId { - const _$_VideoId(this.value) : super._(); +class _$VideoIdImpl extends _VideoId { + const _$VideoIdImpl(this.value) : super._(); /// ID as string. @override final String value; @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$_VideoId && + other is _$VideoIdImpl && (identical(other.value, value) || other.value == value)); } @@ -109,12 +110,12 @@ class _$_VideoId extends _VideoId { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$_VideoIdCopyWith<_$_VideoId> get copyWith => - __$$_VideoIdCopyWithImpl<_$_VideoId>(this, _$identity); + _$$VideoIdImplCopyWith<_$VideoIdImpl> get copyWith => + __$$VideoIdImplCopyWithImpl<_$VideoIdImpl>(this, _$identity); } abstract class _VideoId extends VideoId { - const factory _VideoId(final String value) = _$_VideoId; + const factory _VideoId(final String value) = _$VideoIdImpl; const _VideoId._() : super._(); @override @@ -123,6 +124,6 @@ abstract class _VideoId extends VideoId { String get value; @override @JsonKey(ignore: true) - _$$_VideoIdCopyWith<_$_VideoId> get copyWith => + _$$VideoIdImplCopyWith<_$VideoIdImpl> get copyWith => throw _privateConstructorUsedError; } From f0f00a0665382324fcdb3c81f6333d3a6610b016 Mon Sep 17 00:00:00 2001 From: Mattia Date: Tue, 12 Mar 2024 21:24:02 +0100 Subject: [PATCH 20/36] Add pub.dev publishing workflow --- .github/workflows/publish.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..b252626 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,13 @@ +name: Publish to pub.dev + +on: + push: + tags: + - 'v[0-9]+.[0-9]+.[0-9]+*' # tag-pattern on pub.dev: 'v{{version}}' + +# Publish using the reusable workflow from dart-lang. +jobs: + publish: + permissions: + id-token: write # Required for authentication using OIDC + uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1 From 2278d7ed3ba9733e5ac69f01854e5e8dcb294326 Mon Sep 17 00:00:00 2001 From: Mattia Date: Mon, 1 Apr 2024 00:57:57 +0200 Subject: [PATCH 21/36] Implement AudioTracks(video languages) + streams directory restructure --- lib/src/reverse_engineering/heuristics.dart | 4 +- .../models/stream_info_provider.dart | 6 +- .../player/player_response.dart | 13 ++ lib/src/videos/streams/audio_stream_info.dart | 6 - .../streams/mixins/audio_stream_info.dart | 12 ++ .../streams/{ => mixins}/stream_info.dart | 6 +- .../{ => mixins}/video_stream_info.dart | 2 +- .../videos/streams/models/audio_track.dart | 16 ++ .../streams/models/audio_track.freezed.dart | 191 ++++++++++++++++++ .../videos/streams/models/audio_track.g.dart | 23 +++ .../videos/streams/{ => models}/bitrate.dart | 0 .../streams/{ => models}/bitrate.freezed.dart | 0 .../streams/{ => models}/bitrate.g.dart | 0 .../videos/streams/{ => models}/filesize.dart | 0 .../{ => models}/filesize.freezed.dart | 0 .../streams/{ => models}/filesize.g.dart | 0 .../streams/{ => models}/framerate.dart | 0 .../{ => models}/framerate.freezed.dart | 0 .../streams/{ => models}/framerate.g.dart | 0 .../{ => models}/stream_container.dart | 0 .../stream_container.freezed.dart | 0 .../{ => models}/stream_container.g.dart | 0 .../streams/{ => models}/video_quality.dart | 0 .../{ => models}/video_resolution.dart | 0 .../{ => models}/video_resolution.g.dart | 0 lib/src/videos/streams/stream_client.dart | 2 + lib/src/videos/streams/streams.dart | 24 +-- .../{ => types}/audio_only_stream_info.dart | 31 +-- .../{ => types}/audio_only_stream_info.g.dart | 4 + .../{ => types}/muxed_stream_info.dart | 18 +- .../{ => types}/muxed_stream_info.g.dart | 0 .../{ => types}/video_only_stream_info.dart | 6 +- .../{ => types}/video_only_stream_info.g.dart | 0 33 files changed, 313 insertions(+), 51 deletions(-) delete mode 100644 lib/src/videos/streams/audio_stream_info.dart create mode 100644 lib/src/videos/streams/mixins/audio_stream_info.dart rename lib/src/videos/streams/{ => mixins}/stream_info.dart (93%) rename lib/src/videos/streams/{ => mixins}/video_stream_info.dart (98%) create mode 100644 lib/src/videos/streams/models/audio_track.dart create mode 100644 lib/src/videos/streams/models/audio_track.freezed.dart create mode 100644 lib/src/videos/streams/models/audio_track.g.dart rename lib/src/videos/streams/{ => models}/bitrate.dart (100%) rename lib/src/videos/streams/{ => models}/bitrate.freezed.dart (100%) rename lib/src/videos/streams/{ => models}/bitrate.g.dart (100%) rename lib/src/videos/streams/{ => models}/filesize.dart (100%) rename lib/src/videos/streams/{ => models}/filesize.freezed.dart (100%) rename lib/src/videos/streams/{ => models}/filesize.g.dart (100%) rename lib/src/videos/streams/{ => models}/framerate.dart (100%) rename lib/src/videos/streams/{ => models}/framerate.freezed.dart (100%) rename lib/src/videos/streams/{ => models}/framerate.g.dart (100%) rename lib/src/videos/streams/{ => models}/stream_container.dart (100%) rename lib/src/videos/streams/{ => models}/stream_container.freezed.dart (100%) rename lib/src/videos/streams/{ => models}/stream_container.g.dart (100%) rename lib/src/videos/streams/{ => models}/video_quality.dart (100%) rename lib/src/videos/streams/{ => models}/video_resolution.dart (100%) rename lib/src/videos/streams/{ => models}/video_resolution.g.dart (100%) rename lib/src/videos/streams/{ => types}/audio_only_stream_info.dart (69%) rename lib/src/videos/streams/{ => types}/audio_only_stream_info.g.dart (89%) rename lib/src/videos/streams/{ => types}/muxed_stream_info.dart (85%) rename lib/src/videos/streams/{ => types}/muxed_stream_info.g.dart (100%) rename lib/src/videos/streams/{ => types}/video_only_stream_info.dart (91%) rename lib/src/videos/streams/{ => types}/video_only_stream_info.g.dart (100%) diff --git a/lib/src/reverse_engineering/heuristics.dart b/lib/src/reverse_engineering/heuristics.dart index 44fe507..5284322 100644 --- a/lib/src/reverse_engineering/heuristics.dart +++ b/lib/src/reverse_engineering/heuristics.dart @@ -1,6 +1,6 @@ import '../extensions/helpers_extension.dart'; -import '../videos/streams/video_quality.dart'; -import '../videos/streams/video_resolution.dart'; +import '../videos/streams/models/video_quality.dart'; +import '../videos/streams/models/video_resolution.dart'; const _resolutionMap = { VideoQuality.low144: VideoResolution(256, 144), diff --git a/lib/src/reverse_engineering/models/stream_info_provider.dart b/lib/src/reverse_engineering/models/stream_info_provider.dart index 6f4f02a..f1b506e 100644 --- a/lib/src/reverse_engineering/models/stream_info_provider.dart +++ b/lib/src/reverse_engineering/models/stream_info_provider.dart @@ -1,5 +1,6 @@ import 'package:http_parser/http_parser.dart'; +import '../../videos/streams/models/audio_track.dart'; import 'fragment.dart'; enum StreamSource { muxed, adaptive, dash } @@ -59,4 +60,7 @@ abstract class StreamInfoProvider { /// List? get fragments => null; -} + + /// + AudioTrack? get audioTrack => null; +} \ No newline at end of file diff --git a/lib/src/reverse_engineering/player/player_response.dart b/lib/src/reverse_engineering/player/player_response.dart index 15c8b33..a0dbd35 100644 --- a/lib/src/reverse_engineering/player/player_response.dart +++ b/lib/src/reverse_engineering/player/player_response.dart @@ -4,6 +4,7 @@ import 'package:collection/collection.dart'; import 'package:http_parser/http_parser.dart'; import '../../extensions/helpers_extension.dart'; +import '../../videos/streams/models/audio_track.dart'; import '../models/stream_info_provider.dart'; /// @@ -243,6 +244,18 @@ class _StreamInfo extends StreamInfoProvider { @override late final MediaType codec = _getMimeType()!; + @override + late final AudioTrack? audioTrack = () { + if (root.containsKey('audioTrack')) { + final audioTrack = root.get('audioTrack')!; + return AudioTrack( + displayName: audioTrack.getT('displayName')!, + id: audioTrack.getT('id')!, + audioIsDefault: audioTrack.getT('audioIsDefault')!, + ); + } + }(); + MediaType? _getMimeType() { final mime = root.getT('mimeType'); if (mime == null) { diff --git a/lib/src/videos/streams/audio_stream_info.dart b/lib/src/videos/streams/audio_stream_info.dart deleted file mode 100644 index ff91af2..0000000 --- a/lib/src/videos/streams/audio_stream_info.dart +++ /dev/null @@ -1,6 +0,0 @@ -import 'streams.dart'; - -/// YouTube media stream that contains audio. -mixin AudioStreamInfo on StreamInfo { - String get audioCodec; -} diff --git a/lib/src/videos/streams/mixins/audio_stream_info.dart b/lib/src/videos/streams/mixins/audio_stream_info.dart new file mode 100644 index 0000000..0d45315 --- /dev/null +++ b/lib/src/videos/streams/mixins/audio_stream_info.dart @@ -0,0 +1,12 @@ +import '../models/audio_track.dart'; +import '../streams.dart'; + +/// YouTube media stream that contains audio. +mixin AudioStreamInfo on StreamInfo { + String get audioCodec; + + /// Audio track which describes the language of the audio. + AudioTrack? get audioTrack; + + +} diff --git a/lib/src/videos/streams/stream_info.dart b/lib/src/videos/streams/mixins/stream_info.dart similarity index 93% rename from lib/src/videos/streams/stream_info.dart rename to lib/src/videos/streams/mixins/stream_info.dart index 91f8da6..b5e6f95 100644 --- a/lib/src/videos/streams/stream_info.dart +++ b/lib/src/videos/streams/mixins/stream_info.dart @@ -1,7 +1,8 @@ import 'package:http_parser/http_parser.dart'; -import '../../reverse_engineering/models/fragment.dart'; -import '../videos.dart'; +import '../../../reverse_engineering/models/fragment.dart'; +import '../../videos.dart'; +import '../models/audio_track.dart'; /// Generic YouTube media stream. mixin StreamInfo { @@ -63,6 +64,7 @@ extension StreamInfoIterableExt on Iterable { if (e is VideoOnlyStreamInfo) 'video only', if (e is MuxedStreamInfo) 'muxed', e.size, + if (e case AudioStreamInfo(:AudioTrack audioTrack)) audioTrack.displayName, ]); } return column.toString(); diff --git a/lib/src/videos/streams/video_stream_info.dart b/lib/src/videos/streams/mixins/video_stream_info.dart similarity index 98% rename from lib/src/videos/streams/video_stream_info.dart rename to lib/src/videos/streams/mixins/video_stream_info.dart index 746c123..378a8b6 100644 --- a/lib/src/videos/streams/video_stream_info.dart +++ b/lib/src/videos/streams/mixins/video_stream_info.dart @@ -1,4 +1,4 @@ -import 'streams.dart'; +import '../streams.dart'; /// YouTube media stream that contains video. mixin VideoStreamInfo on StreamInfo { diff --git a/lib/src/videos/streams/models/audio_track.dart b/lib/src/videos/streams/models/audio_track.dart new file mode 100644 index 0000000..14ce6f8 --- /dev/null +++ b/lib/src/videos/streams/models/audio_track.dart @@ -0,0 +1,16 @@ +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'audio_track.freezed.dart'; +part 'audio_track.g.dart'; + +/// Audio track which describes the language of the audio. +@freezed +class AudioTrack with _$AudioTrack { + const factory AudioTrack( + {required String displayName, + required String id, + required bool audioIsDefault}) = _AudioTrack; + + factory AudioTrack.fromJson(Map json) + => _$AudioTrackFromJson(json); +} diff --git a/lib/src/videos/streams/models/audio_track.freezed.dart b/lib/src/videos/streams/models/audio_track.freezed.dart new file mode 100644 index 0000000..6546a4e --- /dev/null +++ b/lib/src/videos/streams/models/audio_track.freezed.dart @@ -0,0 +1,191 @@ +// coverage:ignore-file +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark + +part of 'audio_track.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +T _$identity(T value) => value; + +final _privateConstructorUsedError = UnsupportedError( + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); + +AudioTrack _$AudioTrackFromJson(Map json) { + return _AudioTrack.fromJson(json); +} + +/// @nodoc +mixin _$AudioTrack { + String get displayName => throw _privateConstructorUsedError; + String get id => throw _privateConstructorUsedError; + bool get audioIsDefault => throw _privateConstructorUsedError; + + Map toJson() => throw _privateConstructorUsedError; + @JsonKey(ignore: true) + $AudioTrackCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $AudioTrackCopyWith<$Res> { + factory $AudioTrackCopyWith( + AudioTrack value, $Res Function(AudioTrack) then) = + _$AudioTrackCopyWithImpl<$Res, AudioTrack>; + @useResult + $Res call({String displayName, String id, bool audioIsDefault}); +} + +/// @nodoc +class _$AudioTrackCopyWithImpl<$Res, $Val extends AudioTrack> + implements $AudioTrackCopyWith<$Res> { + _$AudioTrackCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? displayName = null, + Object? id = null, + Object? audioIsDefault = null, + }) { + return _then(_value.copyWith( + displayName: null == displayName + ? _value.displayName + : displayName // ignore: cast_nullable_to_non_nullable + as String, + id: null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as String, + audioIsDefault: null == audioIsDefault + ? _value.audioIsDefault + : audioIsDefault // ignore: cast_nullable_to_non_nullable + as bool, + ) as $Val); + } +} + +/// @nodoc +abstract class _$$AudioTrackImplCopyWith<$Res> + implements $AudioTrackCopyWith<$Res> { + factory _$$AudioTrackImplCopyWith( + _$AudioTrackImpl value, $Res Function(_$AudioTrackImpl) then) = + __$$AudioTrackImplCopyWithImpl<$Res>; + @override + @useResult + $Res call({String displayName, String id, bool audioIsDefault}); +} + +/// @nodoc +class __$$AudioTrackImplCopyWithImpl<$Res> + extends _$AudioTrackCopyWithImpl<$Res, _$AudioTrackImpl> + implements _$$AudioTrackImplCopyWith<$Res> { + __$$AudioTrackImplCopyWithImpl( + _$AudioTrackImpl _value, $Res Function(_$AudioTrackImpl) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? displayName = null, + Object? id = null, + Object? audioIsDefault = null, + }) { + return _then(_$AudioTrackImpl( + displayName: null == displayName + ? _value.displayName + : displayName // ignore: cast_nullable_to_non_nullable + as String, + id: null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as String, + audioIsDefault: null == audioIsDefault + ? _value.audioIsDefault + : audioIsDefault // ignore: cast_nullable_to_non_nullable + as bool, + )); + } +} + +/// @nodoc +@JsonSerializable() +class _$AudioTrackImpl implements _AudioTrack { + const _$AudioTrackImpl( + {required this.displayName, + required this.id, + required this.audioIsDefault}); + + factory _$AudioTrackImpl.fromJson(Map json) => + _$$AudioTrackImplFromJson(json); + + @override + final String displayName; + @override + final String id; + @override + final bool audioIsDefault; + + @override + String toString() { + return 'AudioTrack(displayName: $displayName, id: $id, audioIsDefault: $audioIsDefault)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$AudioTrackImpl && + (identical(other.displayName, displayName) || + other.displayName == displayName) && + (identical(other.id, id) || other.id == id) && + (identical(other.audioIsDefault, audioIsDefault) || + other.audioIsDefault == audioIsDefault)); + } + + @JsonKey(ignore: true) + @override + int get hashCode => Object.hash(runtimeType, displayName, id, audioIsDefault); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$AudioTrackImplCopyWith<_$AudioTrackImpl> get copyWith => + __$$AudioTrackImplCopyWithImpl<_$AudioTrackImpl>(this, _$identity); + + @override + Map toJson() { + return _$$AudioTrackImplToJson( + this, + ); + } +} + +abstract class _AudioTrack implements AudioTrack { + const factory _AudioTrack( + {required final String displayName, + required final String id, + required final bool audioIsDefault}) = _$AudioTrackImpl; + + factory _AudioTrack.fromJson(Map json) = + _$AudioTrackImpl.fromJson; + + @override + String get displayName; + @override + String get id; + @override + bool get audioIsDefault; + @override + @JsonKey(ignore: true) + _$$AudioTrackImplCopyWith<_$AudioTrackImpl> get copyWith => + throw _privateConstructorUsedError; +} diff --git a/lib/src/videos/streams/models/audio_track.g.dart b/lib/src/videos/streams/models/audio_track.g.dart new file mode 100644 index 0000000..979675f --- /dev/null +++ b/lib/src/videos/streams/models/audio_track.g.dart @@ -0,0 +1,23 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +// ignore_for_file: non_constant_identifier_names, require_trailing_commas + +part of 'audio_track.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +_$AudioTrackImpl _$$AudioTrackImplFromJson(Map json) => + _$AudioTrackImpl( + displayName: json['displayName'] as String, + id: json['id'] as String, + audioIsDefault: json['audioIsDefault'] as bool, + ); + +Map _$$AudioTrackImplToJson(_$AudioTrackImpl instance) => + { + 'displayName': instance.displayName, + 'id': instance.id, + 'audioIsDefault': instance.audioIsDefault, + }; diff --git a/lib/src/videos/streams/bitrate.dart b/lib/src/videos/streams/models/bitrate.dart similarity index 100% rename from lib/src/videos/streams/bitrate.dart rename to lib/src/videos/streams/models/bitrate.dart diff --git a/lib/src/videos/streams/bitrate.freezed.dart b/lib/src/videos/streams/models/bitrate.freezed.dart similarity index 100% rename from lib/src/videos/streams/bitrate.freezed.dart rename to lib/src/videos/streams/models/bitrate.freezed.dart diff --git a/lib/src/videos/streams/bitrate.g.dart b/lib/src/videos/streams/models/bitrate.g.dart similarity index 100% rename from lib/src/videos/streams/bitrate.g.dart rename to lib/src/videos/streams/models/bitrate.g.dart diff --git a/lib/src/videos/streams/filesize.dart b/lib/src/videos/streams/models/filesize.dart similarity index 100% rename from lib/src/videos/streams/filesize.dart rename to lib/src/videos/streams/models/filesize.dart diff --git a/lib/src/videos/streams/filesize.freezed.dart b/lib/src/videos/streams/models/filesize.freezed.dart similarity index 100% rename from lib/src/videos/streams/filesize.freezed.dart rename to lib/src/videos/streams/models/filesize.freezed.dart diff --git a/lib/src/videos/streams/filesize.g.dart b/lib/src/videos/streams/models/filesize.g.dart similarity index 100% rename from lib/src/videos/streams/filesize.g.dart rename to lib/src/videos/streams/models/filesize.g.dart diff --git a/lib/src/videos/streams/framerate.dart b/lib/src/videos/streams/models/framerate.dart similarity index 100% rename from lib/src/videos/streams/framerate.dart rename to lib/src/videos/streams/models/framerate.dart diff --git a/lib/src/videos/streams/framerate.freezed.dart b/lib/src/videos/streams/models/framerate.freezed.dart similarity index 100% rename from lib/src/videos/streams/framerate.freezed.dart rename to lib/src/videos/streams/models/framerate.freezed.dart diff --git a/lib/src/videos/streams/framerate.g.dart b/lib/src/videos/streams/models/framerate.g.dart similarity index 100% rename from lib/src/videos/streams/framerate.g.dart rename to lib/src/videos/streams/models/framerate.g.dart diff --git a/lib/src/videos/streams/stream_container.dart b/lib/src/videos/streams/models/stream_container.dart similarity index 100% rename from lib/src/videos/streams/stream_container.dart rename to lib/src/videos/streams/models/stream_container.dart diff --git a/lib/src/videos/streams/stream_container.freezed.dart b/lib/src/videos/streams/models/stream_container.freezed.dart similarity index 100% rename from lib/src/videos/streams/stream_container.freezed.dart rename to lib/src/videos/streams/models/stream_container.freezed.dart diff --git a/lib/src/videos/streams/stream_container.g.dart b/lib/src/videos/streams/models/stream_container.g.dart similarity index 100% rename from lib/src/videos/streams/stream_container.g.dart rename to lib/src/videos/streams/models/stream_container.g.dart diff --git a/lib/src/videos/streams/video_quality.dart b/lib/src/videos/streams/models/video_quality.dart similarity index 100% rename from lib/src/videos/streams/video_quality.dart rename to lib/src/videos/streams/models/video_quality.dart diff --git a/lib/src/videos/streams/video_resolution.dart b/lib/src/videos/streams/models/video_resolution.dart similarity index 100% rename from lib/src/videos/streams/video_resolution.dart rename to lib/src/videos/streams/models/video_resolution.dart diff --git a/lib/src/videos/streams/video_resolution.g.dart b/lib/src/videos/streams/models/video_resolution.g.dart similarity index 100% rename from lib/src/videos/streams/video_resolution.g.dart rename to lib/src/videos/streams/models/video_resolution.g.dart diff --git a/lib/src/videos/streams/stream_client.dart b/lib/src/videos/streams/stream_client.dart index 431c266..bcccda2 100644 --- a/lib/src/videos/streams/stream_client.dart +++ b/lib/src/videos/streams/stream_client.dart @@ -79,6 +79,7 @@ class StreamClient { // Muxed if (!audioCodec.isNullOrWhiteSpace && stream.source != StreamSource.adaptive) { + assert(stream.audioTrack== null); yield MuxedStreamInfo( itag, url, @@ -124,6 +125,7 @@ class StreamClient { stream.qualityLabel, stream.fragments ?? const [], stream.codec, + stream.audioTrack ); } else { throw YoutubeExplodeException('Could not extract stream codec'); diff --git a/lib/src/videos/streams/streams.dart b/lib/src/videos/streams/streams.dart index 534b415..25b1027 100644 --- a/lib/src/videos/streams/streams.dart +++ b/lib/src/videos/streams/streams.dart @@ -1,15 +1,15 @@ -export 'audio_only_stream_info.dart'; -export 'audio_stream_info.dart'; -export 'bitrate.dart'; -export 'filesize.dart'; -export 'framerate.dart'; -export 'muxed_stream_info.dart'; +export 'types/audio_only_stream_info.dart'; +export 'mixins/audio_stream_info.dart'; +export 'models/bitrate.dart'; +export 'models/filesize.dart'; +export 'models/framerate.dart'; +export 'types/muxed_stream_info.dart'; export 'stream_client.dart'; -export 'stream_container.dart'; +export 'models/stream_container.dart'; export 'stream_context.dart'; -export 'stream_info.dart' hide mediaTypeFromJson, mediaTypeToJson; +export 'mixins/stream_info.dart' hide mediaTypeFromJson, mediaTypeToJson; export 'stream_manifest.dart'; -export 'video_only_stream_info.dart'; -export 'video_quality.dart'; -export 'video_resolution.dart'; -export 'video_stream_info.dart'; +export 'types/video_only_stream_info.dart'; +export 'models/video_quality.dart'; +export 'models/video_resolution.dart'; +export 'mixins/video_stream_info.dart'; diff --git a/lib/src/videos/streams/audio_only_stream_info.dart b/lib/src/videos/streams/types/audio_only_stream_info.dart similarity index 69% rename from lib/src/videos/streams/audio_only_stream_info.dart rename to lib/src/videos/streams/types/audio_only_stream_info.dart index e3005c2..e86f049 100644 --- a/lib/src/videos/streams/audio_only_stream_info.dart +++ b/lib/src/videos/streams/types/audio_only_stream_info.dart @@ -1,9 +1,10 @@ import 'package:http_parser/http_parser.dart'; import 'package:json_annotation/json_annotation.dart'; -import '../../reverse_engineering/models/fragment.dart'; -import 'stream_info.dart'; -import 'streams.dart'; +import '../../../reverse_engineering/models/fragment.dart'; +import '../mixins/stream_info.dart'; +import '../models/audio_track.dart'; +import '../streams.dart'; part 'audio_only_stream_info.g.dart'; @@ -38,17 +39,19 @@ class AudioOnlyStreamInfo with StreamInfo, AudioStreamInfo { @override final String qualityLabel; - AudioOnlyStreamInfo( - this.tag, - this.url, - this.container, - this.size, - this.bitrate, - this.audioCodec, - this.qualityLabel, - this.fragments, - this.codec, - ); + @override + final AudioTrack? audioTrack; + + AudioOnlyStreamInfo(this.tag, + this.url, + this.container, + this.size, + this.bitrate, + this.audioCodec, + this.qualityLabel, + this.fragments, + this.codec, + this.audioTrack); @override String toString() => 'Audio-only ($tag | $container)'; diff --git a/lib/src/videos/streams/audio_only_stream_info.g.dart b/lib/src/videos/streams/types/audio_only_stream_info.g.dart similarity index 89% rename from lib/src/videos/streams/audio_only_stream_info.g.dart rename to lib/src/videos/streams/types/audio_only_stream_info.g.dart index 3accad2..4400bb8 100644 --- a/lib/src/videos/streams/audio_only_stream_info.g.dart +++ b/lib/src/videos/streams/types/audio_only_stream_info.g.dart @@ -21,6 +21,9 @@ AudioOnlyStreamInfo _$AudioOnlyStreamInfoFromJson(Map json) => .map((e) => Fragment.fromJson(e as Map)) .toList(), mediaTypeFromJson(json['codec'] as String), + json['audioTrack'] == null + ? null + : AudioTrack.fromJson(json['audioTrack'] as Map), ); Map _$AudioOnlyStreamInfoToJson( @@ -35,4 +38,5 @@ Map _$AudioOnlyStreamInfoToJson( 'codec': mediaTypeToJson(instance.codec), 'fragments': instance.fragments, 'qualityLabel': instance.qualityLabel, + 'audioTrack': instance.audioTrack, }; diff --git a/lib/src/videos/streams/muxed_stream_info.dart b/lib/src/videos/streams/types/muxed_stream_info.dart similarity index 85% rename from lib/src/videos/streams/muxed_stream_info.dart rename to lib/src/videos/streams/types/muxed_stream_info.dart index 916a887..ade6daa 100644 --- a/lib/src/videos/streams/muxed_stream_info.dart +++ b/lib/src/videos/streams/types/muxed_stream_info.dart @@ -1,16 +1,10 @@ import 'package:freezed_annotation/freezed_annotation.dart'; import 'package:http_parser/http_parser.dart'; -import '../../reverse_engineering/models/fragment.dart'; -import 'audio_stream_info.dart'; -import 'bitrate.dart'; -import 'filesize.dart'; -import 'framerate.dart'; -import 'stream_container.dart'; -import 'stream_info.dart'; -import 'video_quality.dart'; -import 'video_resolution.dart'; -import 'video_stream_info.dart'; +import '../../../reverse_engineering/models/fragment.dart'; +import '../models/audio_track.dart'; +import '../streams.dart'; +import '../mixins/stream_info.dart'; part 'muxed_stream_info.g.dart'; @@ -93,4 +87,8 @@ class MuxedStreamInfo with StreamInfo, AudioStreamInfo, VideoStreamInfo { @override Map toJson() => _$MuxedStreamInfoToJson(this); + + /// Muxed streams do not provide info about the language. + @override + AudioTrack? get audioTrack => null; } diff --git a/lib/src/videos/streams/muxed_stream_info.g.dart b/lib/src/videos/streams/types/muxed_stream_info.g.dart similarity index 100% rename from lib/src/videos/streams/muxed_stream_info.g.dart rename to lib/src/videos/streams/types/muxed_stream_info.g.dart diff --git a/lib/src/videos/streams/video_only_stream_info.dart b/lib/src/videos/streams/types/video_only_stream_info.dart similarity index 91% rename from lib/src/videos/streams/video_only_stream_info.dart rename to lib/src/videos/streams/types/video_only_stream_info.dart index 72157b8..eae8889 100644 --- a/lib/src/videos/streams/video_only_stream_info.dart +++ b/lib/src/videos/streams/types/video_only_stream_info.dart @@ -1,9 +1,9 @@ import 'package:freezed_annotation/freezed_annotation.dart'; import 'package:http_parser/http_parser.dart'; -import '../../../youtube_explode_dart.dart'; -import '../../reverse_engineering/models/fragment.dart'; -import 'stream_info.dart'; +import '../../../../youtube_explode_dart.dart'; +import '../../../reverse_engineering/models/fragment.dart'; +import '../mixins/stream_info.dart'; part 'video_only_stream_info.g.dart'; diff --git a/lib/src/videos/streams/video_only_stream_info.g.dart b/lib/src/videos/streams/types/video_only_stream_info.g.dart similarity index 100% rename from lib/src/videos/streams/video_only_stream_info.g.dart rename to lib/src/videos/streams/types/video_only_stream_info.g.dart From 3f33eb35be95b744a4be409d4b383ce66868cd49 Mon Sep 17 00:00:00 2001 From: Mattia Date: Mon, 1 Apr 2024 18:54:22 +0200 Subject: [PATCH 22/36] Fix endless loop when fetching some playlists videos. --- lib/src/playlists/playlist_client.dart | 6 +++++- test/playlist_test.dart | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/src/playlists/playlist_client.dart b/lib/src/playlists/playlist_client.dart index eb57647..aef2cde 100644 --- a/lib/src/playlists/playlist_client.dart +++ b/lib/src/playlists/playlist_client.dart @@ -36,7 +36,7 @@ class PlaylistClient { Stream