Skip to content

Commit

Permalink
# fixind moviepy bug Zulko/moviepy#864
Browse files Browse the repository at this point in the history
  • Loading branch information
ph committed Jan 25, 2019
1 parent b90e591 commit 4ed5414
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion 1_get_faces_from_yt.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,11 @@ def on_downloaded(stream, file_handle):
# clip file after downlaod
yt.register_on_complete_callback(on_downloaded)
# get first "mp4" stream as explained here: https://github.com/nficano/pytube
yt.streams.filter(subtype='mp4').first().download()
try:
yt.streams.filter(subtype='mp4').first().download()
except ProcessLookupError:
pass # process already terminated


if __name__ == "__main__":
# parse command line options
Expand Down
6 changes: 5 additions & 1 deletion 3_youtube_face_swap.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,11 @@ def on_downloaded(stream, file_handle):
# download youtube video from url
yt = YouTube(url)
yt.register_on_complete_callback(on_downloaded)
yt.streams.filter(subtype='mp4').first().download()
try:
yt.streams.filter(subtype='mp4').first().download()
except ProcessLookupError:
pass # fixind moviepy bug https://github.com/Zulko/moviepy/pull/864/


if __name__ == "__main__":
# parse command line options
Expand Down

0 comments on commit 4ed5414

Please sign in to comment.