fixed bug reported in ISSUE-19
This commit is contained in:
		
							parent
							
								
									6ea4a4197e
								
							
						
					
					
						commit
						c65cf27def
					
				|  | @ -151,4 +151,5 @@ class _TranscriptParser(): | |||
|                 'duration': float(xml_element.attrib['dur']), | ||||
|             } | ||||
|             for xml_element in ElementTree.fromstring(self.plain_data) | ||||
|             if xml_element.text is not None | ||||
|         ] | ||||
|  |  | |||
|  | @ -27,7 +27,7 @@ class YouTubeTranscriptCli(): | |||
| 
 | ||||
|         return '\n\n'.join( | ||||
|             [str(YouTubeTranscriptApi.CouldNotRetrieveTranscript(video_id)) for video_id in unretrievable_videos] | ||||
|             + [json.dumps(transcripts) if parsed_args.json else pprint.pformat(transcripts)] | ||||
|             + ([json.dumps(transcripts) if parsed_args.json else pprint.pformat(transcripts)] if transcripts else []) | ||||
|         ) | ||||
| 
 | ||||
|     def _parse_args(self): | ||||
|  |  | |||
|  | @ -2,5 +2,6 @@ | |||
| <transcript> | ||||
|     <text start="0" dur="1.54">Hey, this is just a test</text> | ||||
|     <text start="1.54" dur="4.16">this is not the original transcript</text> | ||||
|     <text start="5" dur="0.5"></text> | ||||
|     <text start="5.7" dur="3.239">just something shorter, I made up for testing</text> | ||||
| </transcript> | ||||
		Loading…
	
		Reference in New Issue