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

VVT2SRT RE.MATCH ISSUE #112

Open
outtycast opened this issue Jul 15, 2023 · 0 comments
Open

VVT2SRT RE.MATCH ISSUE #112

outtycast opened this issue Jul 15, 2023 · 0 comments

Comments

@outtycast
Copy link

outtycast commented Jul 15, 2023

**had issue/error this part of script giving and error with the conversion:

re.error: global flags not at the start of the expression at position 63

I did a work around using ffmpeg and importing subprocess to achieve the same result. you have to add ffmpeg, ffprobe, ffplay to the main folder.**

def download_subtitles(self, subtitle='', filepath=''):
if subtitle:
filename = "%s\%s" % (filepath, subtitle.filename) if os.name == 'nt' else "%s/%s" % (
filepath, subtitle.filename)
try:
retval = subtitle.download(filepath=filepath, quiet=True)
except KeyboardInterrupt:
sys.stdout.write(fc + sd + "\n[" + fr + sb + "-" + fc + sd + "] : " + fr + sd + "User Interrupted..\n")
sys.exit(0)
else:
msg = retval.get('msg')
if msg == "download":
#self.convert(filename=filename)

                #convert to srt using ffmpeg instead of vvt2srt
                srt_name = filename.replace('.vtt', '.srt')
                try:
                    subprocess.run(['ffmpeg', '-i', filename, '-loglevel', 'quiet', '-hide_banner', '-nostats', '-y', srt_name])
                except:
                    pass
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

1 participant