Skip to content

Commit

Permalink
Use alternative streams to improve compatibility with external players
Browse files Browse the repository at this point in the history
  • Loading branch information
MoojMidge committed Oct 29, 2024
1 parent 0db4f20 commit 26ddea3
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions resources/lib/youtube_plugin/youtube/helper/yt_play.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,17 @@ def _play_stream(provider, context):
audio_only = True
else:
audio_only = settings.audio_only()
use_adaptive_formats = (not is_external
or settings.alternative_player_adaptive())

try:
streams = client.get_streams(context,
video_id,
ask_for_quality,
audio_only,
settings.use_mpd_videos())
streams = client.get_streams(
context,
video_id=video_id,
ask_for_quality=ask_for_quality,
audio_only=audio_only,
use_mpd=use_adaptive_formats and settings.use_mpd_videos(),
)
except YouTubeException as exc:
context.log_error('yt_play.play_video - {exc!r}:\n{details}'.format(
exc=exc, details=''.join(format_stack())
Expand All @@ -90,8 +94,7 @@ def _play_stream(provider, context):
streams,
ask_for_quality=ask_for_quality,
audio_only=audio_only,
use_adaptive_formats=(not is_external
or settings.alternative_player_adaptive()),
use_adaptive_formats=use_adaptive_formats,
)

if stream is None:
Expand Down

0 comments on commit 26ddea3

Please sign in to comment.