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

Script enchanment #18

Open
alzamer2 opened this issue Nov 23, 2019 · 10 comments
Open

Script enchanment #18

alzamer2 opened this issue Nov 23, 2019 · 10 comments
Labels
enhancement New feature or request

Comments

@alzamer2
Copy link
Owner

alzamer2 commented Nov 23, 2019

I opened this issue so others can give Suggestions and ideas to improve this code
and i will use these ideas to make to-do-list for future development

To-Do-List:

1-[ ] compile error msg that explain why code failed to download, which include: region lock, need a premium account...etc
2-[ * ] update setting code so it can import old setting without raising an error
3-[ * ] add the position of the download folder in the settings
4-[ * ] Separate executable bins into x86/x64
5-[ ] adding download all dub audio option

legend:

[ ] idea accepted and will work at it in future
[x] working at the idea at the moment
[*] idea was embeded into the code

let's make this code better

@alzamer2 alzamer2 added the enhancement New feature or request label Nov 23, 2019
@darkhelmet2016
Copy link

Get an error when trying to update.

trying to close Crunchyroll-XML-Decoder-py3.......
Press any key to continue . . . Traceback (most recent call last):
File ".\crunchy-xml-decoder\updater.py", line 80, in
run_update()
File ".\crunchy-xml-decoder\updater.py", line 67, in run_update
wget.download('https://github.com/alzamer2/Crunchyroll-XML-Decoder-py3/archi
ve/master.zip',os.path.abspath(os.path.join(code_dir__,'update.zip')))
File "C:\Users\Owner\AppData\Local\Programs\Python\Python37-32\lib\site-packag
es\wget.py", line 526, in download
(tmpfile, headers) = ulib.urlretrieve(binurl, tmpfile, callback)
File "C:\Users\Owner\AppData\Local\Programs\Python\Python37-32\lib\urllib\requ
est.py", line 257, in urlretrieve
tfp = open(filename, 'wb')
FileNotFoundError: [Errno 2] No such file or directory: 'C:\Users\Public\Crun
chyroll-XML-Decoder_link\update.zipe8ntpeb7.tmp'

@alzamer2
Copy link
Owner Author

Lol this issue is for new idea not for problems
But I will look into this update problem
Plz post in #16 in future for 1.3 problems or open new issue

@fixx1983
Copy link

Can you add the position of the download folder in the settings?

@alzamer2
Copy link
Owner Author

first sorry for delay @fixx1983
secend sure i will ad then in future to-do-list pf the code

@darkhelmet2016
Copy link

Is there anyway to have an option in the settings.ini to change the audio language? All files output as Japanese when merged and some shows have more than one language.

https://www.crunchyroll.com/mob-psycho-100

@alzamer2
Copy link
Owner Author

@darkhelmet2016 there is option in setting that let the batch download catch dub audio links.
i plan in future to add option that let you chose which way to download
and after selection dash option you will be able to download all audio for that episode
i did not embed this idea before because hls method cant download audio only and i need to download both video and audio at same time like this example:
HLS
1 episode = 100mb (90mb video + 10mb audio)
need to download 200mb (100mb jap +100mb eng) to get 110mb episode with both audio (90mb video + 10mb jap audio +10mb eng audio)
DASH
1 episode = 100mb (90mb video + 10mb audio)
need to download only 110mb (90mb video + 10mb jap audio +10mb eng audio) because in dash audio and video downloaded separately
ps: these numbers are only for ref and to make Comparative easier , as some episode can reach 1GB in high resolution

@darkhelmet2016
Copy link

That is not exactly what mean. During the output muxing in to mkv it writes the flags for the video/audio/subs language. The py scrip by default sets the output for Japanese but it allows it to set the sub file based on which sub language you use and the iso codes for each language. Can a similar scrip that you use for the defalult subs also be made for the default langage flag in mkv merge is what is asking. Yes you can do it all manually by installing mkv merge but then you would have to batch edit each show in mkv merge to change the audio language to the one you want. Or change it in the py scrip but then you would need a py for each language. Video: MPEG4 Video (H264) 848x480 (853:480) 23.976fps [V: Japanese [jpn] (h264 main L3.1, yuv420p, 848x480) [default]]
Audio: AAC 44100Hz stereo [A: Japanese [jpn] (aac lc, 44100 Hz, stereo) [default]]
Subtitle: Advanced SubStation Alpha [S: English (US) [eng] (ass) [default,forced]]
Subtitle: UTF-8 [S: No subtitles] Is the default for all shows except for subtitle which can be changed based off of what settings are used in the ini.

cmd = [mkvmerge, "-o", os.path.abspath(filename_output), '--language', '0:jpn', '--language', '1:jpn',
'-a', '1', '-d', '0', os.path.abspath(os.path.join(working_dir, file)), '--title', working_name]

lang_iso = {'English': 'English (US)', u'Español' : u'Espa\xf1ol', u'Español (Espana)': u'Espa\xf1ol (Espa\xf1a)',
u'Français (France)': u'Fran\xe7ais (France)', u'Português (Brasil)': u'Portugu\xeas (Brasil)',
u'Italiano': 'Italiano', u'Deutsch': 'Deutsch', u'العربية': 'العربية', u'Русский': 'Русский',
u'Türkçe': 'uTürkçe'}
defult_lang_sub = ''
for file in os.listdir(working_dir):
if file.startswith(working_name) and file.endswith(".ass"):
#print(re.findall(r'][(.)]',file)[0], lang_iso[lang1], lang_iso[lang2], defult_lang_sub)
if re.findall(r'][(.
)]',file)[0] == lang_iso[config_['language']]:
defult_lang_sub = re.findall(r'][(.)]',file)[0]
if defult_lang_sub == '':
if re.findall(r'][(.
)]', file)[0] == lang_iso[config_['language2']]:
defult_lang_sub = re.findall(r'][(.*)]', file)[0]
#print(defult_lang_sub)
for file in os.listdir(working_dir):
if file.startswith(working_name) and file.endswith(".m4a"):
cmd += ['--language', '0:jpn',
'--default-track', '0:yes',
'--forced-track', '0:yes',
os.path.abspath(os.path.join(working_dir, file))]

@alzamer2
Copy link
Owner Author

ohh you meant you want the script to identified the audio iso language and flag it correctly in mkv?

@darkhelmet2016
Copy link

Yes. I understand you are still working on the other part you mentioned but you can still add shows manually to the queue in the language you want but the scrip will still have the iso flag as Japanese even if you are downloading the English dub for Mob Psycho by manually adding all the English dub links. cmd = [mkvmerge, "-o", os.path.abspath(filename_output), '--language', '0:jpn', '--language', '1:jpn', needs to be changed in a way if possible to have it where it can change the flag to to like English, Spanish, German or whatever other dubs a show may provide. You already have a way to do this with the subs just not the audio iso language flag.

@alzamer2
Copy link
Owner Author

When I wrote this part of code, I did not consider that audio has other languages than Japanese.
That why I wrote it this way
As for editing, sure I will include it in next update, as the code don't need this change to work its low priority

@alzamer2 alzamer2 pinned this issue Nov 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants