Skip to content

Conversation

@xZetsubou
Copy link
Contributor

@xZetsubou xZetsubou commented Jan 9, 2026

Sometimes I noticed that even If I have the subtitle already exists a4ks may auto-download new subtitle and overwrite the existed one, and the downloaded subtitle aren't always correct if the episode doesn't exists in the website.

What causes the issue is that service try to access player_props['currentsubtitle']['index'] however for some-reason currentsubtitle are not always defined which rise an error and skip the subtitle check process.

Error line

except Exception as e:
core.logger.debug('Error on update_sub_stream: %s' % e)

Example logs: "the current language index is 0"

2026-01-09 00:54:49.568 T:29416    info <general>: service.subtitles.a4ksubtitles: player_props: {'currentsubtitle': {}, 'subtitleenabled': True, 'subtitles': [{'index': 0, 'isdefault': False, 'isforced': False, 'isimpaired': False, 'language': 'ara', 'name': '(External)'}, {'index': 1, 'isdefault': True, 'isforced': False, 'isimpaired': False, 'language': 'fre', 'name': ''}]}
2026-01-09 00:54:49.568 T:29416    info <general>: service.subtitles.a4ksubtitles: prefer_sdh: False
2026-01-09 00:54:49.568 T:29416    info <general>: service.subtitles.a4ksubtitles: prefer_forced: True
2026-01-09 00:54:49.568 T:29416    info <general>: service.subtitles.a4ksubtitles: preferredlang_code: ara
2026-01-09 00:54:49.568 T:29416    info <general>: service.subtitles.a4ksubtitles: sub_langs: ['ara', 'fra']
2026-01-09 00:54:49.568 T:29416    info <general>: service.subtitles.a4ksubtitles: preferedlang_sub_indexes: [0]
2026-01-09 00:54:49.568 T:29416   error <general>: service.subtitles.a4ksubtitles: player_props {'currentsubtitle': {}, 'subtitleenabled': True, 'subtitles': [{'index': 0, 'isdefault': False, 'isforced': False, 'isimpaired': False, 'language': 'ara', 'name': '(External)'}, {'index': 1, 'isdefault': True, 'isforced': False, 'isimpaired': False, 'language': 'fre', 'name': ''}]} and player_props subtitles: [{'index': 0, 'isdefault': False, 'isforced': False, 'isimpaired': False, 'language': 'ara', 'name': '(External)'}, {'index': 1, 'isdefault': True, 'isforced': False, 'isimpaired': False, 'language': 'fre', 'name': ''}]
2026-01-09 00:54:49.568 T:29416    info <general>: service.subtitles.a4ksubtitles: found default subtitles: (external)

2026-01-09 00:54:49.568 T:29416   error <general>: service.subtitles.a4ksubtitles: Error on update_sub_stream: 'index'

Now the change will instead of directly check currentsubtitle -> index; If currentsubtitle value isn't defined it will set the preferred language.

edit:
Not sure if v3.22.0 triggered because crc hasn't changed nor addon.xml updated.

@xZetsubou xZetsubou requested a review from newt-sc as a code owner January 9, 2026 00:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant