Crunchyroll-XML-Decoder-py3 icon indicating copy to clipboard operation
Crunchyroll-XML-Decoder-py3 copied to clipboard

Script enchanment

Open alzamer2 opened this issue 5 years ago • 10 comments

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 avatar Nov 23 '19 23:11 alzamer2

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'

darkhelmet2016 avatar Nov 26 '19 01:11 darkhelmet2016

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

alzamer2 avatar Nov 26 '19 04:11 alzamer2

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

fixx1983 avatar Dec 11 '19 21:12 fixx1983

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

alzamer2 avatar Dec 20 '19 22:12 alzamer2

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

darkhelmet2016 avatar Feb 12 '20 04:02 darkhelmet2016

@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

alzamer2 avatar Feb 12 '20 07:02 alzamer2

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))]

darkhelmet2016 avatar Feb 12 '20 12:02 darkhelmet2016

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

alzamer2 avatar Feb 12 '20 14:02 alzamer2

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.

darkhelmet2016 avatar Feb 12 '20 23:02 darkhelmet2016

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 avatar Feb 13 '20 06:02 alzamer2