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

Support for extra out-of-region languages #29

Open
gmertes opened this issue Jun 18, 2022 · 4 comments · Fixed by #36
Open

Support for extra out-of-region languages #29

gmertes opened this issue Jun 18, 2022 · 4 comments · Fixed by #36
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@gmertes
Copy link
Owner

gmertes commented Jun 18, 2022

Netflix has added support for extra out-of-region subtitle languages. These subs are present in the manifest, but they are missing their download url. For in-region subtitles we get the download url from manifest.timedtexttracks[].ttDownloadables, but this field is empty for the extra subs. I have done only limited investigation at the time of writing, but I don't see the download url anywhere in other fields.

What's interesting is that once you select one of the extra languages as primary sub, the ttDownloadables for that track is populated with a download url - making that language available as secondary sub (and it will show up on refresh). This may be a deliberate obfuscation. It also indicates that ttDownloadables is still used by the player when activating the extra subs, we just need to figure out where it gets populated from. If we cannot easily get a complete list of download urls, we could potentially mimic user behaviour and just cycle through the primary subs one by one to intercept all urls (not ideal but 🤷‍♀️).

I'm opening this issue to document the implementation of support for out of region languages, and request help from the community. Feedback, suggestions and PR are very much appreciated.

@gmertes gmertes added enhancement New feature or request help wanted Extra attention is needed labels Jun 18, 2022
hyww added a commit to hyww/NflxMultiSubs that referenced this issue Dec 9, 2022
hyww added a commit to hyww/NflxMultiSubs that referenced this issue Dec 9, 2022
@hyww
Copy link

hyww commented Dec 10, 2022

Using older version of cadmium player with showAllSubDubTracks set to true does get all ttDownloadables populated with downloadUrls. I've tested with unmodified cadmium-playercore-6.0033.414.911.js. But I think it won't be a good idea to keep using old version player since Netflix could stop supporting it anytime...

showAllSubDubTracks seems have no effect with licensedManifest requests used by newer player (6.0038.181.911 in my case), though licensedManifest looks just like `manifest requests with some extra fields.

@hyww
Copy link

hyww commented Dec 10, 2022

When an extra language is activated as primary sub, these parameters are set in licensedManifest requests

  • preferredAudioLocale:"en"
  • preferredTextLocale:"da"

The way I could view/modify parameters in requests for now is by hooking JSON.stringify (as in #34 ). I guess it will be more difficult to actually make another modified requests and get urls we want.

hyww added a commit to hyww/NflxMultiSubs that referenced this issue Dec 10, 2022
resolves gmertes#29
tested with cadium-playercore 6.0033.414.911, 6.0034.588.911, 6.0038.181.911
@hyww
Copy link

hyww commented Dec 14, 2022

I tried to mimic user behaviour (clicking primary subtitles on menu) to trigger manifest request and get download urls for extra subtitles. Primary subtitle is restored to original setting after manifest request triggered.

It has some problems:

  • doesn't work for secondaryLanguageMode === 'last' (preferredTextLocale hack might help, but it has other problems)
  • doesn't work if user closed (mouse leaves) the subtitle menu before we could restore original primary subtitle setting

I put my implementation here in case someone is interested in it.

@gmertes gmertes reopened this Dec 16, 2022
@gmertes
Copy link
Owner Author

gmertes commented Dec 16, 2022

#36 is currently a partial fix, it requires the user to manually activate the primary subs first before it's available as secondary sub.

@hyww I tried to mimic user behaviour (clicking primary subtitles on menu) to trigger manifest request and get download urls for extra subtitles.

Amazing! I am really temped to also pull this in if we can polish it and deal with those problems. One thing I would suggest is to keep the original hydrated languages at the top of the list and add a horizontal line under them, so that the layout is the same as the primary list. I'll have some time in the coming weeks to play around with your fork!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
2 participants