mirror of
https://codeberg.org/polarisfm/youtube-dl.git
synced 2024-12-25 01:01:39 +00:00
fix ffmpeg error, if youtube-dl runs more than once with --embed-thumbnail with same video
This commit is contained in:
parent
0c14e2fbe3
commit
149254d0d5
3 changed files with 7 additions and 7 deletions
|
@ -91,7 +91,7 @@ from .version import __version__
|
||||||
from .YoutubeDL import YoutubeDL
|
from .YoutubeDL import YoutubeDL
|
||||||
from .postprocessor import (
|
from .postprocessor import (
|
||||||
AtomicParsleyPP,
|
AtomicParsleyPP,
|
||||||
FFmpegMediaFixPP,
|
FFmpegAudioFixPP,
|
||||||
FFmpegMetadataPP,
|
FFmpegMetadataPP,
|
||||||
FFmpegVideoConvertor,
|
FFmpegVideoConvertor,
|
||||||
FFmpegExtractAudioPP,
|
FFmpegExtractAudioPP,
|
||||||
|
@ -808,7 +808,7 @@ def _real_main(argv=None):
|
||||||
if opts.xattrs:
|
if opts.xattrs:
|
||||||
ydl.add_post_processor(XAttrMetadataPP())
|
ydl.add_post_processor(XAttrMetadataPP())
|
||||||
if opts.embedthumbnail:
|
if opts.embedthumbnail:
|
||||||
ydl.add_post_processor(FFmpegMediaFixPP())
|
ydl.add_post_processor(FFmpegAudioFixPP())
|
||||||
ydl.add_post_processor(AtomicParsleyPP())
|
ydl.add_post_processor(AtomicParsleyPP())
|
||||||
|
|
||||||
# Update version
|
# Update version
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
|
|
||||||
from .atomicparsley import AtomicParsleyPP
|
from .atomicparsley import AtomicParsleyPP
|
||||||
from .ffmpeg import (
|
from .ffmpeg import (
|
||||||
FFmpegMediaFixPP,
|
FFmpegAudioFixPP,
|
||||||
FFmpegMergerPP,
|
FFmpegMergerPP,
|
||||||
FFmpegMetadataPP,
|
FFmpegMetadataPP,
|
||||||
FFmpegVideoConvertor,
|
FFmpegVideoConvertor,
|
||||||
|
@ -12,7 +12,7 @@ from .xattrpp import XAttrMetadataPP
|
||||||
|
|
||||||
__all__ = [
|
__all__ = [
|
||||||
'AtomicParsleyPP',
|
'AtomicParsleyPP',
|
||||||
'FFmpegMediaFixPP',
|
'FFmpegAudioFixPP',
|
||||||
'FFmpegMergerPP',
|
'FFmpegMergerPP',
|
||||||
'FFmpegMetadataPP',
|
'FFmpegMetadataPP',
|
||||||
'FFmpegVideoConvertor',
|
'FFmpegVideoConvertor',
|
||||||
|
|
|
@ -484,13 +484,13 @@ class FFmpegMergerPP(FFmpegPostProcessor):
|
||||||
return True, info
|
return True, info
|
||||||
|
|
||||||
|
|
||||||
class FFmpegMediaFixPP(FFmpegPostProcessor):
|
class FFmpegAudioFixPP(FFmpegPostProcessor):
|
||||||
def run(self, info):
|
def run(self, info):
|
||||||
filename = info['filepath']
|
filename = info['filepath']
|
||||||
temp_filename = prepend_extension(filename, 'temp')
|
temp_filename = prepend_extension(filename, 'temp')
|
||||||
|
|
||||||
options = ['-vcodec', 'copy', '-acodec', 'copy']
|
options = ['-vn', '-acodec', 'copy']
|
||||||
self._downloader.to_screen(u'[ffmpeg] Fixing media file "%s"' % filename)
|
self._downloader.to_screen(u'[ffmpeg] Fixing audio file "%s"' % filename)
|
||||||
self.run_ffmpeg(filename, temp_filename, options)
|
self.run_ffmpeg(filename, temp_filename, options)
|
||||||
|
|
||||||
os.remove(encodeFilename(filename))
|
os.remove(encodeFilename(filename))
|
||||||
|
|
Loading…
Reference in a new issue