mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-07-26 23:28:29 +00:00
Apply suggestions from code review
Co-authored-by: bashonly <88596187+bashonly@users.noreply.github.com>
This commit is contained in:
parent
5249b8ab4a
commit
307e5b3606
@ -51,12 +51,12 @@ def _real_extract(self, url):
|
|||||||
if format_url:
|
if format_url:
|
||||||
urlh = self._request_webpage(
|
urlh = self._request_webpage(
|
||||||
HEADRequest(format_url), event_id, fatal=False, note='Checking stream')
|
HEADRequest(format_url), event_id, fatal=False, note='Checking stream')
|
||||||
if not urlh or urlh.status != 200:
|
if urlh and urlh.status == 200:
|
||||||
ext = urlhandle_detect_ext(urlh)
|
ext = urlhandle_detect_ext(urlh)
|
||||||
if ext == 'octet-stream':
|
if ext == 'octet-stream':
|
||||||
self.report_warning(
|
self.report_warning(
|
||||||
'The server did not return a valid file extension for the stream URL, '
|
'The server did not return a valid file extension for the stream URL. '
|
||||||
'defaulting to "mp3". Please ensure that the downloaded audio is actually mp3.')
|
'Assuming an mp3 stream; postprocessing may fail if this is incorrect')
|
||||||
ext = 'mp3'
|
ext = 'mp3'
|
||||||
formats.append({
|
formats.append({
|
||||||
'url': format_url,
|
'url': format_url,
|
||||||
@ -116,7 +116,6 @@ def _real_extract(self, url):
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
'id': recording_id,
|
'id': recording_id,
|
||||||
'is_live': False,
|
|
||||||
**traverse_obj(recording_info, ('data', 'attributes', {
|
**traverse_obj(recording_info, ('data', 'attributes', {
|
||||||
'ext': ('file_format', {str}),
|
'ext': ('file_format', {str}),
|
||||||
'url': ('url', {url_or_none}),
|
'url': ('url', {url_or_none}),
|
||||||
|
Loading…
Reference in New Issue
Block a user