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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
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
from ..utils import (
extract_attributes,
filter_dict,
parse_qs,
smuggle_url,
unsmuggle_url,
update_url_query,
)
``` | 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,72 @@
+import re
+
+from .common import InfoExtractor
+from ..utils import extract_attributes, filter_dict, parse_qs, update_url_query | yt_dlp/extractor/mux.py | 4 | Python | 0.786 | refactor | 163 | 29 | 29 | false | [ie/mux] Add extractor | 14,914 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | PierceLBrooks |
**traverse_obj(data, ('activeEpisodeData', {
'url': ('audio', {urljoin(self._API_BASE_URL)}),
'id': ('id', {str}),
'title': ('title', {str}),
'description': ('description', {clean_html}),
'duration': ('duration', {int_or_none}),... | We probably want to also include URLs with query args or anchors, right?
```suggestion
_VALID_URL = r'https?://(?P<id>[\w-]+)\.mave\.digital/?(?:$|[?#])'
``` | 'episode': 'Episode 3',
'episode_number': 3,
'timestamp': 1747817300,
'upload_date': '20250521',
},
}, {
'url': 'https://budem.mave.digital/ep-12',
'md5': 'e1ce2780fcdb6f17821aa3ca3e8c919f',
'info_dict': {
'id': '41898bb5-ff... | @@ -105,3 +106,53 @@ def _real_extract(self, url):
'uploader': ('author', {str}),
})),
}
+
+
+class MaveChannelIE(InfoExtractor):
+ IE_NAME = 'mave:channel'
+ _VALID_URL = r'https?://(?P<id>[\w-]+)\.mave\.digital/?$' | yt_dlp/extractor/mave.py | 26 | Python | 0.714 | suggestion | 164 | 51 | 51 | false | [ie/mave:channel] Add extractor | 14,915 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | anlar |
IE_NAME = 'mave:channel'
_VALID_URL = r'https?://(?P<id>[\w-]+)\.mave\.digital/?$'
_TESTS = [{
'url': 'https://budem.mave.digital/',
'info_dict': {
'id': 'budem',
'title': 'Все там будем',
'description': 'md5:f04ae12a42be0f1d765c5e326b41987a',
},
... | This limits us to the first 50 entries. Example with more episodes: https://geekcity.mave.digital/
Instead I would use the API and properly paginate https://api.mave.digital/v1/website/geekcity/episodes?view=all&page=1&sort=newest&format=all
Arguably even the single page extractor should have used the api. Either w... | 'series': 'Все там будем',
'series_id': 'fe9347bf-c009-4ebd-87e8-b06f2f324746',
'season': 'Season 2',
'season_number': 2,
'episode': 'Episode 5',
'episode_number': 5,
'timestamp': 1735538400,
'upload_date': '20241230',
... | @@ -105,3 +106,53 @@ def _real_extract(self, url):
'uploader': ('author', {str}),
})),
}
+
+
+class MaveChannelIE(InfoExtractor):
+ IE_NAME = 'mave:channel'
+ _VALID_URL = r'https?://(?P<id>[\w-]+)\.mave\.digital/?$'
+ _TESTS = [{
+ 'url': 'https://budem.mave.digit... | yt_dlp/extractor/mave.py | 26 | Python | 0.5 | refactor | 539 | 48 | 51 | false | [ie/mave:channel] Add extractor | 14,915 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | anlar |
'id': 'budem',
'title': 'Все там будем',
'description': 'md5:f04ae12a42be0f1d765c5e326b41987a',
},
'playlist_mincount': 15,
}, {
'url': 'https://ochenlichnoe.mave.digital/',
'info_dict': {
'id': 'ochenlichnoe',
'title': 'Оче... | can be inlined as a single traverse_obj call that is unpacked in to kwargs of `playlist_result` | 'episode_number': 5,
'timestamp': 1735538400,
'upload_date': '20241230',
},
}]
def _real_extract(self, url):
channel_id, episode_code = self._match_valid_url(url).group(
'channel_id', 'episode_code')
display_id = f'{channel_id}-{episode_co... | @@ -105,3 +106,53 @@ def _real_extract(self, url):
'uploader': ('author', {str}),
})),
}
+
+
+class MaveChannelIE(InfoExtractor):
+ IE_NAME = 'mave:channel'
+ _VALID_URL = r'https?://(?P<id>[\w-]+)\.mave\.digital/?$'
+ _TESTS = [{
+ 'url': 'https://budem.mave.digit... | yt_dlp/extractor/mave.py | 26 | Python | 0.357 | suggestion | 95 | 43 | 51 | false | [ie/mave:channel] Add extractor | 14,915 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | anlar |
from .magentamusik import MagentaMusikIE
from .mailru import (
MailRuIE,
MailRuMusicIE,
MailRuMusicSearchIE,
)
from .mainstreaming import MainStreamingIE
from .mangomolo import (
MangomoloLiveIE,
MangomoloVideoIE,
)
from .manoto import (
ManotoTVIE,
ManotoTVLiveIE,
ManotoTVShowIE,
)
from... | ```suggestion
from .mave import (
MaveChannelIE,
MaveIE,
)
``` | from .magentamusik import MagentaMusikIE
from .mailru import (
MailRuIE,
MailRuMusicIE,
MailRuMusicSearchIE,
)
from .mainstreaming import MainStreamingIE
from .mangomolo import (
MangomoloLiveIE,
MangomoloVideoIE,
)
from .manoto import (
ManotoTVIE,
ManotoTVLiveIE,
ManotoTVShowIE,
)
from... | @@ -1090,7 +1090,7 @@
from .massengeschmacktv import MassengeschmackTVIE
from .masters import MastersIE
from .matchtv import MatchTVIE
-from .mave import MaveIE
+from .mave import MaveChannelIE, MaveIE | yt_dlp/extractor/_extractors.py | 26 | Python | 0.571 | suggestion | 75 | 51 | 51 | false | [ie/mave:channel] Add extractor | 14,915 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | anlar |
from .common import InfoExtractor
from ..utils import (
clean_html,
int_or_none,
parse_iso8601,
)
class MaveBaseIE(InfoExtractor):
_API_BASE_URL = 'https://api.mave.digital/v1/website'
_API_BASE_STORAGE_URL = 'https://store.cloud.mts.ru/mave/'
def _load_channel_meta(self, channel_id):
... | I would add a note
```suggestion
return self._download_json(
f'{self._API_BASE_URL}/{channel_id}/', channel_id,
note='Downloading channel metadata')
``` | import functools
import math
from .common import InfoExtractor
from ..utils import (
InAdvancePagedList,
clean_html,
int_or_none,
parse_iso8601,
urljoin,
)
from ..utils.traversal import require, traverse_obj
class MaveBaseIE(InfoExtractor):
_API_BASE_URL = 'https://api.mave.digital/v1/website... | @@ -1,24 +1,73 @@
-import re
-
from .common import InfoExtractor
from ..utils import (
clean_html,
int_or_none,
parse_iso8601,
- urljoin,
)
-from ..utils.traversal import require, traverse_obj
-class MaveIE(InfoExtractor):
- _VALID_URL = r'https?://(?P<channel>[\w-]+)\.mave\.digital/(?P<id>e... | yt_dlp/extractor/mave.py | 16 | Python | 0.714 | suggestion | 189 | 41 | 41 | false | [ie/mave:channel] Add extractor | 14,915 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | anlar |
from .common import InfoExtractor
from ..utils import (
clean_html,
int_or_none,
parse_iso8601,
)
class MaveBaseIE(InfoExtractor):
_API_BASE_URL = 'https://api.mave.digital/v1/website'
_API_BASE_STORAGE_URL = 'https://store.cloud.mts.ru/mave/'
def _load_channel_meta(self, channel_id):
... | same here
```suggestion
return self._download_json(
f'{self._API_BASE_URL}/{channel_id}/episodes/{episode_code}',
episode_code, note='Downloading episode metadata')
``` | import functools
import math
from .common import InfoExtractor
from ..utils import (
InAdvancePagedList,
clean_html,
int_or_none,
parse_iso8601,
urljoin,
)
from ..utils.traversal import require, traverse_obj
class MaveBaseIE(InfoExtractor):
_API_BASE_URL = 'https://api.mave.digital/v1/website... | @@ -1,24 +1,73 @@
-import re
-
from .common import InfoExtractor
from ..utils import (
clean_html,
int_or_none,
parse_iso8601,
- urljoin,
)
-from ..utils.traversal import require, traverse_obj
-class MaveIE(InfoExtractor):
- _VALID_URL = r'https?://(?P<channel>[\w-]+)\.mave\.digital/(?P<id>e... | yt_dlp/extractor/mave.py | 21 | Python | 0.786 | suggestion | 205 | 46 | 46 | false | [ie/mave:channel] Add extractor | 14,915 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | anlar |
'thumbnail': self._API_BASE_STORAGE_URL + episode_meta['image'],
'url': self._API_BASE_STORAGE_URL + episode_meta['audio'],
'id': episode_meta['id'],
'title': episode_meta['title'],
'description': clean_html(episode_meta['description']),
'duration'... | Let's simplify this using `traverse_obj`
```suggestion
return {
'display_id': f'{channel_id}-{episode_meta["code"]}',
'channel_id': channel_id,
'channel_url': f'https://{channel_id}.mave.digital/',
'vcodec': 'none',
**traverse_obj(episode_meta, ... | 'extractor_key': MaveIE.ie_key(),
'extractor': MaveIE.IE_NAME,
'webpage_url': f'https://{channel_id}.mave.digital/ep-{episode_code}',
'channel_id': channel_id,
'channel_url': f'https://{channel_id}.mave.digital/',
'vcodec': 'none',
**tr... | @@ -1,24 +1,73 @@
-import re
-
from .common import InfoExtractor
from ..utils import (
clean_html,
int_or_none,
parse_iso8601,
- urljoin,
)
-from ..utils.traversal import require, traverse_obj
-class MaveIE(InfoExtractor):
- _VALID_URL = r'https?://(?P<channel>[\w-]+)\.mave\.digital/(?P<id>e... | yt_dlp/extractor/mave.py | 26 | Python | 1 | security | 1,552 | 51 | 51 | false | [ie/mave:channel] Add extractor | 14,915 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | anlar |
}]
def _real_extract(self, url):
channel_id = self._match_id(url)
channel_meta = self._load_channel_meta(channel_id)
entries = []
page = 1
while True:
data = self._download_json(
f'{self._API_BASE_URL}/{channel_id}/episodes?'
... | I would use an InAdvancePagedList here
```suggestion
_PAGE_SIZE = 50
def _entries(self, channel_id, channel_meta, page_num):
page_data = self._download_json(
f'{self._API_BASE_URL}/{channel_id}/episodes', channel_id, query={
'view': 'all',
'page': pag... | 'description': 'md5:4164d425d60a0d97abdce9d1f6f8e049',
},
'playlist_mincount': 80,
}]
_PAGE_SIZE = 50
def _entries(self, channel_id, channel_meta, page_num):
page_data = self._download_json(
f'{self._API_BASE_URL}/{channel_id}/episodes', channel_id, query={
... | @@ -68,40 +117,75 @@ class MaveIE(InfoExtractor):
'upload_date': '20241230',
},
}]
- _API_BASE_URL = 'https://api.mave.digital/'
def _real_extract(self, url):
- channel_id, slug = self._match_valid_url(url).group('channel', 'id')
- display_id = f'{channel_id}-{slug}'
-... | yt_dlp/extractor/mave.py | 26 | Python | 0.857 | refactor | 754 | 35 | 34 | false | [ie/mave:channel] Add extractor | 14,915 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | anlar |
entries = []
page = 1
while True:
data = self._download_json(
f'{self._API_BASE_URL}/{channel_id}/episodes?'
f'view=all&page={page}&sort=newest&format=all',
channel_id)
episodes = data.get('episodes', [])
if n... | And also make the metadata extraction non-fatal
```suggestion
**traverse_obj(channel_meta, {
'title': ('podcast', 'title', {str}),
'description': ('podcast', 'description', {str}),
}),
'entries': InAdvancePagedList(
functools.par... | page_data = self._download_json(
f'{self._API_BASE_URL}/{channel_id}/episodes', channel_id, query={
'view': 'all',
'page': page_num + 1,
'sort': 'newest',
'format': 'all',
}, note=f'Downloading page {page_num + 1}')
... | @@ -68,40 +117,75 @@ class MaveIE(InfoExtractor):
'upload_date': '20241230',
},
}]
- _API_BASE_URL = 'https://api.mave.digital/'
def _real_extract(self, url):
- channel_id, slug = self._match_valid_url(url).group('channel', 'id')
- display_id = f'{channel_id}-{slug}'
-... | yt_dlp/extractor/mave.py | 26 | Python | 1 | refactor | 478 | 28 | 27 | false | [ie/mave:channel] Add extractor | 14,915 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | anlar |
import functools
import math
from .common import InfoExtractor
from ..utils import (
InAdvancePagedList,
clean_html,
int_or_none,
parse_iso8601,
traverse_obj,
urljoin,
)
class MaveBaseIE(InfoExtractor):
_API_BASE_URL = 'https://api.mave.digital/v1/website'
_API_BASE_STORAGE_URL = 'htt... | We should in the logs show the actual display_id
```suggestion
def _load_channel_meta(self, channel_id, display_id):
return self._download_json(
f'{self._API_BASE_URL}/{channel_id}/', display_id,
``` | import functools
import math
from .common import InfoExtractor
from ..utils import (
InAdvancePagedList,
clean_html,
int_or_none,
parse_iso8601,
urljoin,
)
from ..utils.traversal import require, traverse_obj
class MaveBaseIE(InfoExtractor):
_API_BASE_URL = 'https://api.mave.digital/v1/website... | @@ -1,24 +1,75 @@
-import re
+import functools
+import math
from .common import InfoExtractor
from ..utils import (
+ InAdvancePagedList,
clean_html,
int_or_none,
parse_iso8601,
+ traverse_obj,
urljoin,
)
-from ..utils.traversal import require, traverse_obj
-class MaveIE(InfoExtractor... | yt_dlp/extractor/mave.py | 21 | Python | 0.857 | suggestion | 228 | 46 | 46 | false | [ie/mave:channel] Add extractor | 14,915 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | anlar |
import functools
import math
from .common import InfoExtractor
from ..utils import (
InAdvancePagedList,
clean_html,
int_or_none,
parse_iso8601,
traverse_obj,
urljoin,
)
class MaveBaseIE(InfoExtractor):
_API_BASE_URL = 'https://api.mave.digital/v1/website'
_API_BASE_STORAGE_URL = 'htt... | ```suggestion
def _load_episode_meta(self, channel_id, episode_code, display_id):
``` | import functools
import math
from .common import InfoExtractor
from ..utils import (
InAdvancePagedList,
clean_html,
int_or_none,
parse_iso8601,
urljoin,
)
from ..utils.traversal import require, traverse_obj
class MaveBaseIE(InfoExtractor):
_API_BASE_URL = 'https://api.mave.digital/v1/website... | @@ -1,24 +1,75 @@
-import re
+import functools
+import math
from .common import InfoExtractor
from ..utils import (
+ InAdvancePagedList,
clean_html,
int_or_none,
parse_iso8601,
+ traverse_obj,
urljoin,
)
-from ..utils.traversal import require, traverse_obj
-class MaveIE(InfoExtractor... | yt_dlp/extractor/mave.py | 24 | Python | 0.571 | suggestion | 91 | 49 | 49 | false | [ie/mave:channel] Add extractor | 14,915 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | anlar |
import math
from .common import InfoExtractor
from ..utils import (
InAdvancePagedList,
clean_html,
int_or_none,
parse_iso8601,
traverse_obj,
urljoin,
)
class MaveBaseIE(InfoExtractor):
_API_BASE_URL = 'https://api.mave.digital/v1/website'
_API_BASE_STORAGE_URL = 'https://store.cloud.... | ```suggestion
display_id, note='Downloading episode metadata')
``` | import math
from .common import InfoExtractor
from ..utils import (
InAdvancePagedList,
clean_html,
int_or_none,
parse_iso8601,
urljoin,
)
from ..utils.traversal import require, traverse_obj
class MaveBaseIE(InfoExtractor):
_API_BASE_URL = 'https://api.mave.digital/v1/website'
_API_BASE_S... | @@ -1,24 +1,75 @@
-import re
+import functools
+import math
from .common import InfoExtractor
from ..utils import (
+ InAdvancePagedList,
clean_html,
int_or_none,
parse_iso8601,
+ traverse_obj,
urljoin,
)
-from ..utils.traversal import require, traverse_obj
-class MaveIE(InfoExtractor... | yt_dlp/extractor/mave.py | 26 | Python | 0.571 | suggestion | 80 | 51 | 51 | false | [ie/mave:channel] Add extractor | 14,915 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | anlar |
InAdvancePagedList,
clean_html,
int_or_none,
parse_iso8601,
traverse_obj,
urljoin,
)
class MaveBaseIE(InfoExtractor):
_API_BASE_URL = 'https://api.mave.digital/v1/website'
_API_BASE_STORAGE_URL = 'https://store.cloud.mts.ru/mave/'
def _load_channel_meta(self, channel_id):
... | Need to set extractor_key, extractor, and webpage_url
```suggestion
'display_id': f'{channel_id}-{episode_code}',
'extractor_key': MaveIE.ie_key(),
'extractor': MaveIE.IE_NAME,
'webpage_url': f'https://{channel_id}.mave.digital/ep-{episode_code}',
``` | InAdvancePagedList,
clean_html,
int_or_none,
parse_iso8601,
urljoin,
)
from ..utils.traversal import require, traverse_obj
class MaveBaseIE(InfoExtractor):
_API_BASE_URL = 'https://api.mave.digital/v1/website'
_API_BASE_STORAGE_URL = 'https://store.cloud.mts.ru/mave/'
def _load_channe... | @@ -1,24 +1,75 @@
-import re
+import functools
+import math
from .common import InfoExtractor
from ..utils import (
+ InAdvancePagedList,
clean_html,
int_or_none,
parse_iso8601,
+ traverse_obj,
urljoin,
)
-from ..utils.traversal import require, traverse_obj
-class MaveIE(InfoExtractor... | yt_dlp/extractor/mave.py | 26 | Python | 0.857 | refactor | 305 | 51 | 51 | false | [ie/mave:channel] Add extractor | 14,915 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | anlar |
InAdvancePagedList,
clean_html,
int_or_none,
parse_iso8601,
traverse_obj,
urljoin,
)
class MaveBaseIE(InfoExtractor):
_API_BASE_URL = 'https://api.mave.digital/v1/website'
_API_BASE_STORAGE_URL = 'https://store.cloud.mts.ru/mave/'
def _load_channel_meta(self, channel_id):
... | ```suggestion
episode_code = traverse_obj(episode_meta, ('code', {require('episode code')}))
return {
``` | InAdvancePagedList,
clean_html,
int_or_none,
parse_iso8601,
urljoin,
)
from ..utils.traversal import require, traverse_obj
class MaveBaseIE(InfoExtractor):
_API_BASE_URL = 'https://api.mave.digital/v1/website'
_API_BASE_STORAGE_URL = 'https://store.cloud.mts.ru/mave/'
def _load_channe... | @@ -1,24 +1,75 @@
-import re
+import functools
+import math
from .common import InfoExtractor
from ..utils import (
+ InAdvancePagedList,
clean_html,
int_or_none,
parse_iso8601,
+ traverse_obj,
urljoin,
)
-from ..utils.traversal import require, traverse_obj
-class MaveIE(InfoExtractor... | yt_dlp/extractor/mave.py | 26 | Python | 0.714 | suggestion | 124 | 51 | 51 | false | [ie/mave:channel] Add extractor | 14,915 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | anlar |
return self._download_json(
f'{self._API_BASE_URL}/{channel_id}/episodes/{episode_code}',
episode_code, note='Downloading episode metadata')
def _create_entry(self, channel_id, channel_meta, episode_meta):
return {
'display_id': f'{channel_id}-{episode_meta["code... | Please keep the formatting as I suggested it
```suggestion
'like_count': ('reactions', lambda _, v: v['type'] == 'like', 'count', {int_or_none}, any),
'dislike_count': ('reactions', lambda _, v: v['type'] == 'dislike', 'count', {int_or_none}, any),
``` | return self._download_json(
f'{self._API_BASE_URL}/{channel_id}/episodes/{episode_code}',
display_id, note='Downloading episode metadata')
def _create_entry(self, channel_id, channel_meta, episode_meta):
episode_code = traverse_obj(episode_meta, ('code', {int}, {require('epi... | @@ -1,24 +1,75 @@
-import re
+import functools
+import math
from .common import InfoExtractor
from ..utils import (
+ InAdvancePagedList,
clean_html,
int_or_none,
parse_iso8601,
+ traverse_obj,
urljoin,
)
-from ..utils.traversal import require, traverse_obj
-class MaveIE(InfoExtractor... | yt_dlp/extractor/mave.py | 26 | Python | 0.929 | suggestion | 288 | 51 | 51 | false | [ie/mave:channel] Add extractor | 14,915 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | anlar |
f'{self._API_BASE_URL}/{channel_id}/episodes/{episode_code}',
episode_code, note='Downloading episode metadata')
def _create_entry(self, channel_id, channel_meta, episode_meta):
return {
'display_id': f'{channel_id}-{episode_meta["code"]}',
'channel_id': chan... | Additional bool check
```suggestion
'age_limit': ('is_explicit', {bool}, {lambda x: 18 if x else None}),
``` | f'{self._API_BASE_URL}/{channel_id}/episodes/{episode_code}',
display_id, note='Downloading episode metadata')
def _create_entry(self, channel_id, channel_meta, episode_meta):
episode_code = traverse_obj(episode_meta, ('code', {int}, {require('episode code')}))
return {
... | @@ -1,24 +1,75 @@
-import re
+import functools
+import math
from .common import InfoExtractor
from ..utils import (
+ InAdvancePagedList,
clean_html,
int_or_none,
parse_iso8601,
+ traverse_obj,
urljoin,
)
-from ..utils.traversal import require, traverse_obj
-class MaveIE(InfoExtractor... | yt_dlp/extractor/mave.py | 26 | Python | 0.714 | suggestion | 127 | 51 | 51 | false | [ie/mave:channel] Add extractor | 14,915 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | anlar |
'title': 'Екатерина Михайлова: "Горе от ума" не про женщин написана',
'description': 'md5:fa3bdd59ee829dfaf16e3efcb13f1d19',
'uploader': 'Полина Цветкова+Евгения Акопова',
'channel': 'Все там будем',
'channel_id': 'budem',
'channel_url': 'https://b... | ```suggestion
'channel_id', 'episode_code')
display_id = f'{channel_id}-{episode_code}'
``` | 'title': 'Екатерина Михайлова: "Горе от ума" не про женщин написана',
'description': 'md5:fa3bdd59ee829dfaf16e3efcb13f1d19',
'uploader': 'Полина Цветкова+Евгения Акопова',
'channel': 'Все там будем',
'channel_id': 'budem',
'channel_url': 'https://b... | @@ -68,40 +119,74 @@ class MaveIE(InfoExtractor):
'upload_date': '20241230',
},
}]
- _API_BASE_URL = 'https://api.mave.digital/'
def _real_extract(self, url):
- channel_id, slug = self._match_valid_url(url).group('channel', 'id')
- display_id = f'{channel_id}-{slug}'
-... | yt_dlp/extractor/mave.py | 26 | Python | 0.714 | suggestion | 114 | 51 | 51 | false | [ie/mave:channel] Add extractor | 14,915 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | anlar |
'channel': 'Все там будем',
'channel_id': 'budem',
'channel_url': 'https://budem.mave.digital/',
'view_count': int,
'like_count': int,
'dislike_count': int,
'age_limit': 18,
'duration': 3664,
'thumbnail': r're:ht... | ```suggestion
channel_meta = self._load_channel_meta(channel_id, display_id)
episode_meta = self._load_episode_meta(channel_id, episode_code, display_id)
``` | 'channel': 'Все там будем',
'channel_id': 'budem',
'channel_url': 'https://budem.mave.digital/',
'view_count': int,
'like_count': int,
'dislike_count': int,
'age_limit': 18,
'duration': 3664,
'thumbnail': r're:ht... | @@ -68,40 +119,74 @@ class MaveIE(InfoExtractor):
'upload_date': '20241230',
},
}]
- _API_BASE_URL = 'https://api.mave.digital/'
def _real_extract(self, url):
- channel_id, slug = self._match_valid_url(url).group('channel', 'id')
- display_id = f'{channel_id}-{slug}'
-... | yt_dlp/extractor/mave.py | 26 | Python | 0.714 | suggestion | 176 | 51 | 51 | false | [ie/mave:channel] Add extractor | 14,915 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | anlar |
}, {
'url': 'https://geekcity.mave.digital/',
'info_dict': {
'id': 'geekcity',
'title': 'Мужчины в трико',
'description': 'md5:4164d425d60a0d97abdce9d1f6f8e049',
},
'playlist_mincount': 80,
}]
_PAGE_SIZE = 50
def _entries(self, channel... | ```suggestion
channel_meta = self._load_channel_meta(channel_id, channel_id)
``` | 'playlist_mincount': 20,
}, {
'url': 'https://geekcity.mave.digital/',
'info_dict': {
'id': 'geekcity',
'title': 'Мужчины в трико',
'description': 'md5:4164d425d60a0d97abdce9d1f6f8e049',
},
'playlist_mincount': 80,
}]
_PAGE_SIZE = 5... | @@ -68,40 +119,74 @@ class MaveIE(InfoExtractor):
'upload_date': '20241230',
},
}]
- _API_BASE_URL = 'https://api.mave.digital/'
def _real_extract(self, url):
- channel_id, slug = self._match_valid_url(url).group('channel', 'id')
- display_id = f'{channel_id}-{slug}'
-... | yt_dlp/extractor/mave.py | 26 | Python | 0.571 | suggestion | 90 | 42 | 40 | false | [ie/mave:channel] Add extractor | 14,915 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | anlar |
'view': 'all',
'page': page_num + 1,
'sort': 'newest',
'format': 'all',
}, note=f'Downloading page {page_num + 1}')
for ep in traverse_obj(page_data, ('episodes', ..., {dict})):
yield self._create_entry(channel_id, channel_m... | ```suggestion
math.ceil(channel_meta['podcast']['episodes_count'] / self._PAGE_SIZE), self._PAGE_SIZE),
``` | f'{self._API_BASE_URL}/{channel_id}/episodes', channel_id, query={
'view': 'all',
'page': page_num + 1,
'sort': 'newest',
'format': 'all',
}, note=f'Downloading page {page_num + 1}')
for ep in traverse_obj(page_data, ('episo... | @@ -68,40 +119,74 @@ class MaveIE(InfoExtractor):
'upload_date': '20241230',
},
}]
- _API_BASE_URL = 'https://api.mave.digital/'
def _real_extract(self, url):
- channel_id, slug = self._match_valid_url(url).group('channel', 'id')
- display_id = f'{channel_id}-{slug}'
-... | yt_dlp/extractor/mave.py | 26 | Python | 0.857 | suggestion | 125 | 28 | 26 | false | [ie/mave:channel] Add extractor | 14,915 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | anlar |
'info_dict': {
'id': 'ochenlichnoe',
'title': 'Очень личное',
'description': 'md5:ee36a6a52546b91b487fe08c552fdbb2',
},
'playlist_mincount': 20,
}, {
'url': 'https://geekcity.mave.digital/',
'info_dict': {
'id': 'geekcity',
... | do we want to filter for `audio` (and maybe `id` too)? | 'info_dict': {
'id': 'ochenlichnoe',
'title': 'Очень личное',
'description': 'md5:ee36a6a52546b91b487fe08c552fdbb2',
},
'playlist_mincount': 20,
}, {
'url': 'https://geekcity.mave.digital/',
'info_dict': {
'id': 'geekcity',
... | @@ -68,40 +119,72 @@ class MaveIE(InfoExtractor):
'upload_date': '20241230',
},
}]
- _API_BASE_URL = 'https://api.mave.digital/'
def _real_extract(self, url):
- channel_id, slug = self._match_valid_url(url).group('channel', 'id')
- display_id = f'{channel_id}-{slug}'
-... | yt_dlp/extractor/mave.py | 26 | Python | 0.357 | question | 54 | 45 | 45 | false | [ie/mave:channel] Add extractor | 14,915 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | anlar |
'id': 'ochenlichnoe',
'title': 'Очень личное',
'description': 'md5:ee36a6a52546b91b487fe08c552fdbb2',
},
'playlist_mincount': 20,
}, {
'url': 'https://geekcity.mave.digital/',
'info_dict': {
'id': 'geekcity',
'title': 'Мужчи... | ```suggestion
yield self._create_entry(channel_id, channel_meta, ep)
``` | 'id': 'ochenlichnoe',
'title': 'Очень личное',
'description': 'md5:ee36a6a52546b91b487fe08c552fdbb2',
},
'playlist_mincount': 20,
}, {
'url': 'https://geekcity.mave.digital/',
'info_dict': {
'id': 'geekcity',
'title': 'Мужчи... | @@ -68,40 +119,72 @@ class MaveIE(InfoExtractor):
'upload_date': '20241230',
},
}]
- _API_BASE_URL = 'https://api.mave.digital/'
def _real_extract(self, url):
- channel_id, slug = self._match_valid_url(url).group('channel', 'id')
- display_id = f'{channel_id}-{slug}'
-... | yt_dlp/extractor/mave.py | 26 | Python | 0.571 | suggestion | 86 | 44 | 44 | false | [ie/mave:channel] Add extractor | 14,915 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | anlar |
# number of fragment that would subsequently requested with (`&sq=N`)
if fmt_stream.get('type') == 'FORMAT_STREAM_TYPE_OTF' and not bool(fmt_stream.get('drmFamilies')):
continue
stream_id = get_stream_id(fmt_stream)
... | ```suggestion
# We still need to register original/default language information
# See: https://github.com/yt-dlp/yt-dlp/issues/14883
``` | # number of fragment that would subsequently requested with (`&sq=N`)
if fmt_stream.get('type') == 'FORMAT_STREAM_TYPE_OTF' and not bool(fmt_stream.get('drmFamilies')):
continue
stream_id = get_stream_id(fmt_stream)
... | @@ -3206,6 +3219,8 @@ def process_https_formats():
fmt_url = fmt_stream.get('url')
encrypted_sig, sc = None, None
if not fmt_url:
+ # We should still extract original/default language information | yt_dlp/extractor/youtube/_video.py | 26 | Python | 0.714 | suggestion | 187 | 51 | 51 | false | [ie/youtube] Fix original language detection | 14,919 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | bashonly |
for format_id in ['', 'hi', 'webm']:
video_url = url_or_none(xpath_text(video, f'./{format_id}file'))
if not video_url:
continue
formats.append({
'url': video_url,
'filesize': int_or_none(xpath_text(video, f'./{format_id}size'))... | just a note about `unescapeHTML` (that maybe you're already aware of):
it has a [nasty assert](https://github.com/yt-dlp/yt-dlp/blob/5767fb4ab108dddb07fc839a3b0f4d323a7c4bea/yt_dlp/utils/_utils.py#L814) and should always be preceded by `{str}` in a traversal path (or you should just use `{clean_html}` instead)
he... | for format_id in ['', 'hi', 'webm']:
video_url = url_or_none(xpath_text(video, f'./{format_id}file'))
if not video_url:
continue
formats.append({
'url': video_url,
'filesize': int_or_none(xpath_text(video, f'./{format_id}size'))... | @@ -131,12 +152,28 @@ def _real_extract(self, url):
formats.extend(self._extract_mpd_formats(
dash_manifest, video_id, mpd_id='dash', fatal=False))
+ metadata = self._download_xml(
+ f'https://www.ntv.ru/exp/video/{video_id}', video_id, 'Downloading XML metadata', fatal... | yt_dlp/extractor/ntvru.py | 26 | Python | 0.643 | security | 449 | 43 | 43 | false | [ie/ntv.ru] Rework extractor | 14,934 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | seproDev |
hls_manifest, video_id, m3u8_id='hls', fatal=False))
dash_manifest = xpath_text(video, './playback/dash')
if dash_manifest:
formats.extend(self._extract_mpd_formats(
dash_manifest, video_id, mpd_id='dash', fatal=False))
metadata = self._download_xml(
... | triggered again
but it's fine | hls_manifest, video_id, m3u8_id='hls', fatal=False))
dash_manifest = xpath_text(video, './playback/dash')
if dash_manifest:
formats.extend(self._extract_mpd_formats(
dash_manifest, video_id, mpd_id='dash', fatal=False))
metadata = self._download_xml(
... | @@ -131,12 +152,28 @@ def _real_extract(self, url):
formats.extend(self._extract_mpd_formats(
dash_manifest, video_id, mpd_id='dash', fatal=False))
+ metadata = self._download_xml(
+ f'https://www.ntv.ru/exp/video/{video_id}', video_id, 'Downloading XML metadata', fatal... | yt_dlp/extractor/ntvru.py | 26 | Python | 0.071 | suggestion | 32 | 32 | 32 | false | [ie/ntv.ru] Rework extractor | 14,934 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | seproDev |
for q in TP_SMIL_QUERY:
q.update(query)
m_url = update_url_query(smil_url, q)
m_url = self._sign_url(m_url, self._THEPLATFORM_KEY, self._THEPLATFORM_SECRET)
try:
tp_formats, tp_subtitles = self._extract_theplatform_smil(
m_url, ... | Simpler? But also consider if you could use `_html_search_meta()`.
```suggestion
r'<meta\s[^>]*(?:content="[^"]*tpid/(\d+)"|name="videoId"[^>]+content="(\d+)")',
```
THe proposed pattern works because of a little-known feature (that I don't remember seeing used before) of `_search_regex()` where the fir... | }
if auth:
query['auth'] = auth
TP_SMIL_QUERY = [{
'assetTypes': 'high_video_ak',
'switch': 'hls_high_ak',
}, {
'assetTypes': 'high_video_s3',
}, {
'assetTypes': 'high_video_s3',
'switch': 'hls_high_fastly',
... | @@ -73,18 +73,21 @@ def _extract_aen_smil(self, smil_url, video_id, auth=None):
def _extract_aetn_info(self, domain, filter_key, filter_value, url):
requestor_id, brand, software_statement = self._DOMAIN_MAP[domain]
+ graphql_video_id = (self._search_regex(
+ r'<meta[^>]+content="[^"]*... | yt_dlp/extractor/aenetworks.py | 26 | Python | 0.857 | suggestion | 365 | 51 | 51 | false | [ie/aenetworks] Fix extractor | 14,959 | yt-dlp/yt-dlp | 132,642 | Python | dirkf | Sipherdrakon |
raise
last_e = e
continue
formats.extend(tp_formats)
subtitles = self._merge_subtitles(subtitles, tp_subtitles)
if last_e and not formats:
raise last_e
return {
'id': video_id,
'formats': form... | ```suggestion
result = traverse_obj(result, ('data', 'video', {lambda x: x.get('publicUrl') and x})
if not result:
``` | 'assetTypes': 'high_video_s3',
'switch': 'hls_high_fastly',
}]
formats = []
subtitles = {}
last_e = None
for q in TP_SMIL_QUERY:
q.update(query)
m_url = update_url_query(smil_url, q)
m_url = self._sign_url(m_url, self._T... | @@ -73,18 +73,21 @@ def _extract_aen_smil(self, smil_url, video_id, auth=None):
def _extract_aetn_info(self, domain, filter_key, filter_value, url):
requestor_id, brand, software_statement = self._DOMAIN_MAP[domain]
+ graphql_video_id = (self._search_regex(
+ r'<meta[^>]+content="[^"]*... | yt_dlp/extractor/aenetworks.py | 26 | Python | 0.714 | suggestion | 137 | 51 | 51 | false | [ie/aenetworks] Fix extractor | 14,959 | yt-dlp/yt-dlp | 132,642 | Python | dirkf | Sipherdrakon |
'query': 'query getUserVideo($videoId: ID!) { video(id: $videoId) { title publicUrl programId tvSeasonNumber tvSeasonEpisodeNumber series { title } } }'}).encode(),
headers={'Content-Type': 'application/json'})
result = traverse_obj(result, ('data', 'video'), default={})... | ```suggestion
**traverse_obj(result, {
'series': ('series', 'title', {str}),
'season_number': ('tvSeasonNumber', {int_or_none}),
'episode_number': ('tvSeasonEpisodeNumber', {int_or_none}),
}),
``` | return {
'id': video_id,
'formats': formats,
'subtitles': subtitles,
}
def _extract_aetn_info(self, domain, filter_key, filter_value, url):
requestor_id, brand, software_statement = self._DOMAIN_MAP[domain]
if filter_key == 'canonical':
... | @@ -100,7 +103,7 @@ def _extract_aetn_info(self, domain, filter_key, filter_value, url):
info.update(self._extract_aen_smil(media_url, video_id, auth))
info.update({
'title': title,
- 'series': result.get('seriesName'),
+ 'series': (result.get('series') or {}).get('t... | yt_dlp/extractor/aenetworks.py | 26 | Python | 0.786 | suggestion | 274 | 51 | 51 | false | [ie/aenetworks] Fix extractor | 14,959 | yt-dlp/yt-dlp | 132,642 | Python | dirkf | Sipherdrakon |
from __future__ import annotations
import abc
import dataclasses
import functools
import os.path
from ._utils import _get_exe_version_output, detect_exe_version, int_or_none
# NOT public API
def runtime_version_tuple(v):
# NB: will return (0,) if `v` is an invalid version string
return tuple(int_or_none(x, d... | we probably don't want others to use this for now
```suggestion
def _determine_runtime_path(path, basename):
``` | from __future__ import annotations
import abc
import dataclasses
import functools
import os.path
from ._utils import _get_exe_version_output, detect_exe_version, int_or_none
# NOT public API
def runtime_version_tuple(v):
# NB: will return (0,) if `v` is an invalid version string
return tuple(int_or_none(x, d... | @@ -12,6 +13,14 @@ def runtime_version_tuple(v):
return tuple(int_or_none(x, default=0) for x in v.split('.'))
+def determine_runtime_path(path, basename): | yt_dlp/utils/_jsruntime.py | 16 | Python | 0.786 | suggestion | 112 | 41 | 41 | false | Allow `--js-runtimes` to accept file or dir as its `PATH` argument | 14,964 | yt-dlp/yt-dlp | 132,642 | Python | Grub4K | bashonly |
from __future__ import annotations
import abc
import dataclasses
import functools
import os.path
from ._utils import _get_exe_version_output, detect_exe_version, int_or_none
# NOT public API
def runtime_version_tuple(v):
# NB: will return (0,) if `v` is an invalid version string
return tuple(int_or_none(x, d... | Maybe this? We could allow people using `--js-runtimes deno:` to mean current workdir?
```suggestion
if path is None:
``` | from __future__ import annotations
import abc
import dataclasses
import functools
import os.path
from ._utils import _get_exe_version_output, detect_exe_version, int_or_none
# NOT public API
def runtime_version_tuple(v):
# NB: will return (0,) if `v` is an invalid version string
return tuple(int_or_none(x, d... | @@ -12,6 +13,14 @@ def runtime_version_tuple(v):
return tuple(int_or_none(x, default=0) for x in v.split('.'))
+def determine_runtime_path(path, basename):
+ if not path: | yt_dlp/utils/_jsruntime.py | 17 | Python | 0.786 | suggestion | 125 | 42 | 42 | false | Allow `--js-runtimes` to accept file or dir as its `PATH` argument | 14,964 | yt-dlp/yt-dlp | 132,642 | Python | Grub4K | bashonly |
'uploader_id': ('creator', 'id', {str}),
'channel': ('channel', 'title', {str}),
'channel_id': ('channel', 'id', {str}),
'release_timestamp': ('releaseDate', {parse_iso8601}),
}),
}
items = []
for media in traverse_obj(... | Additional fix needed for floatplane, as we otherwise might crash later on the partition call due to an empty url field
```suggestion
for variant in traverse_obj(stream, ('groups', 0, 'variants', lambda _, v: v['url'])):
``` | 'uploader_id': ('creator', 'id', {str}),
'channel': ('channel', 'title', {str}),
'channel_id': ('channel', 'id', {str}),
'release_timestamp': ('releaseDate', {parse_iso8601}),
}),
}
items = []
for media in traverse_obj(... | @@ -55,25 +55,17 @@ def _real_extract(self, url):
note=f'Downloading {media_typ} metadata', impersonate=self._IMPERSONATE_TARGET)
stream = self._download_json(
- f'{self._BASE_URL}/api/v2/cdn/delivery', media_id, query={
- 'type': 'vod' if media_typ == '... | yt_dlp/extractor/floatplane.py | 26 | Python | 0.786 | bug | 239 | 51 | 51 | false | [ie/floatplane] Fix extractor with new delivery api | 14,984 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | i3p9 |
if self._IMPERSONATE_TARGET is not None:
m3u8_data = self._download_webpage(
url, media_id, fatal=False, impersonate=self._IMPERSONATE_TARGET, headers=self._HEADERS,
note=join_nonempty('Downloading', format_id, 'm3u8 information', delim... | This would mark all formats as video only
```suggestion
``` |
# If we need impersonation for the API, then we need it for HLS keys too: extract in advance
if self._IMPERSONATE_TARGET is not None:
m3u8_data = self._download_webpage(
format_url, media_id, fatal=False, impersonate=self._IMPERSONATE_TARGET, ... | @@ -98,12 +90,12 @@ def format_path(params):
hls_aes['key'] = urlh.read().hex()
formats.append({
- **traverse_obj(quality, {
+ **traverse_obj(variant, {
'format_note': ('label', {str}),
- ... | yt_dlp/extractor/floatplane.py | 26 | Python | 0.571 | suggestion | 61 | 51 | 51 | false | [ie/floatplane] Fix extractor with new delivery api | 14,984 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | i3p9 |
# If we need impersonation for the API, then we need it for HLS keys too: extract in advance
if self._IMPERSONATE_TARGET is not None:
m3u8_data = self._download_webpage(
url, media_id, fatal=False, impersonate=self._IMPERSONATE_TARGET, headers... | Instead, as they provide much more info now, we can do the following:
```suggestion
'width': ('meta', 'video', 'width', {int_or_none}),
'height': ('meta', 'video', 'height', {int_or_none}),
'vcodec': ('meta', 'video', 'codec', {str}),
... | hls_aes = {}
m3u8_data = None
# If we need impersonation for the API, then we need it for HLS keys too: extract in advance
if self._IMPERSONATE_TARGET is not None:
m3u8_data = self._download_webpage(
format_url,... | @@ -98,12 +90,12 @@ def format_path(params):
hls_aes['key'] = urlh.read().hex()
formats.append({
- **traverse_obj(quality, {
+ **traverse_obj(variant, {
'format_note': ('label', {str}),
- ... | yt_dlp/extractor/floatplane.py | 26 | Python | 0.857 | suggestion | 753 | 51 | 51 | false | [ie/floatplane] Fix extractor with new delivery api | 14,984 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | i3p9 |
'channel': ('channel', 'title', {str}),
'channel_id': ('channel', 'id', {str}),
'release_timestamp': ('releaseDate', {parse_iso8601}),
}),
}
items = []
for media in traverse_obj(post_data, (('videoAttachments', 'audioAttachments'), ...... | ```suggestion
for variant in traverse_obj(stream, ('groups', 0, 'variants', lambda _, v: v['url'])):
url = urljoin(cdn_base_url, variant['url'])
``` | 'channel': ('channel', 'title', {str}),
'channel_id': ('channel', 'id', {str}),
'release_timestamp': ('releaseDate', {parse_iso8601}),
}),
}
items = []
for media in traverse_obj(post_data, (('videoAttachments', 'audioAttachments'), ...... | @@ -55,25 +55,17 @@ def _real_extract(self, url):
note=f'Downloading {media_typ} metadata', impersonate=self._IMPERSONATE_TARGET)
stream = self._download_json(
- f'{self._BASE_URL}/api/v2/cdn/delivery', media_id, query={
- 'type': 'vod' if media_typ == '... | yt_dlp/extractor/floatplane.py | 26 | Python | 0.714 | suggestion | 179 | 51 | 51 | false | [ie/floatplane] Fix extractor with new delivery api | 14,984 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | i3p9 |
'channel_id': ('channel', 'id', {str}),
'release_timestamp': ('releaseDate', {parse_iso8601}),
}),
}
items = []
for media in traverse_obj(post_data, (('videoAttachments', 'audioAttachments'), ...)):
media_id = media['id']
media... | ```suggestion
format_id = traverse_obj(variant, ('name', {str}))
``` | 'channel_id': ('channel', 'id', {str}),
'release_timestamp': ('releaseDate', {parse_iso8601}),
}),
}
items = []
for media in traverse_obj(post_data, (('videoAttachments', 'audioAttachments'), ...)):
media_id = media['id']
media... | @@ -55,25 +55,17 @@ def _real_extract(self, url):
note=f'Downloading {media_typ} metadata', impersonate=self._IMPERSONATE_TARGET)
stream = self._download_json(
- f'{self._BASE_URL}/api/v2/cdn/delivery', media_id, query={
- 'type': 'vod' if media_typ == '... | yt_dlp/extractor/floatplane.py | 26 | Python | 0.571 | suggestion | 86 | 51 | 51 | false | [ie/floatplane] Fix extractor with new delivery api | 14,984 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | i3p9 |
'channel_url': urljoin(f'{uploader_url}/', traverse_obj(post_data, ('channel', 'urlname'))),
'availability': self._availability(needs_subscription=True),
**traverse_obj(post_data, {
'uploader': ('creator', 'title', {str}),
'uploader_id': ('creator', 'i... | annoying formatting comment
```suggestion
f'{self._BASE_URL}/api/v3/content/{media_typ}', media_id,
f'Downloading {media_typ} metadata', query={'id': media_id},
fatal=False, impersonate=self._IMPERSONATE_TARGET)
``` | 'channel_url': urljoin(f'{uploader_url}/', traverse_obj(post_data, ('channel', 'urlname'))),
'availability': self._availability(needs_subscription=True),
**traverse_obj(post_data, {
'uploader': ('creator', 'title', {str}),
'uploader_id': ('creator', 'i... | @@ -50,37 +50,30 @@ def _real_extract(self, url):
media_id = media['id']
media_typ = media.get('type') or 'video'
- metadata = self._download_json(
- f'{self._BASE_URL}/api/v3/content/{media_typ}', media_id, query={'id': media_id},
- note=f'Downloadin... | yt_dlp/extractor/floatplane.py | 26 | Python | 0.786 | suggestion | 268 | 51 | 51 | false | [ie/floatplane] Fix extractor with new delivery api | 14,984 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | i3p9 |
'info_dict': {
'id': '1536535',
'ext': 'mp3',
'title': 'Club Glow - 15/12/2023 - 20:00',
'thumbnail': r're:^https://.+\.(?:jpg|JPG)$',
'release_timestamp': 1702598400,
'release_date': '20231215',
},
}]
def _real_extract(sel... | Why all this extra logging?
```suggestion
entry = self._download_json(
f'{self._API_BASE}/episodes/{display_id}', display_id,
note='Downloading episode data from API')['entry']
``` | 'id': '1536535',
'ext': 'mp3',
'title': 'Club Glow - 15/12/2023 - 20:00',
'thumbnail': r're:^https://.+\.(?:jpg|JPG)$',
'release_timestamp': 1702598400,
'release_date': '20231215',
},
}]
def _real_extract(self, url):
displa... | @@ -45,8 +48,20 @@ class RinseFMIE(RinseFMBaseIE):
def _real_extract(self, url):
display_id = self._match_id(url)
- webpage = self._download_webpage(url, display_id)
- entry = self._search_nextjs_data(webpage, display_id)['props']['pageProps']['entry']
+
+ api_url = f'{self._API_BAS... | yt_dlp/extractor/rinsefm.py | 26 | Python | 0.786 | question | 217 | 51 | 51 | false | [ie/rinsefm] Fix extractors | 15,020 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | 1bnBattuta |
class RinseFMArtistPlaylistIE(RinseFMBaseIE):
_VALID_URL = r'https?://(?:www\.)?rinse\.fm/shows/(?P<id>[^/?#]+)'
_TESTS = [{
'url': 'https://rinse.fm/shows/resources/',
'info_dict': {
'id': 'resources',
'title': '[re]sources',
'description': '[re]sources est u... | Why are we changing this away from the `traverse_obj` call? Just pass the api data
```suggestion
def _entries(self, data):
for episode in traverse_obj(data, (
'episodes', lambda _, v: determine_ext(v['fileUrl']) in MEDIA_EXTENSIONS.audio),
):
yield self._parse_entry(epi... | 'url': 'https://www.rinse.fm/shows/esk',
'info_dict': {
'id': 'esk',
'title': 'Esk',
'description': 'md5:5893d7c1d411ae8dea7fba12f109aa98',
},
'playlist_mincount': 139,
}]
def _entries(self, data):
for episode in traverse_obj(data, (
... | @@ -71,19 +86,37 @@ class RinseFMArtistPlaylistIE(RinseFMBaseIE):
'playlist_mincount': 7,
}]
- def _entries(self, data):
- for episode in traverse_obj(data, (
- 'props', 'pageProps', 'episodes', lambda _, v: determine_ext(v['fileUrl']) in MEDIA_EXTENSIONS.audio),
- ):
- ... | yt_dlp/extractor/rinsefm.py | 26 | Python | 0.786 | question | 330 | 51 | 29 | false | [ie/rinsefm] Fix extractors | 15,020 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | 1bnBattuta |
if file_url and determine_ext(file_url) in MEDIA_EXTENSIONS.audio:
yield self._parse_entry(episode)
def _real_extract(self, url):
playlist_id = self._match_id(url)
api_url = f'{self._API_BASE}/shows/{playlist_id}'
self.write_debug(f'API URL: {api_url}')
... | Again, I don't see the point to this excessive logging
```suggestion
api_data = self._download_json(
f'{self._API_BASE}/shows/{playlist_id}', playlist_id,
note='Downloading show data from API')
``` | from .common import InfoExtractor
from ..utils import (
MEDIA_EXTENSIONS,
determine_ext,
parse_iso8601,
url_or_none,
)
from ..utils.traversal import traverse_obj
class RinseFMBaseIE(InfoExtractor):
_API_BASE = 'https://rinse.fm/api/query/v1'
@staticmethod
def _parse_entry(entry):
... | @@ -71,19 +86,37 @@ class RinseFMArtistPlaylistIE(RinseFMBaseIE):
'playlist_mincount': 7,
}]
- def _entries(self, data):
- for episode in traverse_obj(data, (
- 'props', 'pageProps', 'episodes', lambda _, v: determine_ext(v['fileUrl']) in MEDIA_EXTENSIONS.audio),
- ):
- ... | yt_dlp/extractor/rinsefm.py | 26 | Python | 0.786 | suggestion | 234 | 31 | 97 | false | [ie/rinsefm] Fix extractors | 15,020 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | 1bnBattuta |
playlist_id = self._match_id(url)
api_url = f'{self._API_BASE}/shows/{playlist_id}'
self.write_debug(f'API URL: {api_url}')
api_data = self._download_json(
api_url, playlist_id,
note='Downloading show data from API',
)
self.write_debug(f'API res... | Can inline the title/description extraction. For description, I would also use the actual description instead of the extract
```suggestion
self._entries(api_data), playlist_id,
**traverse_obj(api_data, ('entry', {
'title': ('title', {str}),
'description': ('d... | from .common import InfoExtractor
from ..utils import (
MEDIA_EXTENSIONS,
determine_ext,
parse_iso8601,
url_or_none,
)
from ..utils.traversal import traverse_obj
class RinseFMBaseIE(InfoExtractor):
_API_BASE = 'https://rinse.fm/api/query/v1'
@staticmethod
def _parse_entry(entry):
... | @@ -71,19 +86,37 @@ class RinseFMArtistPlaylistIE(RinseFMBaseIE):
'playlist_mincount': 7,
}]
- def _entries(self, data):
- for episode in traverse_obj(data, (
- 'props', 'pageProps', 'episodes', lambda _, v: determine_ext(v['fileUrl']) in MEDIA_EXTENSIONS.audio),
- ):
- ... | yt_dlp/extractor/rinsefm.py | 26 | Python | 0.857 | refactor | 390 | 27 | 97 | false | [ie/rinsefm] Fix extractors | 15,020 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | 1bnBattuta |
},
'playlist_mincount': 4,
}, {
'url': 'https://store.steampowered.com/app/271590/Grand_Theft_Auto_V/',
'info_dict': {
'id': '271590',
'title': 'Grand Theft Auto V Legacy',
},
'playlist_mincount': 26,
}]
def _real_extract(self, url):
... | Use a generator instead of an append loop | },
'playlist_mincount': 5,
}, {
'url': 'https://store.steampowered.com/app/271590/Grand_Theft_Auto_V/',
'info_dict': {
'id': '271590',
'title': 'Grand Theft Auto V Legacy',
},
'playlist_mincount': 26,
}]
def _entries(self, app_id, app_... | @@ -45,29 +42,40 @@ def _real_extract(self, url):
self._set_cookie('store.steampowered.com', 'lastagecheckage', '1-January-2000')
webpage = self._download_webpage(url, app_id)
- app_name = traverse_obj(webpage, ({find_element(cls='apphub_AppName')}, {clean_html}))
+ data_props = traver... | yt_dlp/extractor/steam.py | 26 | Python | 0.143 | suggestion | 41 | 51 | 51 | false | [ie/steam] Fix extractor | 15,028 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | doe1080 |
import re
from .common import InfoExtractor
from ..utils import ExtractorError
class YfanefaIE(InfoExtractor):
IE_NAME = 'yfanefa'
# FIXED: Capture entire path until ? or #
_VALID_URL = r'https?://(?:www\.)?yfanefa\.com/(?P<id>[^?#]+)'
_TESTS = [{
'url': 'https://www.yfanefa.com/record/2717... | Not needed
```suggestion
``` | from .common import InfoExtractor
from ..utils import (
determine_ext,
int_or_none,
join_nonempty,
remove_end,
url_or_none,
)
from ..utils.traversal import traverse_obj
class YfanefaIE(InfoExtractor):
IE_NAME = 'yfanefa'
_VALID_URL = r'https?://(?:www\.)?yfanefa\.com/(?P<id>[^?#]+)'
_T... | @@ -0,0 +1,79 @@
+import re
+
+from .common import InfoExtractor
+from ..utils import ExtractorError
+
+
+class YfanefaIE(InfoExtractor):
+ IE_NAME = 'yfanefa'
+
+ # FIXED: Capture entire path until ? or # | yt_dlp/extractor/yfanefa.py | 10 | Python | 0.429 | suggestion | 30 | 35 | 35 | false | [ie/yfanefa] Add extractor | 15,032 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | Haytam001 |
}, {
'url': 'https://www.yfanefa.com/evaluating_nature_matters',
'info_dict': {
'id': 'evaluating_nature_matters',
'ext': 'mp4',
'title': 'Evaluating Nature Matters',
},
'params': {'skip_download': True},
}]
def _real_extract(self, url):
... | Let's use the _search_json helper instead and extract the entire set of player options
```suggestion
player_data = self._search_json(
r'iwPlayer\.options\["[\w.]+"\]\s*=', webpage, 'player options', video_id)
``` | 'title': 'Memory Bank: Bradford Launch',
'thumbnail': r're:https://media\.yfanefa\.com/storage/v1/file/',
},
}, {
'url': 'https://www.yfanefa.com/evaluating_nature_matters',
'info_dict': {
'id': 'evaluating_nature_matters',
'ext': 'mp4',
... | @@ -0,0 +1,79 @@
+import re
+
+from .common import InfoExtractor
+from ..utils import ExtractorError
+
+
+class YfanefaIE(InfoExtractor):
+ IE_NAME = 'yfanefa'
+
+ # FIXED: Capture entire path until ? or #
+ _VALID_URL = r'https?://(?:www\.)?yfanefa\.com/(?P<id>[^?#]+)'
+
+ _TESTS = [{
+ 'url': 'http... | yt_dlp/extractor/yfanefa.py | 26 | Python | 0.857 | refactor | 236 | 51 | 40 | false | [ie/yfanefa] Add extractor | 15,032 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | Haytam001 |
raise ExtractorError('Could not find player configuration')
config_str = player_match.group(1).replace('\\/', '/')
url_match = re.search(r'"url":"(https://media\.yfanefa\.com/storage/v1/(?:hls|file)/[^"]+)"', config_str)
sig_match = re.search(r'"signature":"(\?[^"]*)"', config_str)
... | And then I would do something like this
```suggestion
formats = []
video_url = join_nonempty(player_data['url'], player_data.get('signature'), delim='')
if determine_ext(video_url) == 'm3u8':
formats = self._extract_m3u8_formats(
video_url, video_id, 'mp4', m3u8... | from .common import InfoExtractor
from ..utils import (
determine_ext,
int_or_none,
join_nonempty,
remove_end,
url_or_none,
)
from ..utils.traversal import traverse_obj
class YfanefaIE(InfoExtractor):
IE_NAME = 'yfanefa'
_VALID_URL = r'https?://(?:www\.)?yfanefa\.com/(?P<id>[^?#]+)'
_T... | @@ -0,0 +1,79 @@
+import re
+
+from .common import InfoExtractor
+from ..utils import ExtractorError
+
+
+class YfanefaIE(InfoExtractor):
+ IE_NAME = 'yfanefa'
+
+ # FIXED: Capture entire path until ? or #
+ _VALID_URL = r'https?://(?:www\.)?yfanefa\.com/(?P<id>[^?#]+)'
+
+ _TESTS = [{
+ 'url': 'http... | yt_dlp/extractor/yfanefa.py | 26 | Python | 0.857 | refactor | 408 | 34 | 68 | false | [ie/yfanefa] Add extractor | 15,032 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | Haytam001 |
webpage = self._download_webpage(url, video_id)
title = self._og_search_title(webpage) or self._html_extract_title(webpage)
player_match = re.search(r'iwPlayer\.options\[[^\]]+\]\s*=\s*({.*?});', webpage, re.DOTALL)
if not player_match:
raise ExtractorError('Could not find p... | Lets inline title, and use the player_data to fill in some more metadata
```suggestion
return {
'id': video_id,
'title': self._og_search_title(webpage, default=None) or self._html_extract_title(webpage),
'formats': formats,
**traverse_obj(player_data, {
... | def _real_extract(self, url):
video_id = self._match_id(url)
webpage = self._download_webpage(url, video_id)
player_data = self._search_json(
r'iwPlayer\.options\["[\w.]+"\]\s*=', webpage, 'player options', video_id)
formats = []
video_url = join_nonempty(player... | @@ -0,0 +1,79 @@
+import re
+
+from .common import InfoExtractor
+from ..utils import ExtractorError
+
+
+class YfanefaIE(InfoExtractor):
+ IE_NAME = 'yfanefa'
+
+ # FIXED: Capture entire path until ? or #
+ _VALID_URL = r'https?://(?:www\.)?yfanefa\.com/(?P<id>[^?#]+)'
+
+ _TESTS = [{
+ 'url': 'http... | yt_dlp/extractor/yfanefa.py | 26 | Python | 0.857 | refactor | 466 | 39 | 27 | false | [ie/yfanefa] Add extractor | 15,032 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | Haytam001 |
import re
from .common import InfoExtractor
from ..utils import ExtractorError
class YfanefaIE(InfoExtractor):
IE_NAME = 'yfanefa'
# FIXED: Capture entire path until ? or #
_VALID_URL = r'https?://(?:www\.)?yfanefa\.com/(?P<id>[^?#]+)'
_TESTS = [{
'url': 'https://www.yfanefa.com/record/2717... | ```suggestion
from .common import InfoExtractor
from ..utils import determine_ext, int_or_none, join_nonempty, url_or_none
from ..utils.traversal import traverse_obj
``` | from .common import InfoExtractor
from ..utils import (
determine_ext,
int_or_none,
join_nonempty,
remove_end,
url_or_none,
)
from ..utils.traversal import traverse_obj
class YfanefaIE(InfoExtractor):
IE_NAME = 'yfanefa'
_VALID_URL = r'https?://(?:www\.)?yfanefa\.com/(?P<id>[^?#]+)'
_T... | @@ -0,0 +1,79 @@
+import re
+
+from .common import InfoExtractor
+from ..utils import ExtractorError | yt_dlp/extractor/yfanefa.py | 4 | Python | 0.786 | refactor | 173 | 29 | 29 | false | [ie/yfanefa] Add extractor | 15,032 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | Haytam001 |
assert res.read(1) == b'f'
assert not res.fp.closed
assert res.read() == b'oobar'
# Should automatically close the underlying file object
assert res.fp.closed
os.unlink(tf.name)
def test_data_uri_auto_close(self, handler):
with handler() ... | consistent naming scheme
```suggestion
def test_data_uri_partial_read_then_full_read(self, handler):
``` | assert res.read(1) == b'f'
assert not res.fp.closed
assert res.read() == b'oobar'
# Should automatically close the underlying file object
assert res.fp.closed
os.unlink(tf.name)
def test_data_uri_auto_close(self, handler):
with handler() ... | @@ -920,6 +931,28 @@ def test_http_response_auto_close(self, handler):
assert res.fp.fp is None
assert res.closed
+ def test_data_uri_partial_read_then_full(self, handler): | test/test_networking.py | 26 | Python | 0.857 | suggestion | 111 | 51 | 51 | false | [rh:urllib] Do not read after close | 15,049 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | bashonly |
format_duration = traverse_obj(fmt_stream, ('approxDurationMs', {float_or_none(scale=1000)}))
# Some formats may have much smaller duration than others (possibly damaged during encoding)
# E.g. 2-nOtRESiUc Ref: https://github.com/yt-dlp/yt-dlp/issues/2823
... | ```suggestion
name, fmt_stream.get('isDrc') and 'DRC', super_resolution and 'AI-upscaled',
``` | format_duration = traverse_obj(fmt_stream, ('approxDurationMs', {float_or_none(scale=1000)}))
# Some formats may have much smaller duration than others (possibly damaged during encoding)
# E.g. 2-nOtRESiUc Ref: https://github.com/yt-dlp/yt-dlp/issues/2823
... | @@ -3253,10 +3256,13 @@ def process_format_stream(fmt_stream, proto, missing_pot):
dct = {
'asr': int_or_none(fmt_stream.get('audioSampleRate')),
'filesize': int_or_none(fmt_stream.get('contentLength')),
- 'format_id': f'{itag}{"-drc" if fmt_... | yt_dlp/extractor/youtube/_video.py | 26 | Python | 0.714 | suggestion | 120 | 51 | 51 | false | [ie/youtube] Detect "super resolution" AI-upscaled formats | 15,050 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | bashonly |
'description': 'md5:03d1ffebec3139aa4bafe302369269c5',
'subtitles': {'lyrics': [{'ext': 'lrc'}]},
'duration': 229,
'alt_title': '说出愿望吧(Genie)',
'thumbnail': r're:^http.*\.jpg',
'average_rating': int,
'album': 'Oh!',
'album_a... | don't need to escape the dot in a character class
```suggestion
lyrics_expr = r'\[([0-9]{2}):([0-9]{2})[:.]([0-9]{2,})\]([^\n]+)'
``` | 'description': 'md5:03d1ffebec3139aa4bafe302369269c5',
'subtitles': {'lyrics': [{'ext': 'lrc'}]},
'duration': 229,
'alt_title': '说出愿望吧(Genie)',
'thumbnail': r're:^http.*\.jpg',
'average_rating': int,
'album': 'Oh!',
'album_a... | @@ -241,9 +259,16 @@ def _process_lyrics(self, lyrics_info):
'lyrics': [{'data': original, 'ext': 'lrc'}],
}
- lyrics_expr = r'(\[[0-9]{2}:[0-9]{2}\.[0-9]{2,}\])([^\n]+)'
- original_ts_texts = re.findall(lyrics_expr, original)
- translation_ts_dict = dict(re.findall(... | yt_dlp/extractor/neteasemusic.py | 26 | Python | 0.714 | security | 148 | 51 | 51 | false | [ie/neteasemusic] Fix merged lyrics extraction | 15,052 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | Mivik |
'timestamp': 1264608000,
'description': 'md5:03d1ffebec3139aa4bafe302369269c5',
'subtitles': {'lyrics': [{'ext': 'lrc'}]},
'duration': 229,
'alt_title': '说出愿望吧(Genie)',
'thumbnail': r're:^http.*\.jpg',
'average_rating': int,
... | nested func doesn't need the underscore prefix
```suggestion
def collect_lyrics(lrc):
``` | 'timestamp': 1264608000,
'description': 'md5:03d1ffebec3139aa4bafe302369269c5',
'subtitles': {'lyrics': [{'ext': 'lrc'}]},
'duration': 229,
'alt_title': '说出愿望吧(Genie)',
'thumbnail': r're:^http.*\.jpg',
'average_rating': int,
... | @@ -241,9 +259,16 @@ def _process_lyrics(self, lyrics_info):
'lyrics': [{'data': original, 'ext': 'lrc'}],
}
- lyrics_expr = r'(\[[0-9]{2}:[0-9]{2}\.[0-9]{2,}\])([^\n]+)'
- original_ts_texts = re.findall(lyrics_expr, original)
- translation_ts_dict = dict(re.findall(... | yt_dlp/extractor/neteasemusic.py | 26 | Python | 0.714 | suggestion | 100 | 51 | 51 | false | [ie/neteasemusic] Fix merged lyrics extraction | 15,052 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | Mivik |
'thumbnail': r're:^http.*\.jpg',
'average_rating': int,
'album': 'Oh!',
'album_artist': '少女时代',
},
'skip': 'Blocked outside Mainland China',
}]
def _process_lyrics(self, lyrics_info):
original = traverse_obj(lyrics_info, ('lrc', 'lyric', {... | maybe?
```suggestion
(f'[{min}:{sec}.{ms}]', text)
for min, sec, ms, text in matches
``` | 'thumbnail': r're:^http.*\.jpg',
'average_rating': int,
'album': 'Oh!',
'album_artist': '少女时代',
},
'skip': 'Blocked outside Mainland China',
}]
def _process_lyrics(self, lyrics_info):
original = traverse_obj(lyrics_info, ('lrc', 'lyric', {... | @@ -241,9 +259,16 @@ def _process_lyrics(self, lyrics_info):
'lyrics': [{'data': original, 'ext': 'lrc'}],
}
- lyrics_expr = r'(\[[0-9]{2}:[0-9]{2}\.[0-9]{2,}\])([^\n]+)'
- original_ts_texts = re.findall(lyrics_expr, original)
- translation_ts_dict = dict(re.findall(... | yt_dlp/extractor/neteasemusic.py | 26 | Python | 0.714 | suggestion | 124 | 51 | 51 | false | [ie/neteasemusic] Fix merged lyrics extraction | 15,052 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | Mivik |
},
'skip': 'Blocked outside Mainland China',
}]
def _process_lyrics(self, lyrics_info):
original = traverse_obj(lyrics_info, ('lrc', 'lyric', {str}))
translated = traverse_obj(lyrics_info, ('tlyric', 'lyric', {str}))
if not original or original == '[99:00.00]纯音乐,请欣赏\n':... | ```suggestion
original_ts_texts = collect_lyrics(original)
translation_ts_dict = dict(collect_lyrics(translated))
``` | },
'skip': 'Blocked outside Mainland China',
}]
def _process_lyrics(self, lyrics_info):
original = traverse_obj(lyrics_info, ('lrc', 'lyric', {str}))
translated = traverse_obj(lyrics_info, ('tlyric', 'lyric', {str}))
if not original or original == '[99:00.00]纯音乐,请欣赏\n':... | @@ -241,9 +259,16 @@ def _process_lyrics(self, lyrics_info):
'lyrics': [{'data': original, 'ext': 'lrc'}],
}
- lyrics_expr = r'(\[[0-9]{2}:[0-9]{2}\.[0-9]{2,}\])([^\n]+)'
- original_ts_texts = re.findall(lyrics_expr, original)
- translation_ts_dict = dict(re.findall(... | yt_dlp/extractor/neteasemusic.py | 26 | Python | 0.714 | suggestion | 136 | 51 | 51 | false | [ie/neteasemusic] Fix merged lyrics extraction | 15,052 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | Mivik |
'thumbnail': r're:^http.*\.jpg',
'album': 'Piano Solos, Vol. 2',
'album_artist': 'Dustin O\'Halloran',
'average_rating': int,
'description': 'md5:b566b92c55ca348df65d206c5d689576',
'album_artists': ['Dustin O\'Halloran'],
'creators': ['... | is the download test code smart enough to check an md5 hash of the lyrics `data`? | 'thumbnail': r're:^http.*\.jpg',
'album': 'Piano Solos, Vol. 2',
'album_artist': 'Dustin O\'Halloran',
'average_rating': int,
'description': 'md5:b566b92c55ca348df65d206c5d689576',
'album_artists': ['Dustin O\'Halloran'],
'creators': ['... | @@ -156,18 +156,36 @@ class NetEaseMusicIE(NetEaseMusicBaseIE):
'id': '17241424',
'ext': 'mp3',
'title': 'Opus 28',
- 'upload_date': '20080211',
- 'timestamp': 1202745600,
+ 'upload_date': '20060912',
+ 'timestamp': 1158076800,
... | yt_dlp/extractor/neteasemusic.py | 26 | Python | 0.357 | question | 81 | 51 | 51 | false | [ie/neteasemusic] Fix merged lyrics extraction | 15,052 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | Mivik |
Note that channel fields may or may not repeat uploader
fields. This depends on a particular extractor.
channel_id: Id of the channel.
channel_url: Full URL to a channel webpage.
channel_follower_count: Number of followers of the channel.
channel_is_verifie... | IMO `save_count` would be a more obvious name and could possibly make it more widely applicable (e.g. if a site allows downloads and tracks how many times it has been downloaded)
```suggestion
save_count: Number of times the video has been saved or bookmarked
```
I would also move this below `repost_count` | Note that channel fields may or may not repeat uploader
fields. This depends on a particular extractor.
channel_id: Id of the channel.
channel_url: Full URL to a channel webpage.
channel_follower_count: Number of followers of the channel.
channel_is_verifie... | @@ -348,6 +348,7 @@ class InfoExtractor:
duration: Length of the video in seconds, as an integer or float.
view_count: How many users have watched the video on the platform.
concurrent_view_count: How many users are currently watching the video on the platform.
+ bookmark_count: Number of bo... | yt_dlp/extractor/common.py | 26 | Python | 0.857 | refactor | 319 | 51 | 51 | false | [ie/tiktok] Extract `save_count` | 15,054 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | pomtnp |
'formats': None if extract_flat else self._extract_web_formats(aweme_detail),
'subtitles': None if extract_flat else self.extract_subtitles(aweme_detail, video_id, None),
'http_headers': {'Referer': webpage_url},
**author_info,
'channel_url': format_field(auth... | ```suggestion
'save_count': 'collectCount',
``` | 'id': video_id,
'formats': None if extract_flat else self._extract_web_formats(aweme_detail),
'subtitles': None if extract_flat else self.extract_subtitles(aweme_detail, video_id, None),
'http_headers': {'Referer': webpage_url},
**author_info,
'cha... | @@ -607,6 +607,7 @@ def _parse_aweme_video_web(self, aweme_detail, webpage_url, video_id, extract_fl
'like_count': 'diggCount',
'repost_count': 'shareCount',
'comment_count': 'commentCount',
+ 'bookmark_count': 'collectCount', | yt_dlp/extractor/tiktok.py | 26 | Python | 0.571 | suggestion | 65 | 51 | 51 | false | [ie/tiktok] Extract `save_count` | 15,054 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | pomtnp |
is_generic_og_trackname = music_info.get('is_original_sound') and music_info.get('title') == 'original sound - {}'.format(music_info.get('owner_handle'))
if is_generic_og_trackname:
music_track, music_author = contained_music_track or 'original sound', contained_music_author
else:
... | ```suggestion
'save_count': 'collect_count',
``` | is_generic_og_trackname = music_info.get('is_original_sound') and music_info.get('title') == 'original sound - {}'.format(music_info.get('owner_handle'))
if is_generic_og_trackname:
music_track, music_author = contained_music_track or 'original sound', contained_music_author
else:
... | @@ -454,6 +454,7 @@ def extract_addr(addr, add_meta={}):
'like_count': 'digg_count',
'repost_count': 'share_count',
'comment_count': 'comment_count',
+ 'save_count': 'collect_count' | yt_dlp/extractor/tiktok.py | 26 | Python | 0.571 | suggestion | 66 | 51 | 51 | false | [ie/tiktok] Extract `save_count` | 15,054 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | pomtnp |
webpage, default=None) or self._html_search_meta(
'description', webpage, default=None))
upload_date = unified_strdate(self._search_regex(
r'<input type="hidden" id="air_date_[0-9]+" value="([^"]+)"',
webpage, 'upload date', default=None))
... | please add a test that needs this pattern or mark which existing tests need this pattern | None, headers=self.geo_verification_headers(), fatal=False) or {}).get('cookie')
if cookie:
station = self._search_regex(r'#?s=\["([^"]+)"', cookie, 'station')
if station:
self._set_cookie('.pbs.org', 'pbsol.station', station)
def _extract_webpage(self, u... | @@ -506,6 +506,7 @@ def _extract_webpage(self, url):
r"(?s)window\.PBS\.playerConfig\s*=\s*{.*?id\s*:\s*'([0-9]+)',",
r'<div[^>]+\bdata-cove-id=["\'](\d+)"', # http://www.pbs.org/wgbh/roadshow/watch/episode/2105-indianapolis-hour-2/
r'<iframe[^>]+\bsrc=["\'](?:https?:... | yt_dlp/extractor/pbs.py | 26 | Python | 0.214 | suggestion | 88 | 51 | 51 | false | [PBS] An extractor error has occurred. (caused by KeyError('title')) | 15,083 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | nlurker |
'info_dict': {
'id': '3091549094',
'ext': 'mp4',
'title': 'PBS NewsHour - Capehart and Johnson on the unusual Biden-Trump debate plans',
'description': 'Capehart and Johnson on how the Biden-Trump debates could shape the campaign season',
... | ```suggestion
{
# Next.js v13+, see https://github.com/yt-dlp/yt-dlp/issues/13299
'url': 'https://www.pbs.org/video/caregiving',
``` | 'info_dict': {
'id': '3091549094',
'ext': 'mp4',
'title': 'PBS NewsHour - Capehart and Johnson on the unusual Biden-Trump debate plans',
'description': 'Capehart and Johnson on how the Biden-Trump debates could shape the campaign season',
... | @@ -453,6 +453,22 @@ class PBSIE(InfoExtractor):
'url': 'https://player.pbs.org/portalplayer/3004638221/?uid=',
'only_matching': True,
},
+ {
+ 'url': 'https://www.pbs.org/video/caregiving', | yt_dlp/extractor/pbs.py | 26 | Python | 0.714 | suggestion | 168 | 51 | 51 | false | [PBS] An extractor error has occurred. (caused by KeyError('title')) | 15,083 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | nlurker |
webpage, default=None) or self._html_search_meta(
'description', webpage, default=None))
upload_date = unified_strdate(self._search_regex(
r'<input type="hidden" id="air_date_[0-9]+" value="([^"]+)"',
webpage, 'upload date', default=None))
... | ```suggestion
r'\\"videoTPMediaId\\":\\\"(\d+)\\"', # Next.js v13, e.g. https://www.pbs.org/video/caregiving
``` | description = strip_or_none(self._og_search_description(
webpage, default=None) or self._html_search_meta(
'description', webpage, default=None))
upload_date = unified_strdate(self._search_regex(
r'<input type="hidden" id="air_date_[0-9]+" value="(... | @@ -506,6 +522,7 @@ def _extract_webpage(self, url):
r"(?s)window\.PBS\.playerConfig\s*=\s*{.*?id\s*:\s*'([0-9]+)',",
r'<div[^>]+\bdata-cove-id=["\'](\d+)"', # http://www.pbs.org/wgbh/roadshow/watch/episode/2105-indianapolis-hour-2/
r'<iframe[^>]+\bsrc=["\'](?:https?:... | yt_dlp/extractor/pbs.py | 26 | Python | 0.714 | suggestion | 131 | 51 | 51 | false | [PBS] An extractor error has occurred. (caused by KeyError('title')) | 15,083 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | nlurker |
from .common import InfoExtractor
from ..utils import (
int_or_none,
str_or_none,
url_or_none,
)
from ..utils.traversal import traverse_obj
class MedalTVIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?medal\.tv/games/[^/?#&]+/clips/(?P<id>[^/?#&]+)'
_TESTS = [{
'url': 'https://medal.... | ```suggestion
from .common import InfoExtractor
``` | from .common import InfoExtractor
from ..utils import (
int_or_none,
url_or_none,
)
from ..utils.traversal import traverse_obj
class MedalTVIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?medal\.tv/games/[^/?#&]+/clips/(?P<id>[^/?#&]+)'
_TESTS = [{
'url': 'https://medal.tv/games/valorant/... | @@ -1,14 +1,11 @@
-import re
from .common import InfoExtractor | yt_dlp/extractor/medaltv.py | 2 | Python | 0.643 | refactor | 53 | 27 | 27 | false | [ie/MedalTV] Rework extractor | 15,103 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | seproDev |
'description': '',
'uploader': 'Aciel',
'timestamp': 1651628243,
'upload_date': '20220504',
'uploader_id': '19335460',
'uploader_url': 'https://medal.tv/users/19335460',
'comment_count': int,
'view_count': int,
'... | IMO it's good to check extension since we block non-image extensions now | 'timestamp': 1651628243,
'upload_date': '20220504',
'uploader_id': '19335460',
'uploader_url': 'https://medal.tv/users/19335460',
'comment_count': int,
'view_count': int,
'like_count': int,
'duration': 13,
'thumb... | @@ -57,104 +37,90 @@ class MedalTVIE(InfoExtractor):
'id': '2um24TWdty0NA',
'ext': 'mp4',
'title': 'u tk me i tk u bigger',
- 'description': 'Medal,https://medal.tv/desktop/',
- 'uploader': 'Mimicc',
+ 'description': '',
+ 'uploader': 'z... | yt_dlp/extractor/medaltv.py | 26 | Python | 0.214 | suggestion | 72 | 51 | 51 | false | [ie/MedalTV] Rework extractor | 15,103 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | seproDev |
if not formats:
# Fallback, does not require auth
self.report_warning('Video formats are not available through API, falling back to social video URL')
urlh = self._request_webpage(
f'https://medal.tv/api/content/{video_id}/socialVideoUrl', video_id, fatal=Fals... | do you mean `{int}, {str_or_none}`? or else why not just `{str}`? | self.report_warning('Video formats are not available through API, falling back to social video URL')
urlh = self._request_webpage(
f'https://medal.tv/api/content/{video_id}/socialVideoUrl', video_id,
note='Checking social video URL')
formats.append({
... | @@ -57,104 +37,90 @@ class MedalTVIE(InfoExtractor):
'id': '2um24TWdty0NA',
'ext': 'mp4',
'title': 'u tk me i tk u bigger',
- 'description': 'Medal,https://medal.tv/desktop/',
- 'uploader': 'Mimicc',
+ 'description': '',
+ 'uploader': 'z... | yt_dlp/extractor/medaltv.py | 26 | Python | 0.357 | question | 65 | 32 | 30 | false | [ie/MedalTV] Rework extractor | 15,103 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | seproDev |
# Fallback, does not require auth
self.report_warning('Video formats are not available through API, falling back to social video URL')
urlh = self._request_webpage(
f'https://medal.tv/api/content/{video_id}/socialVideoUrl', video_id, fatal=False,
note=... | same question here, and also maybe we should add a `filter` so that we don't return an empty string | urlh = self._request_webpage(
f'https://medal.tv/api/content/{video_id}/socialVideoUrl', video_id,
note='Checking social video URL')
formats.append({
'url': urlh.url,
'format_id': 'social-video',
'ext': 'mp4',
... | @@ -57,104 +37,90 @@ class MedalTVIE(InfoExtractor):
'id': '2um24TWdty0NA',
'ext': 'mp4',
'title': 'u tk me i tk u bigger',
- 'description': 'Medal,https://medal.tv/desktop/',
- 'uploader': 'Mimicc',
+ 'description': '',
+ 'uploader': 'z... | yt_dlp/extractor/medaltv.py | 26 | Python | 0.429 | suggestion | 99 | 31 | 29 | false | [ie/MedalTV] Rework extractor | 15,103 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | seproDev |
}]
def _real_extract(self, url):
video_id = self._match_id(url)
content_data = self._download_json(
f'https://medal.tv/api/content/{video_id}', video_id,
headers={'Accept': 'application/json'})
formats = []
if m3u8_url := url_or_none(content_data.get('c... | can't be non-fatal if we try to use `urlh.url` no matter what | def _real_extract(self, url):
video_id = self._match_id(url)
content_data = self._download_json(
f'https://medal.tv/api/content/{video_id}', video_id,
headers={'Accept': 'application/json'})
formats = []
if m3u8_url := url_or_none(content_data.get('contentUr... | @@ -57,104 +37,90 @@ class MedalTVIE(InfoExtractor):
'id': '2um24TWdty0NA',
'ext': 'mp4',
'title': 'u tk me i tk u bigger',
- 'description': 'Medal,https://medal.tv/desktop/',
- 'uploader': 'Mimicc',
+ 'description': '',
+ 'uploader': 'z... | yt_dlp/extractor/medaltv.py | 26 | Python | 0.429 | suggestion | 61 | 51 | 50 | false | [ie/MedalTV] Rework extractor | 15,103 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | seproDev |
import json
import re
from typing import Any
from .common import ExtractorError, InfoExtractor
from ..utils import (
int_or_none,
str_or_none,
traverse_obj,
)
class AGalegaIE(InfoExtractor):
IE_NAME = 'AGalega'
_VALID_URL = r'https?://(?:www\.)?agalega\.gal/videos/(?:(?:detail|category)/)?(?P<id>... | This should be split into two extractors, one for videos and one for playlists | import json
import time
from .common import InfoExtractor
from ..utils import jwt_decode_hs256, url_or_none
from ..utils.traversal import traverse_obj
class AGalegaBaseIE(InfoExtractor):
_access_token = None
@staticmethod
def _jwt_is_expired(token):
return jwt_decode_hs256(token)['exp'] - time.t... | @@ -0,0 +1,273 @@
+import json
+import re
+from typing import Any
+
+from .common import ExtractorError, InfoExtractor
+from ..utils import (
+ int_or_none,
+ str_or_none,
+ traverse_obj,
+)
+
+
+class AGalegaIE(InfoExtractor):
+ IE_NAME = 'AGalega'
+ _VALID_URL = r'https?://(?:www\.)?agalega\.gal/videos... | yt_dlp/extractor/agalega.py | 15 | Python | 0.286 | refactor | 78 | 40 | 40 | false | [ie/AGalega] Add extractor | 15,105 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | putridambassador121 |
'description': 'Anxo, Noemí, Silvia e Estrella comparten as sensacións da clase de Eddy.',
'thumbnail': 'https://crtvg-bucket.flumotion.cloud/content_cards/a6bb7da6c8994b82bf961ac6cad1707b.png',
'ext': 'mp4',
},
},
{
'url': 'https://www.agalega.gal/videos... | This can be moved in to a base class
As a side note, yt-dlp extractor code currently does not use any typing, as generally sites could be sending us anything. Please remove it.
Please also use `snake_case`, instead of `camelCase` throughout the extractor. | headers={'Authorization': f'jwtok {AGalegaBaseIE._access_token}'})
class AGalegaIE(AGalegaBaseIE):
IE_NAME = 'agalega:videos'
_VALID_URL = r'https?://(?:www\.)?agalega\.gal/videos/(?:detail/)?(?P<id>[0-9]+)'
_TESTS = [{
'url': 'https://www.agalega.gal/videos/288664-lr-ninguencheconta',... | @@ -0,0 +1,273 @@
+import json
+import re
+from typing import Any
+
+from .common import ExtractorError, InfoExtractor
+from ..utils import (
+ int_or_none,
+ str_or_none,
+ traverse_obj,
+)
+
+
+class AGalegaIE(InfoExtractor):
+ IE_NAME = 'AGalega'
+ _VALID_URL = r'https?://(?:www\.)?agalega\.gal/videos... | yt_dlp/extractor/agalega.py | 26 | Python | 0.643 | refactor | 259 | 51 | 51 | false | [ie/AGalega] Add extractor | 15,105 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | putridambassador121 |
'playlist_count': 17,
},
]
def getAPIToken(self, videoid: str) -> dict[str, str] | None:
tokenUrl = 'https://www.agalega.gal/api/fetch-api/jwt/token'
bodyData = json.dumps({
'username': None,
'password': None,
'client': 'crtvg',
'chec... | inline these and put the `optional_fields` inside the `query` arg of `_download_json`
Can add a `_API_BASE` class variable | 'title': 'Pulso activo | 18-11-2025',
'description': 'Anxo, Noemí, Silvia e Estrella comparten as sensacións da clase de Eddy.',
'thumbnail': 'https://crtvg-bucket.flumotion.cloud/content_cards/a6bb7da6c8994b82bf961ac6cad1707b.png',
'ext': 'mp4',
},
}]
d... | @@ -0,0 +1,273 @@
+import json
+import re
+from typing import Any
+
+from .common import ExtractorError, InfoExtractor
+from ..utils import (
+ int_or_none,
+ str_or_none,
+ traverse_obj,
+)
+
+
+class AGalegaIE(InfoExtractor):
+ IE_NAME = 'AGalega'
+ _VALID_URL = r'https?://(?:www\.)?agalega\.gal/videos... | yt_dlp/extractor/agalega.py | 26 | Python | 0.5 | suggestion | 125 | 51 | 39 | false | [ie/AGalega] Add extractor | 15,105 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | putridambassador121 |
pageCategoryContent = 2
while next_url_category_content and len(episode_ids) < countCategoryContent:
next_page_url = f'{categoryContentsUrl.format(category_id=seriesid)}&page={pageCategoryContent}'
pageCategoryContent += 1
next... | `serieThumb` is used nowhere else. Also why are we introducing this other format instead of just returning an info dict here? | import json
import time
from .common import InfoExtractor
from ..utils import jwt_decode_hs256, url_or_none
from ..utils.traversal import traverse_obj
class AGalegaBaseIE(InfoExtractor):
_access_token = None
@staticmethod
def _jwt_is_expired(token):
return jwt_decode_hs256(token)['exp'] - time.t... | @@ -0,0 +1,273 @@
+import json
+import re
+from typing import Any
+
+from .common import ExtractorError, InfoExtractor
+from ..utils import (
+ int_or_none,
+ str_or_none,
+ traverse_obj,
+)
+
+
+class AGalegaIE(InfoExtractor):
+ IE_NAME = 'AGalega'
+ _VALID_URL = r'https?://(?:www\.)?agalega\.gal/videos... | yt_dlp/extractor/agalega.py | 26 | Python | 0.571 | question | 125 | 51 | 92 | false | [ie/AGalega] Add extractor | 15,105 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | putridambassador121 |
return None
def _real_extract(self, url: str) -> dict[str, Any]:
video_id: str = self._match_id(url)
if re.search(r'(?:(programas|peliculas-e-documentais|informativos-g24|deportes|xeracion-zeta))', url, re.I):
raise ExtractorError('''This category contains too many items.
... | Why is this fatal?
Generally, all metadata should be non-fatal and using `traverse_obj` | import json
import time
from .common import InfoExtractor
from ..utils import jwt_decode_hs256, url_or_none
from ..utils.traversal import traverse_obj
class AGalegaBaseIE(InfoExtractor):
_access_token = None
@staticmethod
def _jwt_is_expired(token):
return jwt_decode_hs256(token)['exp'] - time.t... | @@ -0,0 +1,273 @@
+import json
+import re
+from typing import Any
+
+from .common import ExtractorError, InfoExtractor
+from ..utils import (
+ int_or_none,
+ str_or_none,
+ traverse_obj,
+)
+
+
+class AGalegaIE(InfoExtractor):
+ IE_NAME = 'AGalega'
+ _VALID_URL = r'https?://(?:www\.)?agalega\.gal/videos... | yt_dlp/extractor/agalega.py | 26 | Python | 0.429 | question | 88 | 47 | 92 | false | [ie/AGalega] Add extractor | 15,105 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | putridambassador121 |
import json
import re
from .common import ExtractorError, InfoExtractor
from ..utils import (
int_or_none,
require,
str_or_none,
traverse_obj,
url_or_none,
)
class AGalegaBaseIE(InfoExtractor):
_VALID_URL = False
def _get_access_token(self, video_id: str) -> dict[str, str] | None:
... | Not needed
```suggestion
``` | import json
import time
from .common import InfoExtractor
from ..utils import jwt_decode_hs256, url_or_none
from ..utils.traversal import traverse_obj
class AGalegaBaseIE(InfoExtractor):
_access_token = None
@staticmethod
def _jwt_is_expired(token):
return jwt_decode_hs256(token)['exp'] - time.t... | @@ -0,0 +1,336 @@
+import json
+import re
+
+from .common import ExtractorError, InfoExtractor
+from ..utils import (
+ int_or_none,
+ require,
+ str_or_none,
+ traverse_obj,
+ url_or_none,
+)
+
+
+class AGalegaBaseIE(InfoExtractor):
+ _VALID_URL = False
+ | yt_dlp/extractor/agalega.py | 16 | Python | 0.429 | suggestion | 30 | 41 | 41 | false | [ie/AGalega] Add extractor | 15,105 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | putridambassador121 |
import json
import re
from .common import ExtractorError, InfoExtractor
from ..utils import (
int_or_none,
require,
str_or_none,
traverse_obj,
url_or_none,
)
class AGalegaBaseIE(InfoExtractor):
_VALID_URL = False
def _get_access_token(self, video_id: str) -> dict[str, str] | None:
... | ```suggestion
def _get_access_token(self, video_id):
``` | import json
import time
from .common import InfoExtractor
from ..utils import jwt_decode_hs256, url_or_none
from ..utils.traversal import traverse_obj
class AGalegaBaseIE(InfoExtractor):
_access_token = None
@staticmethod
def _jwt_is_expired(token):
return jwt_decode_hs256(token)['exp'] - time.t... | @@ -0,0 +1,336 @@
+import json
+import re
+
+from .common import ExtractorError, InfoExtractor
+from ..utils import (
+ int_or_none,
+ require,
+ str_or_none,
+ traverse_obj,
+ url_or_none,
+)
+
+
+class AGalegaBaseIE(InfoExtractor):
+ _VALID_URL = False
+
+ def _get_access_token(self, video_id: st... | yt_dlp/extractor/agalega.py | 17 | Python | 0.571 | suggestion | 62 | 42 | 42 | false | [ie/AGalega] Add extractor | 15,105 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | putridambassador121 |
traverse_obj,
url_or_none,
)
class AGalegaBaseIE(InfoExtractor):
_VALID_URL = False
def _get_access_token(self, video_id: str) -> dict[str, str] | None:
token_url = 'https://www.agalega.gal/api/fetch-api/jwt/token'
body_data = json.dumps({
'username': None,
'pa... | There is nothing useful we can do without this token, right? Then might as well make this fatal
```suggestion
access_token = self._download_json(
'https://www.agalega.gal/api/fetch-api/jwt/token', video_id,
note='Downloading access token',
data=json.dumps({
... | class AGalegaBaseIE(InfoExtractor):
_access_token = None
@staticmethod
def _jwt_is_expired(token):
return jwt_decode_hs256(token)['exp'] - time.time() < 120
def _refresh_access_token(self, video_id):
AGalegaBaseIE._access_token = self._download_json(
'https://www.agalega.ga... | @@ -0,0 +1,336 @@
+import json
+import re
+
+from .common import ExtractorError, InfoExtractor
+from ..utils import (
+ int_or_none,
+ require,
+ str_or_none,
+ traverse_obj,
+ url_or_none,
+)
+
+
+class AGalegaBaseIE(InfoExtractor):
+ _VALID_URL = False
+
+ def _get_access_token(self, video_id: st... | yt_dlp/extractor/agalega.py | 26 | Python | 0.857 | security | 637 | 51 | 51 | false | [ie/AGalega] Add extractor | 15,105 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | putridambassador121 |
'description': 'O cómico ademais fai un repaso dalgúns momentos da súa traxectoria profesional',
'thumbnail': 'https://crtvg-bucket.flumotion.cloud/content_cards/2ef32c3b9f6249d9868fd8f11d389d3d.png',
'ext': 'mp4',
},
},
{
'url': 'https://www.agalega.gal/v... | The URLs should be inlined and query parameters passed as a dict.
```suggestion
auth_headers = self._get_access_token(video_id)
content_data = self._download_json(
f'https://api-agalega.interactvty.com/api/2.0/contents/content/{video_id}/', video_id,
note='Downloading cont... | 'thumbnail': 'https://crtvg-bucket.flumotion.cloud/content_cards/2ef32c3b9f6249d9868fd8f11d389d3d.png',
'ext': 'mp4',
},
}, {
'url': 'https://www.agalega.gal/videos/detail/296152-pulso-activo-7',
'md5': '26df7fdcf859f38ad92d837279d6b56d',
'info_dict': {
... | @@ -0,0 +1,336 @@
+import json
+import re
+
+from .common import ExtractorError, InfoExtractor
+from ..utils import (
+ int_or_none,
+ require,
+ str_or_none,
+ traverse_obj,
+ url_or_none,
+)
+
+
+class AGalegaBaseIE(InfoExtractor):
+ _VALID_URL = False
+
+ def _get_access_token(self, video_id: st... | yt_dlp/extractor/agalega.py | 26 | Python | 1 | security | 925 | 51 | 47 | false | [ie/AGalega] Add extractor | 15,105 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | putridambassador121 |
'md5': '26df7fdcf859f38ad92d837279d6b56d',
'info_dict': {
'id': '296152',
'title': 'Pulso activo | 18-11-2025',
'description': 'Anxo, Noemí, Silvia e Estrella comparten as sensacións da clase de Eddy.',
'thumbnail': 'https://crtvg-bucket.flumotion.cloud/c... | Same here, we should also extract all possible media URLs and not silently discard subtitles.
```suggestion
formats = []
subtitles = {}
for m3u8_url in traverse_obj(resource_data, ('results', ..., 'media_url', {url_or_none})):
fmts, subs = self._extract_m3u8_formats_and_subtitle... | 'id': '296152',
'title': 'Pulso activo | 18-11-2025',
'description': 'Anxo, Noemí, Silvia e Estrella comparten as sensacións da clase de Eddy.',
'thumbnail': 'https://crtvg-bucket.flumotion.cloud/content_cards/a6bb7da6c8994b82bf961ac6cad1707b.png',
'ext': 'mp... | @@ -0,0 +1,336 @@
+import json
+import re
+
+from .common import ExtractorError, InfoExtractor
+from ..utils import (
+ int_or_none,
+ require,
+ str_or_none,
+ traverse_obj,
+ url_or_none,
+)
+
+
+class AGalegaBaseIE(InfoExtractor):
+ _VALID_URL = False
+
+ def _get_access_token(self, video_id: st... | yt_dlp/extractor/agalega.py | 26 | Python | 0.857 | refactor | 483 | 51 | 40 | false | [ie/AGalega] Add extractor | 15,105 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | putridambassador121 |
info_url = f'https://api-agalega.interactvty.com/api/2.0/contents/content/{video_id}/?optional_fields=image,is_premium,short_description,has_subtitle'
media_url = f'https://api-agalega.interactvty.com/api/2.0/contents/content_resources/{video_id}/?optional_fields=media_url'
auth_header = self._g... | Any reason not to use the video_id from the URL?
```suggestion
return {
'id': video_id,
'formats': formats,
'subtitles': subtitles,
**traverse_obj(content_data, {
'title': ('name', {str}),
'description': (('description', 'sh... | query={
'optional_fields': 'image,is_premium,short_description,has_subtitle',
})
resource_data = self._call_api(
f'content_resources/{video_id}/', video_id, note='Downloading resource data',
query={
'optional_fields': 'media_url',
... | @@ -0,0 +1,336 @@
+import json
+import re
+
+from .common import ExtractorError, InfoExtractor
+from ..utils import (
+ int_or_none,
+ require,
+ str_or_none,
+ traverse_obj,
+ url_or_none,
+)
+
+
+class AGalegaBaseIE(InfoExtractor):
+ _VALID_URL = False
+
+ def _get_access_token(self, video_id: st... | yt_dlp/extractor/agalega.py | 26 | Python | 0.857 | suggestion | 448 | 51 | 28 | false | [ie/AGalega] Add extractor | 15,105 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | putridambassador121 |
class AGalegaSeriesIE(AGalegaBaseIE):
IE_NAME = 'agalega:series'
_VALID_URL = r'https?://(?:www\.)?agalega\.gal/videos/category/(?P<id>[0-9]+)'
_TESTS = [{
'url': 'https://www.agalega.gal/videos/category/27035-galician-friki',
'info_dict': {
'id': '27035',
'title': 'G... | ```suggestion
def _real_extract(self, url):
``` | import json
import time
from .common import InfoExtractor
from ..utils import jwt_decode_hs256, url_or_none
from ..utils.traversal import traverse_obj
class AGalegaBaseIE(InfoExtractor):
_access_token = None
@staticmethod
def _jwt_is_expired(token):
return jwt_decode_hs256(token)['exp'] - time.t... | @@ -0,0 +1,336 @@
+import json
+import re
+
+from .common import ExtractorError, InfoExtractor
+from ..utils import (
+ int_or_none,
+ require,
+ str_or_none,
+ traverse_obj,
+ url_or_none,
+)
+
+
+class AGalegaBaseIE(InfoExtractor):
+ _VALID_URL = False
+
+ def _get_access_token(self, video_id: st... | yt_dlp/extractor/agalega.py | 26 | Python | 0.643 | refactor | 53 | 51 | 92 | false | [ie/AGalega] Add extractor | 15,105 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | putridambassador121 |
IE_NAME = 'agalega:series'
_VALID_URL = r'https?://(?:www\.)?agalega\.gal/videos/category/(?P<id>[0-9]+)'
_TESTS = [{
'url': 'https://www.agalega.gal/videos/category/27035-galician-friki',
'info_dict': {
'id': '27035',
'title': 'Galician Friki',
'descripti... | Let's use `playlist_id`, since this isn't really a video
```suggestion
playlist_id = self._match_id(url)
``` | import json
import time
from .common import InfoExtractor
from ..utils import jwt_decode_hs256, url_or_none
from ..utils.traversal import traverse_obj
class AGalegaBaseIE(InfoExtractor):
_access_token = None
@staticmethod
def _jwt_is_expired(token):
return jwt_decode_hs256(token)['exp'] - time.t... | @@ -0,0 +1,336 @@
+import json
+import re
+
+from .common import ExtractorError, InfoExtractor
+from ..utils import (
+ int_or_none,
+ require,
+ str_or_none,
+ traverse_obj,
+ url_or_none,
+)
+
+
+class AGalegaBaseIE(InfoExtractor):
+ _VALID_URL = False
+
+ def _get_access_token(self, video_id: st... | yt_dlp/extractor/agalega.py | 26 | Python | 0.786 | suggestion | 119 | 51 | 92 | false | [ie/AGalega] Add extractor | 15,105 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | putridambassador121 |
'id': '27035',
'title': 'Galician Friki',
'description': 'md5:68279845eea70ba3b4324bd96e3aac30',
'thumbnail': 'https://crtvg-bucket.flumotion.cloud/category_cards/f1d4e23fa336467ba9b1330f6224c589.jpg',
},
'playlist_count': 7,
},
{
'url'... | If it works, I don't think the extractor should stop users from passing any specific URLs
```suggestion
``` | import json
import time
from .common import InfoExtractor
from ..utils import jwt_decode_hs256, url_or_none
from ..utils.traversal import traverse_obj
class AGalegaBaseIE(InfoExtractor):
_access_token = None
@staticmethod
def _jwt_is_expired(token):
return jwt_decode_hs256(token)['exp'] - time.t... | @@ -0,0 +1,336 @@
+import json
+import re
+
+from .common import ExtractorError, InfoExtractor
+from ..utils import (
+ int_or_none,
+ require,
+ str_or_none,
+ traverse_obj,
+ url_or_none,
+)
+
+
+class AGalegaBaseIE(InfoExtractor):
+ _VALID_URL = False
+
+ def _get_access_token(self, video_id: st... | yt_dlp/extractor/agalega.py | 26 | Python | 0.786 | refactor | 109 | 51 | 92 | false | [ie/AGalega] Add extractor | 15,105 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | putridambassador121 |
if not sub_category_sorted:
raise ExtractorError('No seasons or episodes found', expected=True)
entries = []
for season_idx, season in enumerate(sub_category_sorted, 1):
for ep_idx, episode in enumerate(season.get('episodes', []), 1):
episode_id = trave... | I don't think we should be guessing the season/episode number based on the index. What if a single episode/season is missing. If the site doesn't provide the data, yt-dlp should not provide it either. | import json
import time
from .common import InfoExtractor
from ..utils import jwt_decode_hs256, url_or_none
from ..utils.traversal import traverse_obj
class AGalegaBaseIE(InfoExtractor):
_access_token = None
@staticmethod
def _jwt_is_expired(token):
return jwt_decode_hs256(token)['exp'] - time.t... | @@ -0,0 +1,336 @@
+import json
+import re
+
+from .common import ExtractorError, InfoExtractor
+from ..utils import (
+ int_or_none,
+ require,
+ str_or_none,
+ traverse_obj,
+ url_or_none,
+)
+
+
+class AGalegaBaseIE(InfoExtractor):
+ _VALID_URL = False
+
+ def _get_access_token(self, video_id: st... | yt_dlp/extractor/agalega.py | 26 | Python | 0.5 | suggestion | 200 | 41 | 92 | false | [ie/AGalega] Add extractor | 15,105 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | putridambassador121 |
'_type': 'url_transparent',
'url': m3u8_url,
'id': episode_id,
**traverse_obj(episode, {
'title': ('episodeName', {str_or_none}),
'thumbnail': ('episodeThumb', {url_or_... | We don't want to be compiling the entire entries in advance. Instead, this should use a generator so that features such as `--lazy-playlist` work. | import json
import time
from .common import InfoExtractor
from ..utils import jwt_decode_hs256, url_or_none
from ..utils.traversal import traverse_obj
class AGalegaBaseIE(InfoExtractor):
_access_token = None
@staticmethod
def _jwt_is_expired(token):
return jwt_decode_hs256(token)['exp'] - time.t... | @@ -0,0 +1,336 @@
+import json
+import re
+
+from .common import ExtractorError, InfoExtractor
+from ..utils import (
+ int_or_none,
+ require,
+ str_or_none,
+ traverse_obj,
+ url_or_none,
+)
+
+
+class AGalegaBaseIE(InfoExtractor):
+ _VALID_URL = False
+
+ def _get_access_token(self, video_id: st... | yt_dlp/extractor/agalega.py | 26 | Python | 0.571 | suggestion | 146 | 28 | 92 | false | [ie/AGalega] Add extractor | 15,105 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | putridambassador121 |
for ep_idx, episode in enumerate(season.get('episodes', []), 1):
episode_id = traverse_obj(episode, ('episodeID', {str_or_none}, {require('episodeID')}))
media_raw = self._download_json(media_url.format(video_id=episode_id), episode_id, headers=auth_header)
if... | ```suggestion
'id': playlist_id,
``` | import json
import time
from .common import InfoExtractor
from ..utils import jwt_decode_hs256, url_or_none
from ..utils.traversal import traverse_obj
class AGalegaBaseIE(InfoExtractor):
_access_token = None
@staticmethod
def _jwt_is_expired(token):
return jwt_decode_hs256(token)['exp'] - time.t... | @@ -0,0 +1,336 @@
+import json
+import re
+
+from .common import ExtractorError, InfoExtractor
+from ..utils import (
+ int_or_none,
+ require,
+ str_or_none,
+ traverse_obj,
+ url_or_none,
+)
+
+
+class AGalegaBaseIE(InfoExtractor):
+ _VALID_URL = False
+
+ def _get_access_token(self, video_id: st... | yt_dlp/extractor/agalega.py | 26 | Python | 0.571 | suggestion | 50 | 34 | 92 | false | [ie/AGalega] Add extractor | 15,105 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | putridambassador121 |
}),
})
if len(episodes_list) >= count_episodes:
break
next_url_episodes = str_or_none(next_data.get('next'))
if not next_url_episodes:
break
sub_category_sorted.appe... | I don't think we should be making the individual media requests inside the playlist extractor. Instead, use `self.url_result`. That way the video extractor can take care of the video extraction. | import json
import time
from .common import InfoExtractor
from ..utils import jwt_decode_hs256, url_or_none
from ..utils.traversal import traverse_obj
class AGalegaBaseIE(InfoExtractor):
_access_token = None
@staticmethod
def _jwt_is_expired(token):
return jwt_decode_hs256(token)['exp'] - time.t... | @@ -0,0 +1,336 @@
+import json
+import re
+
+from .common import ExtractorError, InfoExtractor
+from ..utils import (
+ int_or_none,
+ require,
+ str_or_none,
+ traverse_obj,
+ url_or_none,
+)
+
+
+class AGalegaBaseIE(InfoExtractor):
+ _VALID_URL = False
+
+ def _get_access_token(self, video_id: st... | yt_dlp/extractor/agalega.py | 26 | Python | 0.571 | refactor | 194 | 51 | 92 | false | [ie/AGalega] Add extractor | 15,105 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | putridambassador121 |
results = next_data.get('results') or []
if not results:
break
for episode_item in results:
episodes_list.append({
'episodeID': traverse_obj(episode_item, ('id', {int}, {str_or_none}, {require('episodeID')}... | I would not introduce this intermediate format here. Instead, I would just use the same nomenclature as the info dict format. | import json
import time
from .common import InfoExtractor
from ..utils import jwt_decode_hs256, url_or_none
from ..utils.traversal import traverse_obj
class AGalegaBaseIE(InfoExtractor):
_access_token = None
@staticmethod
def _jwt_is_expired(token):
return jwt_decode_hs256(token)['exp'] - time.t... | @@ -0,0 +1,336 @@
+import json
+import re
+
+from .common import ExtractorError, InfoExtractor
+from ..utils import (
+ int_or_none,
+ require,
+ str_or_none,
+ traverse_obj,
+ url_or_none,
+)
+
+
+class AGalegaBaseIE(InfoExtractor):
+ _VALID_URL = False
+
+ def _get_access_token(self, video_id: st... | yt_dlp/extractor/agalega.py | 26 | Python | 0.429 | suggestion | 125 | 51 | 92 | false | [ie/AGalega] Add extractor | 15,105 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | putridambassador121 |
category_contents_raw = self._download_json(
category_contents_url.format(category_id=video_id),
video_id,
headers=auth_header,
)
if not category_contents_raw:
raise ExtractorError('Failed to download category contents'... | Would this be a usecase for `InAdvancePagedList` or `OnDemandPagedList`? | import json
import time
from .common import InfoExtractor
from ..utils import jwt_decode_hs256, url_or_none
from ..utils.traversal import traverse_obj
class AGalegaBaseIE(InfoExtractor):
_access_token = None
@staticmethod
def _jwt_is_expired(token):
return jwt_decode_hs256(token)['exp'] - time.t... | @@ -0,0 +1,336 @@
+import json
+import re
+
+from .common import ExtractorError, InfoExtractor
+from ..utils import (
+ int_or_none,
+ require,
+ str_or_none,
+ traverse_obj,
+ url_or_none,
+)
+
+
+class AGalegaBaseIE(InfoExtractor):
+ _VALID_URL = False
+
+ def _get_access_token(self, video_id: st... | yt_dlp/extractor/agalega.py | 26 | Python | 0.429 | question | 72 | 51 | 92 | false | [ie/AGalega] Add extractor | 15,105 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | putridambassador121 |
'info_dict': {
'id': '296152',
'title': 'Pulso activo | 18-11-2025',
'description': 'Anxo, Noemí, Silvia e Estrella comparten as sensacións da clase de Eddy.',
'thumbnail': 'https://crtvg-bucket.flumotion.cloud/content_cards/a6bb7da6c8994b82bf961ac6cad1707b.png',... | No need for this guard. `content_data` is not required anyway. | _VALID_URL = r'https?://(?:www\.)?agalega\.gal/videos/(?:detail/)?(?P<id>[0-9]+)'
_TESTS = [{
'url': 'https://www.agalega.gal/videos/288664-lr-ninguencheconta',
'md5': '04533a66c5f863d08dd9724b11d1c223',
'info_dict': {
'id': '288664',
'title': 'Roberto e Ángel Mar... | @@ -0,0 +1,81 @@
+import json
+
+from .common import InfoExtractor
+from ..utils import require, str_or_none, traverse_obj, url_or_none
+
+
+class AGalegaBaseIE(InfoExtractor):
+ def _call_api(self, video_id):
+ access_token = self._download_json(
+ 'https://www.agalega.gal/api/fetch-api/jwt/token'... | yt_dlp/extractor/agalega.py | 26 | Python | 0.357 | suggestion | 62 | 45 | 51 | false | [ie/AGalega] Add extractor | 15,105 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | putridambassador121 |
_VALID_URL = r'https?://(?:www\.)?agalega\.gal/videos/(?:detail/)?(?P<id>[0-9]+)'
_TESTS = [{
'url': 'https://www.agalega.gal/videos/288664-lr-ninguencheconta',
'md5': '04533a66c5f863d08dd9724b11d1c223',
'info_dict': {
'id': '288664',
'title': 'Roberto e Ángel Mar... | The playlist_id comment was intended for the playlist extractor | 'client': 'crtvg',
'checkExistsCookies': False,
}).encode())['access']
def _call_api(self, endpoint, display_id, note, fatal=True, query=None):
if not AGalegaBaseIE._access_token or self._jwt_is_expired(AGalegaBaseIE._access_token):
self._refresh_acce... | @@ -0,0 +1,81 @@
+import json
+
+from .common import InfoExtractor
+from ..utils import require, str_or_none, traverse_obj, url_or_none
+
+
+class AGalegaBaseIE(InfoExtractor):
+ def _call_api(self, video_id):
+ access_token = self._download_json(
+ 'https://www.agalega.gal/api/fetch-api/jwt/token'... | yt_dlp/extractor/agalega.py | 26 | Python | 0.286 | refactor | 63 | 51 | 51 | false | [ie/AGalega] Add extractor | 15,105 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | putridambassador121 |
import json
from .common import InfoExtractor
from ..utils import require, str_or_none, traverse_obj, url_or_none
class AGalegaBaseIE(InfoExtractor):
def _call_api(self, video_id):
access_token = self._download_json(
'https://www.agalega.gal/api/fetch-api/jwt/token', video_id,
not... | I don't understand the rename. `_call_api` is what you would use for a generic api wrapper method. I would rename to `_fetch_auth_headers` | import json
import time
from .common import InfoExtractor
from ..utils import jwt_decode_hs256, url_or_none
from ..utils.traversal import traverse_obj
class AGalegaBaseIE(InfoExtractor):
_access_token = None
@staticmethod
def _jwt_is_expired(token):
return jwt_decode_hs256(token)['exp'] - time.t... | @@ -0,0 +1,81 @@
+import json
+
+from .common import InfoExtractor
+from ..utils import require, str_or_none, traverse_obj, url_or_none
+
+
+class AGalegaBaseIE(InfoExtractor):
+ def _call_api(self, video_id): | yt_dlp/extractor/agalega.py | 8 | Python | 0.571 | security | 138 | 33 | 33 | false | [ie/AGalega] Add extractor | 15,105 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | putridambassador121 |
)
from .adn import (
ADNIE,
ADNSeasonIE,
)
from .adobeconnect import AdobeConnectIE
from .adobetv import AdobeTVVideoIE
from .adultswim import AdultSwimIE
from .aenetworks import (
AENetworksCollectionIE,
AENetworksIE,
AENetworksShowIE,
BiographyIE,
HistoryPlayerIE,
HistoryTopicIE,
)
fro... | Just name it `AGalegaIE`
```suggestion
from .agalega import AGalegaIE
``` | )
from .adn import (
ADNIE,
ADNSeasonIE,
)
from .adobeconnect import AdobeConnectIE
from .adobetv import AdobeTVVideoIE
from .adultswim import AdultSwimIE
from .aenetworks import (
AENetworksCollectionIE,
AENetworksIE,
AENetworksShowIE,
BiographyIE,
HistoryPlayerIE,
HistoryTopicIE,
)
fro... | @@ -75,6 +75,9 @@
AfreecaTVLiveIE,
AfreecaTVUserIE,
)
+from .agalega import (
+ AGalegaVideosIE,
+) | yt_dlp/extractor/_extractors.py | 26 | Python | 0.571 | suggestion | 76 | 51 | 51 | false | [ie/AGalega] Add extractor | 15,105 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | putridambassador121 |
import json
from .common import InfoExtractor
from ..utils import require, str_or_none, traverse_obj, url_or_none
class AGalegaBaseIE(InfoExtractor):
def _call_api(self, video_id):
access_token = self._download_json(
'https://www.agalega.gal/api/fetch-api/jwt/token', video_id,
not... | ```suggestion
class AGalegaIE(AGalegaBaseIE):
``` | import json
import time
from .common import InfoExtractor
from ..utils import jwt_decode_hs256, url_or_none
from ..utils.traversal import traverse_obj
class AGalegaBaseIE(InfoExtractor):
_access_token = None
@staticmethod
def _jwt_is_expired(token):
return jwt_decode_hs256(token)['exp'] - time.t... | @@ -0,0 +1,81 @@
+import json
+
+from .common import InfoExtractor
+from ..utils import require, str_or_none, traverse_obj, url_or_none
+
+
+class AGalegaBaseIE(InfoExtractor):
+ def _call_api(self, video_id):
+ access_token = self._download_json(
+ 'https://www.agalega.gal/api/fetch-api/jwt/token'... | yt_dlp/extractor/agalega.py | 21 | Python | 0.571 | suggestion | 51 | 46 | 46 | false | [ie/AGalega] Add extractor | 15,105 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | putridambassador121 |
video_id = self._match_id(url)
content_data = self._call_api(
f'content/{video_id}/', video_id, note='Downloading content data', fatal=False,
query={
'optional_fields': 'image,is_premium,short_description,has_subtitle',
})
resource_data = self.... | ```suggestion
'title': ('name', {str}),
'description': (('description', 'short_description'), {str}, any),
``` | video_id = self._match_id(url)
content_data = self._call_api(
f'content/{video_id}/', video_id, note='Downloading content data', fatal=False,
query={
'optional_fields': 'image,is_premium,short_description,has_subtitle',
})
resource_data = self.... | @@ -0,0 +1,90 @@
+import json
+import time
+
+from .common import InfoExtractor
+from ..utils import jwt_decode_hs256, str_or_none, url_or_none
+from ..utils.traversal import traverse_obj
+
+
+class AGalegaBaseIE(InfoExtractor):
+ _ACCESS_TOKEN = None
+
+ @staticmethod
+ def _jwt_is_expired(token):
+ re... | yt_dlp/extractor/agalega.py | 26 | Python | 0.714 | suggestion | 145 | 30 | 31 | false | [ie/AGalega] Add extractor | 15,105 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | putridambassador121 |
'ext': 'mp4',
},
}]
def _real_extract(self, url):
video_id = self._match_id(url)
content_data = self._call_api(
f'content/{video_id}/', video_id, note='Downloading content data', fatal=False,
query={
'optional_fields': 'image,is_premiu... | ```suggestion
self._merge_subtitles(subs, target=subtitles)
return {
``` | 'ext': 'mp4',
},
}]
def _real_extract(self, url):
video_id = self._match_id(url)
content_data = self._call_api(
f'content/{video_id}/', video_id, note='Downloading content data', fatal=False,
query={
'optional_fields': 'image,is_premiu... | @@ -0,0 +1,90 @@
+import json
+import time
+
+from .common import InfoExtractor
+from ..utils import jwt_decode_hs256, str_or_none, url_or_none
+from ..utils.traversal import traverse_obj
+
+
+class AGalegaBaseIE(InfoExtractor):
+ _ACCESS_TOKEN = None
+
+ @staticmethod
+ def _jwt_is_expired(token):
+ re... | yt_dlp/extractor/agalega.py | 26 | Python | 0.571 | suggestion | 97 | 35 | 36 | false | [ie/AGalega] Add extractor | 15,105 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | putridambassador121 |
# Ref: https://pyinstaller.org/en/v6.10.0/runtime-information.html#ld-library-path-libpath-considerations
# https://github.com/yt-dlp/yt-dlp/issues/4573
def _fix(key):
orig = env.get(f'{key}_ORIG')
if orig is None:
env.pop(key, None)
else:... | ```suggestion
# If running a batch/cmd file, we must apply shell escaping
# These conditions should be very specific to limit impact
``` | # Ref: https://pyinstaller.org/en/v6.10.0/runtime-information.html#ld-library-path-libpath-considerations
# https://github.com/yt-dlp/yt-dlp/issues/4573
def _fix(key):
orig = env.get(f'{key}_ORIG')
if orig is None:
env.pop(key, None)
else:... | @@ -876,13 +876,19 @@ def __init__(self, args, *remaining, env=None, text=False, shell=False, **kwargs
kwargs.setdefault('encoding', 'utf-8')
kwargs.setdefault('errors', 'replace')
- if shell and os.name == 'nt' and kwargs.get('executable') is None:
- if not isinstance(args... | yt_dlp/utils/_utils.py | 26 | Python | 0.786 | performance | 163 | 51 | 51 | false | Respect `PATHEXT` when locating JS runtime on Windows | 15,117 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | Grub4K |
# https://github.com/yt-dlp/yt-dlp/issues/4573
def _fix(key):
orig = env.get(f'{key}_ORIG')
if orig is None:
env.pop(key, None)
else:
env[key] = orig
_fix('LD_LIBRARY_PATH') # Linux
_fix('DYLD_LIBRARY_PATH') # ma... | the ext will always be lowercase? | # https://github.com/yt-dlp/yt-dlp/issues/4573
def _fix(key):
orig = env.get(f'{key}_ORIG')
if orig is None:
env.pop(key, None)
else:
env[key] = orig
_fix('LD_LIBRARY_PATH') # Linux
_fix('DYLD_LIBRARY_PATH') # ma... | @@ -876,13 +876,19 @@ def __init__(self, args, *remaining, env=None, text=False, shell=False, **kwargs
kwargs.setdefault('encoding', 'utf-8')
kwargs.setdefault('errors', 'replace')
- if shell and os.name == 'nt' and kwargs.get('executable') is None:
- if not isinstance(args... | yt_dlp/utils/_utils.py | 26 | Python | 0.071 | question | 33 | 51 | 51 | false | Respect `PATHEXT` when locating JS runtime on Windows | 15,117 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | Grub4K |
from .common import InfoExtractor
from ..utils import ExtractorError
class NetAppBaseIE(InfoExtractor):
_ACCOUNT_ID = '6255154784001'
_VIDEO_METADATA_URL = 'https://api.media.netapp.com/client/detail/%s'
_COLLECTION_METADATA_URL = 'https://api.media.netapp.com/client/collection/%s'
_BC_URL = f'https:/... | Use regex to not match the whole URL | from .brightcove import BrightcoveNewIE
from .common import InfoExtractor
from ..utils import parse_iso8601
from ..utils.traversal import require, traverse_obj
class NetAppBaseIE(InfoExtractor):
_BC_URL = 'https://players.brightcove.net/6255154784001/default_default/index.html?videoId={}'
@staticmethod
d... | @@ -0,0 +1,86 @@
+from .common import InfoExtractor
+from ..utils import ExtractorError
+
+
+class NetAppBaseIE(InfoExtractor):
+ _ACCOUNT_ID = '6255154784001'
+ _VIDEO_METADATA_URL = 'https://api.media.netapp.com/client/detail/%s'
+ _COLLECTION_METADATA_URL = 'https://api.media.netapp.com/client/collection/%s... | yt_dlp/extractor/netapp.py | 24 | Python | 0.143 | suggestion | 36 | 49 | 49 | false | [ie/NetApp] Add extractor | 15,122 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | darkstar |
from .common import InfoExtractor
from ..utils import ExtractorError
class NetAppBaseIE(InfoExtractor):
_ACCOUNT_ID = '6255154784001'
_VIDEO_METADATA_URL = 'https://api.media.netapp.com/client/detail/%s'
_COLLECTION_METADATA_URL = 'https://api.media.netapp.com/client/collection/%s'
_BC_URL = f'https:/... | Imo. it's not needed to add class variables for things that are only used a single time
```suggestion
_BC_URL_TMPL = 'https://players.brightcove.net/6255154784001/default_default/index.html?videoId={}'
``` | from .brightcove import BrightcoveNewIE
from .common import InfoExtractor
from ..utils import parse_iso8601
from ..utils.traversal import require, traverse_obj
class NetAppBaseIE(InfoExtractor):
_BC_URL = 'https://players.brightcove.net/6255154784001/default_default/index.html?videoId={}'
@staticmethod
d... | @@ -0,0 +1,86 @@
+from .common import InfoExtractor
+from ..utils import ExtractorError
+
+
+class NetAppBaseIE(InfoExtractor):
+ _ACCOUNT_ID = '6255154784001'
+ _VIDEO_METADATA_URL = 'https://api.media.netapp.com/client/detail/%s'
+ _COLLECTION_METADATA_URL = 'https://api.media.netapp.com/client/collection/%s... | yt_dlp/extractor/netapp.py | 9 | Python | 0.857 | suggestion | 212 | 34 | 34 | false | [ie/NetApp] Add extractor | 15,122 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | darkstar |
class NetAppVideoIE(NetAppBaseIE):
_VALID_URL = r'https?://media\.netapp\.com/video-detail/(?P<id>[0-9a-f-]+)'
_TESTS = [{
'url': 'https://media.netapp.com/video-detail/da25fc01-82ad-5284-95bc-26920200a222/seamless-storage-for-modern-kubernetes-deployments',
'info_dict': {
'id': '1... | Can just inline the URL
```suggestion
metadata = self._download_json(
f'https://api.media.netapp.com/client/detail/{video_uuid}', video_uuid)
``` | def _parse_metadata(item):
return traverse_obj(item, {
'title': ('name', {str}),
'description': ('description', {str}),
'timestamp': ('createdAt', {parse_iso8601}),
})
class NetAppVideoIE(NetAppBaseIE):
_VALID_URL = r'https?://media\.netapp\.com/video-detail... | @@ -0,0 +1,86 @@
+from .common import InfoExtractor
+from ..utils import ExtractorError
+
+
+class NetAppBaseIE(InfoExtractor):
+ _ACCOUNT_ID = '6255154784001'
+ _VIDEO_METADATA_URL = 'https://api.media.netapp.com/client/detail/%s'
+ _COLLECTION_METADATA_URL = 'https://api.media.netapp.com/client/collection/%s... | yt_dlp/extractor/netapp.py | 26 | Python | 0.714 | suggestion | 169 | 51 | 51 | false | [ie/NetApp] Add extractor | 15,122 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | darkstar |
'tags': 'count:15',
'timestamp': 1758213949,
'upload_date': '20250918',
},
}, {
'url': 'https://media.netapp.com/video-detail/45593e5d-cf1c-5996-978c-c9081906e69f/unleash-ai-innovation-with-your-data-with-the-netapp-platform',
'only_matching': True,
}]... | Let's use traverse_obj for this. Title is also not a mandatory field
```suggestion
brightcove_video_id = traverse_obj(metadata, (
'sections', lambda _, v: v['type'] == 'Player', 'video', {str}, any, {require('brightcove video id')}))
``` | 'id': '1843620950167202073',
'ext': 'mp4',
'title': 'Seamless storage for modern Kubernetes deployments',
'description': 'md5:1ee39e315243fe71fb90af2796037248',
'uploader_id': '6255154784001',
'duration': 2159.41,
'thumbnail': r're:http... | @@ -0,0 +1,86 @@
+from .common import InfoExtractor
+from ..utils import ExtractorError
+
+
+class NetAppBaseIE(InfoExtractor):
+ _ACCOUNT_ID = '6255154784001'
+ _VIDEO_METADATA_URL = 'https://api.media.netapp.com/client/detail/%s'
+ _COLLECTION_METADATA_URL = 'https://api.media.netapp.com/client/collection/%s... | yt_dlp/extractor/netapp.py | 26 | Python | 1 | suggestion | 262 | 51 | 51 | false | [ie/NetApp] Add extractor | 15,122 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | darkstar |
def _real_extract(self, url):
video_uuid = self._match_id(url)
metadata = self._download_json(self._VIDEO_METADATA_URL % video_uuid, video_uuid)
video_id = None
title = None
for section in metadata.get('sections', {}):
if section.get('type') == 'Player':
... | And then we can inline the metadata extraction
```suggestion
return self.url_result(
self._BC_URL_TMPL.format(brightcove_video_id), BrightcoveNewIE, brightcove_video_id,
url_transparent=True,
**traverse_obj(metadata, ('sections', lambda _, v: v['type'] == 'VideoDetail',... | 'timestamp': 1758213949,
'upload_date': '20250918',
},
}, {
'url': 'https://media.netapp.com/video-detail/45593e5d-cf1c-5996-978c-c9081906e69f/unleash-ai-innovation-with-your-data-with-the-netapp-platform',
'only_matching': True,
}]
def _real_extract(self, ur... | @@ -0,0 +1,86 @@
+from .common import InfoExtractor
+from ..utils import ExtractorError
+
+
+class NetAppBaseIE(InfoExtractor):
+ _ACCOUNT_ID = '6255154784001'
+ _VIDEO_METADATA_URL = 'https://api.media.netapp.com/client/detail/%s'
+ _COLLECTION_METADATA_URL = 'https://api.media.netapp.com/client/collection/%s... | yt_dlp/extractor/netapp.py | 26 | Python | 1 | refactor | 511 | 51 | 48 | false | [ie/NetApp] Add extractor | 15,122 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | darkstar |
'ie_key': 'BrightcoveNew',
'title': title,
'description': description,
}
class NetAppCollectionIE(NetAppBaseIE):
_VALID_URL = r'https?://media\.netapp\.com/collection/(?P<id>[0-9a-f-]+)'
_TESTS = [{
'url': 'https://media.netapp.com/collection/9820e190-f2a6-4... | Let's check that the brightcove video ID actually exists
```suggestion
for item in traverse_obj(metadata, ('items', lambda _, v: v['brightcoveVideoId'])):
birghtcove_video_id = item['brightcoveVideoId']
yield self.url_result(
self._BC_URL_TMPL.format(birghtcove_video... |
class NetAppCollectionIE(NetAppBaseIE):
_VALID_URL = r'https?://media\.netapp\.com/collection/(?P<id>[0-9a-f-]+)'
_TESTS = [{
'url': 'https://media.netapp.com/collection/9820e190-f2a6-47ac-9c0a-98e5e64234a4',
'info_dict': {
'title': 'Featured sessions',
'id': '9820e190-f... | @@ -0,0 +1,86 @@
+from .common import InfoExtractor
+from ..utils import ExtractorError
+
+
+class NetAppBaseIE(InfoExtractor):
+ _ACCOUNT_ID = '6255154784001'
+ _VIDEO_METADATA_URL = 'https://api.media.netapp.com/client/detail/%s'
+ _COLLECTION_METADATA_URL = 'https://api.media.netapp.com/client/collection/%s... | yt_dlp/extractor/netapp.py | 26 | Python | 0.786 | suggestion | 624 | 33 | 26 | false | [ie/NetApp] Add extractor | 15,122 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | darkstar |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.