mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-23 21:26:55 +01:00
[eria2c] Fix --skip-unavailable fragment
This commit is contained in:
parent
b836dc94f2
commit
fc5c8b6492
@ -115,7 +115,14 @@ def _call_downloader(self, tmpfilename, info_dict):
|
|||||||
|
|
||||||
self._debug_cmd(cmd)
|
self._debug_cmd(cmd)
|
||||||
|
|
||||||
if 'fragments' in info_dict:
|
if 'fragments' not in info_dict:
|
||||||
|
p = subprocess.Popen(
|
||||||
|
cmd, stderr=subprocess.PIPE)
|
||||||
|
_, stderr = process_communicate_or_kill(p)
|
||||||
|
if p.returncode != 0:
|
||||||
|
self.to_stderr(stderr.decode('utf-8', 'replace'))
|
||||||
|
return p.returncode
|
||||||
|
|
||||||
fragment_retries = self.params.get('fragment_retries', 0)
|
fragment_retries = self.params.get('fragment_retries', 0)
|
||||||
skip_unavailable_fragments = self.params.get('skip_unavailable_fragments', True)
|
skip_unavailable_fragments = self.params.get('skip_unavailable_fragments', True)
|
||||||
|
|
||||||
@ -157,13 +164,7 @@ def _call_downloader(self, tmpfilename, info_dict):
|
|||||||
os.remove(encodeFilename(fragment_filename))
|
os.remove(encodeFilename(fragment_filename))
|
||||||
dest.close()
|
dest.close()
|
||||||
os.remove(encodeFilename('%s.frag.urls' % tmpfilename))
|
os.remove(encodeFilename('%s.frag.urls' % tmpfilename))
|
||||||
else:
|
return 0
|
||||||
p = subprocess.Popen(
|
|
||||||
cmd, stderr=subprocess.PIPE)
|
|
||||||
_, stderr = process_communicate_or_kill(p)
|
|
||||||
if p.returncode != 0:
|
|
||||||
self.to_stderr(stderr.decode('utf-8', 'replace'))
|
|
||||||
return p.returncode
|
|
||||||
|
|
||||||
|
|
||||||
class CurlFD(ExternalFD):
|
class CurlFD(ExternalFD):
|
||||||
|
Loading…
Reference in New Issue
Block a user