mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-09-13 07:55:18 +00:00
chore: fix streaming quality is worse then available
This commit is contained in:
parent
cb97f4352c
commit
5b457fc4bd
@ -17,7 +17,11 @@ class NewPipeEngine implements YouTubeEngine {
|
|||||||
FileSize.unknown,
|
FileSize.unknown,
|
||||||
Bitrate(stream.bitrate),
|
Bitrate(stream.bitrate),
|
||||||
stream.codec,
|
stream.codec,
|
||||||
stream.quality,
|
switch (stream.bitrate) {
|
||||||
|
> 130 * 1024 => "high",
|
||||||
|
> 64 * 1024 => "medium",
|
||||||
|
_ => "low",
|
||||||
|
},
|
||||||
[],
|
[],
|
||||||
MediaType.parse(stream.mediaFormat!.mimeType),
|
MediaType.parse(stream.mediaFormat!.mimeType),
|
||||||
null,
|
null,
|
||||||
|
@ -11,8 +11,9 @@ class YouTubeExplodeEngine implements YouTubeEngine {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<StreamManifest> getStreamManifest(String videoId) {
|
Future<StreamManifest> getStreamManifest(String videoId) async {
|
||||||
return _youtubeExplode.videos.streamsClient.getManifest(
|
final streamManifest =
|
||||||
|
await _youtubeExplode.videos.streamsClient.getManifest(
|
||||||
videoId,
|
videoId,
|
||||||
requireWatchPage: false,
|
requireWatchPage: false,
|
||||||
ytClients: [
|
ytClients: [
|
||||||
@ -21,6 +22,28 @@ class YouTubeExplodeEngine implements YouTubeEngine {
|
|||||||
YoutubeApiClient.mweb,
|
YoutubeApiClient.mweb,
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
||||||
|
return StreamManifest(
|
||||||
|
streamManifest.audioOnly.map((stream) {
|
||||||
|
return AudioOnlyStreamInfo(
|
||||||
|
stream.videoId,
|
||||||
|
stream.tag,
|
||||||
|
stream.url,
|
||||||
|
stream.container,
|
||||||
|
stream.size,
|
||||||
|
stream.bitrate,
|
||||||
|
stream.audioCodec,
|
||||||
|
switch (stream.bitrate.bitsPerSecond) {
|
||||||
|
> 130 * 1024 => "high",
|
||||||
|
> 64 * 1024 => "medium",
|
||||||
|
_ => "low",
|
||||||
|
},
|
||||||
|
stream.fragments,
|
||||||
|
stream.codec,
|
||||||
|
stream.audioTrack,
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
Loading…
Reference in New Issue
Block a user