asciidisco / plugin.video.netflix

Inputstream based Netflix plugin for Kodi
MIT License
1.24k stars 226 forks source link

The addon ignores the preferred subtitle language in the Kodi preferences. #605

Open Paco8 opened 5 years ago

Paco8 commented 5 years ago

I'm submitting a ...

General information

Prerequisites

Description

I have set the preferred subtitle language to Spanish in the Kodi preferences. However every time I play a movie or an episode of a TV show with the netflix addon the subtitles are disabled, so I have to enable them and also select the Spanish track.

Steps to Reproduce

  1. Set Spanish as preferred subtitle language to Spanish in the Kodi preferences
  2. Play a video with the netflix addon

Expected behavior: [What you expected to happen]

Subtitles should be enabled and the track selected to Spanish for all movies and TV shows.

Actual behavior: [What actually happened]

The video plays without subtitles.

Context (Environment)

Installation

Operating System

Additional informatin on the environment

Using Windows 10. It happens also on Android TV.

Essam315 commented 5 years ago

Are you trying to watch shows with "European Spanish" (Spanish - Spanish), "es-ES" like "Elite" and "La casa de papel ", or with Latin American Spanish "es" like "Pablo Escobar, el patrón del mal"? See this post here.

https://github.com/asciidisco/plugin.video.netflix/issues/580#issuecomment-453848905

https://github.com/asciidisco/plugin.video.netflix/issues/580#issuecomment-453895271

Paco8 commented 5 years ago

It's European Spanish. It looks like that post is about the audio track. What should I modify for the subtitle track?

Essam315 commented 5 years ago

For the subtitles to always be in "European Spanish" , in "MSLv2.py" replace (this will disable the other subtitle languages, "European Spanish" will be the only subtitle language you will get)

content_profile = downloadable.keys()[0]

with

        content_profile = downloadable.keys()[0]
        if not text_track['language'] == 'es-ES':
            continue

To enable the subtitles by default, in "Preferred Subtitle language" choose "Original language". The Spanish language in Kodi is for Latin American Spanish only.

Paco8 commented 5 years ago

Yes, that works. But thinking in a more general solution... Let me know if I understand correctly the problem: the language code from netflix for Latin American Spanish is 'es' while the code for European Spanish is 'es-ES' but Kodi only selects the Spanish subtitles if the code is 'es', so that's why it never selects the subtitles for European Spanish.

If that's the case I can think of a workaround: check if the region in the Kodi configuration is Spain. In that case rename the neflix codes in the subtitle tracks from 'es' to 'es-LA' (or something like that) and 'es-ES' to 'es'. With one exception, if there's no 'es-ES' track then don't rename 'es' to 'es-LA' (so it can be used by default if there isn't a specific track for Spain)

I actually began to write a patch which implements that idea and I think it works.

Essam315 commented 5 years ago

You understood the problem correctly. I think the solution for this problem may be done by modifying Kodi and adding "European Spanish" to this file in the same way "Spanish" in it

https://github.com/xbmc/xbmc/blob/d92d5d1b356d8f2a991570a251f56948819b3758/xbmc/utils/LangCodeExpander.cpp

Paco8 commented 5 years ago

Then I guess it will take a while until this gets fixed by the Kodi developers.

I attach my patch for the netflix addon, in case someone could find it useful. It works both for audio and subtitles.

It's simpler than my first idea. It renames 'es-ES' to 'es' but only if there isn't a 'es' track already. This way it won't cause troubles to users from Latin American countries. In Spain most movies and shows use only the European Spanish version, so this will do.

fix_spanish.zip