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

IndexError: string index out of range #8

Closed
s-bhagwat opened this issue Jan 11, 2022 · 4 comments
Closed

IndexError: string index out of range #8

s-bhagwat opened this issue Jan 11, 2022 · 4 comments

Comments

@s-bhagwat
Copy link

s-bhagwat commented Jan 11, 2022

I'm getting this error -
In my subtitle file I dont have any dots (.) I think that is the problem,

This is the output

Number of frames: 103
Getting subtitles for each frame
Traceback (most recent call last):
  File "src/main.py", line 87, in <module>
    runner.run(sys.argv[1:])
  File "src/main.py", line 51, in run
    self.__run__(
  File "src/main.py", line 70, in __run__
    segments = segment_finder.get_subtitle_segments(subtitle_breaks)
  File "D:\Study\Sixth-Sem\Lecture-Video-to-PDF\src\subtitle_segment_finder.py", line 42, in get_subtitle_segments
    pos = self.__get_part_position_of_time_break__(time_break)
  File "D:\Study\Sixth-Sem\Lecture-Video-to-PDF\src\subtitle_segment_finder.py", line 122, in __get_part_position_of_time_break__
    if self.parts[right_part_index].text[right_part_char_index] == ".":
IndexError: string index out of range```
@s-bhagwat s-bhagwat reopened this Jan 11, 2022
@EKarton
Copy link
Owner

EKarton commented Jan 13, 2022

Hi @s-bhagwat thanks for letting me know about this issue. Unfortunately, I was not able to reproduce this issue with a subtitle file without periods. Could you attach a copy of the video and its subtitle file you were trying to transcribe? Thanks

@s-bhagwat
Copy link
Author

s-bhagwat commented Jan 13, 2022

https://drive.google.com/drive/folders/17DC85DsED7GeOJ-qmvlcYj5m__I4hSoF?usp=sharing

It is a youtube video with auto subs I have tested it after cutting it to 10 mins.

https://youtu.be/KN6OSdUfgyA

@EKarton
Copy link
Owner

EKarton commented Jan 15, 2022

Hi @s-bhagwat thanks for filing the bug, and for providing the video and subtitle files. I was able to reproduce the error. A PR was made and merged in to fix the error (#10).

Unfortunately, the provided subtitle file didn't generate the best PDF. I would maybe suggest using another tool to get subtitles from a youtube video. I found https://downsub.com. From their website, I was able to generate subtitles for the youtube video, and generate a PDF that looked like:

output.pdf

On the other hand, please let me know if you encounter any bugs. Thanks

@s-bhagwat
Copy link
Author

Thanks my issue is resolved !
I'm closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants