Compare commits

...

3 Commits

Author SHA1 Message Date
pukkandan c9abebb851
[extractor/youtube] Bypass throttling for `-f17`
and related cleanup

Thanks @AudricV for the finding
2023-03-09 22:13:03 +05:30
pukkandan 66aeaac9aa
[downloader/curl] Fix progress reporting
Bug in 8c53322cda
Closes #6490
2023-03-09 21:58:07 +05:30
Daniel Vogt 3588be59ce
[extractor/opencast] Add ltitools to `_VALID_URL` (#6371)
Authored by: C0D3D3V
2023-03-09 21:51:39 +05:30
3 changed files with 32 additions and 26 deletions

View File

@ -176,7 +176,7 @@ class ExternalFD(FragmentFD):
return 0
def _call_process(self, cmd, info_dict):
return Popen.run(cmd, text=True, stderr=subprocess.PIPE)
return Popen.run(cmd, text=True, stderr=subprocess.PIPE if self._CAPTURE_STDERR else None)
class CurlFD(ExternalFD):

View File

@ -105,10 +105,9 @@ class OpencastBaseIE(InfoExtractor):
class OpencastIE(OpencastBaseIE):
_VALID_URL = r'''(?x)
https?://(?P<host>%s)/paella/ui/watch.html\?.*?
id=(?P<id>%s)
''' % (OpencastBaseIE._INSTANCES_RE, OpencastBaseIE._UUID_RE)
_VALID_URL = rf'''(?x)
https?://(?P<host>{OpencastBaseIE._INSTANCES_RE})/paella/ui/watch\.html\?
(?:[^#]+&)?id=(?P<id>{OpencastBaseIE._UUID_RE})'''
_API_BASE = 'https://%s/search/episode.json?id=%s'
@ -123,6 +122,9 @@ class OpencastIE(OpencastBaseIE):
'thumbnail': r're:^https?://.*\.jpg$',
'timestamp': 1606208400,
'upload_date': '20201124',
'season_id': 'cf68a4a1-36b1-4a53-a6ba-61af5705a0d0',
'series': 'Kryptographie - WiSe 15/16',
'creator': 'Alexander May',
},
}
]
@ -134,10 +136,11 @@ class OpencastIE(OpencastBaseIE):
class OpencastPlaylistIE(OpencastBaseIE):
_VALID_URL = r'''(?x)
https?://(?P<host>%s)/engage/ui/index.html\?.*?
epFrom=(?P<id>%s)
''' % (OpencastBaseIE._INSTANCES_RE, OpencastBaseIE._UUID_RE)
_VALID_URL = rf'''(?x)
https?://(?P<host>{OpencastBaseIE._INSTANCES_RE})(?:
/engage/ui/index\.html\?(?:[^#]+&)?epFrom=|
/ltitools/index\.html\?(?:[^#]+&)?series=
)(?P<id>{OpencastBaseIE._UUID_RE})'''
_API_BASE = 'https://%s/search/episode.json?sid=%s'
@ -148,15 +151,23 @@ class OpencastPlaylistIE(OpencastBaseIE):
'id': 'cf68a4a1-36b1-4a53-a6ba-61af5705a0d0',
'title': 'Kryptographie - WiSe 15/16',
},
'playlist_mincount': 28,
'playlist_mincount': 29,
},
{
'url': 'https://oc-video.ruhr-uni-bochum.de/engage/ui/index.html?e=1&p=1&epFrom=b1a54262-3684-403f-9731-8e77c3766f9a',
'url': 'https://oc-video1.ruhr-uni-bochum.de/ltitools/index.html?subtool=series&series=cf68a4a1-36b1-4a53-a6ba-61af5705a0d0&lng=de',
'info_dict': {
'id': 'b1a54262-3684-403f-9731-8e77c3766f9a',
'title': 'inSTUDIES-Social movements and prefigurative politics in a global perspective',
'id': 'cf68a4a1-36b1-4a53-a6ba-61af5705a0d0',
'title': 'Kryptographie - WiSe 15/16',
},
'playlist_mincount': 6,
'playlist_mincount': 29,
},
{
'url': 'https://electures.uni-muenster.de/engage/ui/index.html?e=1&p=1&epFrom=39391d10-a711-4d23-b21d-afd2ed7d758c',
'info_dict': {
'id': '39391d10-a711-4d23-b21d-afd2ed7d758c',
'title': '021670 Theologische Themen bei Hans Blumenberg WiSe 2017/18',
},
'playlist_mincount': 13,
},
]

View File

@ -3745,13 +3745,11 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
if mime_mobj:
dct['ext'] = mimetype2ext(mime_mobj.group(1))
dct.update(parse_codecs(mime_mobj.group(2)))
no_audio = dct.get('acodec') == 'none'
no_video = dct.get('vcodec') == 'none'
if no_audio:
dct['vbr'] = tbr
if no_video:
dct['abr'] = tbr
if no_audio or no_video:
single_stream = 'none' in (dct.get('acodec'), dct.get('vcodec'))
if single_stream and dct.get('ext'):
dct['container'] = dct['ext'] + '_dash'
if single_stream or itag == '17':
CHUNK_SIZE = 10 << 20
dct.update({
'protocol': 'http_dash_segments',
@ -3760,13 +3758,10 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
'range': f'{range_start}-{min(range_start + CHUNK_SIZE - 1, dct["filesize"])}'
})
} for range_start in range(0, dct['filesize'], CHUNK_SIZE)]
} if dct['filesize'] else {
'downloader_options': {'http_chunk_size': CHUNK_SIZE} # No longer useful?
} if itag != '17' and dct['filesize'] else {
'downloader_options': {'http_chunk_size': CHUNK_SIZE}
})
if dct.get('ext'):
dct['container'] = dct['ext'] + '_dash'
if itag:
itags[itag].add(('https', dct.get('language')))
stream_ids.append(stream_id)