Hi everybody
I have been reading and learning a lot on this forum, but this time I need help!
After ripping a dvd I noticed it has a dual language sub/idx which I converted to srt.
Now I want to split this file so I have one subtitle file for both languages.
Found this post with similar problemI tried the offered solutionCode:https://forum.videohelp.com/threads/388522-Separate-dual-language-subtitle-assBut this didn't work for me. Probably because the subtitles have a different style...The Japanese seems to be limited to lines using the "PP-OP1-RO" or "PP-ED1-RO" styles. Just delete those. E.g. in Aegisub
If someone knows how I can solve this I would very much appreciate it!
Subtitle file is attached.
Kind regards
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays!
+ Reply to Thread
Results 1 to 4 of 4
Thread
-
-
FR.srt
EN.srt
There must be a smarter way than this but I don't know it.
Code:import re def parse_srt_file(file_path): with open(file_path, 'r', encoding='utf-8-sig') as file: srt_content = file.read() subtitle_blocks = re.split(r'\n\n', srt_content) subtitles = [] for block in subtitle_blocks: lines = block.strip().split('\n') index = int(lines[0]) time_interval = lines[1] dialogue_content = tuple(lines[2:]) subtitles.append((index, time_interval, dialogue_content)) return subtitles def process_and_write_subtitles(subtitles_list): with open('FR.srt', 'w', encoding='utf-8') as fr_file, open('EN.srt', 'w', encoding='utf-8') as en_file: for index, time_interval, dialogue_content in subtitles_list: fr_file.write(f"{index}\n{time_interval}\n{dialogue_content[0]}\n\n") en_file.write(f"{index}\n{time_interval}\n{dialogue_content[len(dialogue_content) // 2]}\n\n") process_and_write_subtitles(parse_srt_file('FR-ENG.srt'))
--[----->+<]>.++++++++++++.---.--------.
[*drm mass downloader: widefrog*]~~~[*how to make your own mass downloader: guide*] -
-
That's a Python script. You execute it using Python. You shouldn't bother with it though. I just added it to prove that it can be done. The script may fail for other cases since I've written it only using your fr-eng srt as a reference. I added the split subtitles as attachments.
--[----->+<]>.++++++++++++.---.--------.
[*drm mass downloader: widefrog*]~~~[*how to make your own mass downloader: guide*]
Similar Threads
-
How to add the name of the subtitle language in multiple episodes at once?
By sloke123 in forum EditingReplies: 0Last Post: 10th Jul 2022, 01:52 -
Split a line into two using Subtitle Edit
By loninappleton in forum SubtitleReplies: 32Last Post: 6th Feb 2022, 23:59 -
Media Player Classic - HC ignores audio/subtitle language preference
By Gurenn in forum Software PlayingReplies: 2Last Post: 15th Mar 2021, 15:13 -
How to bulk remove "style" (or dual language subtitle for that matter)
By shadiow in forum SubtitleReplies: 1Last Post: 4th Sep 2020, 13:20 -
one audio language option vanished, in a dual audio track IN VLC mdia plyr
By jraju in forum Newbie / General discussionsReplies: 0Last Post: 28th Dec 2019, 07:43