To see if a video has subtitles, play the video and click the icon that resembles a box with 'CC' in the bottom right corner fo the video playback. Go to in a web browser and use the search bar at the top or other options to find a video that has subtitles. split ( '.' ) m, s = divmod ( int ( sec ), 60 ) h, m = divmod ( m, 60 ) return ")'. Step 1, Navigate to a YouTube video with subtitles. group ( 3 )) else : return None def formatSrtTime ( secTime ): """Convert a time in seconds (google's transcript) to srt time format.""" sec, micro = str ( secTime ). compile ( r'(.*)?' ) def parseLine ( text ): """Parse a subtitle.""" m = re. NB: to get google's transcript, use tihs URL: """ # srt example """1 00:00:20,672 -> 00:00:24,972 Entre l’Australia et la South America, dans l’Océan South Pacific…""" # Google's transcript example (first tags) """ This is a matter of National Security.""" import re, sys # Pattern to identify a subtitle and grab start, duration and text. Takes google's transcript filename as argument (xml extension required). #!/usr/bin/python # -*- encoding:utf-8 -*- """Translate Google's Transcript into srt file.
0 Comments
Leave a Reply. |