mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-27 10:31:29 +00:00
parent
7e9a612585
commit
e121e3cee7
|
@ -909,7 +909,7 @@ def _webpage_read_content(self, urlh, url_or_request, video_id, note=None, errno
|
||||||
dump = base64.b64encode(webpage_bytes).decode('ascii')
|
dump = base64.b64encode(webpage_bytes).decode('ascii')
|
||||||
self._downloader.to_screen(dump)
|
self._downloader.to_screen(dump)
|
||||||
if self.get_param('write_pages'):
|
if self.get_param('write_pages'):
|
||||||
filename = self._request_dump_filename(video_id, urlh.geturl())
|
filename = self._request_dump_filename(urlh.geturl(), video_id)
|
||||||
self.to_screen(f'Saving request to {filename}')
|
self.to_screen(f'Saving request to {filename}')
|
||||||
with open(filename, 'wb') as outf:
|
with open(filename, 'wb') as outf:
|
||||||
outf.write(webpage_bytes)
|
outf.write(webpage_bytes)
|
||||||
|
@ -940,7 +940,7 @@ def _parse_json(self, json_string, video_id, transform_source=None, fatal=True,
|
||||||
if fatal:
|
if fatal:
|
||||||
raise ExtractorError(errmsg, cause=ve)
|
raise ExtractorError(errmsg, cause=ve)
|
||||||
else:
|
else:
|
||||||
self.report_warning(errmsg + str(ve))
|
self.report_warning(f'{errmsg}: {ve}')
|
||||||
|
|
||||||
def _parse_socket_response_as_json(self, data, video_id, transform_source=None, fatal=True):
|
def _parse_socket_response_as_json(self, data, video_id, transform_source=None, fatal=True):
|
||||||
return self._parse_json(
|
return self._parse_json(
|
||||||
|
|
|
@ -216,10 +216,10 @@ def get(self, url, html=None, video_id=None, note=None, note2='Executing JS on w
|
||||||
[self.exe, '--ssl-protocol=any', self._TMP_FILES['script'].name],
|
[self.exe, '--ssl-protocol=any', self._TMP_FILES['script'].name],
|
||||||
text=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
text=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||||
if returncode:
|
if returncode:
|
||||||
raise ExtractorError(f'Executing JS failed\n:{stderr}')
|
raise ExtractorError(f'Executing JS failed:\n{stderr}')
|
||||||
with open(self._TMP_FILES['html'].name, 'rb') as f:
|
with open(self._TMP_FILES['html'].name, 'rb') as f:
|
||||||
html = f.read().decode('utf-8')
|
html = f.read().decode('utf-8')
|
||||||
|
|
||||||
self._load_cookies()
|
self._load_cookies()
|
||||||
|
|
||||||
return (html, stdout)
|
return html, stdout
|
||||||
|
|
|
@ -239,7 +239,8 @@ def get_audio_codec(self, path):
|
||||||
encodeArgument('-i')]
|
encodeArgument('-i')]
|
||||||
cmd.append(encodeFilename(self._ffmpeg_filename_argument(path), True))
|
cmd.append(encodeFilename(self._ffmpeg_filename_argument(path), True))
|
||||||
self.write_debug(f'{self.basename} command line: {shell_quote(cmd)}')
|
self.write_debug(f'{self.basename} command line: {shell_quote(cmd)}')
|
||||||
stdout, stderr, returncode = Popen.run(cmd, text=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
stdout, stderr, returncode = Popen.run(
|
||||||
|
cmd, text=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||||
if returncode != (0 if self.probe_available else 1):
|
if returncode != (0 if self.probe_available else 1):
|
||||||
return None
|
return None
|
||||||
except OSError:
|
except OSError:
|
||||||
|
@ -343,7 +344,8 @@ def make_args(file, args, name, number):
|
||||||
for i, (path, opts) in enumerate(path_opts) if path)
|
for i, (path, opts) in enumerate(path_opts) if path)
|
||||||
|
|
||||||
self.write_debug('ffmpeg command line: %s' % shell_quote(cmd))
|
self.write_debug('ffmpeg command line: %s' % shell_quote(cmd))
|
||||||
stdout, stderr, returncode = Popen.run(cmd, text=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE)
|
_, stderr, returncode = Popen.run(
|
||||||
|
cmd, text=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE)
|
||||||
if returncode not in variadic(expected_retcodes):
|
if returncode not in variadic(expected_retcodes):
|
||||||
raise FFmpegPostProcessorError(stderr.strip().splitlines()[-1])
|
raise FFmpegPostProcessorError(stderr.strip().splitlines()[-1])
|
||||||
for out_path, _ in output_path_opts:
|
for out_path, _ in output_path_opts:
|
||||||
|
|
|
@ -4954,7 +4954,7 @@ def write_xattr(path, key, value):
|
||||||
try:
|
try:
|
||||||
_, stderr, returncode = Popen.run(
|
_, stderr, returncode = Popen.run(
|
||||||
[exe, '-w', key, value, path] if exe == 'xattr' else [exe, '-n', key, '-v', value, path],
|
[exe, '-w', key, value, path] if exe == 'xattr' else [exe, '-n', key, '-v', value, path],
|
||||||
stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE)
|
text=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE)
|
||||||
except OSError as e:
|
except OSError as e:
|
||||||
raise XAttrMetadataError(e.errno, e.strerror)
|
raise XAttrMetadataError(e.errno, e.strerror)
|
||||||
if returncode:
|
if returncode:
|
||||||
|
|
Loading…
Reference in a new issue