before_code stringlengths 14 465k | reviewer_comment stringlengths 16 64.5k | after_code stringlengths 9 467k | diff_context stringlengths 0 97k | file_path stringlengths 5 226 | comment_line int32 0 26 | language stringclasses 37
values | quality_score float32 0.07 1 | comment_type stringclasses 9
values | comment_length int32 16 64.5k | before_lines int32 1 17.2k | after_lines int32 1 12.1k | is_negative bool 2
classes | pr_title stringlengths 1 308 | pr_number int32 1 299k | repo_name stringclasses 533
values | repo_stars int64 321 419k | repo_language stringclasses 27
values | reviewer_username stringlengths 0 39 | author_username stringlengths 2 39 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
'genres': ['Keyboard', 'Sonata (Keyboard)'],
'track': 'I. Adagio sostenuto',
'timestamp': 1518076337,
'upload_date': '20180208',
},
}]
def _real_extract(self, url):
track_id = self._match_id(url)
track_info = self._download_json(
... | Very minor thing, lets set the `vcodec` to `'none'` so yt-dlp knows it's audio only.
```suggestion
'ext': 'mp3',
'vcodec': 'none',
``` | 'artists': [],
'genres': ['Keyboard', 'Sonata (Keyboard)'],
'track': 'I. Adagio sostenuto',
'timestamp': 1518076337,
'upload_date': '20180208',
},
}]
def _real_extract(self, url):
track_id = self._match_id(url)
track_info = sel... | @@ -0,0 +1,259 @@
+from .common import InfoExtractor
+from ..utils import int_or_none, traverse_obj, unified_timestamp, url_or_none
+
+
+class IdagioTrackIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?app\.idagio\.com/recordings/[0-9]+\?trackId=(?P<id>[0-9]+)(&[a-zA-Z0-9_-]+=[a-zA-Z0-9_-]+)*'
+ _TESTS = [... | yt_dlp/extractor/idagio.py | 26 | Python | 0.714 | suggestion | 162 | 51 | 51 | false | [ie/idagio] Add extractors | 14,586 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | robin-mu |
f'https://api.idagio.com/v1.8/content/track/{track_id}', track_id,
query={
'quality': '0',
'format': '2',
'client_type': 'web-4',
})
return {
'ext': 'mp3',
'id': track_id,
'url': traverse_obj... | ```suggestion
_VALID_URL = r'https?://(?:www\.)?app\.idagio\.com/recordings/(?P<id>\d+)(?![^#]*[&?]trackId=\d+)'
``` | if traverse_obj(track_info, 'error_code') == 'idagio.error.blocked.location':
self.raise_geo_restricted()
content_info = self._download_json(
f'https://api.idagio.com/v1.8/content/track/{track_id}', track_id,
query={
'quality': '0',
'f... | @@ -0,0 +1,259 @@
+from .common import InfoExtractor
+from ..utils import int_or_none, traverse_obj, unified_timestamp, url_or_none
+
+
+class IdagioTrackIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?app\.idagio\.com/recordings/[0-9]+\?trackId=(?P<id>[0-9]+)(&[a-zA-Z0-9_-]+=[a-zA-Z0-9_-]+)*'
+ _TESTS = [... | yt_dlp/extractor/idagio.py | 26 | Python | 0.714 | suggestion | 122 | 51 | 51 | false | [ie/idagio] Add extractors | 14,586 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | robin-mu |
})),
}
class IdagioRecordingIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?app\.idagio\.com/recordings/(?P<id>[0-9]+)($|\?(?!trackId=[0-9]+))'
_TESTS = [{
'url': 'https://app.idagio.com/recordings/30576934',
'info_dict': {
'id': '30576934',
'ti... | If the recording info is mandatory, we can make this fatal
```suggestion
recording_id = self._match_id(url)
recording_info = self._download_json(
f'https://api.idagio.com/v2.0/metadata/recordings/{recording_id}',
recording_id)['result']
``` | 'duration': ('duration', {int_or_none}),
'track': ('piece', 'title', {str}),
'artists': ('recording', ('conductor', ('ensembles', ...), ('soloists', ...)), 'name', {str}, filter),
'composers': ('piece', 'workpart', 'work', 'composer', 'name', {str}, filter... | @@ -0,0 +1,259 @@
+from .common import InfoExtractor
+from ..utils import int_or_none, traverse_obj, unified_timestamp, url_or_none
+
+
+class IdagioTrackIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?app\.idagio\.com/recordings/[0-9]+\?trackId=(?P<id>[0-9]+)(&[a-zA-Z0-9_-]+=[a-zA-Z0-9_-]+)*'
+ _TESTS = [... | yt_dlp/extractor/idagio.py | 26 | Python | 0.786 | suggestion | 286 | 51 | 51 | false | [ie/idagio] Add extractors | 14,586 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | robin-mu |
_VALID_URL = r'https?://(?:www\.)?app\.idagio\.com/recordings/(?P<id>[0-9]+)($|\?(?!trackId=[0-9]+))'
_TESTS = [{
'url': 'https://app.idagio.com/recordings/30576934',
'info_dict': {
'id': '30576934',
'title': 'Variations on an Original Theme op. 36',
'composer... | Is multi_video really the correct type here? This is intended for cases where a video was uploaded as two parts on a streaming site. By default, yt-dlp will concatenate multi videos. | })),
}
class IdagioPlaylistBaseIE(InfoExtractor):
"""Subclasses must set _API_URL_TMPL and define _parse_playlist_metadata"""
_PLAYLIST_ID_KEY = 'id' # vs. 'display_id'
def _entries(self, playlist_info):
for track_data in traverse_obj(playlist_info, ('tracks', lambda _, v: v[... | @@ -0,0 +1,259 @@
+from .common import InfoExtractor
+from ..utils import int_or_none, traverse_obj, unified_timestamp, url_or_none
+
+
+class IdagioTrackIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?app\.idagio\.com/recordings/[0-9]+\?trackId=(?P<id>[0-9]+)(&[a-zA-Z0-9_-]+=[a-zA-Z0-9_-]+)*'
+ _TESTS = [... | yt_dlp/extractor/idagio.py | 26 | Python | 0.5 | suggestion | 182 | 51 | 51 | false | [ie/idagio] Add extractors | 14,586 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | robin-mu |
'composers': ['Edward Elgar'],
'artists': ['Vasily Petrenko', 'Royal Liverpool Philharmonic Orchestra'],
'genres': ['Orchestral', 'Other Orchestral Music'],
'timestamp': 1554474370,
'modified_timestamp': 1554474370,
'modified_date': '20190405',
... | If we just enumerate, I would leave this info out and instead rely on `playlist_index`. With that, we could simplify to:
```suggestion
**traverse_obj(recording_info, {
'entries': ('tracks', ..., 'id', {int}, {construct_track_url}),
``` | _PLAYLIST_ID_KEY = 'id' # vs. 'display_id'
def _entries(self, playlist_info):
for track_data in traverse_obj(playlist_info, ('tracks', lambda _, v: v['id'] and v['recording']['id'])):
track_id = track_data['id']
recording_id = track_data['recording']['id']
yield sel... | @@ -0,0 +1,259 @@
+from .common import InfoExtractor
+from ..utils import int_or_none, traverse_obj, unified_timestamp, url_or_none
+
+
+class IdagioTrackIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?app\.idagio\.com/recordings/[0-9]+\?trackId=(?P<id>[0-9]+)(&[a-zA-Z0-9_-]+=[a-zA-Z0-9_-]+)*'
+ _TESTS = [... | yt_dlp/extractor/idagio.py | 26 | Python | 0.857 | refactor | 267 | 51 | 51 | false | [ie/idagio] Add extractors | 14,586 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | robin-mu |
class IdagioRecordingIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?app\.idagio\.com/recordings/(?P<id>[0-9]+)($|\?(?!trackId=[0-9]+))'
_TESTS = [{
'url': 'https://app.idagio.com/recordings/30576934',
'info_dict': {
'id': '30576934',
'title': 'Variations on an Ori... | And define
```suggestion
def construct_track_url(track_id):
return self.url_result(
f'https://app.idagio.com/recordings/{recording_id}?trackId={track_id}',
ie=IdagioTrackIE, video_id=track_id)
``` | 'artists': ('recording', ('conductor', ('ensembles', ...), ('soloists', ...)), 'name', {str}, filter),
'composers': ('piece', 'workpart', 'work', 'composer', 'name', {str}, filter, all, filter),
'genres': ('piece', 'workpart', 'work', ('genre', 'subgenre'), 'title', {str}... | @@ -0,0 +1,259 @@
+from .common import InfoExtractor
+from ..utils import int_or_none, traverse_obj, unified_timestamp, url_or_none
+
+
+class IdagioTrackIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?app\.idagio\.com/recordings/[0-9]+\?trackId=(?P<id>[0-9]+)(&[a-zA-Z0-9_-]+=[a-zA-Z0-9_-]+)*'
+ _TESTS = [... | yt_dlp/extractor/idagio.py | 26 | Python | 0.786 | suggestion | 254 | 51 | 51 | false | [ie/idagio] Add extractors | 14,586 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | robin-mu |
recording_id).get('result')
track_ids: list[int] = traverse_obj(recording_info, ('tracks', ..., 'id'))
return {
'_type': 'multi_video',
'ext': 'mp3',
'id': recording_id,
'entries': [self.url_result(f'htt... | ```suggestion
_VALID_URL = r'https?://(?:www\.)?app\.idagio\.com/albums/(?P<id>[\w-]+)'
``` |
return {
'_type': 'playlist',
self._PLAYLIST_ID_KEY: playlist_id,
'entries': self._entries(playlist_info),
**self._parse_playlist_metadata(playlist_info),
}
class IdagioRecordingIE(IdagioPlaylistBaseIE):
_VALID_URL = r'https?://(?:www\.)?app\.idagio... | @@ -0,0 +1,259 @@
+from .common import InfoExtractor
+from ..utils import int_or_none, traverse_obj, unified_timestamp, url_or_none
+
+
+class IdagioTrackIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?app\.idagio\.com/recordings/[0-9]+\?trackId=(?P<id>[0-9]+)(&[a-zA-Z0-9_-]+=[a-zA-Z0-9_-]+)*'
+ _TESTS = [... | yt_dlp/extractor/idagio.py | 26 | Python | 0.571 | suggestion | 97 | 51 | 51 | false | [ie/idagio] Add extractors | 14,586 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | robin-mu |
track_id = self._match_id(url)
track_info = self._download_json(
f'https://api.idagio.com/v2.0/metadata/tracks/{track_id}', track_id, fatal=False)
content_info = self._download_json(
f'https://api.idagio.com/v1.8/content/track/{track_id}', track_id,
query={
... | ```suggestion
'artists': ('recording', ('conductor', ('ensembles', ...), ('soloists', ...)), 'name', {str}, filter),
'composers': ('piece', 'workpart', 'work', 'composer', 'name', {str}, filter, all, filter),
'genres': ('piece', 'workpart', 'work', ('genre', 'subgenre'... | def _real_extract(self, url):
track_id = self._match_id(url)
track_info = self._download_json(
f'https://api.idagio.com/v2.0/metadata/tracks/{track_id}',
track_id, fatal=False, expected_status=406)
if traverse_obj(track_info, 'error_code') == 'idagio.error.blocked.loc... | @@ -0,0 +1,264 @@
+from .common import InfoExtractor
+from ..utils import int_or_none, traverse_obj, unified_timestamp, url_or_none
+
+
+class IdagioTrackIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?app\.idagio\.com/recordings/\d+\?(?:[^#]+&)?trackId=(?P<id>\d+)'
+ _TESTS = [{
+ 'url': 'https://a... | yt_dlp/extractor/idagio.py | 26 | Python | 0.786 | suggestion | 352 | 51 | 51 | false | [ie/idagio] Add extractors | 14,586 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | robin-mu |
})),
}
class IdagioRecordingIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?app\.idagio\.com/recordings/(?P<id>\d+)(?![^#]*[&?]trackId=\d+)'
_TESTS = [{
'url': 'https://app.idagio.com/recordings/30576934',
'info_dict': {
'id': '30576934',
'title... | ```suggestion
recording_info = self._download_json(
f'https://api.idagio.com/v2.0/metadata/recordings/{recording_id}', recording_id)['result']
``` | 'track': ('piece', 'title', {str}),
'artists': ('recording', ('conductor', ('ensembles', ...), ('soloists', ...)), 'name', {str}, filter),
'composers': ('piece', 'workpart', 'work', 'composer', 'name', {str}, filter, all, filter),
'genres': ('piece', 'work... | @@ -0,0 +1,264 @@
+from .common import InfoExtractor
+from ..utils import int_or_none, traverse_obj, unified_timestamp, url_or_none
+
+
+class IdagioTrackIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?app\.idagio\.com/recordings/\d+\?(?:[^#]+&)?trackId=(?P<id>\d+)'
+ _TESTS = [{
+ 'url': 'https://a... | yt_dlp/extractor/idagio.py | 26 | Python | 0.714 | suggestion | 169 | 51 | 51 | false | [ie/idagio] Add extractors | 14,586 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | robin-mu |
'creators': ('curator', 'name', {str}, all),
}),
}
class IdagioPersonalPlaylistIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?app\.idagio\.com/playlists/personal/(?P<id>[\da-f-]+)'
_TESTS = [{
'url': 'https://app.idagio.com/playlists/personal/99dad72e-7b3a-45a... | ```suggestion
playlist_info = self._download_json(
f'https://api.idagio.com/v1.0/personal-playlists/{playlist_id}', playlist_id)['result']
``` | from .common import InfoExtractor
from ..utils import int_or_none, unified_timestamp, url_or_none
from ..utils.traversal import traverse_obj
class IdagioTrackIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?app\.idagio\.com/recordings/\d+\?(?:[^#]+&)?trackId=(?P<id>\d+)'
_TESTS = [{
'url': 'https:... | @@ -0,0 +1,264 @@
+from .common import InfoExtractor
+from ..utils import int_or_none, traverse_obj, unified_timestamp, url_or_none
+
+
+class IdagioTrackIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?app\.idagio\.com/recordings/\d+\?(?:[^#]+&)?trackId=(?P<id>\d+)'
+ _TESTS = [{
+ 'url': 'https://a... | yt_dlp/extractor/idagio.py | 26 | Python | 0.714 | suggestion | 165 | 48 | 234 | false | [ie/idagio] Add extractors | 14,586 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | robin-mu |
'description': ('description', {str}),
'artists': ('participants', ..., 'name', {str}, all),
'tags': ('tags', ..., {str}),
}),
}
class IdagioPlaylistIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?app\.idagio\.com/playlists/(?!personal/)(?P<... | ```suggestion
playlist_info = self._download_json(
f'https://api.idagio.com/v2.0/playlists/{playlist_display_id}', playlist_display_id)['result']
``` | 'thumbnail': ('imageUrl', {url_or_none}),
'description': ('description', {str}),
'artists': ('participants', ..., 'name', {str}),
'tags': ('tags', ..., {str}),
})
class IdagioPlaylistIE(IdagioPlaylistBaseIE):
_VALID_URL = r'https?://(?:www\.)?app\.idagio\.co... | @@ -0,0 +1,264 @@
+from .common import InfoExtractor
+from ..utils import int_or_none, traverse_obj, unified_timestamp, url_or_none
+
+
+class IdagioTrackIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?app\.idagio\.com/recordings/\d+\?(?:[^#]+&)?trackId=(?P<id>\d+)'
+ _TESTS = [{
+ 'url': 'https://a... | yt_dlp/extractor/idagio.py | 26 | Python | 0.714 | suggestion | 172 | 51 | 51 | false | [ie/idagio] Add extractors | 14,586 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | robin-mu |
'modified_timestamp': 1562566559.0,
'modified_date': '20190708',
},
'playlist_count': 19,
}, {
'url': 'https://app.idagio.com/albums/brahms-ein-deutsches-requiem-3B403DF6-62D7-4A42-807B-47173F3E0192',
'info_dict': {
'id': '2862ad4e-4a61-45ad-9ce4-7... | ```suggestion
album_info = self._download_json(
f'https://api.idagio.com/v2.0/metadata/albums/{album_display_id}', album_display_id)['result']
``` |
class IdagioAlbumIE(IdagioPlaylistBaseIE):
_VALID_URL = r'https?://(?:www\.)?app\.idagio\.com/albums/(?P<id>[\w-]+)'
_TESTS = [{
'url': 'https://app.idagio.com/albums/elgar-enigma-variations-in-the-south-serenade-for-strings',
'info_dict': {
'id': 'a9f139b8-f70d-4b8a-a9a4-5fe8d35ea... | @@ -0,0 +1,264 @@
+from .common import InfoExtractor
+from ..utils import int_or_none, traverse_obj, unified_timestamp, url_or_none
+
+
+class IdagioTrackIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?app\.idagio\.com/recordings/\d+\?(?:[^#]+&)?trackId=(?P<id>\d+)'
+ _TESTS = [{
+ 'url': 'https://a... | yt_dlp/extractor/idagio.py | 26 | Python | 0.714 | suggestion | 169 | 51 | 51 | false | [ie/idagio] Add extractors | 14,586 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | robin-mu |
'url': 'https://app.idagio.com/albums/brahms-ein-deutsches-requiem-3B403DF6-62D7-4A42-807B-47173F3E0192',
'info_dict': {
'id': '2862ad4e-4a61-45ad-9ce4-7fcf0c2626fe',
'display_id': 'brahms-ein-deutsches-requiem-3B403DF6-62D7-4A42-807B-47173F3E0192',
'title': 'Brahms: ... | this is duplicated in each of the playlist extractors
have you considered a baseclass? and each subclass could just define a `_extract_playlist_metadata` method | 'url': 'https://app.idagio.com/albums/elgar-enigma-variations-in-the-south-serenade-for-strings',
'info_dict': {
'id': 'a9f139b8-f70d-4b8a-a9a4-5fe8d35eaf9c',
'display_id': 'elgar-enigma-variations-in-the-south-serenade-for-strings',
'title': 'Elgar: Enigma Variations... | @@ -0,0 +1,264 @@
+from .common import InfoExtractor
+from ..utils import int_or_none, traverse_obj, unified_timestamp, url_or_none
+
+
+class IdagioTrackIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?app\.idagio\.com/recordings/\d+\?(?:[^#]+&)?trackId=(?P<id>\d+)'
+ _TESTS = [{
+ 'url': 'https://a... | yt_dlp/extractor/idagio.py | 26 | Python | 0.571 | refactor | 163 | 51 | 51 | false | [ie/idagio] Add extractors | 14,586 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | robin-mu |
'id': '2862ad4e-4a61-45ad-9ce4-7fcf0c2626fe',
'display_id': 'brahms-ein-deutsches-requiem-3B403DF6-62D7-4A42-807B-47173F3E0192',
'title': 'Brahms: Ein deutsches Requiem',
'description': '',
'thumbnail': 'https://idagio-images.global.ssl.fastly.net/albums/31490... | ```suggestion
'artists': ('participants', ..., 'name', {str}),
``` | 'id': '2862ad4e-4a61-45ad-9ce4-7fcf0c2626fe',
'display_id': 'brahms-ein-deutsches-requiem-3B403DF6-62D7-4A42-807B-47173F3E0192',
'title': 'Brahms: Ein deutsches Requiem',
'description': '',
'thumbnail': 'https://idagio-images.global.ssl.fastly.net/albums/31490... | @@ -0,0 +1,233 @@
+from .common import InfoExtractor
+from ..utils import int_or_none, unified_timestamp, url_or_none
+from ..utils.traversal import traverse_obj
+
+
+class IdagioTrackIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?app\.idagio\.com/recordings/\d+\?(?:[^#]+&)?trackId=(?P<id>\d+)'
+ _TESTS =... | yt_dlp/extractor/idagio.py | 26 | Python | 0.571 | suggestion | 80 | 51 | 51 | false | [ie/idagio] Add extractors | 14,586 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | robin-mu |
class IdagioRecordingIE(IdagioPlaylistBaseIE):
_VALID_URL = r'https?://(?:www\.)?app\.idagio\.com/recordings/(?P<id>\d+)(?![^#]*[&?]trackId=\d+)'
_TESTS = [{
'url': 'https://app.idagio.com/recordings/30576934',
'info_dict': {
'id': '30576934',
'title': 'Variations on an O... | ```suggestion
'artists': (('conductor', ('ensembles', ...), ('soloists', ...)), 'name', {str}),
``` | class IdagioRecordingIE(IdagioPlaylistBaseIE):
_VALID_URL = r'https?://(?:www\.)?app\.idagio\.com/recordings/(?P<id>\d+)(?![^#]*[&?]trackId=\d+)'
_TESTS = [{
'url': 'https://app.idagio.com/recordings/30576934',
'info_dict': {
'id': '30576934',
'title': 'Variations on an O... | @@ -0,0 +1,233 @@
+from .common import InfoExtractor
+from ..utils import int_or_none, unified_timestamp, url_or_none
+from ..utils.traversal import traverse_obj
+
+
+class IdagioTrackIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?app\.idagio\.com/recordings/\d+\?(?:[^#]+&)?trackId=(?P<id>\d+)'
+ _TESTS =... | yt_dlp/extractor/idagio.py | 26 | Python | 0.714 | suggestion | 113 | 51 | 51 | false | [ie/idagio] Add extractors | 14,586 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | robin-mu |
_TESTS = [{
'url': 'https://app.idagio.com/recordings/30576934',
'info_dict': {
'id': '30576934',
'title': 'Variations on an Original Theme op. 36',
'composers': ['Edward Elgar'],
'artists': ['Vasily Petrenko', 'Royal Liverpool Philharmonic Orchestra']... | ```suggestion
'genres': ('work', ('genre', 'subgenre'), 'title', {str}),
``` | _TESTS = [{
'url': 'https://app.idagio.com/recordings/30576934',
'info_dict': {
'id': '30576934',
'title': 'Variations on an Original Theme op. 36',
'composers': ['Edward Elgar'],
'artists': ['Vasily Petrenko', 'Royal Liverpool Philharmonic Orchestra']... | @@ -0,0 +1,233 @@
+from .common import InfoExtractor
+from ..utils import int_or_none, unified_timestamp, url_or_none
+from ..utils.traversal import traverse_obj
+
+
+class IdagioTrackIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?app\.idagio\.com/recordings/\d+\?(?:[^#]+&)?trackId=(?P<id>\d+)'
+ _TESTS =... | yt_dlp/extractor/idagio.py | 26 | Python | 0.571 | suggestion | 90 | 51 | 51 | false | [ie/idagio] Add extractors | 14,586 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | robin-mu |
'fragments': [{
'url': url.replace('$M', str(j)),
'duration': min(fragment_duration, duration - (j * fragment_duration)),
} for j in range(math.ceil(fragment_count))],
}
def _download_initial_webpage(self, webpage_url, webpage_clie... | why the pointless parentheses? and the `[]` arg is incorrect
```suggestion
for slot_renderer in traverse_obj(ad_slot_lists, ('adSlots', ..., 'adSlotRenderer', {dict})):
``` | ('errorScreen', 'playerLegacyDesktopYpcTrailerRenderer', 'trailerVideoId'),
expected_type=str)
if trailer_video_id:
return self.url_result(
trailer_video_id, self.ie_key(), trailer_video_id)
search_meta = ((lambda x: self._html_search_meta(x, webpage,... | @@ -3783,6 +3784,21 @@ def _download_initial_webpage(self, webpage_url, webpage_client, video_id):
}))
return webpage
+ def _get_preroll_length(self, ad_slot_lists):
+ for ad_slot in traverse_obj(ad_slot_lists, ('adSlots'), []):
+ slot_renderer = traverse_obj(ad_slot, ('... | yt_dlp/extractor/youtube/_video.py | 26 | Python | 0.714 | bug | 183 | 51 | 51 | false | [ie/youtube] Determine wait time from player response | 14,646 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | WhatAmISupposedToPutHere |
} for j in range(math.ceil(fragment_count))],
}
def _download_initial_webpage(self, webpage_url, webpage_client, video_id):
webpage = None
if webpage_url and 'webpage' not in self._configuration_arg('player_skip'):
query = {'bpctr': '9999999999', 'has_verifie... | ```suggestion
if traverse_obj(slot_renderer, ('adSlotMetadata', 'triggerEvent')) != 'SLOT_TRIGGER_EVENT_BEFORE_CONTENT':
continue
``` | return self.url_result(
trailer_video_id, self.ie_key(), trailer_video_id)
search_meta = ((lambda x: self._html_search_meta(x, webpage, default=None))
if webpage else (lambda x: None))
video_details = traverse_obj(player_responses, (..., 'videoDetails... | @@ -3783,6 +3784,21 @@ def _download_initial_webpage(self, webpage_url, webpage_client, video_id):
}))
return webpage
+ def _get_preroll_length(self, ad_slot_lists):
+ for ad_slot in traverse_obj(ad_slot_lists, ('adSlots'), []):
+ slot_renderer = traverse_obj(ad_slot, ('... | yt_dlp/extractor/youtube/_video.py | 26 | Python | 0.714 | suggestion | 164 | 51 | 51 | false | [ie/youtube] Determine wait time from player response | 14,646 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | WhatAmISupposedToPutHere |
}
def _download_initial_webpage(self, webpage_url, webpage_client, video_id):
webpage = None
if webpage_url and 'webpage' not in self._configuration_arg('player_skip'):
query = {'bpctr': '9999999999', 'has_verified': '1'}
pp = (
self._configuratio... | ```suggestion
instream_ad_renderer = traverse_obj(slot_renderer, (
'fulfillmentContent', 'fulfilledLayout', 'playerBytesAdLayoutRenderer',
'renderingContent', 'instreamVideoAdRenderer', {dict})) or {}
``` | trailer_video_id, self.ie_key(), trailer_video_id)
search_meta = ((lambda x: self._html_search_meta(x, webpage, default=None))
if webpage else (lambda x: None))
video_details = traverse_obj(player_responses, (..., 'videoDetails'), expected_type=dict)
micr... | @@ -3783,6 +3784,21 @@ def _download_initial_webpage(self, webpage_url, webpage_client, video_id):
}))
return webpage
+ def _get_preroll_length(self, ad_slot_lists):
+ for ad_slot in traverse_obj(ad_slot_lists, ('adSlots'), []):
+ slot_renderer = traverse_obj(ad_slot, ('... | yt_dlp/extractor/youtube/_video.py | 26 | Python | 0.786 | suggestion | 252 | 51 | 51 | false | [ie/youtube] Determine wait time from player response | 14,646 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | WhatAmISupposedToPutHere |
webpage = None
if webpage_url and 'webpage' not in self._configuration_arg('player_skip'):
query = {'bpctr': '9999999999', 'has_verified': '1'}
pp = (
self._configuration_arg('player_params', [None], casesense=True)[0]
or traverse_obj(INNERTUBE_CLI... | ```suggestion
milliseconds = traverse_obj(instream_ad_renderer, ('skipOffsetMilliseconds', {int}))
if milliseconds is not None:
return milliseconds
``` | if webpage else (lambda x: None))
video_details = traverse_obj(player_responses, (..., 'videoDetails'), expected_type=dict)
microformats = traverse_obj(
player_responses, (..., 'microformat', 'playerMicroformatRenderer'),
expected_type=dict)
# Fal... | @@ -3783,6 +3784,21 @@ def _download_initial_webpage(self, webpage_url, webpage_client, video_id):
}))
return webpage
+ def _get_preroll_length(self, ad_slot_lists):
+ for ad_slot in traverse_obj(ad_slot_lists, ('adSlots'), []):
+ slot_renderer = traverse_obj(ad_slot, ('... | yt_dlp/extractor/youtube/_video.py | 26 | Python | 0.714 | suggestion | 195 | 51 | 51 | false | [ie/youtube] Determine wait time from player response | 14,646 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | WhatAmISupposedToPutHere |
self._configuration_arg('player_params', [None], casesense=True)[0]
or traverse_obj(INNERTUBE_CLIENTS, (webpage_client, 'PLAYER_PARAMS', {str}))
)
if pp:
query['pp'] = pp
webpage = self._download_webpage_with_retries(
we... | ```suggestion
seconds = traverse_obj(instream_ad_renderer, ('playerVars', {urllib.parse.parse_qs}, 'length_seconds', -1, {int_or_none}))
if seconds is not None:
return seconds * 1000
return 0
``` | player_responses, (..., 'microformat', 'playerMicroformatRenderer'),
expected_type=dict)
# Fallbacks in case player responses are missing metadata
initial_sdcr = traverse_obj(initial_data, (
'engagementPanels', ..., 'engagementPanelSectionListRenderer',
'... | @@ -3783,6 +3784,21 @@ def _download_initial_webpage(self, webpage_url, webpage_client, video_id):
}))
return webpage
+ def _get_preroll_length(self, ad_slot_lists):
+ for ad_slot in traverse_obj(ad_slot_lists, ('adSlots'), []):
+ slot_renderer = traverse_obj(ad_slot, ('... | yt_dlp/extractor/youtube/_video.py | 26 | Python | 0.786 | suggestion | 248 | 51 | 51 | false | [ie/youtube] Determine wait time from player response | 14,646 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | WhatAmISupposedToPutHere |
po_token=player_po_token)
except ExtractorError as e:
self.report_warning(e)
continue
if pr_id := self._invalid_player_response(pr, video_id):
skipped_clients[client] = pr_id
elif pr:
# Save client d... | the name should indicate it is in millseconds | 'source_preference': (-5 if itag == '22' else -1) + (100 if 'Premium' in name else 0),
'fps': fps if fps > 1 else None, # For some formats, fps is wrongly returned as 1
'audio_channels': fmt_stream.get('audioChannels'),
'height': height,
... | @@ -3288,6 +3290,7 @@ def append_client(*client_names):
f[STREAMING_DATA_IS_PREMIUM_SUBSCRIBER] = is_premium_subscriber
f[STREAMING_DATA_PLAYER_TOKEN_PROVIDED] = bool(player_po_token)
f[STREAMING_DATA_FETCHED_TIMESTAMP] = fetched_timestamp
+ ... | yt_dlp/extractor/youtube/_video.py | 26 | Python | 0.143 | suggestion | 45 | 51 | 51 | false | [ie/youtube] Determine wait time from player response | 14,646 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | WhatAmISupposedToPutHere |
if not requested_clients:
requested_clients.extend(default_clients)
for excluded_client in excluded_clients:
if excluded_client in requested_clients:
requested_clients.remove(excluded_client)
if not requested_clients:
raise ExtractorError('No p... | if you are removing the extractor-arg you need to remove the documentation for it as well | def is_super_resolution(f_url):
return '1' in traverse_obj(f_url, ({parse_qs}, 'xtags', ..., {urllib.parse.parse_qs}, 'sr', ...))
def solve_sig(s, spec):
return ''.join(s[i] for i in spec)
def build_fragments(f):
return LazyList({
'url': upda... | @@ -3404,12 +3407,10 @@ def gvs_pot_required(policy, is_premium_subscriber, has_player_token):
# save pots per client to avoid fetching again
gvs_pots = {}
- # For handling potential pre-playback required waiting period
- playback_wait = int_or_none(self._configuration_arg('playback_wa... | yt_dlp/extractor/youtube/_video.py | 26 | Python | 0.286 | refactor | 89 | 51 | 51 | false | [ie/youtube] Determine wait time from player response | 14,646 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | WhatAmISupposedToPutHere |
audio_track = fmt_stream.get('audioTrack') or {}
display_name = audio_track.get('displayName') or ''
language_code = audio_track.get('id', '').split('.')[0] or None
if 'descriptive' in display_name.lower():
return join_nonempty(language_code, 'desc'), -10
... | I would be in favor of just removing this extractor-arg |
status = traverse_obj(pr, ('playabilityStatus', 'status', {str}))
if status not in ('OK', 'LIVE_STREAM_OFFLINE', 'AGE_CHECK_REQUIRED', 'AGE_VERIFICATION_REQUIRED'):
self.write_debug(f'{video_id}: {client} player response playability status: {status}')
prs.extend(deprior... | @@ -3092,6 +3092,9 @@ def get_language_code_and_preference(fmt_stream):
is_premium_subscriber = streaming_data[STREAMING_DATA_IS_PREMIUM_SUBSCRIBER]
player_token_provided = streaming_data[STREAMING_DATA_PLAYER_TOKEN_PROVIDED]
client_name = streaming_data.get(STREAMING_DATA_CLIENT_... | yt_dlp/extractor/youtube/_video.py | 26 | Python | 0.286 | refactor | 55 | 51 | 51 | false | [ie/youtube] Determine wait time from player response | 14,646 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | WhatAmISupposedToPutHere |
'duration': min(fragment_duration, duration - (j * fragment_duration)),
} for j in range(math.ceil(fragment_count))],
}
def _download_initial_webpage(self, webpage_url, webpage_client, video_id):
webpage = None
if webpage_url and 'webpage' not in self... | Should we humanize the wait time? a la
```suggestion
length = length_ms / 1000 if length_ms % 1000 else length_ms // 1000
self.write_debug(f'Detected a {length}s skippable ad')
``` | if itag in ('616', '235'):
f['format_note'] = join_nonempty(f.get('format_note'), 'Premium', delim=' ')
f['source_preference'] += 100
f['quality'] = q(itag_qualities.get(try_get(f, lambda f: f['format_id'].split('-')[0]), -1))
if f... | @@ -3541,6 +3544,36 @@ def _download_initial_webpage(self, webpage_url, webpage_client, video_id):
}))
return webpage
+ def _parse_instream_ad_renderer(self, renderer):
+ instream_renderer = traverse_obj(renderer, ('instreamVideoAdRenderer', {dict})) or {}
+ length_ms = trav... | yt_dlp/extractor/youtube/_video.py | 26 | Python | 1 | bug | 204 | 51 | 51 | false | [ie/youtube] Determine wait time from player response | 14,646 | yt-dlp/yt-dlp | 132,642 | Python | Grub4K | WhatAmISupposedToPutHere |
def _download_initial_webpage(self, webpage_url, webpage_client, video_id):
webpage = None
if webpage_url and 'webpage' not in self._configuration_arg('player_skip'):
query = {'bpctr': '9999999999', 'has_verified': '1'}
pp = (
self._configuration_arg('player_p... | Same here, but `unskippable`
```suggestion
length = length_ms / 1000 if length_ms % 1000 else length_ms // 1000
self.write_debug(f'Detected a {length}s unskippable ad')
``` | f['quality'] = q(itag_qualities.get(try_get(f, lambda f: f['format_id'].split('-')[0]), -1))
if f['quality'] == -1 and f.get('height'):
f['quality'] = q(res_qualities[min(res_qualities, key=lambda x: abs(x - f['height']))])
if self.get_param('verbose')... | @@ -3541,6 +3544,36 @@ def _download_initial_webpage(self, webpage_url, webpage_client, video_id):
}))
return webpage
+ def _parse_instream_ad_renderer(self, renderer):
+ instream_renderer = traverse_obj(renderer, ('instreamVideoAdRenderer', {dict})) or {}
+ length_ms = trav... | yt_dlp/extractor/youtube/_video.py | 26 | Python | 0.857 | bug | 196 | 51 | 51 | false | [ie/youtube] Determine wait time from player response | 14,646 | yt-dlp/yt-dlp | 132,642 | Python | Grub4K | WhatAmISupposedToPutHere |
audio_track = fmt_stream.get('audioTrack') or {}
display_name = audio_track.get('displayName') or ''
language_code = audio_track.get('id', '').split('.')[0] or None
if 'descriptive' in display_name.lower():
return join_nonempty(language_code, 'desc'), -10
... | If the parsed wait time is greater than 6 I'd like to write debug output that logs the actual wait time |
status = traverse_obj(pr, ('playabilityStatus', 'status', {str}))
if status not in ('OK', 'LIVE_STREAM_OFFLINE', 'AGE_CHECK_REQUIRED', 'AGE_VERIFICATION_REQUIRED'):
self.write_debug(f'{video_id}: {client} player response playability status: {status}')
prs.extend(deprior... | @@ -3092,7 +3092,9 @@ def get_language_code_and_preference(fmt_stream):
is_premium_subscriber = streaming_data[STREAMING_DATA_IS_PREMIUM_SUBSCRIBER]
player_token_provided = streaming_data[STREAMING_DATA_PLAYER_TOKEN_PROVIDED]
client_name = streaming_data.get(STREAMING_DATA_CLIENT_... | yt_dlp/extractor/youtube/_video.py | 26 | Python | 0.5 | bug | 103 | 51 | 51 | false | [ie/youtube] Determine wait time from player response | 14,646 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | WhatAmISupposedToPutHere |
remove_start,
smuggle_url,
str_or_none,
str_to_int,
strftime_or_none,
traverse_obj,
try_call,
try_get,
unescapeHTML,
unified_strdate,
unsmuggle_url,
update_url_query,
url_or_none,
urljoin,
variadic,
)
from ...utils.networking import clean_headers, clean_proxie... | ```suggestion
STREAMING_DATA_AVAILABLE_AT_TIMESTAMP = '__yt_dlp_available_at_timestamp'
``` | remove_start,
smuggle_url,
str_or_none,
str_to_int,
strftime_or_none,
traverse_obj,
try_call,
try_get,
unescapeHTML,
unified_strdate,
unsmuggle_url,
update_url_query,
url_or_none,
urljoin,
variadic,
)
from ...utils.networking import clean_headers, clean_proxie... | @@ -77,6 +77,7 @@
STREAMING_DATA_INNERTUBE_CONTEXT = '__yt_dlp_innertube_context'
STREAMING_DATA_IS_PREMIUM_SUBSCRIBER = '__yt_dlp_is_premium_subscriber'
STREAMING_DATA_FETCHED_TIMESTAMP = '__yt_dlp_fetched_timestamp'
+STREAMING_DATA_PREROLL_LENGTH_MSEC = '__yt_dlp_preroll_length_msec' | yt_dlp/extractor/youtube/_video.py | 26 | Python | 0.571 | suggestion | 93 | 51 | 51 | false | [ie/youtube] Determine wait time from player response | 14,646 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | WhatAmISupposedToPutHere |
player_ytcfg=player_ytcfg,
player_url=player_url,
initial_pr=initial_pr,
visitor_data=visitor_data,
data_sync_id=data_sync_id,
po_token=player_po_token)
except ExtractorError as e:
... | ```suggestion
sd['STREAMING_DATA_AVAILABLE_AT_TIMESTAMP'] = self._get_available_at_timestamp(pr, video_id, client)
``` | player_url=player_url,
initial_pr=initial_pr,
visitor_data=visitor_data,
data_sync_id=data_sync_id,
po_token=player_po_token)
except ExtractorError as e:
self.report_warning(e)
... | @@ -3041,6 +3043,7 @@ def append_client(*client_names):
sd[STREAMING_DATA_FETCH_SUBS_PO_TOKEN] = fetch_subs_po_token_func
sd[STREAMING_DATA_IS_PREMIUM_SUBSCRIBER] = is_premium_subscriber
sd[STREAMING_DATA_FETCHED_TIMESTAMP] = fetched_timestamp
+ sd[STREA... | yt_dlp/extractor/youtube/_video.py | 26 | Python | 0.714 | suggestion | 136 | 51 | 51 | false | [ie/youtube] Determine wait time from player response | 14,646 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | WhatAmISupposedToPutHere |
audio_track = fmt_stream.get('audioTrack') or {}
display_name = audio_track.get('displayName') or ''
language_code = audio_track.get('id', '').split('.')[0] or None
if 'descriptive' in display_name.lower():
return join_nonempty(language_code, 'desc'), -10
... | ```suggestion
available_at = streaming_data[STREAMING_DATA_AVAILABLE_AT_TIMESTAMP]
``` | return join_nonempty(language_code, 'desc'), -10
if 'original' in display_name.lower():
if language_code and not language_map.get(ORIGINAL_LANG_VALUE):
language_map[ORIGINAL_LANG_VALUE] = language_code
return language_code, ORIGINAL_LANG_VA... | @@ -3199,7 +3199,9 @@ def get_language_code_and_preference(fmt_stream):
is_premium_subscriber = streaming_data[STREAMING_DATA_IS_PREMIUM_SUBSCRIBER]
player_token_provided = streaming_data[STREAMING_DATA_PLAYER_TOKEN_PROVIDED]
client_name = streaming_data.get(STREAMING_DATA_CLIENT_... | yt_dlp/extractor/youtube/_video.py | 26 | Python | 0.714 | suggestion | 100 | 51 | 51 | false | [ie/youtube] Determine wait time from player response | 14,646 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | WhatAmISupposedToPutHere |
self.write_debug(f'Detected a {length}s skippable ad')
return length_ms
length_ms = traverse_obj(instream_renderer, ('playerVars', {urllib.parse.parse_qs}, 'length_seconds', -1, {int_or_none(invscale=1000)}))
if length_ms is not None:
length = length_ms / 1000 if leng... | ```suggestion
def _get_available_at_timestamp(self, player_response, video_id, client):
now = time.time()
wait_seconds = 0
instream_video_ad_renderers = traverse_obj(player_response, (
'adSlots', lambda _, v: v['adSlotRenderer']['adSlotMetadata']['triggerEvent'] == 'SLOT_T... | duration = traverse_obj(renderer, ('playerVars', {urllib.parse.parse_qs}, 'length_seconds', -1, {int_or_none}))
ad = 'an ad' if duration is None else f'a {duration}s ad'
skip_time = traverse_obj(renderer, ('skipOffsetMilliseconds', {float_or_none(scale=1000)}))
if skip_t... | @@ -3653,6 +3655,38 @@ def _download_initial_webpage(self, webpage_url, webpage_client, video_id):
}))
return webpage
+ def _parse_instream_ad_renderer(self, renderer):
+ instream_renderer = traverse_obj(renderer, ('instreamVideoAdRenderer', {dict})) or {}
+ length_ms = trav... | yt_dlp/extractor/youtube/_video.py | 26 | Python | 0.929 | bug | 1,724 | 51 | 51 | false | [ie/youtube] Determine wait time from player response | 14,646 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | WhatAmISupposedToPutHere |
from .common import InfoExtractor
from ..utils import int_or_none, unified_timestamp, url_or_none
from ..utils.traversal import traverse_obj
class IdagioTrackIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?app\.idagio\.com(?:/[a-z]+)?/recordings/\d+\?(?:[^#]+&)?trackId=(?P<id>\d+)'
_TESTS = [{
'u... | ```suggestion
_VALID_URL = r'https?://(?:www\.)?app\.idagio\.com(?:/[a-z]{2})?/recordings/\d+\?(?:[^#]+&)?trackId=(?P<id>\d+)'
``` | from .common import InfoExtractor
from ..utils import int_or_none, unified_timestamp, url_or_none
from ..utils.traversal import traverse_obj
class IdagioTrackIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?app\.idagio\.com(?:/[a-z]{2})?/recordings/\d+\?(?:[^#]+&)?trackId=(?P<id>\d+)'
_TESTS = [{
... | @@ -4,7 +4,7 @@
class IdagioTrackIE(InfoExtractor):
- _VALID_URL = r'https?://(?:www\.)?app\.idagio\.com/recordings/\d+\?(?:[^#]+&)?trackId=(?P<id>\d+)'
+ _VALID_URL = r'https?://(?:www\.)?app\.idagio\.com(?:/[a-z]+)?/recordings/\d+\?(?:[^#]+&)?trackId=(?P<id>\d+)' | yt_dlp/extractor/idagio.py | 7 | Python | 0.714 | suggestion | 136 | 32 | 32 | false | [ie/idagio] Update valid urls to respect country codes | 14,655 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | robin-mu |
from .common import InfoExtractor
from ..utils import int_or_none, unified_timestamp, url_or_none
from ..utils.traversal import traverse_obj
class IdagioTrackIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?app\.idagio\.com(?:/[a-z]+)?/recordings/\d+\?(?:[^#]+&)?trackId=(?P<id>\d+)'
_TESTS = [{
'u... | add a test, please. it can be `'only_matching': True` | from .common import InfoExtractor
from ..utils import int_or_none, unified_timestamp, url_or_none
from ..utils.traversal import traverse_obj
class IdagioTrackIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?app\.idagio\.com(?:/[a-z]{2})?/recordings/\d+\?(?:[^#]+&)?trackId=(?P<id>\d+)'
_TESTS = [{
... | @@ -4,7 +4,7 @@
class IdagioTrackIE(InfoExtractor):
- _VALID_URL = r'https?://(?:www\.)?app\.idagio\.com/recordings/\d+\?(?:[^#]+&)?trackId=(?P<id>\d+)'
+ _VALID_URL = r'https?://(?:www\.)?app\.idagio\.com(?:/[a-z]+)?/recordings/\d+\?(?:[^#]+&)?trackId=(?P<id>\d+)'
_TESTS = [{ | yt_dlp/extractor/idagio.py | 8 | Python | 0.357 | suggestion | 53 | 33 | 33 | false | [ie/idagio] Update valid urls to respect country codes | 14,655 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | robin-mu |
"""Subclasses must set _API_URL_TMPL and define _parse_playlist_metadata"""
_PLAYLIST_ID_KEY = 'id' # vs. 'display_id'
def _entries(self, playlist_info):
for track_data in traverse_obj(playlist_info, ('tracks', lambda _, v: v['id'] and v['recording']['id'])):
track_id = track_data['id'... | ```suggestion
_VALID_URL = r'https?://(?:www\.)?app\.idagio\.com(?:/[a-z]{2})?/recordings/(?P<id>\d+)(?![^#]*[&?]trackId=\d+)'
``` |
class IdagioPlaylistBaseIE(InfoExtractor):
"""Subclasses must set _API_URL_TMPL and define _parse_playlist_metadata"""
_PLAYLIST_ID_KEY = 'id' # vs. 'display_id'
def _entries(self, playlist_info):
for track_data in traverse_obj(playlist_info, ('tracks', lambda _, v: v['id'] and v['recording']['i... | @@ -97,7 +96,7 @@ def _real_extract(self, url):
class IdagioRecordingIE(IdagioPlaylistBaseIE):
- _VALID_URL = r'https?://(?:www\.)?app\.idagio\.com/recordings/(?P<id>\d+)(?![^#]*[&?]trackId=\d+)'
+ _VALID_URL = r'https?://(?:www\.)?app\.idagio\.com(?:/[a-z]+)?/recordings/(?P<id>\d+)(?![^#]*[&?]trackId=\d+)' | yt_dlp/extractor/idagio.py | 26 | Python | 0.714 | suggestion | 136 | 51 | 51 | false | [ie/idagio] Update valid urls to respect country codes | 14,655 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | robin-mu |
'composers': ['Ludwig van Beethoven'],
'genres': ['Keyboard', 'Sonata (Keyboard)'],
'timestamp': 1518076337,
'upload_date': '20180208',
'modified_timestamp': 1518076337,
'modified_date': '20180208',
},
'playlist_count': 3,
}]
... | ```suggestion
_VALID_URL = r'https?://(?:www\.)?app\.idagio\.com(?:/[a-z]{2})?/albums/(?P<id>[\w-]+)'
``` | 'info_dict': {
'id': '20514467',
'title': 'Sonata for Piano No. 14 in C sharp minor op. 27/2',
'composers': ['Ludwig van Beethoven'],
'genres': ['Keyboard', 'Sonata (Keyboard)'],
'timestamp': 1518076337,
'upload_date': '20180208',
... | @@ -129,7 +141,7 @@ def _parse_playlist_metadata(self, playlist_info):
class IdagioAlbumIE(IdagioPlaylistBaseIE):
- _VALID_URL = r'https?://(?:www\.)?app\.idagio\.com/albums/(?P<id>[\w-]+)'
+ _VALID_URL = r'https?://(?:www\.)?app\.idagio\.com(?:/[a-z]+)?/albums/(?P<id>[\w-]+)' | yt_dlp/extractor/idagio.py | 26 | Python | 0.714 | suggestion | 111 | 51 | 51 | false | [ie/idagio] Update valid urls to respect country codes | 14,655 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | robin-mu |
'upload_date': '20251010',
'modified_timestamp': 1760624868,
'modified_date': '20251016',
'tags': ['recommended', 'recent-release'],
},
'playlist_count': 7,
}]
_API_URL_TMPL = 'https://api.idagio.com/v2.0/metadata/albums/{}'
_PLAYLIST_ID_KEY = ... | ```suggestion
_VALID_URL = r'https?://(?:www\.)?app\.idagio\.com(?:/[a-z]{2})?/playlists/(?!personal/)(?P<id>[\w-]+)'
_TESTS = [{
```
again, add `only_matching` test please | 'thumbnail': r're:https://.+/albums/3149020954522/main\.jpg',
'artists': ['Sabine Devieilhe', 'Stéphane Degout', 'Raphaël Pichon', 'Pygmalion', 'Johannes Brahms'],
'timestamp': 1760054400,
'upload_date': '20251010',
'modified_timestamp': 1760624868,
... | @@ -179,7 +191,7 @@ def _parse_playlist_metadata(self, playlist_info):
class IdagioPlaylistIE(IdagioPlaylistBaseIE):
- _VALID_URL = r'https?://(?:www\.)?app\.idagio\.com/playlists/(?!personal/)(?P<id>[\w-]+)'
+ _VALID_URL = r'https?://(?:www\.)?app\.idagio\.com(?:/[a-z]+)?/playlists/(?!personal/)(?P<id>[\w-]... | yt_dlp/extractor/idagio.py | 26 | Python | 0.714 | suggestion | 184 | 51 | 51 | false | [ie/idagio] Update valid urls to respect country codes | 14,655 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | robin-mu |
'info_dict': {
'id': '31652bec-8c5b-460e-a3f0-cf1f69817f53',
'display_id': 'beethoven-the-most-beautiful-piano-music',
'title': 'Beethoven: the most beautiful piano music',
'description': 'md5:d41bb04b8896bb69377f5c2cd9345ad1',
'thumbnail': r're:https:... | ```suggestion
_VALID_URL = r'https?://(?:www\.)?app\.idagio\.com(?:/[a-z]{2})?/playlists/personal/(?P<id>[\da-f-]+)'
_TESTS = [{
```
again, add `only_matching` test please | _VALID_URL = r'https?://(?:www\.)?app\.idagio\.com(?:/[a-z]{2})?/playlists/(?!personal/)(?P<id>[\w-]+)'
_TESTS = [{
'url': 'https://app.idagio.com/playlists/beethoven-the-most-beautiful-piano-music',
'info_dict': {
'id': '31652bec-8c5b-460e-a3f0-cf1f69817f53',
'display_id... | @@ -206,7 +218,7 @@ def _parse_playlist_metadata(self, playlist_info):
class IdagioPersonalPlaylistIE(IdagioPlaylistBaseIE):
- _VALID_URL = r'https?://(?:www\.)?app\.idagio\.com/playlists/personal/(?P<id>[\da-f-]+)'
+ _VALID_URL = r'https?://(?:www\.)?app\.idagio\.com(?:/[a-z]+)?/playlists/personal/(?P<id>[\... | yt_dlp/extractor/idagio.py | 26 | Python | 0.714 | suggestion | 183 | 50 | 51 | false | [ie/idagio] Update valid urls to respect country codes | 14,655 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | robin-mu |
'title': 'Theme. Andante',
'duration': 82,
'composers': ['Edward Elgar'],
'artists': ['Vasily Petrenko', 'Royal Liverpool Philharmonic Orchestra'],
'genres': ['Orchestral', 'Other Orchestral Music'],
'track': 'Theme. Andante',
'timestam... | For `only_matching` tests, all of the test data is ignored. And since this is just a duplicate of the test above, I would do this:
```suggestion
}, {
'url': 'https://app.idagio.com/de/recordings/20514467?trackId=20514483&utm_source=pcl',
'only_matching': True,
``` | 'title': 'Theme. Andante',
'duration': 82,
'composers': ['Edward Elgar'],
'artists': ['Vasily Petrenko', 'Royal Liverpool Philharmonic Orchestra'],
'genres': ['Orchestral', 'Other Orchestral Music'],
'track': 'Theme. Andante',
'timestam... | @@ -34,6 +34,21 @@ class IdagioTrackIE(InfoExtractor):
'timestamp': 1518076337,
'upload_date': '20180208',
},
+ }, {
+ 'url': 'https://app.idagio.com/de/recordings/20514467?trackId=20514483&utm_source=pcl',
+ 'md5': 'fe834a94294058ea54cd743ce3ecf624',
+ 'info_d... | yt_dlp/extractor/idagio.py | 26 | Python | 0.786 | refactor | 289 | 51 | 51 | false | [ie/idagio] Update valid urls to respect country codes | 14,655 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | robin-mu |
class IdagioPlaylistIE(IdagioPlaylistBaseIE):
_VALID_URL = r'https?://(?:www\.)?app\.idagio\.com(?:/[a-z]{2})?/playlists/(?!personal/)(?P<id>[\w-]+)'
_TESTS = [{
'url': 'https://app.idagio.com/playlists/beethoven-the-most-beautiful-piano-music',
'info_dict': {
'id': '31652bec-8c5b-4... | since this is a unique test, let's just remove `only_matching` and keep the test data
```suggestion
``` | },
'playlist_mincount': 16, # one entry is geo-restricted
}, {
'url': 'https://app.idagio.com/de/playlists/piano-music-for-an-autumn-day',
'info_dict': {
'id': 'd70e9c7f-7080-4308-ae0f-f890dddeda82',
'display_id': 'piano-music-for-an-autumn-day',
... | @@ -203,6 +218,18 @@ class IdagioPlaylistIE(IdagioPlaylistBaseIE):
'creators': ['IDAGIO'],
},
'playlist_mincount': 16, # one entry is geo-restricted
+ }, {
+ 'url': 'https://app.idagio.com/de/playlists/piano-music-for-an-autumn-day',
+ 'info_dict': {
+ 'id': '... | yt_dlp/extractor/idagio.py | 26 | Python | 0.786 | suggestion | 105 | 51 | 51 | false | [ie/idagio] Update valid urls to respect country codes | 14,655 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | robin-mu |
_TESTS = [{
'url': 'https://app.idagio.com/playlists/personal/99dad72e-7b3a-45a4-b216-867c08046ed8',
'info_dict': {
'id': '99dad72e-7b3a-45a4-b216-867c08046ed8',
'title': 'Test',
'creators': ['1a6f16a6-4514-4d0c-b481-3a9877835626'],
'thumbnail': r're:h... | same as above
```suggestion
``` | from .common import InfoExtractor
from ..utils import int_or_none, unified_timestamp, url_or_none
from ..utils.traversal import traverse_obj
class IdagioTrackIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?app\.idagio\.com(?:/[a-z]{2})?/recordings/\d+\?(?:[^#]+&)?trackId=(?P<id>\d+)'
_TESTS = [{
... | @@ -232,6 +259,20 @@ class IdagioPersonalPlaylistIE(IdagioPlaylistBaseIE):
'modified_date': '20250819',
},
'playlist_count': 100,
+ }, {
+ 'url': 'https://app.idagio.com/de/playlists/personal/99dad72e-7b3a-45a4-b216-867c08046ed8',
+ 'info_dict': {
+ 'id': '99da... | yt_dlp/extractor/idagio.py | 26 | Python | 0.429 | suggestion | 33 | 39 | 263 | false | [ie/idagio] Update valid urls to respect country codes | 14,655 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | robin-mu |
# - SMOOTH url 404's on every tested entry until now
continue
yield from self._set_format_type(formats, fmt_type)
# TODO: Add test for these
for fmt_type in self._FORMAT_TYPES:
if not has_hls:
hls_formats = self._extract_m3u8_form... | ```suggestion
paella/ui/watch\.html\?(?:[^#]*&)?id=|
``` | # - SMOOTH url 404's on every tested entry until now
continue
yield from self._set_format_type(formats, fmt_type)
# TODO: Add test for these
for fmt_type in self._FORMAT_TYPES:
if not has_hls:
hls_formats = self._extract_m3u8_form... | @@ -136,8 +136,10 @@ class TubeTuGrazIE(TubeTuGrazBaseIE):
IE_DESC = 'tube.tugraz.at'
_VALID_URL = r'''(?x)
- https?://tube\.tugraz\.at/paella/ui/watch.html\?id=
- (?P<id>[0-9a-fA-F]{8}-(?:[0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12})
+ https?://tube\.tugraz\.at/(?:
+ paella/ui/watch\.... | yt_dlp/extractor/tubetugraz.py | 26 | Python | 0.571 | suggestion | 70 | 51 | 51 | false | [TubeTuGraz] Add support for new portal URL format | 14,718 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | krystophny |
confirmed_source_url = extract_attributes(
get_element_html_by_id('download-form', confirmation_webpage) or '').get('action')
if confirmed_source_url:
urlh = request_source_file(confirmed_source_url, 'confirmed source', data=b'')
... | could move the conditional and the traversal inside the method
```suggestion
'subtitles': self.extract_subtitles(video_id, video_info),
``` | errnote='Unable to confirm download', fatal=False)
if confirmation_webpage:
confirmed_source_url = extract_attributes(
get_element_html_by_id('download-form', confirmation_webpage) or '').get('action')
if confirmed_sourc... | @@ -264,30 +201,20 @@ def add_source_format(urlh):
or get_element_by_class('uc-error-caption', confirmation_webpage)
or 'unable to extract confirmation code')
- if not formats and reason:
- if title:
- self.raise_no_formats(rea... | yt_dlp/extractor/googledrive.py | 26 | Python | 0.786 | refactor | 154 | 51 | 51 | false | [ie/GoogleDrive] Rework extractor | 14,746 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | seproDev |
'url': 'https://drive.usercontent.google.com/download?id=0ByeS4oOUV-49Zzh4R1J6R09zazQ',
'only_matching': True,
}]
@classmethod
def _extract_embed_urls(cls, url, webpage):
mobj = re.search(
r'<iframe[^>]+src="https?://(?:video\.google\.com/get_player\?.*?docid=|(?:docs|dr... | ```suggestion
def _get_subtitles(self, video_id, video_info):
subtitles = {}
timed_text_base_url = traverse_obj(video_info, ('timedTextDetails', 'timedTextBaseUrl', {url_or_none}))
if not timed_text_base_url:
return subtitles
subtitle_data = self._download_xml(
``` | 'url': 'https://drive.usercontent.google.com/download?id=0ByeS4oOUV-49Zzh4R1J6R09zazQ',
'only_matching': True,
}]
@classmethod
def _extract_embed_urls(cls, url, webpage):
mobj = re.search(
r'<iframe[^>]+src="https?://(?:video\.google\.com/get_player\?.*?docid=|(?:docs|dr... | @@ -91,129 +88,69 @@ def _extract_embed_urls(cls, url, webpage):
if mobj:
yield 'https://drive.google.com/file/d/{}'.format(mobj.group('id'))
- def _download_subtitles_xml(self, video_id, subtitles_id, hl):
- if self._captions_xml:
- return
- self._captions_xml = self... | yt_dlp/extractor/googledrive.py | 26 | Python | 0.786 | suggestion | 320 | 51 | 51 | false | [ie/GoogleDrive] Rework extractor | 14,746 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | seproDev |
# WBM captures seem to all switch to this layout ~July 2020
modern_captures = [x for x in all_captures if x >= 20200701000000]
if modern_captures:
capture_dates.append(modern_captures[0])
capture_dates.append(url_date)
if all_captures:
capture_dates.append... | ```suggestion
'The requested video is not archived or indexed', expected=True)
``` | # WBM captures seem to all switch to this layout ~July 2020
modern_captures = [x for x in all_captures if x >= 20200701000000]
if modern_captures:
capture_dates.append(modern_captures[0])
capture_dates.append(url_date)
if all_captures:
capture_dates.append... | @@ -933,23 +1064,13 @@ def _real_extract(self, url):
video_id, url_date, url_date_2 = self._match_valid_url(url).group('id', 'date', 'date2')
url_date = url_date or url_date_2
- urlh = None
- retry_manager = self.RetryManager(fatal=False)
- for retry in retry_manager:
- ... | yt_dlp/extractor/archiveorg.py | 26 | Python | 0.714 | suggestion | 100 | 51 | 51 | false | [ie/web.archive:youtube] Improve extraction | 14,753 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | seproDev |
}, {
'url': 'https://web.archive.org/http://www.youtube.com:80/watch?v=-05VVye-ffg',
'only_matching': True,
}, {
'url': 'ytarchive:BaW_jenozKc:20050214000000',
'only_matching': True,
}, {
'url': 'ytarchive:BaW_jenozKc',
'onl... | ```suggestion
_FORMATS = {
``` | }, {
'url': 'https://web.archive.org/http://www.youtube.com:80/watch?v=-05VVye-ffg',
'only_matching': True,
}, {
'url': 'ytarchive:BaW_jenozKc:20050214000000',
'only_matching': True,
}, {
'url': 'ytarchive:BaW_jenozKc',
'onl... | @@ -724,6 +748,113 @@ class YoutubeWebArchiveIE(InfoExtractor):
_OLDEST_CAPTURE_DATE = 20050214000000
_NEWEST_CAPTURE_DATE = 20500101000000
+ _formats = { | yt_dlp/extractor/archiveorg.py | 26 | Python | 0.429 | suggestion | 36 | 51 | 51 | false | [ie/web.archive:youtube] Improve extraction | 14,753 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | seproDev |
self.raise_no_formats(
'The requested video is not archived or indexed', expected=True)
capture_dates = self._get_capture_dates(video_id, int_or_none(url_date))
self.write_debug('Captures to try: ' + join_nonempty(*capture_dates, delim=', '))
info = {'id': video_id}
... | ```suggestion
**self._FORMATS.get(format_id, {}),
``` | self.raise_no_formats(
'The requested video is not archived or indexed', expected=True)
capture_dates = self._get_capture_dates(video_id, int_or_none(url_date))
self.write_debug('Captures to try: ' + join_nonempty(*capture_dates, delim=', '))
info = {'id': video_id}
... | @@ -968,25 +1089,18 @@ def _real_extract(self, url):
info['thumbnails'] = self._extract_thumbnails(video_id)
- if urlh:
- url = urllib.parse.unquote(urlh.url)
- video_file_url_qs = parse_qs(url)
- # Attempt to recover any ext & format info from playback url & respons... | yt_dlp/extractor/archiveorg.py | 26 | Python | 0.571 | suggestion | 71 | 36 | 36 | false | [ie/web.archive:youtube] Improve extraction | 14,753 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | seproDev |
default=['deno'],
help=(
'Additional JavaScript runtime to enable, with an optional path to the runtime location. '
'This option can be used multiple times to enable multiple runtimes. '
'Supported runtimes: deno, node, quickjs, bun. By default, only "deno" runtime is... | ```suggestion
'Remote components to allow yt-dlp to fetch when required. '
'This option is currently not needed if you are using an official executable '
'or have the yt-dlp-ejs library installed in your Python environment. '
'You can use this option multiple times to... | default=['deno'],
help=(
'Additional JavaScript runtime to enable, with an optional path to the runtime location. '
'This option can be used multiple times to enable multiple runtimes. '
'Supported runtimes are (in order of priority, from highest to lowest): deno, nod... | @@ -484,6 +486,7 @@ def _preset_alias_callback(option, opt_str, value, parser):
default=[],
help=(
'Remote components to allow yt-dlp to fetch when required. '
+ 'This option should not be required when using correctly packaged versions of yt-dlp. '
'You can use th... | yt_dlp/options.py | 26 | Python | 0.857 | suggestion | 586 | 51 | 51 | false | [cleanup] Misc | 14,767 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | bashonly |
type='str',
callback_kwargs={'delim': None},
default=['default'],
help=(
'Path to an additional directory to search for plugins. '
'This option can be used multiple times to add multiple directories. '
'Use "default" to search the default plugin direct... | ```suggestion
'Supported runtimes are (in order of priority, from highest to lowest): deno, node, quickjs, bun. '
'Only "deno" is enabled by default. The highest priority runtime that is both enabled and '
'available will be used. In order to use a lower priority runtime when "den... | type='str',
callback_kwargs={'delim': None},
default=['default'],
help=(
'Path to an additional directory to search for plugins. '
'This option can be used multiple times to add multiple directories. '
'Use "default" to search the default plugin direct... | @@ -468,7 +468,9 @@ def _preset_alias_callback(option, opt_str, value, parser):
help=(
'Additional JavaScript runtime to enable, with an optional path to the runtime location. '
'This option can be used multiple times to enable multiple runtimes. '
- 'Supported runtimes: de... | yt_dlp/options.py | 26 | Python | 0.857 | suggestion | 428 | 51 | 51 | false | [cleanup] Misc | 14,767 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | bashonly |
callback_kwargs={'delim': None},
default=['default'],
help=(
'Path to an additional directory to search for plugins. '
'This option can be used multiple times to add multiple directories. '
'Use "default" to search the default plugin directories (default)'))
... | ```suggestion
'--no-js-runtimes needs to be passed before enabling other runtimes'))
``` | callback_kwargs={'delim': None},
default=['default'],
help=(
'Path to an additional directory to search for plugins. '
'This option can be used multiple times to add multiple directories. '
'Use "default" to search the default plugin directories (default)'))
... | @@ -468,7 +468,10 @@ def _preset_alias_callback(option, opt_str, value, parser):
help=(
'Additional JavaScript runtime to enable, with an optional path to the runtime location. '
'This option can be used multiple times to enable multiple runtimes. '
- 'Supported runtimes: d... | yt_dlp/options.py | 26 | Python | 0.714 | suggestion | 102 | 51 | 51 | false | [cleanup] Misc | 14,767 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | bashonly |
'This option can be used multiple times to enable multiple runtimes. '
'Supported runtimes are (in order of priority, from highest to lowest): deno, node, quickjs, bun. '
'Only "deno" is enabled by default. The highest priority runtime that is both enabled and '
'availabl... | ```suggestion
'By default, no remote components are allowed'))
``` | 'This option can be used multiple times to enable multiple runtimes. '
'Supported runtimes are (in order of priority, from highest to lowest): deno, node, quickjs, bun. '
'Only "deno" is enabled by default. The highest priority runtime that is both enabled and '
'availabl... | @@ -484,8 +487,11 @@ def _preset_alias_callback(option, opt_str, value, parser):
default=[],
help=(
'Remote components to allow yt-dlp to fetch when required. '
+ 'This option is currently not needed if you are using an official executable '
+ 'or have the yt-dlp-ejs... | yt_dlp/options.py | 26 | Python | 0.571 | suggestion | 80 | 51 | 51 | false | [cleanup] Misc | 14,767 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | bashonly |
callback_kwargs={'delim': None},
default=['deno'],
help=(
'Additional JavaScript runtime to enable, with an optional path to the runtime location. '
'This option can be used multiple times to enable multiple runtimes. '
'Supported runtimes are (in order of pri... | ```suggestion
'or have the requisite version of the yt-dlp-ejs package installed. '
``` | callback_kwargs={'delim': None},
default=['deno'],
help=(
'Additional JavaScript runtime to enable, with an optional path to the runtime location. '
'This option can be used multiple times to enable multiple runtimes. '
'Supported runtimes are (in order of pri... | @@ -484,9 +487,12 @@ def _preset_alias_callback(option, opt_str, value, parser):
default=[],
help=(
'Remote components to allow yt-dlp to fetch when required. '
+ 'This option is currently not needed if you are using an official executable '
+ 'or have the yt-dlp-ejs... | yt_dlp/options.py | 26 | Python | 0.714 | suggestion | 101 | 51 | 51 | false | [cleanup] Misc | 14,767 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | bashonly |
import json
import uuid
from .common import InfoExtractor
from ..networking.exceptions import HTTPError
from ..utils import (
ExtractorError,
determine_ext,
float_or_none,
int_or_none,
remove_start,
strip_or_none,
traverse_obj,
try_get,
unified_timestamp,
)
class DPlayBaseIE(InfoE... | ```suggestion
try_get,
unified_timestamp,
)
from ..utils.traversal import traverse_obj
``` | import json
import uuid
from .common import InfoExtractor
from ..networking.exceptions import HTTPError
from ..utils import (
ExtractorError,
determine_ext,
float_or_none,
int_or_none,
remove_start,
strip_or_none,
try_get,
unified_timestamp,
)
from ..utils.traversal import traverse_obj
... | @@ -10,6 +10,7 @@
int_or_none,
remove_start,
strip_or_none,
+ traverse_obj,
try_get,
unified_timestamp,
) | yt_dlp/extractor/dplay.py | 16 | Python | 0.714 | suggestion | 103 | 41 | 41 | false | fix [DMAX] some (newer?) videos cannot be downloaded. #14735 | 14,818 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | w4grfw |
class DiscoveryPlusShowBaseIE(DPlayBaseIE):
def _entries(self, show_name):
headers = {
'x-disco-client': self._X_CLIENT,
'x-disco-params': f'realm={self._REALM}',
'referer': self._DOMAIN,
'Authentication': self._get_auth(self._BASE_API, None, self._REALM),
... | did you run this test? it's missing `upload_date`, `season` and `episode`
is this test case checking for something that the others don't? it looks like the pre-existing 1st test case (id `4756322`) may be sufficient
does the 2nd test case still work? (id `78867`) | 'tags': [],
'categories': ['Paranormal', 'Gruselig!'],
},
'params': {'skip_download': 'm3u8'},
}, {
'url': 'https://tlc.de/sendungen/evil-gesichter-des-boesen/das-geheimnis-meines-bruders',
'info_dict': {
'id': '7792288',
'ext': 'mp4',
... | @@ -1106,14 +1107,37 @@ class DiscoveryNetworksDeIE(DiscoveryPlusBaseIE):
}, {
'url': 'https://tlc.de/sendungen/breaking-amish/die-welt-da-drauen/',
'only_matching': True,
+ }, {
+ 'url': 'https://dmax.de/sendungen/feuerwache-3-alarm-in-muenchen/24-stunden-auf-der-feuerwache-3',
+ ... | yt_dlp/extractor/dplay.py | 26 | Python | 0.571 | question | 269 | 51 | 51 | false | fix [DMAX] some (newer?) videos cannot be downloaded. #14735 | 14,818 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | w4grfw |
'info_dict': {
'id': '8873549',
'ext': 'mp4',
'title': '24 Stunden auf der Feuerwache 3',
'description': 'md5:f2a79516eb08ae812d3ce07940a5224f',
'display_id': '8873549',
'episode_number': 1,
'season_number': 1,
'seri... | are we sure the old slug method still works and this request should be non-fatal? can you find any working examples where sending the slug with the API call still works?
if not, then this:
```suggestion
video_id = self._download_json(
f'https://de-api.loma-cms.com/feloma/videos/{alternate_id... | 'ext': 'mp4',
'title': '24 Stunden auf der Feuerwache 3',
'description': 'md5:f3084ef6170bfb79f9a6e0c030e09330',
'display_id': '24-stunden-auf-der-feuerwache-3',
'episode': 'Episode 1',
'episode_number': 1,
'season': 'Season 1',
... | @@ -1106,14 +1107,37 @@ class DiscoveryNetworksDeIE(DiscoveryPlusBaseIE):
}, {
'url': 'https://tlc.de/sendungen/breaking-amish/die-welt-da-drauen/',
'only_matching': True,
+ }, {
+ 'url': 'https://dmax.de/sendungen/feuerwache-3-alarm-in-muenchen/24-stunden-auf-der-feuerwache-3',
+ ... | yt_dlp/extractor/dplay.py | 26 | Python | 0.857 | question | 1,003 | 51 | 51 | false | fix [DMAX] some (newer?) videos cannot be downloaded. #14735 | 14,818 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | w4grfw |
'x-disco-client': self._X_CLIENT,
'x-disco-params': f'realm={self._REALM}',
'referer': self._DOMAIN,
'Authentication': self._get_auth(self._BASE_API, None, self._REALM),
}
show_json = self._download_json(
f'{self._BASE_API}cms/routes/{self._SHO... | `meta['taxonomies']` has category/tag data that isn't extracted now for the new shows in `_get_disco_api_info()` despite being requested in the API call there.
The data can be extracted with `traverse_obj(meta, ('taxonomies', lambda _, v: v.get('category') == 'genre', 'title', {strip_or_none}))` and merged into the ... | 'episode_number': 1,
'season': 'Season 1',
'season_number': 1,
'series': 'Evil - Gesichter des Bösen',
'duration': 2626.0,
'upload_date': '20240926',
'timestamp': 1727388000,
'creators': ['TLC'],
'thumbnail': 'ht... | @@ -1106,14 +1107,44 @@ class DiscoveryNetworksDeIE(DiscoveryPlusBaseIE):
}, {
'url': 'https://tlc.de/sendungen/breaking-amish/die-welt-da-drauen/',
'only_matching': True,
+ }, {
+ 'url': 'https://dmax.de/sendungen/feuerwache-3-alarm-in-muenchen/24-stunden-auf-der-feuerwache-3',
+ ... | yt_dlp/extractor/dplay.py | 26 | Python | 0.857 | refactor | 896 | 51 | 51 | false | fix [DMAX] some (newer?) videos cannot be downloaded. #14735 | 14,818 | yt-dlp/yt-dlp | 132,642 | Python | dirkf | w4grfw |
'url': 'https://dmax.de/sendungen/feuerwache-3-alarm-in-muenchen/24-stunden-auf-der-feuerwache-3',
'info_dict': {
'id': '8873549',
'ext': 'mp4',
'title': '24 Stunden auf der Feuerwache 3',
'description': 'md5:f3084ef6170bfb79f9a6e0c030e09330',
... | dplay.co.uk no longer exists (DNS error).
```suggestion
realm = domain.replace('.', '')
```
and earlier
```diff
- _VALID_URL = r'https?://(?:www\.)?(?P<domain>(?:tlc|dmax)\.de|dplay\.co\.uk)/(?:programme|show|sendungen)/(?P<programme>[^/]+)/(?:video/)?(?P<alternate_id>[^/]+)'
+ _VALID_URL = r'https... | 'id': '8873549',
'ext': 'mp4',
'title': '24 Stunden auf der Feuerwache 3',
'description': 'md5:f3084ef6170bfb79f9a6e0c030e09330',
'display_id': '24-stunden-auf-der-feuerwache-3',
'episode': 'Episode 1',
'episode_number': 1,
... | @@ -1106,14 +1107,44 @@ class DiscoveryNetworksDeIE(DiscoveryPlusBaseIE):
}, {
'url': 'https://tlc.de/sendungen/breaking-amish/die-welt-da-drauen/',
'only_matching': True,
+ }, {
+ 'url': 'https://dmax.de/sendungen/feuerwache-3-alarm-in-muenchen/24-stunden-auf-der-feuerwache-3',
+ ... | yt_dlp/extractor/dplay.py | 26 | Python | 1 | bug | 738 | 51 | 51 | false | fix [DMAX] some (newer?) videos cannot be downloaded. #14735 | 14,818 | yt-dlp/yt-dlp | 132,642 | Python | dirkf | w4grfw |
_DISCO_API_PARAMS = {
'disco_host': 'ap2-prod-direct.discoveryplus.in',
'realm': 'dplusindia',
'country': 'in',
'domain': 'https://www.discoveryplus.in/',
}
def _update_disco_api_headers(self, headers, disco_base, display_id, realm):
headers.update({
'x-d... | As the series/slug is not being passed into `_get_disco_api_info()` for the new case, the `display_id` has either to be re-created there by changing this in the returned dict:
```diff
- 'display_id': display_id,
+ 'display_id': '/'.join(traverse_obj(video, (
+ (('included', ...)... | _DISCO_API_PARAMS = {
'disco_host': 'ap2-prod-direct.discoveryplus.in',
'realm': 'dplusindia',
'country': 'in',
'domain': 'https://www.discoveryplus.in/',
}
def _update_disco_api_headers(self, headers, disco_base, display_id, realm):
headers.update({
'x-d... | @@ -1062,7 +1063,7 @@ class DiscoveryNetworksDeIE(DiscoveryPlusBaseIE):
'ext': 'mp4',
'title': 'German Gold',
'description': 'md5:f3073306553a8d9b40e6ac4cdbf09fc6',
- 'display_id': 'goldrausch-in-australien/german-gold',
+ 'display_id': '4756322', | yt_dlp/extractor/dplay.py | 26 | Python | 1 | suggestion | 734 | 51 | 51 | false | fix [DMAX] some (newer?) videos cannot be downloaded. #14735 | 14,818 | yt-dlp/yt-dlp | 132,642 | Python | dirkf | w4grfw |
'thumbnail': 'https://eu1-prod-images.disco-api.com/2024/11/29/e9f3e3ae-74ec-3631-81b7-fc7bbe844741.jpeg',
'tags': ['kriminalfall', 'böse', 'verbrecher', 'zusammenleben', 'mord', 'familie', 'ermittler', 'leben', 'fälle', 'opfer', 'tod', 'mörder', 'crime'],
'categories': ['True Crime'... | - If the `meta` API call is non-fatal, then we need a fallback value for `video_id`
- Inline when it's reasonable to do so
- If we're going to modify the `disco_api_info` result for `categories`, then we may as well preserve the `display_id` too
```suggestion
meta = self._download_json(
f'htt... | 'thumbnail': 'https://eu1-prod-images.disco-api.com/2024/11/29/e9f3e3ae-74ec-3631-81b7-fc7bbe844741.jpeg',
'tags': 'count:13',
'categories': ['True Crime', 'Mord'],
},
'params': {'skip_download': 'm3u8'},
}]
def _real_extract(self, url):
domain, progr... | @@ -1100,20 +1102,96 @@ class DiscoveryNetworksDeIE(DiscoveryPlusBaseIE):
}, {
'url': 'https://www.dmax.de/programme/dmax-highlights/video/tuning-star-sidney-hoffmann-exklusiv-bei-dmax/191023082312316',
'only_matching': True,
- }, {
- 'url': 'https://www.dplay.co.uk/show/ghost-adventure... | yt_dlp/extractor/dplay.py | 26 | Python | 0.857 | suggestion | 1,060 | 51 | 51 | false | fix [DMAX] some (newer?) videos cannot be downloaded. #14735 | 14,818 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | w4grfw |
'timestamp': 1734948900,
'creators': ['TLC'],
'thumbnail': 'https://eu1-prod-images.disco-api.com/2023/04/05/59941d26-a81b-365f-829f-69d8cd81fd0f.jpeg',
'tags': [],
'categories': ['Paranormal', 'Gruselig!'],
},
'params': {'skip_download': 'm3u8... | ```suggestion
'tags': 'count:13',
``` | 'timestamp': 1734948900,
'creators': ['TLC'],
'thumbnail': 'https://eu1-prod-images.disco-api.com/2023/04/05/59941d26-a81b-365f-829f-69d8cd81fd0f.jpeg',
'tags': [],
'categories': ['Paranormal', 'Gruselig!'],
},
'params': {'skip_download': 'm3u8... | @@ -1100,20 +1102,93 @@ class DiscoveryNetworksDeIE(DiscoveryPlusBaseIE):
}, {
'url': 'https://www.dmax.de/programme/dmax-highlights/video/tuning-star-sidney-hoffmann-exklusiv-bei-dmax/191023082312316',
'only_matching': True,
- }, {
- 'url': 'https://www.dplay.co.uk/show/ghost-adventure... | yt_dlp/extractor/dplay.py | 26 | Python | 0.571 | suggestion | 51 | 51 | 51 | false | fix [DMAX] some (newer?) videos cannot be downloaded. #14735 | 14,818 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | w4grfw |
'creators': ['TLC'],
'thumbnail': 'https://eu1-prod-images.disco-api.com/2024/11/29/e9f3e3ae-74ec-3631-81b7-fc7bbe844741.jpeg',
'tags': ['kriminalfall', 'böse', 'verbrecher', 'zusammenleben', 'mord', 'familie', 'ermittler', 'leben', 'fälle', 'opfer', 'tod', 'mörder', 'crime'],
... | ```suggestion
video_id = traverse_obj(meta, ('uid', {str}, {lambda s: s[-7:]})) or alternate_id
disco_api_info = self._get_disco_api_info(
url, video_id, 'eu1-prod.disco-api.com', domain.replace('.', ''), 'DE')
disco_api_info['display_id'] = alternate_id
disco_api_info... | 'creators': ['TLC'],
'thumbnail': 'https://eu1-prod-images.disco-api.com/2024/11/29/e9f3e3ae-74ec-3631-81b7-fc7bbe844741.jpeg',
'tags': 'count:13',
'categories': ['True Crime', 'Mord'],
},
'params': {'skip_download': 'm3u8'},
}]
def _real_extract(... | @@ -1100,20 +1102,93 @@ class DiscoveryNetworksDeIE(DiscoveryPlusBaseIE):
}, {
'url': 'https://www.dmax.de/programme/dmax-highlights/video/tuning-star-sidney-hoffmann-exklusiv-bei-dmax/191023082312316',
'only_matching': True,
- }, {
- 'url': 'https://www.dplay.co.uk/show/ghost-adventure... | yt_dlp/extractor/dplay.py | 26 | Python | 0.857 | suggestion | 505 | 51 | 51 | false | fix [DMAX] some (newer?) videos cannot be downloaded. #14735 | 14,818 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | w4grfw |
'season': 'Season 8',
'tags': [],
},
'params': {
'skip_download': True,
},
}]
_PRODUCT = 'dplus-india'
_DISCO_API_PARAMS = {
'disco_host': 'ap2-prod-direct.discoveryplus.in',
'realm': 'dplusindia',
'country': 'in',
... | ```suggestion
_VALID_URL = r'https?://(?:www\.)?(?P<domain>(?:tlc|dmax)\.de)/(?:programme|show|sendungen)/(?P<programme>[^/?#]+)/(?:video/)?(?P<alternate_id>[^/?#]+)'
``` | 'season': 'Season 8',
'tags': [],
},
'params': {
'skip_download': True,
},
}]
_PRODUCT = 'dplus-india'
_DISCO_API_PARAMS = {
'disco_host': 'ap2-prod-direct.discoveryplus.in',
'realm': 'dplusindia',
'country': 'in',
... | @@ -1053,7 +1054,7 @@ def _update_disco_api_headers(self, headers, disco_base, display_id, realm):
class DiscoveryNetworksDeIE(DiscoveryPlusBaseIE):
- _VALID_URL = r'https?://(?:www\.)?(?P<domain>(?:tlc|dmax)\.de|dplay\.co\.uk)/(?:programme|show|sendungen)/(?P<programme>[^/]+)/(?:video/)?(?P<alternate_id>[^/]+)... | yt_dlp/extractor/dplay.py | 26 | Python | 0.714 | suggestion | 176 | 51 | 51 | false | fix [DMAX] some (newer?) videos cannot be downloaded. #14735 | 14,818 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | w4grfw |
'timestamp': 1690732800,
'upload_date': '20230730',
'tags': ['2023', 'race #22', 'richmond', 'chris buescher', 'cup'],
'chapters': 'count:18',
},
},
{
'url': 'https://classics.nascar.com/video/UASvPDOwEha~SIvJii7uAC~wszPshklHN',
'md5': ... | let's extract the whole nextjs data block
```suggestion
content_data = self._search_nextjs_data(
webpage, video_id)['props']['pageProps']['contentData']
``` | 'id': 'Ka5qGuxzZ~SIvJii7uAC~wszPshklHN',
'ext': 'mp4',
'title': 'Cook Out 400 2023',
'thumbnail': 'https://va.aws.nascar.com/IMAGES/CUP_2023_22_RICHMOND_THUMB_NCD.jpg',
'timestamp': 1690732800,
'upload_date': '20230730',
'tags': ['2023'... | @@ -0,0 +1,63 @@
+from .common import InfoExtractor
+from ..utils import int_or_none, parse_iso8601, str_or_none, traverse_obj, url_or_none
+
+
+class NascarClassicsIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?classics\.nascar\.com/video/(?P<id>[\w~-]+)'
+ _TESTS = [{
+ 'url': 'https://classics.n... | yt_dlp/extractor/nascar.py | 26 | Python | 0.786 | refactor | 180 | 49 | 46 | false | [ie/NascarClassics] Add extractor | 14,866 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | JrM2628 |
def _real_extract(self, url):
video_id = self._match_id(url)
webpage = self._download_webpage(url, video_id)
content_data = self._search_json('contentData":', webpage, 'nascar_classics_content_data', video_id)
name = traverse_obj(content_data, ('input', 'name'))
description ... | Can be simplified to a single `traverse_obj` call. m3u8 url extraction might as well be fatal
```suggestion
return {
'id': video_id,
'formats': self._extract_m3u8_formats(content_data['input']['src'], video_id),
**traverse_obj(content_data, {
'title': ('... | from .common import InfoExtractor
from ..utils import (
float_or_none,
parse_iso8601,
url_or_none,
)
from ..utils.traversal import traverse_obj
class NascarClassicsIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?classics\.nascar\.com/video/(?P<id>[\w~-]+)'
_TESTS = [{
'url': 'https://... | @@ -0,0 +1,63 @@
+from .common import InfoExtractor
+from ..utils import int_or_none, parse_iso8601, str_or_none, traverse_obj, url_or_none
+
+
+class NascarClassicsIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?classics\.nascar\.com/video/(?P<id>[\w~-]+)'
+ _TESTS = [{
+ 'url': 'https://classics.n... | yt_dlp/extractor/nascar.py | 26 | Python | 0.857 | refactor | 867 | 27 | 61 | false | [ie/NascarClassics] Add extractor | 14,866 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | JrM2628 |
'timestamp': 1501995600,
'upload_date': '20170806',
'tags': ['watkins glen', 'race #22', '2017', 'martin truex jr.', 'cup'],
'chapters': 'count:13',
},
}]
def _real_extract(self, url):
video_id = self._match_id(url)
webpage = self._downloa... | ```suggestion
'chapters': ('overlay', 'data', 'timelines', 0, 'events', lambda _, v: float(v['timestamp']) is not None, {
'start_time': ('timestamp', {float_or_none}),
'title': ('name', {str}),
}),
``` | 'ext': 'mp4',
'title': 'I Love New York 355 at the Glen 2017',
'thumbnail': 'https://va.aws.nascar.com/IMAGES/CUP_2017_22_WATKINSGLEN_THUMB_NCD.jpg',
'timestamp': 1501995600,
'upload_date': '20170806',
'tags': ['watkins glen', 'race #22', '2017', '... | @@ -0,0 +1,57 @@
+from .common import InfoExtractor
+from ..utils import float_or_none, parse_iso8601, traverse_obj, url_or_none
+
+
+class NascarClassicsIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?classics\.nascar\.com/video/(?P<id>[\w~-]+)'
+ _TESTS = [{
+ 'url': 'https://classics.nascar.com/v... | yt_dlp/extractor/nascar.py | 26 | Python | 0.786 | suggestion | 278 | 29 | 32 | false | [ie/NascarClassics] Add extractor | 14,866 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | JrM2628 |
'md5': 'a5e8d6ec6005da3857d25ba2df5e7133',
'info_dict': {
'id': 'UASvPDOwEha~SIvJii7uAC~wszPshklHN',
'ext': 'mp4',
'title': 'I Love New York 355 at the Glen 2017',
'thumbnail': 'https://va.aws.nascar.com/IMAGES/CUP_2017_22_WATKINSGLEN_THUMB_NCD.jpg',
... | ```suggestion
'description': ('input', 'description', {str}, filter),
``` | 'chapters': 'count:18',
},
}, {
'url': 'https://classics.nascar.com/video/UASvPDOwEha~SIvJii7uAC~wszPshklHN',
'md5': 'a5e8d6ec6005da3857d25ba2df5e7133',
'info_dict': {
'id': 'UASvPDOwEha~SIvJii7uAC~wszPshklHN',
'ext': 'mp4',
'title': 'I... | @@ -0,0 +1,57 @@
+from .common import InfoExtractor
+from ..utils import float_or_none, parse_iso8601, traverse_obj, url_or_none
+
+
+class NascarClassicsIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?classics\.nascar\.com/video/(?P<id>[\w~-]+)'
+ _TESTS = [{
+ 'url': 'https://classics.nascar.com/v... | yt_dlp/extractor/nascar.py | 26 | Python | 0.571 | suggestion | 91 | 36 | 39 | false | [ie/NascarClassics] Add extractor | 14,866 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | JrM2628 |
},
}, {
'url': 'https://classics.nascar.com/video/UASvPDOwEha~SIvJii7uAC~wszPshklHN',
'md5': 'a5e8d6ec6005da3857d25ba2df5e7133',
'info_dict': {
'id': 'UASvPDOwEha~SIvJii7uAC~wszPshklHN',
'ext': 'mp4',
'title': 'I Love New York 355 at the Glen 2017'... | I would do this just in case, unless you know the videos can have a different extension. It can prevent videos downloading with an m3u8 extension sometimes
```suggestion
'formats': self._extract_m3u8_formats(content_data['input']['src'], video_id, 'mp4'),
``` | 'timestamp': 1690732800,
'upload_date': '20230730',
'tags': ['2023', 'race #22', 'richmond', 'chris buescher', 'cup'],
'chapters': 'count:18',
},
}, {
'url': 'https://classics.nascar.com/video/UASvPDOwEha~SIvJii7uAC~wszPshklHN',
'md5': 'a5e8d6e... | @@ -0,0 +1,57 @@
+from .common import InfoExtractor
+from ..utils import float_or_none, parse_iso8601, traverse_obj, url_or_none
+
+
+class NascarClassicsIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?classics\.nascar\.com/video/(?P<id>[\w~-]+)'
+ _TESTS = [{
+ 'url': 'https://classics.nascar.com/v... | yt_dlp/extractor/nascar.py | 26 | Python | 0.857 | refactor | 274 | 39 | 42 | false | [ie/NascarClassics] Add extractor | 14,866 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | JrM2628 |
from .common import InfoExtractor
from ..utils import float_or_none, parse_iso8601, traverse_obj, url_or_none
class NascarClassicsIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?classics\.nascar\.com/video/(?P<id>[\w~-]+)'
_TESTS = [{
'url': 'https://classics.nascar.com/video/Ka5qGuxzZ~SIvJii7uAC... | ```suggestion
from ..utils import (
float_or_none,
parse_iso8601,
url_or_none,
)
from ..utils.traversal import traverse_obj
``` | from .common import InfoExtractor
from ..utils import (
float_or_none,
parse_iso8601,
url_or_none,
)
from ..utils.traversal import traverse_obj
class NascarClassicsIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?classics\.nascar\.com/video/(?P<id>[\w~-]+)'
_TESTS = [{
'url': 'https://... | @@ -0,0 +1,57 @@
+from .common import InfoExtractor
+from ..utils import float_or_none, parse_iso8601, traverse_obj, url_or_none | yt_dlp/extractor/nascar.py | 2 | Python | 0.714 | suggestion | 146 | 27 | 27 | false | [ie/NascarClassics] Add extractor | 14,866 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | JrM2628 |
/id
)/(?P<id>[\d+a-z]+)'''
_EMBED_REGEX = [r'<(?:iframe|script)[^>]+src=["\'](?P<url>(?:https?:)?//(?:www\.)?ultimedia\.com/deliver/(?:generic|musique)(?:/[^/]+)*/(?:src|article)/[\d+a-z]+)']
_TESTS = [{
'url': 'https://www.ultimedia.com/default/index/videogeneric/id/3x5x55k',
... | This is not quite correct, other MDTK IDs exist as well, but the server doesn't seem to care.
Example https://www.ultimedia.com/deliver/generic/iframe/mdtk/01002929/zone/3/src/30kq5ru or https://www.ultimedia.com/deliver/generic/iframe/mdtk/01032022/zone/1/src/3x3rp3k | )
/id
)/(?P<id>[\d+a-z]+)'''
_EMBED_REGEX = [r'<(?:iframe|script)[^>]+src=["\'](?P<url>(?:https?:)?//(?:www\.)?ultimedia\.com/deliver/(?:generic|musique)(?:/[^/]+)*/(?:src|article)/[\d+a-z]+)']
_TESTS = [{
'url': 'https://www.ultimedia.com/default/index/videogeneric/id/3x... | @@ -64,6 +46,47 @@ def _real_extract(self, url):
if video_type == 'music':
video_type = 'musique'
+ IFRAME_MD_ID = '01836272' # Static ID for Ultimedia iframes | yt_dlp/extractor/digiteka.py | 26 | Python | 0.429 | suggestion | 269 | 51 | 51 | false | [ie/Digiteka] Rework extractor | 14,903 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | beliote |
'thumbnail': r're:^https?://.*\.jpg',
'duration': 89,
'upload_date': '20251012',
'timestamp': 1760285363,
'uploader_id': '3pz33',
},
'params': {'skip_download': True},
}]
def _real_extract(self, url):
mobj = self._match_valid_u... | Why don't we call the api instead of trying to parse the json-ld? https://www.ultimedia.com/player/getConf/01032022/1/3xm58mr | 'title': 'Il est passionné de DS',
'thumbnail': r're:^https?://.*\.jpg',
'duration': 89,
'upload_date': '20251012',
'timestamp': 1760285363,
'uploader_id': '3pz33',
},
'params': {'skip_download': True},
}]
_IFRAME_MD_ID = '0... | @@ -64,6 +46,47 @@ def _real_extract(self, url):
if video_type == 'music':
video_type = 'musique'
+ IFRAME_MD_ID = '01836272' # Static ID for Ultimedia iframes
+ iframe_json_ld_url = (
+ f'https://www.ultimedia.com/deliver/generic/iframe/mdtk/{IFRAME_MD_ID}/zone/1/src/... | yt_dlp/extractor/digiteka.py | 26 | Python | 0.429 | question | 125 | 51 | 50 | false | [ie/Digiteka] Rework extractor | 14,903 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | beliote |
def _real_extract(self, url):
mobj = self._match_valid_url(url)
video_id = mobj.group('id')
video_type = mobj.group('embed_type') or mobj.group('site_type')
if video_type == 'music':
video_type = 'musique'
IFRAME_MD_ID = '01836272' # Static ID for Ultimedia ifr... | Do you have an example where this is required? If yes, add a test case | _IFRAME_MD_ID = '01836272' # One static ID working for Ultimedia iframes
def _real_extract(self, url):
video_id = self._match_id(url)
video_info = self._download_json(
f'https://www.ultimedia.com/player/getConf/{self._IFRAME_MD_ID}/1/{video_id}', video_id,
note='Downl... | @@ -64,6 +46,47 @@ def _real_extract(self, url):
if video_type == 'music':
video_type = 'musique'
+ IFRAME_MD_ID = '01836272' # Static ID for Ultimedia iframes
+ iframe_json_ld_url = (
+ f'https://www.ultimedia.com/deliver/generic/iframe/mdtk/{IFRAME_MD_ID}/zone/1/src/... | yt_dlp/extractor/digiteka.py | 26 | Python | 0.214 | suggestion | 70 | 51 | 41 | false | [ie/Digiteka] Rework extractor | 14,903 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | beliote |
)|
default/index/video
(?P<site_type>
generic|
music
)
/id
)/(?P<id>[\d+a-z]+)'''
_EMBED_REGEX = [r'<(?:iframe|script)[^>]+src=["\'](?P<url>(?:https?:)?//(?:www\.)?ultimedia\.com/deliver/(?:generic|musique)(?:/[^/]+)... | Do these music URLs still exist? If yes, or you are not sure then the test should not be remvoed. | article
)|
default/index/video
(?P<site_type>
generic|
music
)
/id
)/(?P<id>[\d+a-z]+)'''
_EMBED_REGEX = [r'<(?:iframe|script)[^>]+src=["\'](?P<url>(?:https?:)?//(?:www\.)?ultimedia\.com/deliver/(?:ge... | @@ -25,36 +25,18 @@ class DigitekaIE(InfoExtractor):
)/(?P<id>[\d+a-z]+)'''
_EMBED_REGEX = [r'<(?:iframe|script)[^>]+src=["\'](?P<url>(?:https?:)?//(?:www\.)?ultimedia\.com/deliver/(?:generic|musique)(?:/[^/]+)*/(?:src|article)/[\d+a-z]+)']
_TESTS = [{
- # news
- 'url': 'https://www.ult... | yt_dlp/extractor/digiteka.py | 26 | Python | 0.286 | suggestion | 97 | 51 | 51 | false | [ie/Digiteka] Rework extractor | 14,903 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | beliote |
video_url = self._search_regex(
r'"mp4_404"\s*:\s*"(https?:\\/\\/assets\.digiteka\.com\\/encoded\\/[^"]+\\/mp4\\/[^"]+_404\.mp4)"',
iframe_webpage, 'MP4 404 URL', fatal=False)
if video_url:
video_url = video_url.replace('\\/', '/')
if vide... | Are there any cases where the API logic still works? Are there any cases where the logic above doesn't work. If yes there should be tests added. If not we don't need to keep dead code around. | from .common import InfoExtractor
from ..utils import int_or_none, url_or_none
from ..utils.traversal import traverse_obj
class DigitekaIE(InfoExtractor):
_VALID_URL = r'''(?x)
https?://(?:www\.)?(?:digiteka\.net|ultimedia\.com)/
(?:
deliver/
(?P<embed_type>
... | @@ -64,6 +46,47 @@ def _real_extract(self, url):
if video_type == 'music':
video_type = 'musique'
+ IFRAME_MD_ID = '01836272' # Static ID for Ultimedia iframes
+ iframe_json_ld_url = (
+ f'https://www.ultimedia.com/deliver/generic/iframe/mdtk/{IFRAME_MD_ID}/zone/1/src/... | yt_dlp/extractor/digiteka.py | 26 | Python | 0.429 | suggestion | 191 | 39 | 82 | false | [ie/Digiteka] Rework extractor | 14,903 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | beliote |
default/index/video
(?P<site_type>
generic|
music
)
/id
)/(?P<id>[\d+a-z]+)'''
_EMBED_REGEX = [r'<(?:iframe|script)[^>]+src=["\'](?P<url>(?:https?:)?//(?:www\.)?ultimedia\.com/deliver/(?:generic|musique)(?:/[^/]+)*/(?:src|articl... | ```suggestion
video_id = self._match_id(url)
``` | )|
default/index/video
(?P<site_type>
generic|
music
)
/id
)/(?P<id>[\d+a-z]+)'''
_EMBED_REGEX = [r'<(?:iframe|script)[^>]+src=["\'](?P<url>(?:https?:)?//(?:www\.)?ultimedia\.com/deliver/(?:generic|musique)(?:/[^/]+)... | @@ -25,74 +25,83 @@ class DigitekaIE(InfoExtractor):
)/(?P<id>[\d+a-z]+)'''
_EMBED_REGEX = [r'<(?:iframe|script)[^>]+src=["\'](?P<url>(?:https?:)?//(?:www\.)?ultimedia\.com/deliver/(?:generic|musique)(?:/[^/]+)*/(?:src|article)/[\d+a-z]+)']
_TESTS = [{
- # news
- 'url': 'https://www.ult... | yt_dlp/extractor/digiteka.py | 26 | Python | 0.571 | suggestion | 58 | 51 | 51 | false | [ie/Digiteka] Rework extractor | 14,903 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | beliote |
generic|
music
)
/id
)/(?P<id>[\d+a-z]+)'''
_EMBED_REGEX = [r'<(?:iframe|script)[^>]+src=["\'](?P<url>(?:https?:)?//(?:www\.)?ultimedia\.com/deliver/(?:generic|musique)(?:/[^/]+)*/(?:src|article)/[\d+a-z]+)']
_TESTS = [{
'url': 'https://www... | Turn this in to a class variable | (?P<site_type>
generic|
music
)
/id
)/(?P<id>[\d+a-z]+)'''
_EMBED_REGEX = [r'<(?:iframe|script)[^>]+src=["\'](?P<url>(?:https?:)?//(?:www\.)?ultimedia\.com/deliver/(?:generic|musique)(?:/[^/]+)*/(?:src|article)/[\d+a-z]+)']
_TESTS = [{
... | @@ -25,74 +25,83 @@ class DigitekaIE(InfoExtractor):
)/(?P<id>[\d+a-z]+)'''
_EMBED_REGEX = [r'<(?:iframe|script)[^>]+src=["\'](?P<url>(?:https?:)?//(?:www\.)?ultimedia\.com/deliver/(?:generic|musique)(?:/[^/]+)*/(?:src|article)/[\d+a-z]+)']
_TESTS = [{
- # news
- 'url': 'https://www.ult... | yt_dlp/extractor/digiteka.py | 26 | Python | 0.071 | suggestion | 32 | 51 | 51 | false | [ie/Digiteka] Rework extractor | 14,903 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | beliote |
_EMBED_REGEX = [r'<(?:iframe|script)[^>]+src=["\'](?P<url>(?:https?:)?//(?:www\.)?ultimedia\.com/deliver/(?:generic|musique)(?:/[^/]+)*/(?:src|article)/[\d+a-z]+)']
_TESTS = [{
'url': 'https://www.ultimedia.com/default/index/videogeneric/id/3x5x55k',
'info_dict': {
'id': '3x5x55k',
... | Can just inline this and make it fatal. If the API doesn't return a video, there is nothing useful we can do anyway
```suggestion
video_info = self._download_json(
f'https://www.ultimedia.com/player/getConf/{IFRAME_MD_ID}/1/{video_id}', video_id,
note='Downloading player configuratio... | )/(?P<id>[\d+a-z]+)'''
_EMBED_REGEX = [r'<(?:iframe|script)[^>]+src=["\'](?P<url>(?:https?:)?//(?:www\.)?ultimedia\.com/deliver/(?:generic|musique)(?:/[^/]+)*/(?:src|article)/[\d+a-z]+)']
_TESTS = [{
'url': 'https://www.ultimedia.com/default/index/videogeneric/id/3x5x55k',
'info_dict': {... | @@ -25,74 +25,83 @@ class DigitekaIE(InfoExtractor):
)/(?P<id>[\d+a-z]+)'''
_EMBED_REGEX = [r'<(?:iframe|script)[^>]+src=["\'](?P<url>(?:https?:)?//(?:www\.)?ultimedia\.com/deliver/(?:generic|musique)(?:/[^/]+)*/(?:src|article)/[\d+a-z]+)']
_TESTS = [{
- # news
- 'url': 'https://www.ult... | yt_dlp/extractor/digiteka.py | 26 | Python | 0.857 | suggestion | 337 | 51 | 51 | false | [ie/Digiteka] Rework extractor | 14,903 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | beliote |
'title': 'Il est passionné de DS',
'thumbnail': r're:^https?://.*\.jpg',
'duration': 89,
'upload_date': '20251012',
'timestamp': 1760285363,
'uploader_id': '3pz33',
},
'params': {'skip_download': True},
}]
def _real_extract... | Title should not be mandatory
```suggestion
``` | 'ext': 'mp4',
'title': 'Il est passionné de DS',
'thumbnail': r're:^https?://.*\.jpg',
'duration': 89,
'upload_date': '20251012',
'timestamp': 1760285363,
'uploader_id': '3pz33',
},
'params': {'skip_download': True},
... | @@ -25,74 +25,83 @@ class DigitekaIE(InfoExtractor):
)/(?P<id>[\d+a-z]+)'''
_EMBED_REGEX = [r'<(?:iframe|script)[^>]+src=["\'](?P<url>(?:https?:)?//(?:www\.)?ultimedia\.com/deliver/(?:generic|musique)(?:/[^/]+)*/(?:src|article)/[\d+a-z]+)']
_TESTS = [{
- # news
- 'url': 'https://www.ult... | yt_dlp/extractor/digiteka.py | 26 | Python | 0.5 | suggestion | 49 | 51 | 51 | false | [ie/Digiteka] Rework extractor | 14,903 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | beliote |
formats.append({
'url': hls_url,
'format_id': f'hls-{height_str}',
'height': height,
'protocol': 'm3u8_native',
'ext': 'mp4',
})
mp4_sources = media_sources.get('mp4', {})
for format_id, mp4_url in m... | Do you have any example of Youtube embed still existing? Looking at the sites JS this should when be under `media_sources.youtube`, but without an example I wouldn't att code for this | from .common import InfoExtractor
from ..utils import int_or_none, url_or_none
from ..utils.traversal import traverse_obj
class DigitekaIE(InfoExtractor):
_VALID_URL = r'''(?x)
https?://(?:www\.)?(?:digiteka\.net|ultimedia\.com)/
(?:
deliver/
(?P<embed_type>
... | @@ -25,74 +25,83 @@ class DigitekaIE(InfoExtractor):
)/(?P<id>[\d+a-z]+)'''
_EMBED_REGEX = [r'<(?:iframe|script)[^>]+src=["\'](?P<url>(?:https?:)?//(?:www\.)?ultimedia\.com/deliver/(?:generic|musique)(?:/[^/]+)*/(?:src|article)/[\d+a-z]+)']
_TESTS = [{
- # news
- 'url': 'https://www.ult... | yt_dlp/extractor/digiteka.py | 26 | Python | 0.571 | suggestion | 183 | 40 | 82 | false | [ie/Digiteka] Rework extractor | 14,903 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | beliote |
'height': height,
'protocol': 'm3u8_native',
'ext': 'mp4',
})
mp4_sources = media_sources.get('mp4', {})
for format_id, mp4_url in mp4_sources.items():
if not mp4_url:
continue
height_str = format_id.sp... | No need. Core will take care of this.
```suggestion
``` | from .common import InfoExtractor
from ..utils import int_or_none, url_or_none
from ..utils.traversal import traverse_obj
class DigitekaIE(InfoExtractor):
_VALID_URL = r'''(?x)
https?://(?:www\.)?(?:digiteka\.net|ultimedia\.com)/
(?:
deliver/
(?P<embed_type>
... | @@ -25,74 +25,83 @@ class DigitekaIE(InfoExtractor):
)/(?P<id>[\d+a-z]+)'''
_EMBED_REGEX = [r'<(?:iframe|script)[^>]+src=["\'](?P<url>(?:https?:)?//(?:www\.)?ultimedia\.com/deliver/(?:generic|musique)(?:/[^/]+)*/(?:src|article)/[\d+a-z]+)']
_TESTS = [{
- # news
- 'url': 'https://www.ult... | yt_dlp/extractor/digiteka.py | 26 | Python | 0.571 | suggestion | 57 | 37 | 82 | false | [ie/Digiteka] Rework extractor | 14,903 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | beliote |
height_str = format_id.split('_')[-1]
height = int(height_str) if height_str.isdigit() else None
formats.append({
'url': hls_url,
'format_id': f'hls-{height_str}',
'height': height,
'protocol': 'm3u8_native',
... | I would write this like so
```suggestion
for format_id, mp4_url in traverse_obj(video_info, ('media_sources', 'mp4', {dict.items})):
if not mp4_url:
continue
formats.append({
'url': mp4_url,
'format_id': format_id,
... | from .common import InfoExtractor
from ..utils import int_or_none, url_or_none
from ..utils.traversal import traverse_obj
class DigitekaIE(InfoExtractor):
_VALID_URL = r'''(?x)
https?://(?:www\.)?(?:digiteka\.net|ultimedia\.com)/
(?:
deliver/
(?P<embed_type>
... | @@ -25,74 +25,83 @@ class DigitekaIE(InfoExtractor):
)/(?P<id>[\d+a-z]+)'''
_EMBED_REGEX = [r'<(?:iframe|script)[^>]+src=["\'](?P<url>(?:https?:)?//(?:www\.)?ultimedia\.com/deliver/(?:generic|musique)(?:/[^/]+)*/(?:src|article)/[\d+a-z]+)']
_TESTS = [{
- # news
- 'url': 'https://www.ult... | yt_dlp/extractor/digiteka.py | 26 | Python | 0.786 | suggestion | 424 | 44 | 82 | false | [ie/Digiteka] Rework extractor | 14,903 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | beliote |
conf_data = self._download_json(
api_url, video_id, note='Downloading player configuration')
video_info = conf_data.get('video')
if not video_info:
raise ExtractorError('Failed to retrieve video information from API.', expected=True)
title = video_info['title']
... | Here I would only extract the auto hls format (i.e. the master playlist) and then let core code handle the parsing
```py
formats = []
subtitles = {}
if hls_url := traverse_obj(video_info, ('media_sources', 'hls', 'hls_auto', {url_or_none})):
fmts, subs = self._extract_m3u8_forma... |
formats = []
subtitles = {}
if hls_url := traverse_obj(video_info, ('media_sources', 'hls', 'hls_auto', {url_or_none})):
fmts, subs = self._extract_m3u8_formats_and_subtitles(
hls_url, video_id, 'mp4', m3u8_id='hls', fatal=False)
formats.extend(fmts)
... | @@ -25,74 +25,83 @@ class DigitekaIE(InfoExtractor):
)/(?P<id>[\d+a-z]+)'''
_EMBED_REGEX = [r'<(?:iframe|script)[^>]+src=["\'](?P<url>(?:https?:)?//(?:www\.)?ultimedia\.com/deliver/(?:generic|musique)(?:/[^/]+)*/(?:src|article)/[\d+a-z]+)']
_TESTS = [{
- # news
- 'url': 'https://www.ult... | yt_dlp/extractor/digiteka.py | 26 | Python | 1 | refactor | 506 | 51 | 33 | false | [ie/Digiteka] Rework extractor | 14,903 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | beliote |
mp4_sources = media_sources.get('mp4', {})
for format_id, mp4_url in mp4_sources.items():
if not mp4_url:
continue
height_str = format_id.split('_')[-1]
height = int(height_str) if height_str.isdigit() else None
formats.append({
... | ```suggestion
'formats': formats,
'subtitles': subtitles,
``` | from .common import InfoExtractor
from ..utils import int_or_none, url_or_none
from ..utils.traversal import traverse_obj
class DigitekaIE(InfoExtractor):
_VALID_URL = r'''(?x)
https?://(?:www\.)?(?:digiteka\.net|ultimedia\.com)/
(?:
deliver/
(?P<embed_type>
... | @@ -25,74 +25,83 @@ class DigitekaIE(InfoExtractor):
)/(?P<id>[\d+a-z]+)'''
_EMBED_REGEX = [r'<(?:iframe|script)[^>]+src=["\'](?P<url>(?:https?:)?//(?:www\.)?ultimedia\.com/deliver/(?:generic|musique)(?:/[^/]+)*/(?:src|article)/[\d+a-z]+)']
_TESTS = [{
- # news
- 'url': 'https://www.ult... | yt_dlp/extractor/digiteka.py | 26 | Python | 0.571 | suggestion | 88 | 33 | 82 | false | [ie/Digiteka] Rework extractor | 14,903 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | beliote |
height_str = format_id.split('_')[-1]
height = int(height_str) if height_str.isdigit() else None
formats.append({
'url': mp4_url,
'format_id': f'mp4-{height_str}',
'height': height,
'ext': 'mp4',
})
... | Let's use traverse_obj here to include a type check and have everything be non-fatal
```suggestion
**traverse_obj(video_info, {
'title': ('title', {str}),
'thumbnail': ('image', {url_or_none}),
'duration': ('duration', {int_or_none}),
'ti... | from .common import InfoExtractor
from ..utils import int_or_none, url_or_none
from ..utils.traversal import traverse_obj
class DigitekaIE(InfoExtractor):
_VALID_URL = r'''(?x)
https?://(?:www\.)?(?:digiteka\.net|ultimedia\.com)/
(?:
deliver/
(?P<embed_type>
... | @@ -25,74 +25,83 @@ class DigitekaIE(InfoExtractor):
)/(?P<id>[\d+a-z]+)'''
_EMBED_REGEX = [r'<(?:iframe|script)[^>]+src=["\'](?P<url>(?:https?:)?//(?:www\.)?ultimedia\.com/deliver/(?:generic|musique)(?:/[^/]+)*/(?:src|article)/[\d+a-z]+)']
_TESTS = [{
- # news
- 'url': 'https://www.ult... | yt_dlp/extractor/digiteka.py | 26 | Python | 1 | suggestion | 436 | 28 | 82 | false | [ie/Digiteka] Rework extractor | 14,903 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | beliote |
from .common import InfoExtractor
from ..utils import int_or_none, traverse_obj, url_or_none
class DigitekaIE(InfoExtractor):
_VALID_URL = r'''(?x)
https?://(?:www\.)?(?:digiteka\.net|ultimedia\.com)/
(?:
deliver/
(?P<embed_type>
generic|
mus... | ```suggestion
from ..utils import int_or_none, url_or_none
from ..utils.traversal import traverse_obj
``` | from .common import InfoExtractor
from ..utils import int_or_none, url_or_none
from ..utils.traversal import traverse_obj
class DigitekaIE(InfoExtractor):
_VALID_URL = r'''(?x)
https?://(?:www\.)?(?:digiteka\.net|ultimedia\.com)/
(?:
deliver/
(?P<embed_type>
... | @@ -1,5 +1,5 @@
from .common import InfoExtractor
-from ..utils import int_or_none
+from ..utils import int_or_none, traverse_obj, url_or_none | yt_dlp/extractor/digiteka.py | 2 | Python | 0.714 | suggestion | 108 | 27 | 27 | false | [ie/Digiteka] Rework extractor | 14,903 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | beliote |
'duration': 89,
'upload_date': '20251012',
'timestamp': 1760285363,
'uploader_id': '3pz33',
},
'params': {'skip_download': True},
}]
_IFRAME_MD_ID = '01836272' # One static ID working for Ultimedia iframes
def _real_extract(self, url):
... | this will try to iterate over `None` and throw a `TypeError` if `'mp4'` is not a dict, so we need to branch after `{dict.items}`
```suggestion
for format_id, mp4_url in traverse_obj(video_info, ('media_sources', 'mp4', {dict.items}, ...)):
``` | 'duration': 89,
'upload_date': '20251012',
'timestamp': 1760285363,
'uploader_id': '3pz33',
},
'params': {'skip_download': True},
}]
_IFRAME_MD_ID = '01836272' # One static ID working for Ultimedia iframes
def _real_extract(self, url):
... | @@ -25,74 +26,56 @@ class DigitekaIE(InfoExtractor):
)/(?P<id>[\d+a-z]+)'''
_EMBED_REGEX = [r'<(?:iframe|script)[^>]+src=["\'](?P<url>(?:https?:)?//(?:www\.)?ultimedia\.com/deliver/(?:generic|musique)(?:/[^/]+)*/(?:src|article)/[\d+a-z]+)']
_TESTS = [{
- # news
- 'url': 'https://www.ult... | yt_dlp/extractor/digiteka.py | 26 | Python | 0.929 | suggestion | 254 | 48 | 48 | false | [ie/Digiteka] Rework extractor | 14,903 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | beliote |
import base64
import binascii
import datetime as dt
import hashlib
import hmac
import json
import os
import urllib.parse
from .common import InfoExtractor
from ..utils import ExtractorError, int_or_none
from ..utils.traversal import get_first, traverse_obj
class GoPlayIE(InfoExtractor):
_VALID_URL = r'https?://(... | ```suggestion
class GoPlayIE(InfoExtractor):
IE_NAME = 'play.tv'
IE_DESC = 'PLAY (formerly goplay.be)'
``` | import base64
import binascii
import datetime as dt
import hashlib
import hmac
import json
import os
import urllib.parse
from .common import InfoExtractor
from ..utils import ExtractorError, int_or_none
from ..utils.traversal import get_first, traverse_obj
class GoPlayIE(InfoExtractor):
IE_NAME = 'play.tv'
I... | @@ -13,12 +13,12 @@
class GoPlayIE(InfoExtractor): | yt_dlp/extractor/goplay.py | 15 | Python | 0.786 | refactor | 118 | 40 | 40 | false | [goplay] Update domain from goplay.be to play.tv | 14,905 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | thomasmllt |
from .common import InfoExtractor
class MuxStreamNewIE(InfoExtractor):
IE_NAME = 'stream.new'
_WORKING = True
_VALID_URL = r'https?://stream.new/v/(?P<id>[A-Za-z0-9-]+)(/embed)?'
_TESTS = [{
'url': 'https://stream.new/v/36d8c00L1vEFwF01aF1cRKQs8nblgegMda8YR9CE3wejk/embed',
'info_dict':... | That's the default
```suggestion
``` | import re
from .common import InfoExtractor
from ..utils import (
extract_attributes,
filter_dict,
parse_qs,
smuggle_url,
unsmuggle_url,
update_url_query,
)
from ..utils.traversal import traverse_obj
class MuxIE(InfoExtractor):
_VALID_URL = r'https?://(?:stream\.new/v|player\.mux\.com)/(?... | @@ -0,0 +1,37 @@
+from .common import InfoExtractor
+
+
+class MuxStreamNewIE(InfoExtractor):
+ IE_NAME = 'stream.new'
+ _WORKING = True | yt_dlp/extractor/mux.py | 6 | Python | 0.429 | suggestion | 38 | 31 | 31 | false | [ie/mux] Add extractor | 14,914 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | PierceLBrooks |
from .common import InfoExtractor
class MuxStreamNewIE(InfoExtractor):
IE_NAME = 'stream.new'
_WORKING = True
_VALID_URL = r'https?://stream.new/v/(?P<id>[A-Za-z0-9-]+)(/embed)?'
_TESTS = [{
'url': 'https://stream.new/v/36d8c00L1vEFwF01aF1cRKQs8nblgegMda8YR9CE3wejk/embed',
'info_dict':... | A trailing optional match is redundant
```suggestion
_VALID_URL = r'https?://stream.new/v/(?P<id>[A-Za-z0-9-]+)'
``` | import re
from .common import InfoExtractor
from ..utils import (
extract_attributes,
filter_dict,
parse_qs,
smuggle_url,
unsmuggle_url,
update_url_query,
)
from ..utils.traversal import traverse_obj
class MuxIE(InfoExtractor):
_VALID_URL = r'https?://(?:stream\.new/v|player\.mux\.com)/(?... | @@ -0,0 +1,37 @@
+from .common import InfoExtractor
+
+
+class MuxStreamNewIE(InfoExtractor):
+ IE_NAME = 'stream.new'
+ _WORKING = True
+ _VALID_URL = r'https?://stream.new/v/(?P<id>[A-Za-z0-9-]+)(/embed)?' | yt_dlp/extractor/mux.py | 7 | Python | 0.714 | suggestion | 123 | 32 | 32 | false | [ie/mux] Add extractor | 14,914 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | PierceLBrooks |
IE_NAME = 'stream.new'
_WORKING = True
_VALID_URL = r'https?://stream.new/v/(?P<id>[A-Za-z0-9-]+)(/embed)?'
_TESTS = [{
'url': 'https://stream.new/v/36d8c00L1vEFwF01aF1cRKQs8nblgegMda8YR9CE3wejk/embed',
'info_dict': {
'id': '36d8c00L1vEFwF01aF1cRKQs8nblgegMda8YR9CE3wejk',
... | Use f-string. Why should this be non-fatal? `entry_protocol='m3u8_native' is the default
```suggestion
formats = self._extract_m3u8_formats(
f'https://stream.mux.com/{video_id}.m3u8', video_id, 'mp4')
``` | extract_attributes,
filter_dict,
parse_qs,
smuggle_url,
unsmuggle_url,
update_url_query,
)
from ..utils.traversal import traverse_obj
class MuxIE(InfoExtractor):
_VALID_URL = r'https?://(?:stream\.new/v|player\.mux\.com)/(?P<id>[A-Za-z0-9-]+)'
_EMBED_REGEX = [r'<iframe\b[^>]+\bsrc=["\'... | @@ -0,0 +1,37 @@
+from .common import InfoExtractor
+
+
+class MuxStreamNewIE(InfoExtractor):
+ IE_NAME = 'stream.new'
+ _WORKING = True
+ _VALID_URL = r'https?://stream.new/v/(?P<id>[A-Za-z0-9-]+)(/embed)?'
+ _TESTS = [{
+ 'url': 'https://stream.new/v/36d8c00L1vEFwF01aF1cRKQs8nblgegMda8YR9CE3wejk/em... | yt_dlp/extractor/mux.py | 26 | Python | 0.857 | refactor | 228 | 34 | 51 | false | [ie/mux] Add extractor | 14,914 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | PierceLBrooks |
'id': '36d8c00L1vEFwF01aF1cRKQs8nblgegMda8YR9CE3wejk',
'title': '36d8c00L1vEFwF01aF1cRKQs8nblgegMda8YR9CE3wejk',
'formats': 'mincount:1',
'ext': 'mp4',
'_type': 'video',
},
'params': {
# m3u8 download
'skip_download': Tr... | Not needed
```suggestion
``` | )
from ..utils.traversal import traverse_obj
class MuxIE(InfoExtractor):
_VALID_URL = r'https?://(?:stream\.new/v|player\.mux\.com)/(?P<id>[A-Za-z0-9-]+)'
_EMBED_REGEX = [r'<iframe\b[^>]+\bsrc=["\'](?P<url>(?:https?:)?//(?:stream\.new/v|player\.mux\.com)/(?P<id>[A-Za-z0-9-]+)[^"\']+)']
_TESTS = [{
... | @@ -0,0 +1,37 @@
+from .common import InfoExtractor
+
+
+class MuxStreamNewIE(InfoExtractor):
+ IE_NAME = 'stream.new'
+ _WORKING = True
+ _VALID_URL = r'https?://stream.new/v/(?P<id>[A-Za-z0-9-]+)(/embed)?'
+ _TESTS = [{
+ 'url': 'https://stream.new/v/36d8c00L1vEFwF01aF1cRKQs8nblgegMda8YR9CE3wejk/em... | yt_dlp/extractor/mux.py | 26 | Python | 0.429 | suggestion | 30 | 28 | 51 | false | [ie/mux] Add extractor | 14,914 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | PierceLBrooks |
from .common import InfoExtractor
class MuxStreamNewIE(InfoExtractor):
IE_NAME = 'stream.new'
_WORKING = True
_VALID_URL = r'https?://stream.new/v/(?P<id>[A-Za-z0-9-]+)(/embed)?'
_TESTS = [{
'url': 'https://stream.new/v/36d8c00L1vEFwF01aF1cRKQs8nblgegMda8YR9CE3wejk/embed',
'info_dict':... | Can we also add embed detection using `_EMBED_REGEX`? | }]
_WEBPAGE_TESTS = [{
# iframe embed
'url': 'https://www.redbrickai.com/blog/2025-07-14-FAST-brush',
'info_dict': {
'ext': 'mp4',
'id': 'cXhzAiW1AmsHY01eRbEYFcTEAn0102aGN8sbt8JprP6Dfw',
'title': 'cXhzAiW1AmsHY01eRbEYFcTEAn0102aGN8sbt8JprP6Dfw',
... | @@ -0,0 +1,37 @@
+from .common import InfoExtractor
+
+
+class MuxStreamNewIE(InfoExtractor):
+ IE_NAME = 'stream.new'
+ _WORKING = True
+ _VALID_URL = r'https?://stream.new/v/(?P<id>[A-Za-z0-9-]+)(/embed)?'
+ _TESTS = [{
+ 'url': 'https://stream.new/v/36d8c00L1vEFwF01aF1cRKQs8nblgegMda8YR9CE3wejk/em... | yt_dlp/extractor/mux.py | 26 | Python | 0.357 | question | 53 | 38 | 51 | false | [ie/mux] Add extractor | 14,914 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | PierceLBrooks |
from .common import InfoExtractor
class MuxStreamNewIE(InfoExtractor):
IE_NAME = 'stream.new'
_VALID_URL = r'https?://(?:stream\.new/v|player\.mux\.com)/(?P<id>[A-Za-z0-9-]+)'
_EMBED_REGEX = [r'<iframe\b[^>]+\bsrc=["\'](?P<url>(?:https?:)?//(?:stream\.new/v|player\.mux\.com)/(?P<id>[A-Za-z0-9-]+))']
_... | Since this all the same infrastructure, might as well name it `MuxIE`
```suggestion
class MuxIE(InfoExtractor):
``` | import re
from .common import InfoExtractor
from ..utils import (
extract_attributes,
filter_dict,
parse_qs,
smuggle_url,
unsmuggle_url,
update_url_query,
)
from ..utils.traversal import traverse_obj
class MuxIE(InfoExtractor):
_VALID_URL = r'https?://(?:stream\.new/v|player\.mux\.com)/(?... | @@ -0,0 +1,33 @@
+from .common import InfoExtractor
+
+
+class MuxStreamNewIE(InfoExtractor):
+ IE_NAME = 'stream.new' | yt_dlp/extractor/mux.py | 5 | Python | 0.786 | refactor | 118 | 30 | 30 | false | [ie/mux] Add extractor | 14,914 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | PierceLBrooks |
MotherlessGalleryIE,
MotherlessGroupIE,
MotherlessIE,
MotherlessUploaderIE,
)
from .motorsport import MotorsportIE
from .moviepilot import MoviepilotIE
from .moview import MoviewPlayIE
from .moviezine import MoviezineIE
from .movingimage import MovingImageIE
from .msn import MSNIE
from .mtv import MTVIE... | ```suggestion
from .mux import MuxIE
``` | MotherlessGalleryIE,
MotherlessGroupIE,
MotherlessIE,
MotherlessUploaderIE,
)
from .motorsport import MotorsportIE
from .moviepilot import MoviepilotIE
from .moview import MoviewPlayIE
from .moviezine import MoviezineIE
from .movingimage import MovingImageIE
from .msn import MSNIE
from .mtv import MTVIE... | @@ -1197,6 +1197,7 @@
MusicdexPlaylistIE,
MusicdexSongIE,
)
+from .mux import MuxStreamNewIE | yt_dlp/extractor/_extractors.py | 26 | Python | 0.429 | suggestion | 42 | 51 | 51 | false | [ie/mux] Add extractor | 14,914 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | PierceLBrooks |
from .common import InfoExtractor
class MuxStreamNewIE(InfoExtractor):
IE_NAME = 'stream.new'
_VALID_URL = r'https?://(?:stream\.new/v|player\.mux\.com)/(?P<id>[A-Za-z0-9-]+)'
_EMBED_REGEX = [r'<iframe\b[^>]+\bsrc=["\'](?P<url>(?:https?:)?//(?:stream\.new/v|player\.mux\.com)/(?P<id>[A-Za-z0-9-]+))']
_... | Can you add one test for player.mux.com? Can be `only_matching` | 'title': 'OCtRWZiZqKvLbnZ32WSEYiGNvHdAmB01j',
},
}, {
'url': 'https://player.mux.com/OCtRWZiZqKvLbnZ32WSEYiGNvHdAmB01j',
'info_dict': {
'ext': 'mp4',
'id': 'OCtRWZiZqKvLbnZ32WSEYiGNvHdAmB01j',
'title': 'OCtRWZiZqKvLbnZ32WSEYiGNvHdAmB01j',
... | @@ -0,0 +1,33 @@
+from .common import InfoExtractor
+
+
+class MuxStreamNewIE(InfoExtractor):
+ IE_NAME = 'stream.new'
+ _VALID_URL = r'https?://(?:stream\.new/v|player\.mux\.com)/(?P<id>[A-Za-z0-9-]+)'
+ _EMBED_REGEX = [r'<iframe\b[^>]+\bsrc=["\'](?P<url>(?:https?:)?//(?:stream\.new/v|player\.mux\.com)/(?P<id... | yt_dlp/extractor/mux.py | 26 | Python | 0.357 | suggestion | 63 | 34 | 51 | false | [ie/mux] Add extractor | 14,914 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | PierceLBrooks |
from .common import InfoExtractor
class MuxStreamNewIE(InfoExtractor):
IE_NAME = 'stream.new'
_VALID_URL = r'https?://(?:stream\.new/v|player\.mux\.com)/(?P<id>[A-Za-z0-9-]+)'
_EMBED_REGEX = [r'<iframe\b[^>]+\bsrc=["\'](?P<url>(?:https?:)?//(?:stream\.new/v|player\.mux\.com)/(?P<id>[A-Za-z0-9-]+))']
_... | Please also add `_WEBPAGE_TESTS` for the embed detection | }]
_WEBPAGE_TESTS = [{
# iframe embed
'url': 'https://www.redbrickai.com/blog/2025-07-14-FAST-brush',
'info_dict': {
'ext': 'mp4',
'id': 'cXhzAiW1AmsHY01eRbEYFcTEAn0102aGN8sbt8JprP6Dfw',
'title': 'cXhzAiW1AmsHY01eRbEYFcTEAn0102aGN8sbt8JprP6Dfw',
... | @@ -0,0 +1,33 @@
+from .common import InfoExtractor
+
+
+class MuxStreamNewIE(InfoExtractor):
+ IE_NAME = 'stream.new'
+ _VALID_URL = r'https?://(?:stream\.new/v|player\.mux\.com)/(?P<id>[A-Za-z0-9-]+)'
+ _EMBED_REGEX = [r'<iframe\b[^>]+\bsrc=["\'](?P<url>(?:https?:)?//(?:stream\.new/v|player\.mux\.com)/(?P<id... | yt_dlp/extractor/mux.py | 26 | Python | 0.357 | suggestion | 56 | 34 | 51 | false | [ie/mux] Add extractor | 14,914 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | PierceLBrooks |
from .common import InfoExtractor
class MuxStreamNewIE(InfoExtractor):
IE_NAME = 'stream.new'
_VALID_URL = r'https?://(?:stream\.new/v|player\.mux\.com)/(?P<id>[A-Za-z0-9-]+)'
_EMBED_REGEX = [r'<iframe\b[^>]+\bsrc=["\'](?P<url>(?:https?:)?//(?:stream\.new/v|player\.mux\.com)/(?P<id>[A-Za-z0-9-]+))']
_... | I would expand the embed detection to detect `<mux-player>` web components like used here https://muxvideo.2coders.com/download/ (please also add as a test)
```suggestion
@classmethod
def _extract_embed_urls(cls, url, webpage):
yield from super()._extract_embed_urls(url, webpage)
for play... | _WEBPAGE_TESTS = [{
# iframe embed
'url': 'https://www.redbrickai.com/blog/2025-07-14-FAST-brush',
'info_dict': {
'ext': 'mp4',
'id': 'cXhzAiW1AmsHY01eRbEYFcTEAn0102aGN8sbt8JprP6Dfw',
'title': 'cXhzAiW1AmsHY01eRbEYFcTEAn0102aGN8sbt8JprP6Dfw',
},
... | @@ -0,0 +1,33 @@
+from .common import InfoExtractor
+
+
+class MuxStreamNewIE(InfoExtractor):
+ IE_NAME = 'stream.new'
+ _VALID_URL = r'https?://(?:stream\.new/v|player\.mux\.com)/(?P<id>[A-Za-z0-9-]+)'
+ _EMBED_REGEX = [r'<iframe\b[^>]+\bsrc=["\'](?P<url>(?:https?:)?//(?:stream\.new/v|player\.mux\.com)/(?P<id... | yt_dlp/extractor/mux.py | 26 | Python | 0.857 | refactor | 476 | 34 | 51 | false | [ie/mux] Add extractor | 14,914 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | PierceLBrooks |
'id': 'OCtRWZiZqKvLbnZ32WSEYiGNvHdAmB01j',
'title': 'OCtRWZiZqKvLbnZ32WSEYiGNvHdAmB01j',
},
}]
_WEBPAGE_TESTS = [{
# iframe embed
'url': 'https://www.redbrickai.com/blog/2025-07-14-FAST-brush',
'info_dict': {
'ext': 'mp4',
'id': 'cX... | ```suggestion
for mux_player in re.findall(r'<mux-(?:player|video)\b[^>]*\bplayback-id=[^>]+>', webpage):
``` | 'title': 'OCtRWZiZqKvLbnZ32WSEYiGNvHdAmB01j',
},
}, {
'url': 'https://player.mux.com/OCtRWZiZqKvLbnZ32WSEYiGNvHdAmB01j',
'info_dict': {
'ext': 'mp4',
'id': 'OCtRWZiZqKvLbnZ32WSEYiGNvHdAmB01j',
'title': 'OCtRWZiZqKvLbnZ32WSEYiGNvHdAmB01j',
... | @@ -0,0 +1,72 @@
+import re
+import urllib.parse
+
+from .common import InfoExtractor
+from ..utils import extract_attributes, filter_dict, parse_qs
+from ..utils.traversal import traverse_obj
+
+
+class MuxIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:stream\.new/v|player\.mux\.com)/(?P<id>[A-Za-z0-9-]+)'
+ _E... | yt_dlp/extractor/mux.py | 26 | Python | 0.714 | suggestion | 119 | 51 | 51 | false | [ie/mux] Add extractor | 14,914 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | PierceLBrooks |
'url': 'https://muxvideo.2coders.com/download/',
'info_dict': {
'ext': 'mp4',
'id': 'JBuasdg35Hw7tYmTe9k68QLPQKixL300YsWHDz5Flit8',
'title': 'JBuasdg35Hw7tYmTe9k68QLPQKixL300YsWHDz5Flit8',
},
}]
@classmethod
def _extract_embed_urls(cls, url, webpa... | ```suggestion
token = traverse_obj(parse_qs(url), ('playback-token', -1))
``` | 'info_dict': {
'ext': 'mp4',
'id': 'cXhzAiW1AmsHY01eRbEYFcTEAn0102aGN8sbt8JprP6Dfw',
'title': 'cXhzAiW1AmsHY01eRbEYFcTEAn0102aGN8sbt8JprP6Dfw',
},
}, {
# mux-player embed
'url': 'https://muxvideo.2coders.com/download/',
'info_dict': {
... | @@ -0,0 +1,72 @@
+import re
+
+from .common import InfoExtractor
+from ..utils import extract_attributes, filter_dict, parse_qs, update_url_query
+from ..utils.traversal import traverse_obj
+
+
+class MuxIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:stream\.new/v|player\.mux\.com)/(?P<id>[A-Za-z0-9-]+)'
+ _EMBE... | yt_dlp/extractor/mux.py | 26 | Python | 0.571 | suggestion | 87 | 38 | 51 | false | [ie/mux] Add extractor | 14,914 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | PierceLBrooks |
'id': 'cXhzAiW1AmsHY01eRbEYFcTEAn0102aGN8sbt8JprP6Dfw',
'title': 'cXhzAiW1AmsHY01eRbEYFcTEAn0102aGN8sbt8JprP6Dfw',
},
}, {
# mux-player embed
'url': 'https://muxvideo.2coders.com/download/',
'info_dict': {
'ext': 'mp4',
'id': 'JBuasdg35... | ```suggestion
embed_url = update_url_query(
f'https://player.mux.com/{playback_id}',
filter_dict({'playback-token': token}))
if title := attrs.get('metadata-video-title'):
embed_url = smuggle_url(embed_url, {'title': title})
yield... | },
}]
_WEBPAGE_TESTS = [{
# iframe embed
'url': 'https://www.redbrickai.com/blog/2025-07-14-FAST-brush',
'info_dict': {
'ext': 'mp4',
'id': 'cXhzAiW1AmsHY01eRbEYFcTEAn0102aGN8sbt8JprP6Dfw',
'title': 'cXhzAiW1AmsHY01eRbEYFcTEAn0102aGN8sbt8JprP6D... | @@ -0,0 +1,72 @@
+import re
+
+from .common import InfoExtractor
+from ..utils import extract_attributes, filter_dict, parse_qs, update_url_query
+from ..utils.traversal import traverse_obj
+
+
+class MuxIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:stream\.new/v|player\.mux\.com)/(?P<id>[A-Za-z0-9-]+)'
+ _EMBE... | yt_dlp/extractor/mux.py | 26 | Python | 0.786 | suggestion | 335 | 43 | 51 | false | [ie/mux] Add extractor | 14,914 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | PierceLBrooks |
import re
from .common import InfoExtractor
from ..utils import extract_attributes, filter_dict, parse_qs, update_url_query
from ..utils.traversal import traverse_obj
class MuxIE(InfoExtractor):
_VALID_URL = r'https?://(?:stream\.new/v|player\.mux\.com)/(?P<id>[A-Za-z0-9-]+)'
_EMBED_REGEX = [r'<iframe\b[^>]+... | ```suggestion
url, smuggled_data = unsmuggle_url(url)
video_id = self._match_id(url)
token = traverse_obj(parse_qs(url), ('playback-token', -1))
``` | },
}]
@classmethod
def _extract_embed_urls(cls, url, webpage):
yield from super()._extract_embed_urls(url, webpage)
for mux_player in re.findall(r'<mux-(?:player|video)\b[^>]*\bplayback-id=[^>]+>', webpage):
attrs = extract_attributes(mux_player)
playback_id ... | @@ -0,0 +1,72 @@
+import re
+
+from .common import InfoExtractor
+from ..utils import extract_attributes, filter_dict, parse_qs, update_url_query
+from ..utils.traversal import traverse_obj
+
+
+class MuxIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:stream\.new/v|player\.mux\.com)/(?P<id>[A-Za-z0-9-]+)'
+ _EMBE... | yt_dlp/extractor/mux.py | 26 | Python | 0.714 | suggestion | 176 | 73 | 38 | false | [ie/mux] Add extractor | 14,914 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | PierceLBrooks |
@classmethod
def _extract_embed_urls(cls, url, webpage):
yield from super()._extract_embed_urls(url, webpage)
for mux_player in re.findall(r'<mux-(?:player|video)\b[^>]*\bplayback-id=[^>]+>', webpage):
attrs = extract_attributes(mux_player)
playback_id = attrs.get('playba... | ```suggestion
'title': smuggled_data.get('title') or video_id,
``` | 'info_dict': {
'ext': 'mp4',
'id': 'JBuasdg35Hw7tYmTe9k68QLPQKixL300YsWHDz5Flit8',
'title': 'JBuasdg35Hw7tYmTe9k68QLPQKixL300YsWHDz5Flit8',
},
}, {
# mux-player with title metadata
'url': 'https://datastar-todomvc.cross.stream/',
'info_dict... | @@ -0,0 +1,72 @@
+import re
+
+from .common import InfoExtractor
+from ..utils import extract_attributes, filter_dict, parse_qs, update_url_query
+from ..utils.traversal import traverse_obj
+
+
+class MuxIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:stream\.new/v|player\.mux\.com)/(?P<id>[A-Za-z0-9-]+)'
+ _EMBE... | yt_dlp/extractor/mux.py | 26 | Python | 0.571 | suggestion | 80 | 30 | 50 | false | [ie/mux] Add extractor | 14,914 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | PierceLBrooks |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.