Skip to content

Commit

Permalink
[YoutubeDL] Skip downloading if final merged file already exists
Browse files Browse the repository at this point in the history
  • Loading branch information
dstftw committed Apr 19, 2015
1 parent 0363bda commit 0730511
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion youtube_dl/YoutubeDL.py
Original file line number Diff line number Diff line change
Expand Up @@ -1390,9 +1390,15 @@ def compatible_formats(formats):
return False

requested_formats = info_dict['requested_formats']
# Merge incompatible formats into mkv
uncompatible_merge_warn = False
# Incompatible formats will be merged into mkv
if not compatible_formats(requested_formats):
filename = os.path.splitext(filename)[0] + '.mkv'
uncompatible_merge_warn = True
if os.path.exists(encodeFilename(filename)):
self.report_file_already_downloaded(filename)
return
if uncompatible_merge_warn:
self.report_warning('You have requested formats uncompatible for merge. '
'The formats will be merged into mkv')
for f in requested_formats:
Expand Down

0 comments on commit 0730511

Please sign in to comment.