diff --git a/code/sum.py b/code/sum.py index a65b17f..67bd693 100644 --- a/code/sum.py +++ b/code/sum.py @@ -7,6 +7,7 @@ import sys import math import pysrt +import youtube_dl import imageio imageio.plugins.ffmpeg.download() from moviepy.editor import * @@ -102,10 +103,8 @@ def download_video(url): returns: True ''' - yt = YouTube(url) - yt.set_filename('1') - video = yt.filter('mp4')[-1] - video.download(os.getcwd()) + #This download the video and download the subtitles and convert to srt + os.system('youtube-dl -f mp4 --write-auto-sub --convert-subtitles srt ' + url) return True if __name__ == '__main__': @@ -116,12 +115,11 @@ def download_video(url): args = parser.parse_args() + #help(youtube_dl) + url = args.url if not url: get_summary(args.video_file, args.subtitles_file) else: download_video(url) - # download subtitles # proceed with general summarization - -