Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v7.0.9+beta.10 #864

Merged
merged 5 commits into from
Aug 4, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix incorrectly updating playing VideoItem details
  • Loading branch information
MoojMidge committed Aug 4, 2024
commit 7d6f456573e5186fa1768a08cd24cfaff90e95a2
22 changes: 10 additions & 12 deletions resources/lib/youtube_plugin/youtube/helper/stream_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -1529,18 +1529,16 @@ def load_stream_info(self, video_id):
thumb_suffix = ''

meta_info = {
'video': {
'id': video_id,
'title': unescape(video_details.get('title', '')
.encode('raw_unicode_escape')
.decode('raw_unicode_escape')),
'status': {
'unlisted': microformat.get('isUnlisted', False),
'private': video_details.get('isPrivate', False),
'crawlable': video_details.get('isCrawlable', False),
'family_safe': microformat.get('isFamilySafe', False),
'live': is_live,
},
'id': video_id,
'title': unescape(video_details.get('title', '')
.encode('raw_unicode_escape')
.decode('raw_unicode_escape')),
'status': {
'unlisted': microformat.get('isUnlisted', False),
'private': video_details.get('isPrivate', False),
'crawlable': video_details.get('isCrawlable', False),
'family_safe': microformat.get('isFamilySafe', False),
'live': is_live,
},
'channel': {
'id': video_details.get('channelId', ''),
Expand Down
2 changes: 1 addition & 1 deletion resources/lib/youtube_plugin/youtube/helper/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -829,7 +829,7 @@ def update_play_info(provider, context, video_id, video_item, video_stream,
settings = context.get_settings()
ui = context.get_ui()

meta_data = video_stream.get('meta', None)
meta_data = video_stream.get('meta')
if meta_data:
video_item.live = meta_data.get('status', {}).get('live', False)
video_item.set_subtitles(meta_data.get('subtitles', None))
Expand Down
7 changes: 3 additions & 4 deletions resources/lib/youtube_plugin/youtube/helper/yt_play.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,6 @@ def _play_stream(provider, context):
video_id)

metadata = stream.get('meta', {})
video_details = metadata.get('video', {})

if is_external:
url = urlunsplit((
'http',
Expand All @@ -119,7 +117,8 @@ def _play_stream(provider, context):
'',
))
stream['url'] = url
video_item = VideoItem(video_details.get('title', ''), stream['url'])

video_item = VideoItem(metadata.get('title', ''), stream['url'])

use_history = not (screensaver or incognito or stream.get('live'))
use_remote_history = use_history and settings.use_remote_history()
Expand All @@ -145,7 +144,7 @@ def _play_stream(provider, context):
playback_data = {
'video_id': video_id,
'channel_id': metadata.get('channel', {}).get('id', ''),
'video_status': video_details.get('status', {}),
'video_status': metadata.get('status', {}),
'playing_file': video_item.get_uri(),
'play_count': play_count,
'use_remote_history': use_remote_history,
Expand Down