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

Feature suggestion - set 'language' prop. for subs and allow selecting default track #26

Closed
flagg19 opened this issue Oct 29, 2017 · 2 comments

Comments

@flagg19
Copy link

flagg19 commented Oct 29, 2017

Subject:

For crunchyroll (don't know about the others), subtitle tracks aren't assigned a language. It would be cool to have the language set, so that all players that allow setting things like: "use lang regardless of what default track is in the file" could work. Also, I've seen that the default subtitle language is hard-coded as English, can it be turned into a new script parameter?

Long Explanation:

  1. Note that I only use crunchyroll, I don't know how thing works for other sites, nor if what I'm proposing is applicable to them.
  2. Also note that here I'm only talking about subtitle tracks, but it might be interesting to also consider audio/video tracks.

I can barely read python but for setting the language on crunchyroll subtitles it should be enough to add --language "N:lang" on all the lines regarding subtitles:

subtitles_files = []
for sub_file in glob("*.ass"):
if sub_file.endswith(".enUS.ass"):
subtitles_files.insert(0,
"--track-name 0:English(US) --default-track 0:yes --sub-charset 0:utf-8 " + '"' + str(
os.path.realpath(sub_file)) + '" ')
elif sub_file.endswith(".enGB.ass"):
subtitles_files.append(
"--track-name 0:English(UK) --default-track 0:no --sub-charset 0:utf-8 " + '"' + str(
os.path.realpath(sub_file)) + '" ')
elif sub_file.endswith(".esLA.ass"):
subtitles_files.append("--track-name 0:Español --default-track 0:no --sub-charset 0:utf-8 " + '"' + str(
os.path.realpath(sub_file)) + '" ')
elif sub_file.endswith(".esES.ass"):
subtitles_files.append(
"--track-name 0:Español(España) --default-track 0:no --sub-charset 0:utf-8 " + '"' + str(
os.path.realpath(sub_file)) + '" ')
elif sub_file.endswith(".ptBR.ass"):
subtitles_files.append(
"--track-name 0:Português(Brasil) --default-track 0:no --sub-charset 0:utf-8 " + '"' + str(
os.path.realpath(sub_file)) + '" ')
elif sub_file.endswith(".ptPT.ass"):
subtitles_files.append(
"--track-name 0:Português(Portugal) --default-track 0:no --sub-charset 0:utf-8 " + '"' + str(
os.path.realpath(sub_file)) + '" ')
elif sub_file.endswith(".frFR.ass"):
subtitles_files.append(
"--track-name 0:Français(France) --default-track 0:no --sub-charset 0:utf-8 " + '"' + str(
os.path.realpath(sub_file)) + '" ')
elif sub_file.endswith(".deDE.ass"):
subtitles_files.append("--track-name 0:Deutsch --default-track 0:no --sub-charset 0:utf-8 " + '"' + str(
os.path.realpath(sub_file)) + '" ')
elif sub_file.endswith(".arME.ass"):
subtitles_files.append("--track-name 0:Arabic --default-track 0:no --sub-charset 0:utf-8 " + '"' + str(
os.path.realpath(sub_file)) + '" ')
elif sub_file.endswith(".itIT.ass"):
subtitles_files.append("--track-name 0:Italiano --default-track 0:no --sub-charset 0:utf-8 " + '"' + str(
os.path.realpath(sub_file)) + '" ')
elif sub_file.endswith(".arME.ass"):
subtitles_files.append("--track-name 0:Arabic --default-track 0:no --sub-charset 0:utf-8 " + '"' + str(
os.path.realpath(sub_file)) + '" ')
elif sub_file.endswith(".trTR.ass"):
subtitles_files.append("--track-name 0:Türkçe --default-track 0:no --sub-charset 0:utf-8 " + '"' + str(
os.path.realpath(sub_file)) + '" ')
else:
subtitles_files.append("--track-name 0:und --default-track 0:no --sub-charset 0:utf-8 " + '"' + str(
os.path.realpath(sub_file)) + '" ')

@Xonshiz
Copy link
Owner

Xonshiz commented Oct 30, 2017

A friend of mine asked me to do this a few months back. It's a nice feature to have. I'll look into it and hopefully be done with it by the end of this month :)

@Xonshiz Xonshiz self-assigned this Oct 30, 2017
Xonshiz added a commit that referenced this issue Dec 27, 2017
Fix for #26
@Xonshiz
Copy link
Owner

Xonshiz commented Dec 27, 2017

Fixed the subtitle naming thing. Please open a separate issue for making the default subs. I'll be working on it side by side, will take some time.

@Xonshiz Xonshiz closed this as completed Dec 27, 2017
Xonshiz added a commit that referenced this issue Dec 27, 2017
Fix for #26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants