Skip to content

Commit

Permalink
fix: Make cmdline ARGS opt and change 'download_url' param
Browse files Browse the repository at this point in the history
- Requiring video-file and subtitle cmdline args interfere with downloading Youtube videos
- args.video_file is the incorrect parameter to be placed in 'download_url' function call at line 118
Github issue OpenGenus#1
Github issue OpenGenus#2
Github issue OpenGenus#4
  • Loading branch information
lwgray committed Oct 1, 2017
1 parent caaa533 commit 6cbaa4e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions code/sum.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ def get_summary(filename="1.mp4", subtitles="1.srt"):
return True

def download_video(url):
print url
yt = YouTube(url)
yt.set_filename('1')
video = yt.get('mp4')
Expand All @@ -104,8 +105,8 @@ def download_video(url):

if __name__ == '__main__':
parser = argparse.ArgumentParser("Watch videos quickly")
parser.add_argument('-i', '--video-file', help="Input video file", required=True)
parser.add_argument('-s', '--subtitles-file', help="Input subtitle file (srt)", required=True)
parser.add_argument('-i', '--video-file', help="Input video file")
parser.add_argument('-s', '--subtitles-file', help="Input subtitle file (srt)")
parser.add_argument('-u', '--url', help="Video url")

args = parser.parse_args()
Expand All @@ -114,7 +115,7 @@ def download_video(url):
if not url:
get_summary(args.video_file, args.subtitles_file)
else:
download_video(args.video_file)
download_video(url)
# download subtitles
# proceed with general summarization

Expand Down

0 comments on commit 6cbaa4e

Please sign in to comment.