parent
51ba543deb
commit
0ce24bf017
|
@ -1,3 +1,6 @@
|
||||||
|
## 1.10.10+2
|
||||||
|
- Fix #194: Now closed-captions allow malformed utf8 as well.
|
||||||
|
|
||||||
## 1.10.10+1
|
## 1.10.10+1
|
||||||
- Deprecated `withHighestBitrate()` in favour of `bestQuality`.
|
- Deprecated `withHighestBitrate()` in favour of `bestQuality`.
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import 'dart:convert';
|
||||||
|
|
||||||
import '../../extensions/helpers_extension.dart';
|
import '../../extensions/helpers_extension.dart';
|
||||||
import '../../reverse_engineering/clients/closed_caption_client.dart' as re
|
import '../../reverse_engineering/clients/closed_caption_client.dart' as re
|
||||||
show ClosedCaptionClient;
|
show ClosedCaptionClient;
|
||||||
|
@ -28,7 +30,8 @@ class ClosedCaptionClient {
|
||||||
]}) async {
|
]}) async {
|
||||||
videoId = VideoId.fromString(videoId);
|
videoId = VideoId.fromString(videoId);
|
||||||
var tracks = <ClosedCaptionTrackInfo>{};
|
var tracks = <ClosedCaptionTrackInfo>{};
|
||||||
var watchPage = await WatchPage.get(_httpClient, (videoId as VideoId).value);
|
var watchPage =
|
||||||
|
await WatchPage.get(_httpClient, (videoId as VideoId).value);
|
||||||
var playerResponse = watchPage.playerResponse!;
|
var playerResponse = watchPage.playerResponse!;
|
||||||
|
|
||||||
for (final track in playerResponse.closedCaptionTrack) {
|
for (final track in playerResponse.closedCaptionTrack) {
|
||||||
|
@ -56,7 +59,9 @@ class ClosedCaptionClient {
|
||||||
return ClosedCaptionTrack(captions);
|
return ClosedCaptionTrack(captions);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns the subtitles as a string.
|
/// Returns the subtitles as a string. In XML format.
|
||||||
Future<String> getSubTitles(ClosedCaptionTrackInfo trackInfo) =>
|
Future<String> getSubTitles(ClosedCaptionTrackInfo trackInfo) async {
|
||||||
_httpClient.getString(trackInfo.url);
|
final r = await _httpClient.get(trackInfo.url);
|
||||||
|
return utf8.decode(r.bodyBytes, allowMalformed: true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
name: youtube_explode_dart
|
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.
|
description: A port in dart of the youtube explode library. Supports several API functions without the need of Youtube API Key.
|
||||||
version: 1.10.10+1
|
version: 1.10.10+2
|
||||||
|
|
||||||
homepage: https://github.com/Hexer10/youtube_explode_dart
|
homepage: https://github.com/Hexer10/youtube_explode_dart
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue