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
}, { 'url': 'https://loco.com/stream/c64916eb-10fb-46a9-9a19-8c4b7ed064e7', 'md5': '45ebc8a47ee1c2240178757caf8881b5', 'info_dict': { 'id': 'c64916eb-10fb-46a9-9a19-8c4b7ed064e7', 'ext': 'mp4', 'title': 'PAULINHO LOKO NA LOCO!', 'description': ...
should this use named groups? ```suggestion video_type, video_id = self._match_valid_url(url).group('type', 'id') ```
'params': { 'skip_download': 'Livestream', }, }, { 'url': 'https://loco.com/stream/c64916eb-10fb-46a9-9a19-8c4b7ed064e7', 'md5': '45ebc8a47ee1c2240178757caf8881b5', 'info_dict': { 'id': 'c64916eb-10fb-46a9-9a19-8c4b7ed064e7', 'ext': 'mp4', ...
@@ -0,0 +1,82 @@ +from .common import InfoExtractor +from ..utils import traverse_obj + + +class LocoIE(InfoExtractor): + _VALID_URL = r'https?://(?:www\.)?loco\.com/(?P<type>streamers|stream)/(?P<id>[^/?#]+)' + _TESTS = [{ + 'url': 'https://loco.com/streamers/teuzinfps', + 'info_dict': { + ...
yt_dlp/extractor/loco.py
26
Python
0.929
suggestion
128
51
51
false
[ie/loco] Add extractor
12,667
yt-dlp/yt-dlp
132,642
Python
Grub4K
DTrombett
'timestamp': 1740612872041, 'modified_timestamp': 1740613037111, }, }] def _real_extract(self, url): video_type, video_id = self._match_valid_url(url).groups() webpage = self._download_webpage(url, video_id) stream = traverse_obj(self._search_nextjs_data(...
instead of filtering list, it is usually better to filter by list contents: ```suggestion 'tags': ('tags', ..., {str}), ```
'thumbnail': 'https://static.ivory.getloconow.com/default_thumb/59b5970b-23c1-4518-9e96-17ce341299fe.jpg', 'tags': ['Gameplay'], 'series': 'GTA 5', 'timestamp': 1740612872, 'modified_timestamp': 1740613037, 'upload_date': '20250226', 'm...
@@ -0,0 +1,82 @@ +from .common import InfoExtractor +from ..utils import traverse_obj + + +class LocoIE(InfoExtractor): + _VALID_URL = r'https?://(?:www\.)?loco\.com/(?P<type>streamers|stream)/(?P<id>[^/?#]+)' + _TESTS = [{ + 'url': 'https://loco.com/streamers/teuzinfps', + 'info_dict': { + ...
yt_dlp/extractor/loco.py
26
Python
0.786
suggestion
142
34
39
false
[ie/loco] Add extractor
12,667
yt-dlp/yt-dlp
132,642
Python
Grub4K
DTrombett
from .common import InfoExtractor from ..utils import traverse_obj class LocoIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?loco\.com/(?P<type>streamers|stream)/(?P<id>[^/?#]+)' _TESTS = [{ 'url': 'https://loco.com/streamers/teuzinfps', 'info_dict': { 'id': 'teuzinfps', ...
try to be concise with import location, ie ```suggestion from ..utils.traversal import traverse_obj ```
from .common import InfoExtractor from ..utils import int_or_none, url_or_none from ..utils.traversal import require, traverse_obj class LocoIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?loco\.com/(?P<type>streamers|stream)/(?P<id>[^/?#]+)' _TESTS = [{ 'url': 'https://loco.com/streamers/teuzinf...
@@ -0,0 +1,82 @@ +from .common import InfoExtractor +from ..utils import traverse_obj
yt_dlp/extractor/loco.py
2
Python
0.714
suggestion
106
27
27
false
[ie/loco] Add extractor
12,667
yt-dlp/yt-dlp
132,642
Python
Grub4K
DTrombett
}, }] def _real_extract(self, url): video_type, video_id = self._match_valid_url(url).groups() webpage = self._download_webpage(url, video_id) stream = traverse_obj(self._search_nextjs_data(webpage, video_id), ('props', 'pageProps', ('liveStreamData', 'stream')))[0] form...
Aren't these ms resolution? ```suggestion 'timestamp': ('started_at', {int_or_none(scale=1000)}), 'modified_timestamp': ('updated_at', {int_or_none(scale=1000)}), ```
'series': 'GTA 5', 'timestamp': 1740612872, 'modified_timestamp': 1740613037, 'upload_date': '20250226', 'modified_date': '20250226', }, }] def _real_extract(self, url): video_type, video_id = self._match_valid_url(url).group('type', '...
@@ -0,0 +1,82 @@ +from .common import InfoExtractor +from ..utils import traverse_obj + + +class LocoIE(InfoExtractor): + _VALID_URL = r'https?://(?:www\.)?loco\.com/(?P<type>streamers|stream)/(?P<id>[^/?#]+)' + _TESTS = [{ + 'url': 'https://loco.com/streamers/teuzinfps', + 'info_dict': { + ...
yt_dlp/extractor/loco.py
26
Python
0.786
suggestion
202
32
37
false
[ie/loco] Add extractor
12,667
yt-dlp/yt-dlp
132,642
Python
dirkf
DTrombett
'channel': 'paulinholokobr', 'channel_follower_count': int, 'comment_count': int, 'view_count': int, 'concurrent_view_count': int, 'like_count': int, 'duration': 14491, 'thumbnail': 'https://static.ivory.getloconow.com/defau...
```suggestion **traverse_obj(stream, { ``` the braces are redundant, as they are not creating a tuple (single item tuple requires trailing comma `(...,)`) and `traverse_obj` handles the plain dict as path case
'title': 'PAULINHO LOKO NA LOCO!', 'description': 'live on na loco', 'uploader_id': '2MDO7Z1DPM', 'channel': 'paulinholokobr', 'channel_follower_count': int, 'comment_count': int, 'view_count': int, 'concurrent_view_count': ...
@@ -0,0 +1,82 @@ +from .common import InfoExtractor +from ..utils import traverse_obj + + +class LocoIE(InfoExtractor): + _VALID_URL = r'https?://(?:www\.)?loco\.com/(?P<type>streamers|stream)/(?P<id>[^/?#]+)' + _TESTS = [{ + 'url': 'https://loco.com/streamers/teuzinfps', + 'info_dict': { + ...
yt_dlp/extractor/loco.py
26
Python
0.929
suggestion
224
44
49
false
[ie/loco] Add extractor
12,667
yt-dlp/yt-dlp
132,642
Python
Grub4K
DTrombett
'info_dict': { 'id': 'c64916eb-10fb-46a9-9a19-8c4b7ed064e7', 'ext': 'mp4', 'title': 'PAULINHO LOKO NA LOCO!', 'description': 'live on na loco', 'uploader_id': '2MDO7Z1DPM', 'channel': 'paulinholokobr', 'channel_follower_count': ...
Could be better to unwind these a bit, to facilitate diagnosing any problem from the backtrace? ```suggestion page_props = self._search_nextjs_data(webpage, video_id)['props']['pageProps'] stream = traverse_obj(page_props, (('liveStreamData', 'stream'), {lambda x: x['conf']['hls'] and x}, any)) ...
}, { 'url': 'https://loco.com/stream/c64916eb-10fb-46a9-9a19-8c4b7ed064e7', 'md5': '45ebc8a47ee1c2240178757caf8881b5', 'info_dict': { 'id': 'c64916eb-10fb-46a9-9a19-8c4b7ed064e7', 'ext': 'mp4', 'title': 'PAULINHO LOKO NA LOCO!', 'description': ...
@@ -0,0 +1,82 @@ +from .common import InfoExtractor +from ..utils import traverse_obj + + +class LocoIE(InfoExtractor): + _VALID_URL = r'https?://(?:www\.)?loco\.com/(?P<type>streamers|stream)/(?P<id>[^/?#]+)' + _TESTS = [{ + 'url': 'https://loco.com/streamers/teuzinfps', + 'info_dict': { + ...
yt_dlp/extractor/loco.py
26
Python
0.857
refactor
398
50
51
false
[ie/loco] Add extractor
12,667
yt-dlp/yt-dlp
132,642
Python
dirkf
DTrombett
from .common import InfoExtractor from ..utils import traverse_obj class LocoIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?loco\.com/(?P<type>streamers|stream)/(?P<id>[^/?#]+)' _TESTS = [{ 'url': 'https://loco.com/streamers/teuzinfps', 'info_dict': { 'id': 'teuzinfps', ...
Does the test harness look for `upload_date` too when `timestamp` is set, as in upstream? Or even `modified_date`? But if the test doesn't complain, that's fine.
from .common import InfoExtractor from ..utils import int_or_none, url_or_none from ..utils.traversal import require, traverse_obj class LocoIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?loco\.com/(?P<type>streamers|stream)/(?P<id>[^/?#]+)' _TESTS = [{ 'url': 'https://loco.com/streamers/teuzinf...
@@ -0,0 +1,82 @@ +from .common import InfoExtractor +from ..utils import traverse_obj + + +class LocoIE(InfoExtractor): + _VALID_URL = r'https?://(?:www\.)?loco\.com/(?P<type>streamers|stream)/(?P<id>[^/?#]+)' + _TESTS = [{ + 'url': 'https://loco.com/streamers/teuzinfps', + 'info_dict': { + ...
yt_dlp/extractor/loco.py
25
Python
0.5
suggestion
161
50
50
false
[ie/loco] Add extractor
12,667
yt-dlp/yt-dlp
132,642
Python
dirkf
DTrombett
'id': 'c64916eb-10fb-46a9-9a19-8c4b7ed064e7', 'ext': 'mp4', 'title': 'PAULINHO LOKO NA LOCO!', 'description': 'live on na loco', 'uploader_id': '2MDO7Z1DPM', 'channel': 'paulinholokobr', 'channel_follower_count': int, 'comme...
```suggestion stream = traverse_obj(self._search_nextjs_data(webpage, video_id), ( 'props', 'pageProps', ('liveStreamData', 'stream'), {dict}, any, {require('stream info')})) ```
'id': 'c64916eb-10fb-46a9-9a19-8c4b7ed064e7', 'ext': 'mp4', 'title': 'PAULINHO LOKO NA LOCO!', 'description': 'live on na loco', 'uploader_id': '2MDO7Z1DPM', 'channel': 'paulinholokobr', 'channel_follower_count': int, 'comme...
@@ -0,0 +1,86 @@ +from .common import InfoExtractor +from ..utils import int_or_none +from ..utils.traversal import require, traverse_obj + + +class LocoIE(InfoExtractor): + _VALID_URL = r'https?://(?:www\.)?loco\.com/(?P<type>streamers|stream)/(?P<id>[^/?#]+)' + _TESTS = [{ + 'url': 'https://loco.com/stre...
yt_dlp/extractor/loco.py
26
Python
0.786
suggestion
201
50
51
false
[ie/loco] Add extractor
12,667
yt-dlp/yt-dlp
132,642
Python
bashonly
DTrombett
'description': 'live on na loco', 'uploader_id': '2MDO7Z1DPM', 'channel': 'paulinholokobr', 'channel_follower_count': int, 'comment_count': int, 'view_count': int, 'concurrent_view_count': int, 'like_count': int, ...
since `_extract_m3u8_formats` is fatal we don't need to bother with non-fatally traversing here ```suggestion 'formats': self._extract_m3u8_formats(stream['conf']['hls'], video_id), ```
'description': 'live on na loco', 'uploader_id': '2MDO7Z1DPM', 'channel': 'paulinholokobr', 'channel_follower_count': int, 'comment_count': int, 'view_count': int, 'concurrent_view_count': int, 'like_count': int, ...
@@ -0,0 +1,86 @@ +from .common import InfoExtractor +from ..utils import int_or_none +from ..utils.traversal import require, traverse_obj + + +class LocoIE(InfoExtractor): + _VALID_URL = r'https?://(?:www\.)?loco\.com/(?P<type>streamers|stream)/(?P<id>[^/?#]+)' + _TESTS = [{ + 'url': 'https://loco.com/stre...
yt_dlp/extractor/loco.py
26
Python
0.857
refactor
200
47
48
false
[ie/loco] Add extractor
12,667
yt-dlp/yt-dlp
132,642
Python
bashonly
DTrombett
'timestamp': 1740612872, 'modified_timestamp': 1740613037, 'upload_date': '20250226', 'modified_date': '20250226', }, }] def _real_extract(self, url): video_type, video_id = self._match_valid_url(url).group('type', 'id') webpage = self._do...
```suggestion 'concurrent_view_count': ('viewersCurrent', {int_or_none}), 'view_count': ('total_views', {int_or_none}), 'thumbnail': ('thumbnail_url_small', {url_or_none}), 'like_count': ('likes', {int_or_none}), ```
'timestamp': 1740612872, 'modified_timestamp': 1740613037, 'upload_date': '20250226', 'modified_date': '20250226', }, }] def _real_extract(self, url): video_type, video_id = self._match_valid_url(url).group('type', 'id') webpage = self._do...
@@ -0,0 +1,86 @@ +from .common import InfoExtractor +from ..utils import int_or_none +from ..utils.traversal import require, traverse_obj + + +class LocoIE(InfoExtractor): + _VALID_URL = r'https?://(?:www\.)?loco\.com/(?P<type>streamers|stream)/(?P<id>[^/?#]+)' + _TESTS = [{ + 'url': 'https://loco.com/stre...
yt_dlp/extractor/loco.py
26
Python
0.786
suggestion
285
35
36
false
[ie/loco] Add extractor
12,667
yt-dlp/yt-dlp
132,642
Python
bashonly
DTrombett
def _real_extract(self, url): video_type, video_id = self._match_valid_url(url).group('type', 'id') webpage = self._download_webpage(url, video_id) stream = traverse_obj(self._search_nextjs_data(webpage, video_id), ('props', 'pageProps', ('liveStreamData', 'stream'), {dict}, any, {require('...
```suggestion 'comment_count': ('comments_count', {int_or_none}), 'channel_follower_count': ('followers_count', {int_or_none}), 'duration': ('duration', {int_or_none}), ```
def _real_extract(self, url): video_type, video_id = self._match_valid_url(url).group('type', 'id') webpage = self._download_webpage(url, video_id) stream = traverse_obj(self._search_nextjs_data(webpage, video_id), ( 'props', 'pageProps', ('liveStreamData', 'stream'), {dict}, an...
@@ -0,0 +1,86 @@ +from .common import InfoExtractor +from ..utils import int_or_none +from ..utils.traversal import require, traverse_obj + + +class LocoIE(InfoExtractor): + _VALID_URL = r'https?://(?:www\.)?loco\.com/(?P<type>streamers|stream)/(?P<id>[^/?#]+)' + _TESTS = [{ + 'url': 'https://loco.com/stre...
yt_dlp/extractor/loco.py
26
Python
0.786
suggestion
224
29
30
false
[ie/loco] Add extractor
12,667
yt-dlp/yt-dlp
132,642
Python
bashonly
DTrombett
from .common import InfoExtractor from ..utils import int_or_none from ..utils.traversal import require, traverse_obj class LocoIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?loco\.com/(?P<type>streamers|stream)/(?P<id>[^/?#]+)' _TESTS = [{ 'url': 'https://loco.com/streamers/teuzinfps', ...
```suggestion from ..utils import int_or_none, url_or_none ```
from .common import InfoExtractor from ..utils import int_or_none, url_or_none from ..utils.traversal import require, traverse_obj class LocoIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?loco\.com/(?P<type>streamers|stream)/(?P<id>[^/?#]+)' _TESTS = [{ 'url': 'https://loco.com/streamers/teuzinf...
@@ -0,0 +1,86 @@ +from .common import InfoExtractor +from ..utils import int_or_none
yt_dlp/extractor/loco.py
2
Python
0.571
suggestion
64
27
27
false
[ie/loco] Add extractor
12,667
yt-dlp/yt-dlp
132,642
Python
bashonly
DTrombett
Request, Response, register_preference, register_rh, ) from .exceptions import ( CertificateVerifyError, HTTPError, IncompleteRead, ProxyError, SSLError, TransportError, ) from .impersonate import ImpersonateRequestHandler, ImpersonateTarget from ..dependencies import curl_cffi, ...
since 0.11 would raise this too? ```suggestion raise ImportError('Only curl_cffi versions 0.5.10 and 0.10.X are supported') ```
Request, Response, register_preference, register_rh, ) from .exceptions import ( CertificateVerifyError, HTTPError, IncompleteRead, ProxyError, SSLError, TransportError, ) from .impersonate import ImpersonateRequestHandler, ImpersonateTarget from ..dependencies import curl_cffi, ...
@@ -31,9 +32,9 @@ curl_cffi_version = tuple(map(int, re.split(r'[^\d]+', curl_cffi.__version__)[:3])) -if curl_cffi_version != (0, 5, 10) and not ((0, 7, 0) <= curl_cffi_version < (0, 7, 2)): +if curl_cffi_version != (0, 5, 10) and not (0, 10) <= curl_cffi_version: curl_cffi._yt_dlp__version = f'{curl_cffi.__...
yt_dlp/networking/_curlcffi.py
26
Python
0.857
suggestion
134
51
51
false
[rh:curl_cffi] Support `curl_cffi` 0.10.x
12,670
yt-dlp/yt-dlp
132,642
Python
bashonly
Grub4K
'chrome131': ImpersonateTarget('chrome', '131', 'macos', '14'), 'chrome131_android': ImpersonateTarget('chrome', '131', 'android', '14'), 'chrome133a': ImpersonateTarget('chrome', '133', 'macos', '15'), 'firefox133': ImpersonateTarget('firefox', '133', 'macos', '14'), 'safari18_0...
this seems to fix the problem I mentioned above ```suggestion target: name if curl_cffi_version >= (0, 9) else curl_cffi.requests.BrowserType[name] for name, target in dict(sorted(itertools.chain.from_iterable( targets.items() for version, targets in BROWSER_TARGETS.items() ...
'chrome131': ImpersonateTarget('chrome', '131', 'macos', '14'), 'chrome131_android': ImpersonateTarget('chrome', '131', 'android', '14'), 'chrome133a': ImpersonateTarget('chrome', '133', 'macos', '15'), 'firefox133': ImpersonateTarget('firefox', '133', 'macos', '14'), 'safari18_0...
@@ -97,45 +98,72 @@ def read(self, amt=None): return self.fp.read(amt) except curl_cffi.requests.errors.RequestsError as e: if e.code == CurlECode.PARTIAL_FILE: - content_length = int_or_none(e.response.headers.get('Content-Length')) + content_length = e....
yt_dlp/networking/_curlcffi.py
26
Python
1
suggestion
588
51
51
false
[rh:curl_cffi] Support `curl_cffi` 0.10.x
12,670
yt-dlp/yt-dlp
132,642
Python
bashonly
Grub4K
}, (0, 7): { 'chrome116': ImpersonateTarget('chrome', '116', 'windows', '10'), 'chrome119': ImpersonateTarget('chrome', '119', 'macos', '14'), 'chrome120': ImpersonateTarget('chrome', '120', 'macos', '14'), 'chrome123': ImpersonateTarget('chrome', '123', 'macos', '14'), '...
```suggestion 'firefox135': ImpersonateTarget('firefox', '135', 'macos', '14'), ```
}, (0, 7): { 'chrome116': ImpersonateTarget('chrome', '116', 'windows', '10'), 'chrome119': ImpersonateTarget('chrome', '119', 'macos', '14'), 'chrome120': ImpersonateTarget('chrome', '120', 'macos', '14'), 'chrome123': ImpersonateTarget('chrome', '123', 'macos', '14'), '...
@@ -97,45 +98,72 @@ def read(self, amt=None): return self.fp.read(amt) except curl_cffi.requests.errors.RequestsError as e: if e.code == CurlECode.PARTIAL_FILE: - content_length = int_or_none(e.response.headers.get('Content-Length')) + content_length = e....
yt_dlp/networking/_curlcffi.py
26
Python
0.571
suggestion
93
51
51
false
[rh:curl_cffi] Support `curl_cffi` 0.10.x
12,670
yt-dlp/yt-dlp
132,642
Python
coletdjnz
Grub4K
'linear': 'is_live', 'live': 'is_live', }.get(response.get('type')) audio_quality_func = qualities(('1', '0')) formats, subtitles = [], {} drm_formats = False for source in traverse_obj(response, ('sources', lambda _, v: v['src'])): if source...
do we need `geo_verification_headers` here too?
formats, subtitles = [], {} drm_formats = False for source in traverse_obj(response, ('sources', lambda _, v: v['src'])): if source.get('key_systems'): drm_formats = True continue src_url = source['src'] is_live = live_status...
@@ -0,0 +1,225 @@ +import json +import re +import urllib.parse + +from .common import InfoExtractor +from ..networking.exceptions import HTTPError +from ..utils import ( + ExtractorError, + filter_dict, + float_or_none, + join_nonempty, + mimetype2ext, + parse_iso8601, + qualities, + unsmuggle_u...
yt_dlp/extractor/streaks.py
26
Python
0.214
question
47
51
51
false
[ie/streaks] Add extractor
12,679
yt-dlp/yt-dlp
132,642
Python
bashonly
doe1080
'ext': 'mp4', 'season_number': 3, 'episode_number': 3, 'description': 'In the first elimination of the competition, teams will have 10 hours to build a world inside a snow globe.', 'uploader_id': '4460760524001', 'timestamp': 1619002200, ...
Maybe this will never be called by the time the PR is merged?
'id': '6308830406112', 'title': 'Episode 3', 'ext': 'mp4', 'season_number': 3, 'episode_number': 3, 'description': 'In the first elimination of the competition, teams will have 10 hours to build a world inside a snow globe.', 'uploader_...
@@ -50,17 +60,27 @@ class NineNowIE(InfoExtractor): 'uploader_id': '4460760524001', 'timestamp': 1619002200, 'upload_date': '20210421', + 'duration': 3574.085, + 'thumbnail': r're:https?://.+/.+\.jpg', + 'tags': ['episode'], + 'season': ...
yt_dlp/extractor/ninenow.py
26
Python
0.214
question
63
51
51
false
[ie/9now.com.au] Fix extractor
12,702
yt-dlp/yt-dlp
132,642
Python
dirkf
bashonly
r'\w+\s*:\s*', s, 'next js data', None, contains_pattern=r'\[(?s:.+)\]', default=None) def _old_extract_common_data(self, webpage, display_id, video_type): self.write_debug('Falling back to the old method for extracting common data') page_data = self._parse_json(self._search_regex( ...
If this is going to be the standard way of parsing next_f script calls, this should be refactored with goplay and francetv combining traverse_obj into .extractor.common before racking up more technical debt.
'info_dict': { 'id': '6367798770112', 'ext': 'mp4', 'title': 'Episode 1', 'description': r're:The cultural sensation of Married At First Sight returns with our first weddings! .{90}$', 'uploader_id': '4460760524001', 'duration': 5415.079, ...
@@ -50,17 +60,27 @@ class NineNowIE(InfoExtractor): 'uploader_id': '4460760524001', 'timestamp': 1619002200, 'upload_date': '20210421', + 'duration': 3574.085, + 'thumbnail': r're:https?://.+/.+\.jpg', + 'tags': ['episode'], + 'season': ...
yt_dlp/extractor/ninenow.py
26
Python
0.5
refactor
208
51
51
false
[ie/9now.com.au] Fix extractor
12,702
yt-dlp/yt-dlp
132,642
Python
majibow
bashonly
(..., {json.loads}, ..., {self._find_json}, lambda _, v: v['payload'][video_type]['slug'] == display_id, 'payload', any, {require('video data')})) if traverse_obj(common_data, (video_type, 'video', 'drm', {bool})): self.report_drm(display_id) brightcove...
As far as I can tell the data is present like so ``` "availability": "2025-03-23T09:43:00.000Z", ``` so this would be more fitting: ```suggestion 'release_timestamp': (video_type, 'availability', {parse_iso8601}), ```
common_data = traverse_obj( re.findall(r'<script[^>]*>\s*self\.__next_f\.push\(\s*(\[.+?\])\s*\);?\s*</script>', webpage), (..., {json.loads}, ..., {self._find_json}, lambda _, v: v['payload'][video_type]['slug'] == display_id, 'payload', any, {require('video da...
@@ -50,72 +62,84 @@ class NineNowIE(InfoExtractor): 'uploader_id': '4460760524001', 'timestamp': 1619002200, 'upload_date': '20210421', + 'duration': 3574.085, + 'thumbnail': r're:https?://.+/1920x0/.+\.jpg', + 'tags': ['episode'], + 'se...
yt_dlp/extractor/ninenow.py
26
Python
0.929
suggestion
240
34
37
false
[ie/9now.com.au] Fix extractor
12,702
yt-dlp/yt-dlp
132,642
Python
seproDev
bashonly
re.findall(r'<script[^>]*>\s*self\.__next_f\.push\(\s*(\[.+?\])\s*\);?\s*</script>', webpage), (..., {json.loads}, ..., {self._find_json}, lambda _, v: v['payload'][video_type]['slug'] == display_id, 'payload', any, {require('video data')})) if traverse_obj(com...
We can also add tags: ```suggestion 'tags': (video_type, 'tags', ..., 'name', {str}, all, filter), 'series': ('tvSeries', 'name', {str}), ```
common_data = traverse_obj( re.findall(r'<script[^>]*>\s*self\.__next_f\.push\(\s*(\[.+?\])\s*\);?\s*</script>', webpage), (..., {json.loads}, ..., {self._find_json}, lambda _, v: v['payload'][video_type]['slug'] == display_id, 'payload', any, {require('video d...
@@ -50,72 +62,84 @@ class NineNowIE(InfoExtractor): 'uploader_id': '4460760524001', 'timestamp': 1619002200, 'upload_date': '20210421', + 'duration': 3574.085, + 'thumbnail': r're:https?://.+/1920x0/.+\.jpg', + 'tags': ['episode'], + 'se...
yt_dlp/extractor/ninenow.py
26
Python
0.857
suggestion
177
35
38
false
[ie/9now.com.au] Fix extractor
12,702
yt-dlp/yt-dlp
132,642
Python
seproDev
bashonly
_NOA_STATION_IDS = {'r1': 'r1', 'r2': 'r2', 'fm': 'r3'} def _real_extract(self, url): station = self._match_id(url) area = self._configuration_arg('area', ['tokyo'])[0] config = self._download_xml( 'https://www.nhk.or.jp/radio/config/config_web.xml', station, 'Downloading a...
```suggestion '_old_archive_ids': [make_archive_id(self, join_nonempty(station, area))], ```
import re from .common import InfoExtractor from ..utils import ( ExtractorError, clean_html, filter_dict, get_element_by_class, int_or_none, join_nonempty, make_archive_id, orderedSet, parse_duration, remove_end, traverse_obj, try_call, unescapeHTML, unified_tim...
@@ -911,12 +1013,16 @@ def _real_extract(self, url): noa_info = self._download_json( f'https:{config.find(".//url_program_noa").text}'.format(area=data.find('areakey').text), station, note=f'Downloading {area} station metadata', fatal=False) - present_info = traverse_obj(noa_in...
yt_dlp/extractor/nhk.py
26
Python
0.714
suggestion
106
35
1,016
false
[ie/NhkRadiru] Fix metadata extraction
12,708
yt-dlp/yt-dlp
132,642
Python
bashonly
garret1317
}] _NOA_STATION_IDS = {'r1': 'r1', 'r2': 'r2', 'fm': 'r3'} def _real_extract(self, url): station = self._match_id(url) area = self._configuration_arg('area', ['tokyo'])[0] config = self._download_xml( 'https://www.nhk.or.jp/radio/config/config_web.xml', station, 'Downl...
```suggestion 'title': ('broadcastDisplayName', {str}), 'id': ('id', {str}), ```
import re from .common import InfoExtractor from ..utils import ( ExtractorError, clean_html, filter_dict, get_element_by_class, int_or_none, join_nonempty, make_archive_id, orderedSet, parse_duration, remove_end, traverse_obj, try_call, unescapeHTML, unified_tim...
@@ -911,12 +1013,16 @@ def _real_extract(self, url): noa_info = self._download_json( f'https:{config.find(".//url_program_noa").text}'.format(area=data.find('areakey').text), station, note=f'Downloading {area} station metadata', fatal=False) - present_info = traverse_obj(noa_in...
yt_dlp/extractor/nhk.py
26
Python
0.857
suggestion
115
37
1,016
false
[ie/NhkRadiru] Fix metadata extraction
12,708
yt-dlp/yt-dlp
132,642
Python
bashonly
garret1317
'ext': 'm4a', 'thumbnail': 'https://www.nhk.jp/assets/images/broadcastservice/bs/r3/r3-logo.svg', 'live_status': 'is_live', '_old_archive_ids': ['fm-sapporo'], }, }] _NOA_STATION_IDS = {'r1': 'r1', 'r2': 'r2', 'fm': 'r3'} def _real_extract(self, url)...
I don't really understand the comment. `noa_info` can be requested from that URL? or the `broadcast_service` data can be requested from that URL with an additional API call? I'd maybe just remove the comment
import re from .common import InfoExtractor from ..utils import ( ExtractorError, clean_html, filter_dict, get_element_by_class, int_or_none, join_nonempty, make_archive_id, orderedSet, parse_duration, remove_end, traverse_obj, try_call, unescapeHTML, unified_tim...
@@ -911,12 +1013,16 @@ def _real_extract(self, url): noa_info = self._download_json( f'https:{config.find(".//url_program_noa").text}'.format(area=data.find('areakey').text), station, note=f'Downloading {area} station metadata', fatal=False) - present_info = traverse_obj(noa_in...
yt_dlp/extractor/nhk.py
26
Python
0.786
suggestion
207
42
1,016
false
[ie/NhkRadiru] Fix metadata extraction
12,708
yt-dlp/yt-dlp
132,642
Python
bashonly
garret1317
return '\n\n'.join(tracks) def _format_description(self, response): act = traverse_obj(response, ('misc', 'actList', {self._format_actlist})) music = traverse_obj(response, ('misc', 'musicList', {self._format_musiclist})) desc = join_nonempty('epg80', 'epg200', delim='\n\n', from_di...
readability/snake_case ```suggestion date_id = aa_vinfo[3] ```
'preference': preference, 'id': join_nonempty(name, size), }) preference -= 1 return thumbnails def _extract_extended_metadata(self, episode_id, aa_vinfo): service, _, area = traverse_obj(aa_vinfo, (2, {str}, {lambda x: (x or '').partition(','...
@@ -591,102 +592,198 @@ class NhkRadiruIE(InfoExtractor): IE_DESC = 'NHK らじる (Radiru/Rajiru)' _VALID_URL = r'https?://www\.nhk\.or\.jp/radio/(?:player/ondemand|ondemand/detail)\.html\?p=(?P<site>[\da-zA-Z]+)_(?P<corner>[\da-zA-Z]+)(?:_(?P<headline>[\da-zA-Z]+))?' _TESTS = [{ - 'url': 'https://www....
yt_dlp/extractor/nhk.py
26
Python
0.571
suggestion
73
51
51
false
[ie/NhkRadiru] Fix metadata extraction
12,708
yt-dlp/yt-dlp
132,642
Python
bashonly
garret1317
act = traverse_obj(response, ('misc', 'actList', {self._format_actlist})) music = traverse_obj(response, ('misc', 'musicList', {self._format_musiclist})) desc = join_nonempty('epg80', 'epg200', delim='\n\n', from_dict=traverse_obj(response, 'detailedDescription')) return join_nonempty(d...
`date_id`; `-` is the default delimiter for `join_nonempty` ```suggestion lambda: self._API_URL_TMPL.format(broadcastEventId=join_nonempty(service, area, date_id))) ```
preference -= 1 return thumbnails def _extract_extended_metadata(self, episode_id, aa_vinfo): service, _, area = traverse_obj(aa_vinfo, (2, {str}, {lambda x: (x or '').partition(',')})) date_id = aa_vinfo[3] detail_url = try_call( lambda: self._API_URL_TMPL....
@@ -591,102 +592,198 @@ class NhkRadiruIE(InfoExtractor): IE_DESC = 'NHK らじる (Radiru/Rajiru)' _VALID_URL = r'https?://www\.nhk\.or\.jp/radio/(?:player/ondemand|ondemand/detail)\.html\?p=(?P<site>[\da-zA-Z]+)_(?P<corner>[\da-zA-Z]+)(?:_(?P<headline>[\da-zA-Z]+))?' _TESTS = [{ - 'url': 'https://www....
yt_dlp/extractor/nhk.py
26
Python
0.857
suggestion
183
51
51
false
[ie/NhkRadiru] Fix metadata extraction
12,708
yt-dlp/yt-dlp
132,642
Python
bashonly
garret1317
}) preference -= 1 return thumbnails def _extract_extended_metadata(self, episode_id, aa_vinfo): service, _, area = traverse_obj(aa_vinfo, (2, {str}, {lambda x: (x or '').partition(',')})) dateid = aa_vinfo[3] detail_url = try_call( ...
```suggestion station = traverse_obj(response, ('publishedOn', 'broadcastDisplayName', {str})) ```
return {} if error := traverse_obj(response, ('error', {dict})): self.report_warning( 'Failed to get extended metadata. API returned ' f'Error {join_nonempty("statuscode", "message", from_dict=error, delim=": ")}') return {} station =...
@@ -699,36 +796,38 @@ def _extract_extended_metadata(self, episode_id, aa_vinfo): if error := traverse_obj(response, ('error', {dict})): self.report_warning( 'Failed to get extended metadata. API returned ' - f'Error {join_nonempty("code", "message", from_dict=error...
yt_dlp/extractor/nhk.py
26
Python
0.857
suggestion
108
51
51
false
[ie/NhkRadiru] Fix metadata extraction
12,708
yt-dlp/yt-dlp
132,642
Python
bashonly
garret1317
track_details.append(f'~{location}~') tracks.append(join_nonempty(*track_details, delim='\n')) return '\n\n'.join(tracks) def _format_description(self, response): act = traverse_obj(response, ('misc', 'actList', {self._format_actlist})) music = traverse_obj(res...
- I'd rather that we not unpack a dict full of unknown input (`**thumb`), esp since this site seems to change its API frequently - Let's do the traversal inside this method, which will make things both safer inside the method and simpler outside of the method ```suggestion def _get_thumbnails(self, data, keys, n...
thumbnails.append({ 'url': thumb['url'], 'width': int_or_none(thumb.get('width')), 'height': int_or_none(thumb.get('height')), 'preference': preference, 'id': join_nonempty(name, size), }) preference -= 1...
@@ -591,102 +592,198 @@ class NhkRadiruIE(InfoExtractor): IE_DESC = 'NHK らじる (Radiru/Rajiru)' _VALID_URL = r'https?://www\.nhk\.or\.jp/radio/(?:player/ondemand|ondemand/detail)\.html\?p=(?P<site>[\da-zA-Z]+)_(?P<corner>[\da-zA-Z]+)(?:_(?P<headline>[\da-zA-Z]+))?' _TESTS = [{ - 'url': 'https://www....
yt_dlp/extractor/nhk.py
26
Python
0.857
suggestion
938
51
51
false
[ie/NhkRadiru] Fix metadata extraction
12,708
yt-dlp/yt-dlp
132,642
Python
bashonly
garret1317
detail_url = try_call( lambda: self._API_URL_TMPL.format(broadcastEventId=join_nonempty(service, area, dateid, delim='-'))) if not detail_url: return {} response = self._download_json( detail_url, episode_id, 'Downloading extended metadata', 'Fail...
to go with the above `_get_thumbnails` suggestion: ```suggestion thumbnails = [] thumbnails.extend(self._get_thumbnails(response, ('about', 'eyecatch')) for num, dct in enumerate(traverse_obj(response, ('about', 'eyecatchList', ...))): thumbnails.extend(self._get_thumbnails(dct,...
station = traverse_obj(response, ('publishedOn', 'broadcastDisplayName', {str})) thumbnails = [] thumbnails.extend(self._get_thumbnails(response, ('about', 'eyecatch'))) for num, dct in enumerate(traverse_obj(response, ('about', 'eyecatchList', ...))): thumbnails.extend(self...
@@ -699,36 +796,38 @@ def _extract_extended_metadata(self, episode_id, aa_vinfo): if error := traverse_obj(response, ('error', {dict})): self.report_warning( 'Failed to get extended metadata. API returned ' - f'Error {join_nonempty("code", "message", from_dict=error...
yt_dlp/extractor/nhk.py
26
Python
0.786
suggestion
490
51
51
false
[ie/NhkRadiru] Fix metadata extraction
12,708
yt-dlp/yt-dlp
132,642
Python
bashonly
garret1317
response = self._download_json( detail_url, episode_id, 'Downloading extended metadata', 'Failed to download extended metadata', fatal=False, expected_status=400) if not response: return {} if error := traverse_obj(response, ('error', {dict})): s...
```suggestion 'cast': traverse_obj(response, ('misc', 'actList', ..., 'name', {str})), ```
for num, dct in enumerate(traverse_obj(response, ('about', 'eyecatchList', ...))): thumbnails.extend(self._get_thumbnails(dct, None, join_nonempty('list', num), -2)) thumbnails.extend( self._get_thumbnails(response, ('about', 'partOfSeries', 'eyecatch'), 'series', -3)) r...
@@ -699,36 +796,38 @@ def _extract_extended_metadata(self, episode_id, aa_vinfo): if error := traverse_obj(response, ('error', {dict})): self.report_warning( 'Failed to get extended metadata. API returned ' - f'Error {join_nonempty("code", "message", from_dict=error...
yt_dlp/extractor/nhk.py
26
Python
0.857
suggestion
104
51
51
false
[ie/NhkRadiru] Fix metadata extraction
12,708
yt-dlp/yt-dlp
132,642
Python
bashonly
garret1317
about = response.get('about') thumbnails = [] thumbnails.extend(self._get_thumbnails(traverse_obj(about, ('eyecatch', {dict.items})), '')) if eyecatch_list := about.get('eyecatchList'): for num, v in enumerate(eyecatch_list): thumbnails.extend(self._get_thumb...
```suggestion **traverse_obj(response, ('identifierGroup', { 'series': ('radioSeriesName', {str}) 'series_id': ('radioSeriesId', {str}) 'episode': ('radioEpisodeName', {str}) 'episode_id': ('radioEpisodeId', {str}) 'catego...
}), **traverse_obj(response, ('identifierGroup', { 'series': ('radioSeriesName', {str}), 'series_id': ('radioSeriesId', {str}), 'episode': ('radioEpisodeName', {str}), 'episode_id': ('radioEpisodeId', {str}), 'catego...
@@ -699,36 +796,38 @@ def _extract_extended_metadata(self, episode_id, aa_vinfo): if error := traverse_obj(response, ('error', {dict})): self.report_warning( 'Failed to get extended metadata. API returned ' - f'Error {join_nonempty("code", "message", from_dict=error...
yt_dlp/extractor/nhk.py
26
Python
0.786
suggestion
411
51
51
false
[ie/NhkRadiru] Fix metadata extraction
12,708
yt-dlp/yt-dlp
132,642
Python
bashonly
garret1317
# fallback when extended metadata fails 'url': 'https://www.nhk.or.jp/radio/player/ondemand.html?p=J8792PY43V_14_4177121', 'skip': 'Expires on 2025-04-14', 'info_dict': { 'id': 'J8792PY43V_14_4177121', 'ext': 'm4a', 'title': '「白い蝶[ちょう]を探してみよう」いきもの☆いろいろ...
more readable with the underscore IMO ```suggestion def _format_act_list(self, act_list): ```
}, { # fallback when extended metadata fails 'url': 'https://www.nhk.or.jp/radio/player/ondemand.html?p=J8792PY43V_20_4253945', 'skip': 'Expires on 2025-09-01', 'info_dict': { 'id': 'J8792PY43V_20_4253945', 'ext': 'm4a', 'title': '「後絶たない筋肉増強剤の使用」ワー...
@@ -591,102 +592,198 @@ class NhkRadiruIE(InfoExtractor): IE_DESC = 'NHK らじる (Radiru/Rajiru)' _VALID_URL = r'https?://www\.nhk\.or\.jp/radio/(?:player/ondemand|ondemand/detail)\.html\?p=(?P<site>[\da-zA-Z]+)_(?P<corner>[\da-zA-Z]+)(?:_(?P<headline>[\da-zA-Z]+))?' _TESTS = [{ - 'url': 'https://www....
yt_dlp/extractor/nhk.py
26
Python
0.714
suggestion
100
51
51
false
[ie/NhkRadiru] Fix metadata extraction
12,708
yt-dlp/yt-dlp
132,642
Python
bashonly
garret1317
'skip': 'Expires on 2025-04-14', 'info_dict': { 'id': 'J8792PY43V_14_4177121', 'ext': 'm4a', 'title': '「白い蝶[ちょう]を探してみよう」いきもの☆いろいろ', 'description': '海野 和男(昆虫写真家)', 'uploader': 'NHK R1', 'channel': 'NHK R1', 'thumbnail': '...
```suggestion for act in traverse_obj(act_list, (..., {dict})): ```
'url': 'https://www.nhk.or.jp/radio/player/ondemand.html?p=J8792PY43V_20_4253945', 'skip': 'Expires on 2025-09-01', 'info_dict': { 'id': 'J8792PY43V_20_4253945', 'ext': 'm4a', 'title': '「後絶たない筋肉増強剤の使用」ワールドリポート', 'description': '大濱 敦(ソウル支局)', ...
@@ -591,102 +592,198 @@ class NhkRadiruIE(InfoExtractor): IE_DESC = 'NHK らじる (Radiru/Rajiru)' _VALID_URL = r'https?://www\.nhk\.or\.jp/radio/(?:player/ondemand|ondemand/detail)\.html\?p=(?P<site>[\da-zA-Z]+)_(?P<corner>[\da-zA-Z]+)(?:_(?P<headline>[\da-zA-Z]+))?' _TESTS = [{ - 'url': 'https://www....
yt_dlp/extractor/nhk.py
26
Python
0.571
suggestion
77
51
51
false
[ie/NhkRadiru] Fix metadata extraction
12,708
yt-dlp/yt-dlp
132,642
Python
bashonly
garret1317
'release_timestamp': 1741982400, 'release_date': '20250314', }, 'expected_warnings': ['Failed to download extended metadata: HTTP Error 404: Not Found'], }] _API_URL_TMPL = None # the following few functions are ported from https://www.nhk.or.jp/radio/assets/js/time...
```suggestion formatted_roles.append(join_nonempty(res, act.get('name'), delim='')) ```
'upload_date': '20250706', 'release_timestamp': 1751835600, 'release_date': '20250706', }, 'expected_warnings': ['Failed to download extended metadata: HTTP Error 404: Not Found'], }] _API_URL_TMPL = None # The `_format_*` and `_make_*` functions are po...
@@ -591,102 +592,198 @@ class NhkRadiruIE(InfoExtractor): IE_DESC = 'NHK らじる (Radiru/Rajiru)' _VALID_URL = r'https?://www\.nhk\.or\.jp/radio/(?:player/ondemand|ondemand/detail)\.html\?p=(?P<site>[\da-zA-Z]+)_(?P<corner>[\da-zA-Z]+)(?:_(?P<headline>[\da-zA-Z]+))?' _TESTS = [{ - 'url': 'https://www....
yt_dlp/extractor/nhk.py
26
Python
0.714
suggestion
105
51
51
false
[ie/NhkRadiru] Fix metadata extraction
12,708
yt-dlp/yt-dlp
132,642
Python
bashonly
garret1317
'expected_warnings': ['Failed to download extended metadata: HTTP Error 404: Not Found'], }] _API_URL_TMPL = None # the following few functions are ported from https://www.nhk.or.jp/radio/assets/js/timetable_detail_new.js def _format_actlist(self, act_list): role_groups = {} f...
Typically `_fetch` in a method name implies a network request is being made. Let's use `_get` (or `_make` or `_parse`) ```suggestion def _get_artists(self, by_artist): ```
}, 'expected_warnings': ['Failed to download extended metadata: HTTP Error 404: Not Found'], }] _API_URL_TMPL = None # The `_format_*` and `_make_*` functions are ported from: https://www.nhk.or.jp/radio/assets/js/timetable_detail_new.js def _format_act_list(self, act_list): ...
@@ -591,102 +592,198 @@ class NhkRadiruIE(InfoExtractor): IE_DESC = 'NHK らじる (Radiru/Rajiru)' _VALID_URL = r'https?://www\.nhk\.or\.jp/radio/(?:player/ondemand|ondemand/detail)\.html\?p=(?P<site>[\da-zA-Z]+)_(?P<corner>[\da-zA-Z]+)(?:_(?P<headline>[\da-zA-Z]+))?' _TESTS = [{ - 'url': 'https://www....
yt_dlp/extractor/nhk.py
26
Python
0.786
suggestion
178
51
51
false
[ie/NhkRadiru] Fix metadata extraction
12,708
yt-dlp/yt-dlp
132,642
Python
bashonly
garret1317
res += act.get('name') formatted_roles.append(res) return join_nonempty(*formatted_roles, delim=',') def _fetch_artists(self, by_artist): if not by_artist or len(by_artist) == 0: return None artists = [] for artist in by_artist: ...
Haven't tested this, but I think/hope this should work: ```suggestion artists = [] for artist in traverse_obj(track, (key, ..., {dict})): if res := join_nonempty(*traverse_obj(track, ( ..., ('role', filter, {'{}…'.format}), ('part', filt...
if title := act.get('title'): res += f'{title}…' formatted_roles.append(join_nonempty(res, act.get('name'), delim='')) return join_nonempty(*formatted_roles, delim=',') def _make_artists(self, track, key): artists = [] for artist in traver...
@@ -591,102 +592,198 @@ class NhkRadiruIE(InfoExtractor): IE_DESC = 'NHK らじる (Radiru/Rajiru)' _VALID_URL = r'https?://www\.nhk\.or\.jp/radio/(?:player/ondemand|ondemand/detail)\.html\?p=(?P<site>[\da-zA-Z]+)_(?P<corner>[\da-zA-Z]+)(?:_(?P<headline>[\da-zA-Z]+))?' _TESTS = [{ - 'url': 'https://www....
yt_dlp/extractor/nhk.py
26
Python
0.857
suggestion
497
51
51
false
[ie/NhkRadiru] Fix metadata extraction
12,708
yt-dlp/yt-dlp
132,642
Python
bashonly
garret1317
def _fetch_artists(self, by_artist): if not by_artist or len(by_artist) == 0: return None artists = [] for artist in by_artist: res = '' name = artist.get('name') role = artist.get('role') part = artist.get('part') if...
same thing about the method name here, and let's traverse inside the method? ```suggestion def _get_duration(self, track, key): d = traverse_obj(track, (key, {parse_duration})) ```
return join_nonempty(*formatted_roles, delim=',') def _make_artists(self, track, key): artists = [] for artist in traverse_obj(track, (key, ..., {dict})): if res := join_nonempty(*traverse_obj(artist, (( ('role', filter, {'{}…'.format}), ('part', ...
@@ -591,102 +592,198 @@ class NhkRadiruIE(InfoExtractor): IE_DESC = 'NHK らじる (Radiru/Rajiru)' _VALID_URL = r'https?://www\.nhk\.or\.jp/radio/(?:player/ondemand|ondemand/detail)\.html\?p=(?P<site>[\da-zA-Z]+)_(?P<corner>[\da-zA-Z]+)(?:_(?P<headline>[\da-zA-Z]+))?' _TESTS = [{ - 'url': 'https://www....
yt_dlp/extractor/nhk.py
26
Python
0.714
suggestion
196
51
51
false
[ie/NhkRadiru] Fix metadata extraction
12,708
yt-dlp/yt-dlp
132,642
Python
bashonly
garret1317
tracks = [] for track in music_list: track_details = [] if name := track.get('name'): track_details.append(f'「{name}」') if lyricist := track.get('lyricist'): track_details.append(f'{lyricist}:作詞') if composer := track.get(...
same concept as above with `_get_artists` ```suggestion def _format_music_list(self, music_list): tracks = [] for track in traverse_obj(music_list, (..., {dict})): track_details = traverse_obj(track, ( ..., ('name', filter, {'「{}」'.format}), ('lyric...
track_details.append(f'<{label}>') if location := traverse_obj(track, ('location', {str})): track_details.append(f'~{location}~') tracks.append(join_nonempty(*track_details, delim='\n')) return '\n\n'.join(tracks) def _format_description(self, respons...
@@ -591,102 +592,198 @@ class NhkRadiruIE(InfoExtractor): IE_DESC = 'NHK らじる (Radiru/Rajiru)' _VALID_URL = r'https?://www\.nhk\.or\.jp/radio/(?:player/ondemand|ondemand/detail)\.html\?p=(?P<site>[\da-zA-Z]+)_(?P<corner>[\da-zA-Z]+)(?:_(?P<headline>[\da-zA-Z]+))?' _TESTS = [{ - 'url': 'https://www....
yt_dlp/extractor/nhk.py
26
Python
0.786
suggestion
1,010
51
51
false
[ie/NhkRadiru] Fix metadata extraction
12,708
yt-dlp/yt-dlp
132,642
Python
bashonly
garret1317
track_details.append(f'「{name}」') if lyricist := track.get('lyricist'): track_details.append(f'{lyricist}:作詞') if composer := track.get('composer'): track_details.append(f'{composer}:作曲') if arranger := track.get('arranger'): ...
- adjustments based on above suggestions to the `_format_*` methods - in `join_nonempty`, if `from_dict` is `None`, then it will join the literal strings `epg80` and `epg200`, so we need to typecheck for `{dict}` and fallback with `or {}` - can inline in the outer `join_nonempty` call ```suggestion def _format_...
def _format_description(self, response): detailed_description = traverse_obj(response, ('detailedDescription', {dict})) or {} return join_nonempty( join_nonempty('epg80', 'epg200', delim='\n\n', from_dict=detailed_description), traverse_obj(response, ('misc', 'actList', {self...
@@ -591,102 +592,198 @@ class NhkRadiruIE(InfoExtractor): IE_DESC = 'NHK らじる (Radiru/Rajiru)' _VALID_URL = r'https?://www\.nhk\.or\.jp/radio/(?:player/ondemand|ondemand/detail)\.html\?p=(?P<site>[\da-zA-Z]+)_(?P<corner>[\da-zA-Z]+)(?:_(?P<headline>[\da-zA-Z]+))?' _TESTS = [{ - 'url': 'https://www....
yt_dlp/extractor/nhk.py
26
Python
0.929
suggestion
768
51
51
false
[ie/NhkRadiru] Fix metadata extraction
12,708
yt-dlp/yt-dlp
132,642
Python
bashonly
garret1317
}, { # fallback when extended metadata fails 'url': 'https://www.nhk.or.jp/radio/player/ondemand.html?p=J8792PY43V_14_4177121', 'skip': 'Expires on 2025-04-14', 'info_dict': { 'id': 'J8792PY43V_14_4177121', 'ext': 'm4a', 'title': '「白い蝶[ちょう]を探してみよう」...
```suggestion # The `_format_*` and `_get_*` functions are ported from: # https://www.nhk.or.jp/radio/assets/js/timetable_detail_new.js ```
}, }, { # fallback when extended metadata fails 'url': 'https://www.nhk.or.jp/radio/player/ondemand.html?p=J8792PY43V_20_4253945', 'skip': 'Expires on 2025-09-01', 'info_dict': { 'id': 'J8792PY43V_20_4253945', 'ext': 'm4a', 'title': '「後絶たない...
@@ -591,102 +592,198 @@ class NhkRadiruIE(InfoExtractor): IE_DESC = 'NHK らじる (Radiru/Rajiru)' _VALID_URL = r'https?://www\.nhk\.or\.jp/radio/(?:player/ondemand|ondemand/detail)\.html\?p=(?P<site>[\da-zA-Z]+)_(?P<corner>[\da-zA-Z]+)(?:_(?P<headline>[\da-zA-Z]+))?' _TESTS = [{ - 'url': 'https://www....
yt_dlp/extractor/nhk.py
26
Python
0.714
suggestion
150
51
51
false
[ie/NhkRadiru] Fix metadata extraction
12,708
yt-dlp/yt-dlp
132,642
Python
bashonly
garret1317
'id': episode_id, 'formats': self._extract_m3u8_formats(episode.get('file_name'), episode_id, fatal=False), 'container': 'm4a_dash', # force fixup, AAC-only HLS 'was_live': True, 'series': series_meta.get('title'), 'thumbnail': url_or_none(headlin...
```suggestion # XXX: News programmes use the old API # Can't move this to NhkRadioNewsPageIE because news items still use the normal URL format if site_id == '18439M2W42': ```
'id': episode_id, 'formats': self._extract_m3u8_formats(episode.get('file_name'), episode_id, fatal=False), 'container': 'm4a_dash', # force fixup, AAC-only HLS 'was_live': True, 'series': series_meta.get('title'), 'thumbnail': url_or_none(headlin...
@@ -782,7 +863,7 @@ def _real_extract(self, url): site_id, corner_id, headline_id = self._match_valid_url(url).group('site', 'corner', 'headline') programme_id = f'{site_id}_{corner_id}' - if site_id == 'F261': # XXX: News programmes use old API (for now?) + if site_id == '18439M2W42'...
yt_dlp/extractor/nhk.py
26
Python
0.857
refactor
203
51
51
false
[ie/NhkRadiru] Fix metadata extraction
12,708
yt-dlp/yt-dlp
132,642
Python
bashonly
garret1317
_VALID_URL = r'https?://(?:www\.)?tvw\.org/tvchannels/(?P<id>[^/?#]+)' _TESTS = [{ 'url': 'https://tvw.org/tvchannels/air/', 'info_dict': { 'id': 'TVWAIR', 'ext': 'mp4', 'display_id': 'air', 'title': r're:^TVW Cable Channel Live Stream', ...
I think I would just leave the id from the URL as the `video_id`. `streamName` does not seem like a better id to me. It also means if the stream name were ever to not be present the stream could still be extracted. ```suggestion video_id = self._match_id(url) webpage = self._download_webpage(url, vid...
'is_live': ('eventStatus', {lambda x: x == 'live'}), }), } class TvwTvChannelsIE(InfoExtractor): IE_NAME = 'tvw:tvchannels' _VALID_URL = r'https?://(?:www\.)?tvw\.org/tvchannels/(?P<id>[^/?#]+)' _TESTS = [{ 'url': 'https://tvw.org/tvchannels/air/', 'info...
@@ -115,3 +116,53 @@ def _real_extract(self, url): 'is_live': ('eventStatus', {lambda x: x == 'live'}), }), } + + +class TvwTvChannelsIE(InfoExtractor): + IE_NAME = 'Tvw:TvChannels' + _VALID_URL = r'https?://(?:www\.)?tvw\.org/tvchannels/(?P<id>[^/?#]+)' + _TESTS = [{ + ...
yt_dlp/extractor/tvw.py
26
Python
0.857
refactor
331
47
44
false
[ie/tvw:tvchannels] Add extractor
12,721
yt-dlp/yt-dlp
132,642
Python
seproDev
fries1234
'live_status': 'is_live', }, }, { 'url': 'https://tvw.org/tvchannels/tvw2/', 'info_dict': { 'id': 'TVW2', 'ext': 'mp4', 'display_id': 'tvw2', 'title': r're:^TVW-2 Broadcast Channel', 'thumbnail': r're:^https?://.*\.(?:jp...
How about ```suggestion m3u8_url = traverse_obj(webpage, ( {find_element(id='invintus-persistent-stream-frame', html=True)}, {extract_attributes}, 'src', {parse_qs}, 'encoder', 0, {json.loads}, 'live247URI', {url_or_none}, {require('stream url')})) ```
'url': 'https://tvw.org/tvchannels/air/', 'info_dict': { 'id': 'air', 'ext': 'mp4', 'title': r're:TVW Cable Channel Live Stream', 'thumbnail': r're:https?://.+/.+\.(?:jpe?g|png)$', 'live_status': 'is_live', }, }, { 'url': 'h...
@@ -115,3 +116,53 @@ def _real_extract(self, url): 'is_live': ('eventStatus', {lambda x: x == 'live'}), }), } + + +class TvwTvChannelsIE(InfoExtractor): + IE_NAME = 'Tvw:TvChannels' + _VALID_URL = r'https?://(?:www\.)?tvw\.org/tvchannels/(?P<id>[^/?#]+)' + _TESTS = [{ + ...
yt_dlp/extractor/tvw.py
26
Python
0.857
refactor
289
38
35
false
[ie/tvw:tvchannels] Add extractor
12,721
yt-dlp/yt-dlp
132,642
Python
seproDev
fries1234
'display_id': 'tvw2', 'title': r're:^TVW-2 Broadcast Channel', 'thumbnail': r're:^https?://.*\.(?:jpe?g|png)$', 'live_status': 'is_live', }, }] def _real_extract(self, url): display_id = self._match_id(url) webpage = self._download_webpage...
`fatal=True` is the default. I would also inline ```suggestion return { 'id': video_id, 'formats': self._extract_m3u8_formats(m3u8_url, video_id, 'mp4', m3u8_id='hls', live=True), ```
}, }, { 'url': 'https://tvw.org/tvchannels/tvw2/', 'info_dict': { 'id': 'tvw2', 'ext': 'mp4', 'title': r're:TVW-2 Broadcast Channel', 'thumbnail': r're:https?://.+/.+\.(?:jpe?g|png)$', 'live_status': 'is_live', }, }] ...
@@ -115,3 +116,53 @@ def _real_extract(self, url): 'is_live': ('eventStatus', {lambda x: x == 'live'}), }), } + + +class TvwTvChannelsIE(InfoExtractor): + IE_NAME = 'Tvw:TvChannels' + _VALID_URL = r'https?://(?:www\.)?tvw\.org/tvchannels/(?P<id>[^/?#]+)' + _TESTS = [{ + ...
yt_dlp/extractor/tvw.py
26
Python
0.857
refactor
220
31
28
false
[ie/tvw:tvchannels] Add extractor
12,721
yt-dlp/yt-dlp
132,642
Python
seproDev
fries1234
import json import urllib from .common import InfoExtractor from ..utils import clean_html, remove_end, unescapeHTML, unified_timestamp, url_or_none from ..utils.traversal import traverse_obj class TvwIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?tvw\.org/video/(?P<id>[^/?#]+)' _TESTS = [{ 'u...
For my changes from below to work ```suggestion from ..utils import ( clean_html, extract_attributes, parse_qs, remove_end, unified_timestamp, url_or_none, ) from ..utils.traversal import find_element, require, traverse_obj ```
import json from .common import InfoExtractor from ..utils import ( clean_html, extract_attributes, parse_qs, remove_end, require, unified_timestamp, url_or_none, ) from ..utils.traversal import find_element, traverse_obj class TvwIE(InfoExtractor): IE_NAME = 'tvw' _VALID_URL = r'...
@@ -1,7 +1,8 @@ import json +import urllib from .common import InfoExtractor -from ..utils import clean_html, remove_end, unified_timestamp, url_or_none +from ..utils import clean_html, remove_end, unescapeHTML, unified_timestamp, url_or_none from ..utils.traversal import traverse_obj
yt_dlp/extractor/tvw.py
6
Python
0.857
refactor
262
31
31
false
[ie/tvw:tvchannels] Add extractor
12,721
yt-dlp/yt-dlp
132,642
Python
seproDev
fries1234
TVCIE, TVCArticleIE, ) from .tver import TVerIE from .tvigle import TvigleIE from .tviplayer import TVIPlayerIE from .tvland import TVLandIE from .tvn24 import TVN24IE from .tvnoe import TVNoeIE from .tvopengr import ( TVOpenGrEmbedIE, TVOpenGrWatchIE, ) from .tvp import ( TVPIE, TVPEmbedIE, ...
```suggestion from .tvw import ( TvwIE, TvwTvChannelsIE, ) ```
from .tv4 import TV4IE from .tv5mondeplus import TV5MondePlusIE from .tv5unis import ( TV5UnisIE, TV5UnisVideoIE, ) from .tv24ua import TV24UAVideoIE from .tva import TVAIE from .tvanouvelles import ( TVANouvellesArticleIE, TVANouvellesIE, ) from .tvc import ( TVCIE, TVCArticleIE, ) from .tver i...
@@ -2224,7 +2224,7 @@ TVPlayIE, ) from .tvplayer import TVPlayerIE -from .tvw import TvwIE +from .tvw import TvwIE, TvwTvChannelsIE
yt_dlp/extractor/_extractors.py
26
Python
0.571
suggestion
75
51
51
false
[ie/tvw:tvchannels] Add extractor
12,721
yt-dlp/yt-dlp
132,642
Python
seproDev
fries1234
formats.extend(fmts) self._merge_subtitles(subs, target=subtitles) if caption_url := traverse_obj(video_data, ('captionPath', {url_or_none})): subtitles.setdefault('en', []).append({'url': caption_url, 'ext': 'vtt'}) return { 'id': video_id, '...
```suggestion IE_NAME = 'tvw:tvchannels' ``` and add `IE_NAME = 'tvw'` to `TVWIE` for consistency
formats.extend(fmts) self._merge_subtitles(subs, target=subtitles) if caption_url := traverse_obj(video_data, ('captionPath', {url_or_none})): subtitles.setdefault('en', []).append({'url': caption_url, 'ext': 'vtt'}) return { 'id': video_id, '...
@@ -115,3 +123,43 @@ def _real_extract(self, url): 'is_live': ('eventStatus', {lambda x: x == 'live'}), }), } + + +class TvwTvChannelsIE(InfoExtractor): + IE_NAME = 'Tvw:TvChannels'
yt_dlp/extractor/tvw.py
26
Python
0.714
suggestion
106
51
51
false
[ie/tvw:tvchannels] Add extractor
12,721
yt-dlp/yt-dlp
132,642
Python
bashonly
fries1234
'display_id': display_id, 'formats': formats, 'subtitles': subtitles, 'title': remove_end(self._og_search_title(webpage, default=None), ' - TVW'), 'description': self._og_search_description(webpage, default=None), **traverse_obj(video_data, { ...
```suggestion 'title': r're:TVW Cable Channel Live Stream', ```
'display_id': display_id, 'formats': formats, 'subtitles': subtitles, 'title': remove_end(self._og_search_title(webpage, default=None), ' - TVW'), 'description': self._og_search_description(webpage, default=None), **traverse_obj(video_data, { ...
@@ -115,3 +123,43 @@ def _real_extract(self, url): 'is_live': ('eventStatus', {lambda x: x == 'live'}), }), } + + +class TvwTvChannelsIE(InfoExtractor): + IE_NAME = 'Tvw:TvChannels' + _VALID_URL = r'https?://(?:www\.)?tvw\.org/tvchannels/(?P<id>[^/?#]+)' + _TESTS = [{ + ...
yt_dlp/extractor/tvw.py
26
Python
0.571
suggestion
77
51
51
false
[ie/tvw:tvchannels] Add extractor
12,721
yt-dlp/yt-dlp
132,642
Python
bashonly
fries1234
'formats': formats, 'subtitles': subtitles, 'title': remove_end(self._og_search_title(webpage, default=None), ' - TVW'), 'description': self._og_search_description(webpage, default=None), **traverse_obj(video_data, { 'title': ('title', {str}), ...
```suggestion 'thumbnail': r're:https?://.+/.+\.(?:jpe?g|png)$', ```
'formats': formats, 'subtitles': subtitles, 'title': remove_end(self._og_search_title(webpage, default=None), ' - TVW'), 'description': self._og_search_description(webpage, default=None), **traverse_obj(video_data, { 'title': ('title', {str}), ...
@@ -115,3 +123,43 @@ def _real_extract(self, url): 'is_live': ('eventStatus', {lambda x: x == 'live'}), }), } + + +class TvwTvChannelsIE(InfoExtractor): + IE_NAME = 'Tvw:TvChannels' + _VALID_URL = r'https?://(?:www\.)?tvw\.org/tvchannels/(?P<id>[^/?#]+)' + _TESTS = [{ + ...
yt_dlp/extractor/tvw.py
26
Python
0.571
suggestion
82
51
51
false
[ie/tvw:tvchannels] Add extractor
12,721
yt-dlp/yt-dlp
132,642
Python
bashonly
fries1234
'thumbnail': ('videoThumbnail', {url_or_none}), 'timestamp': ('startDateTime', {unified_timestamp}), 'location': ('locationName', {str}), 'is_live': ('eventStatus', {lambda x: x == 'live'}), }), } class TvwTvChannelsIE(InfoExtractor):...
```suggestion 'title': r're:TVW-2 Broadcast Channel', ```
'thumbnail': ('videoThumbnail', {url_or_none}), 'timestamp': ('startDateTime', {unified_timestamp}), 'location': ('locationName', {str}), 'is_live': ('eventStatus', {lambda x: x == 'live'}), }), } class TvwTvChannelsIE(InfoExtractor):...
@@ -115,3 +123,43 @@ def _real_extract(self, url): 'is_live': ('eventStatus', {lambda x: x == 'live'}), }), } + + +class TvwTvChannelsIE(InfoExtractor): + IE_NAME = 'Tvw:TvChannels' + _VALID_URL = r'https?://(?:www\.)?tvw\.org/tvchannels/(?P<id>[^/?#]+)' + _TESTS = [{ + ...
yt_dlp/extractor/tvw.py
26
Python
0.714
suggestion
71
47
47
false
[ie/tvw:tvchannels] Add extractor
12,721
yt-dlp/yt-dlp
132,642
Python
bashonly
fries1234
'timestamp': ('startDateTime', {unified_timestamp}), 'location': ('locationName', {str}), 'is_live': ('eventStatus', {lambda x: x == 'live'}), }), } class TvwTvChannelsIE(InfoExtractor): IE_NAME = 'Tvw:TvChannels' _VALID_URL = r'https?://(?:w...
```suggestion 'thumbnail': r're:https?://.+/.+\.(?:jpe?g|png)$', ```
'timestamp': ('startDateTime', {unified_timestamp}), 'location': ('locationName', {str}), 'is_live': ('eventStatus', {lambda x: x == 'live'}), }), } class TvwTvChannelsIE(InfoExtractor): IE_NAME = 'tvw:tvchannels' _VALID_URL = r'https?://(?:w...
@@ -115,3 +123,43 @@ def _real_extract(self, url): 'is_live': ('eventStatus', {lambda x: x == 'live'}), }), } + + +class TvwTvChannelsIE(InfoExtractor): + IE_NAME = 'Tvw:TvChannels' + _VALID_URL = r'https?://(?:www\.)?tvw\.org/tvchannels/(?P<id>[^/?#]+)' + _TESTS = [{ + ...
yt_dlp/extractor/tvw.py
26
Python
0.571
suggestion
82
46
46
false
[ie/tvw:tvchannels] Add extractor
12,721
yt-dlp/yt-dlp
132,642
Python
bashonly
fries1234
'view_count': int, 'thumbnail': r're:^https?://.*\.(?:jpe?g|png)$', 'duration': 549, 'description': 'md5:116f326579700f00eaaf5581aae1192e', 'upload_date': '20250304', }, }, { 'url': 'https://17.live/ja/vod/27323042/0de11bac-9bea-40b8-9eab-0...
- `{str}` checks type while `{str_or_none}` is a transformation that will convert dicts, lists, etc to string. You should really only use `{str_or_none}` when you need to convert an int value to string (and ideally you would check that it's int, e.g. `'numeric_id', {int}, {str_or_none}`) - `createdAt` is already a u...
'like_count': int, 'view_count': int, 'thumbnail': r're:https?://.+/.+\.(?:jpe?g|png)', 'duration': 549, 'description': 'md5:116f326579700f00eaaf5581aae1192e', 'timestamp': 1741058645, 'upload_date': '20250304', }, }, { ...
@@ -157,3 +166,45 @@ def _real_extract(self, url): 'description': view_data.get('caption'), 'upload_date': unified_strdate(str_or_none(view_data.get('createdAt'))), } + + +class IchinanaLiveVODIE(InfoExtractor): + IE_NAME = '17live:vod' + _VALID_URL = r'https?://(?:www\.)?17\.li...
yt_dlp/extractor/ichinanalive.py
26
Python
1
refactor
1,279
28
33
false
[ie/17live:vod] Add extractor
12,723
yt-dlp/yt-dlp
132,642
Python
bashonly
subrat-lima
fmt.update({ 'ext': 'mp4', 'protocol': 'https', 'vcodec': 'h264', 'acodec': 'aac', 'http_headers': {'Referer': url}, }) return { 'id': video_id, 'title': uploader or video_id, ...
- Need to use `[^/?#]` instead of `[^/]` or else we'll match the URL query/fragment in the ID - Whenever possible use `id` as the name of the capture group; then the preliminary check done for `--download-archive` is effective ```suggestion _VALID_URL = r'https?://(?:www\.)?17\.live/ja/vod/[^/?#]+/(?P<id>[^/?#]+...
'ext': 'mp4', 'protocol': 'https', 'vcodec': 'h264', 'acodec': 'aac', 'http_headers': {'Referer': url}, }) return { 'id': video_id, 'title': uploader or video_id, 'formats': formats, ...
@@ -157,3 +166,45 @@ def _real_extract(self, url): 'description': view_data.get('caption'), 'upload_date': unified_strdate(str_or_none(view_data.get('createdAt'))), } + + +class IchinanaLiveVODIE(InfoExtractor): + IE_NAME = '17live:vod' + _VALID_URL = r'https?://(?:www\.)?17\.li...
yt_dlp/extractor/ichinanalive.py
26
Python
0.857
suggestion
327
51
51
false
[ie/17live:vod] Add extractor
12,723
yt-dlp/yt-dlp
132,642
Python
bashonly
subrat-lima
class IchinanaLiveVODIE(InfoExtractor): IE_NAME = '17live:vod' _VALID_URL = r'https?://(?:www\.)?17\.live/ja/vod/[^/]+/(?P<video_id>[^/]+)' _TESTS = [{ 'url': 'https://17.live/ja/vod/27323042/2cf84520-e65e-4b22-891e-1d3a00b0f068', 'md5': '3299b930d7457b069639486998a89580', 'info_dict...
another reason to use `id` as the name of the capture group: ```suggestion video_id = self._match_id(url) ```
IE_NAME = '17live:vod' _VALID_URL = r'https?://(?:www\.)?17\.live/ja/vod/[^/?#]+/(?P<id>[^/?#]+)' _TESTS = [{ 'url': 'https://17.live/ja/vod/27323042/2cf84520-e65e-4b22-891e-1d3a00b0f068', 'md5': '3299b930d7457b069639486998a89580', 'info_dict': { 'id': '2cf84520-e65e-4b22...
@@ -157,3 +166,45 @@ def _real_extract(self, url): 'description': view_data.get('caption'), 'upload_date': unified_strdate(str_or_none(view_data.get('createdAt'))), } + + +class IchinanaLiveVODIE(InfoExtractor): + IE_NAME = '17live:vod' + _VALID_URL = r'https?://(?:www\.)?17\.li...
yt_dlp/extractor/ichinanalive.py
26
Python
0.786
suggestion
120
41
46
false
[ie/17live:vod] Add extractor
12,723
yt-dlp/yt-dlp
132,642
Python
bashonly
subrat-lima
'duration': view_data.get('duration'), 'description': view_data.get('caption'), 'upload_date': unified_strdate(str_or_none(view_data.get('createdAt'))), } class IchinanaLiveVODIE(InfoExtractor): IE_NAME = '17live:vod' _VALID_URL = r'https?://(?:www\.)?17\.live/ja/vo...
please update this test if applying my suggestions
'description': view_data.get('caption'), 'upload_date': unified_strdate(str_or_none(view_data.get('createdAt'))), } class IchinanaLiveVODIE(InfoExtractor): IE_NAME = '17live:vod' _VALID_URL = r'https?://(?:www\.)?17\.live/ja/vod/[^/?#]+/(?P<id>[^/?#]+)' _TESTS = [{ ...
@@ -157,3 +166,45 @@ def _real_extract(self, url): 'description': view_data.get('caption'), 'upload_date': unified_strdate(str_or_none(view_data.get('createdAt'))), } + + +class IchinanaLiveVODIE(InfoExtractor): + IE_NAME = '17live:vod' + _VALID_URL = r'https?://(?:www\.)?17\.li...
yt_dlp/extractor/ichinanalive.py
26
Python
0.214
suggestion
50
47
51
false
[ie/17live:vod] Add extractor
12,723
yt-dlp/yt-dlp
132,642
Python
bashonly
subrat-lima
'duration': view_data.get('duration'), 'description': view_data.get('caption'), 'upload_date': unified_strdate(str_or_none(view_data.get('createdAt'))), } class IchinanaLiveVODIE(InfoExtractor): IE_NAME = '17live:vod' _VALID_URL = r'https?://(?:www\.)?17\.live/ja/vo...
`upload_date` should still be returned (not by the extractor; it is set by core code from the `timestamp`). did you actually run the test?
'duration': view_data.get('duration'), 'description': view_data.get('caption'), 'upload_date': unified_strdate(str_or_none(view_data.get('createdAt'))), } class IchinanaLiveVODIE(InfoExtractor): IE_NAME = '17live:vod' _VALID_URL = r'https?://(?:www\.)?17\.live/ja/vo...
@@ -185,26 +184,26 @@ class IchinanaLiveVODIE(InfoExtractor): 'thumbnail': r're:^https?://.*\.(?:jpe?g|png)$', 'duration': 549, 'description': 'md5:116f326579700f00eaaf5581aae1192e', - 'upload_date': '20250304', + 'timestamp': 1741058645,
yt_dlp/extractor/ichinanalive.py
26
Python
0.571
refactor
138
47
51
false
[ie/17live:vod] Add extractor
12,723
yt-dlp/yt-dlp
132,642
Python
bashonly
subrat-lima
'ext': 'mp4', 'title': 'md5:b5f8cbf497d54cc6a60eb3b480182f01', 'uploader': 'md5:29fb12122ab94b5a8495586e7c3085a5', 'uploader_id': '2b4f85f1-d61e-429d-a901-68d32bdd8645', 'like_count': int, 'view_count': int, 'thumbnail': r're:^https?://...
should we try to extract the same value for `uploader_id` that the live extractor does? would that be `('userInfo', 'roomID', {int}, {str_or_none})`?
'ext': 'mp4', 'title': 'md5:b5f8cbf497d54cc6a60eb3b480182f01', 'uploader': 'md5:29fb12122ab94b5a8495586e7c3085a5', 'uploader_id': '27323042', 'channel': '🌟オールナイトニッポン アーカイブ🌟', 'channel_id': '2b4f85f1-d61e-429d-a901-68d32bdd8645', 'like...
@@ -157,3 +165,46 @@ def _real_extract(self, url): 'description': view_data.get('caption'), 'upload_date': unified_strdate(str_or_none(view_data.get('createdAt'))), } + + +class IchinanaLiveVODIE(InfoExtractor): + IE_NAME = '17live:vod' + _VALID_URL = r'https?://(?:www\.)?17\.li...
yt_dlp/extractor/ichinanalive.py
26
Python
0.571
refactor
149
34
39
false
[ie/17live:vod] Add extractor
12,723
yt-dlp/yt-dlp
132,642
Python
bashonly
subrat-lima
self.report_warning(join_nonempty( 'Falling back to generic n function search', player_url and f' player = {player_url}', delim='\n')) return self._search_regex( r'''(?xs) ;\s*(?P<name>[a-zA-Z0-9_$]+)\s*=\s*function\([a-zA-Z...
```suggestion |\[\s*(?:(?P<q4>["\'])(?:(?!(?P=q4)).|\\.)*(?P=q4)\s*,?\s*)+\] ```
self.report_warning(join_nonempty( 'Falling back to generic n function search', player_url and f' player = {player_url}', delim='\n')) return self._search_regex( r'''(?xs) ;\s*(?P<name>[a-zA-Z0-9_$]+)\s*=\s*function\([a-zA-Z...
@@ -2182,6 +2182,7 @@ def _extract_player_js_global_var(self, jscode): (?P<value> (?P<q2>["\'])(?:(?!(?P=q2)).|\\.)+(?P=q2) \.split\((?P<q3>["\'])(?:(?!(?P=q3)).)+(?P=q3)\) + |\[((?P<q4>["\'])(?:(?!(?P=q4)).|\\.)*(?P=q4),?\s*)...
yt_dlp/extractor/youtube/_video.py
26
Python
0.714
suggestion
106
51
51
false
[ie/youtube] Fix nsig extraction for player `4fcd6e4a`
12,748
yt-dlp/yt-dlp
132,642
Python
bashonly
seproDev
self.report_warning(join_nonempty( 'Falling back to generic n function search', player_url and f' player = {player_url}', delim='\n')) return self._search_regex( r'''(?xs) ;\s*(?P<name>[a-zA-Z0-9_$]+)\s*=\s*function\([a-zA-Z...
this too? ```suggestion |\[\s*(?:(?P<q4>["\'])(?:(?!(?P=q4)).|\\.)*(?P=q4)\s*,?\s*)+\] ```
self.report_warning(join_nonempty( 'Falling back to generic n function search', player_url and f' player = {player_url}', delim='\n')) return self._search_regex( r'''(?xs) ;\s*(?P<name>[a-zA-Z0-9_$]+)\s*=\s*function\([a-zA-Z...
@@ -2182,6 +2182,7 @@ def _extract_player_js_global_var(self, jscode): (?P<value> (?P<q2>["\'])(?:(?!(?P=q2)).|\\.)+(?P=q2) \.split\((?P<q3>["\'])(?:(?!(?P=q3)).)+(?P=q3)\) + |\[\s*(?:(?P<q4>["\'])(?:(?!(?P=q4)).|\\.)*(?P=q4),...
yt_dlp/extractor/youtube/_video.py
26
Python
0.714
suggestion
117
51
51
false
[ie/youtube] Fix nsig extraction for player `4fcd6e4a`
12,748
yt-dlp/yt-dlp
132,642
Python
bashonly
seproDev
'uploader_id': channel_name, 'timestamp': timestamp, 'view_count': view_count, 'formats': formats, 'is_live': stream_type == 'live', } class TwitchClipsIE(TwitchBaseIE): IE_NAME = 'twitch:clips' _VALID_URL = r'''(?x) https...
Is there any way to get the old ID value with the new query, so that we don't break download archive compat? (I wonder why we weren't just using the slug/`display_id` to begin with)
'uploader': uploader, 'uploader_id': channel_name, 'timestamp': timestamp, 'view_count': view_count, 'formats': formats, 'is_live': stream_type == 'live', } class TwitchClipsIE(TwitchBaseIE): IE_NAME = 'twitch:clips' _VALID_URL = ...
@@ -1083,17 +1083,45 @@ class TwitchClipsIE(TwitchBaseIE): 'url': 'https://clips.twitch.tv/FaintLightGullWholeWheat', 'md5': '761769e1eafce0ffebfb4089cb3847cd', 'info_dict': { - 'id': '42850523', + 'id': '396245304', 'display_id': 'FaintLightGullWholeWheat',
yt_dlp/extractor/twitch.py
26
Python
0.5
suggestion
184
51
51
false
[ie/twitch:clips] Extract portrait formats
12,763
yt-dlp/yt-dlp
132,642
Python
bashonly
DmitryScaletta
'channel_id': '25163635', 'channel_is_verified': False, 'channel_follower_count': int, 'uploader': 'stereotype_', 'uploader_id': '43566419', }, }, { 'url': 'https://www.twitch.tv/xqc/clip/CulturedAmazingKuduDatSheffy-TiZ_-ixAGYR3y2Uy', ...
we should try to keep metadata consistent with the other extractors in the module, e.g. `TwitchVodIE`'s should extract the same value for `uploader_id` as this extractor does for VODs/clips by the same uploader
'channel': 'EA', 'channel_id': '25163635', 'channel_is_verified': False, 'channel_follower_count': int, 'uploader': 'EA', 'uploader_id': '25163635', }, }, { 'url': 'https://www.twitch.tv/xqc/clip/CulturedAmazingKuduDatSheffy-TiZ...
@@ -1083,17 +1083,45 @@ class TwitchClipsIE(TwitchBaseIE): 'url': 'https://clips.twitch.tv/FaintLightGullWholeWheat', 'md5': '761769e1eafce0ffebfb4089cb3847cd', 'info_dict': { - 'id': '42850523', + 'id': '396245304', 'display_id': 'FaintLightGullWholeWheat',...
yt_dlp/extractor/twitch.py
26
Python
0.643
refactor
210
51
51
false
[ie/twitch:clips] Extract portrait formats
12,763
yt-dlp/yt-dlp
132,642
Python
bashonly
DmitryScaletta
'token': clip['playbackAccessToken']['value'], } asset_default = traverse_obj(clip, ('assets', 0), {}) asset_portrait = traverse_obj(clip, ('assets', 1), {}) game = traverse_obj(clip, ('game', 'displayName')) formats = [] for quality in traverse_obj(asset_def...
`-1` is the default `quality` value. Are you wanting to deprioritize portrait formats? Then use `-2` or `-10` etc. Maybe we should even use `source_preference` instead of `quality`
'sig': clip['playbackAccessToken']['signature'], 'token': clip['playbackAccessToken']['value'], } asset_default = traverse_obj(clip, ('assets', 0, {dict})) or {} asset_portrait = traverse_obj(clip, ('assets', 1, {dict})) or {} formats = [] default_aspect_...
@@ -1135,81 +1161,68 @@ def _real_extract(self, url): 'sig': clip['playbackAccessToken']['signature'], 'token': clip['playbackAccessToken']['value'], } - - data = self._download_base_gql( - video_id, { - 'query': '''{ - clip(slug: "%s") { - broadca...
yt_dlp/extractor/twitch.py
26
Python
0.571
suggestion
181
51
51
false
[ie/twitch:clips] Extract portrait formats
12,763
yt-dlp/yt-dlp
132,642
Python
bashonly
DmitryScaletta
}) if thumb_asset_portrait := asset_portrait.get('thumbnailURL'): thumbnails.append({ 'id': 'portrait', 'url': thumb_asset_portrait, }) old_id = self._search_regex(r'%7C(\d+)(?:-\d+)?.mp4', formats[-1]['url'], 'old id', default=None) ...
I'd just unpack one big traverse_obj call for everything that you can (obviously not `formats` etc) ```py **traverse_obj(clip, { 'title': ('title', {str}), 'duration': ('durationSeconds', {int_or_none}), 'view_count': ('viewCount', {int_or_none}), # etc }),
}) thumb_default_url = url_or_none(clip.get('thumbnailURL')) if thumb_default_url and thumb_default_url != thumb_asset_default_url: thumbnails.append({ 'id': 'small', 'url': thumb_default_url, 'preference': -2, }) ...
@@ -1135,81 +1161,68 @@ def _real_extract(self, url): 'sig': clip['playbackAccessToken']['signature'], 'token': clip['playbackAccessToken']['value'], } - - data = self._download_base_gql( - video_id, { - 'query': '''{ - clip(slug: "%s") { - broadca...
yt_dlp/extractor/twitch.py
26
Python
0.786
suggestion
283
29
33
false
[ie/twitch:clips] Extract portrait formats
12,763
yt-dlp/yt-dlp
132,642
Python
bashonly
DmitryScaletta
'only_matching': True, }, { 'url': 'https://m.twitch.tv/clip/FaintLightGullWholeWheat', 'only_matching': True, }] def _real_extract(self, url): slug = self._match_id(url) clip = self._download_gql( slug, [{ 'operationName': 'ShareClipRend...
safer and clearer: ```suggestion asset_default = traverse_obj(clip, ('assets', 0, {dict})) or {} asset_portrait = traverse_obj(clip, ('assets', 1, {dict})) or {} ```
'url': 'https://go.twitch.tv/rossbroadcast/clip/ConfidentBraveHumanChefFrank', 'only_matching': True, }, { 'url': 'https://m.twitch.tv/clip/FaintLightGullWholeWheat', 'only_matching': True, }] def _real_extract(self, url): slug = self._match_id(url) clip = s...
@@ -1135,81 +1161,68 @@ def _real_extract(self, url): 'sig': clip['playbackAccessToken']['signature'], 'token': clip['playbackAccessToken']['value'], } - - data = self._download_base_gql( - video_id, { - 'query': '''{ - clip(slug: "%s") { - broadca...
yt_dlp/extractor/twitch.py
26
Python
0.714
suggestion
185
51
51
false
[ie/twitch:clips] Extract portrait formats
12,763
yt-dlp/yt-dlp
132,642
Python
bashonly
DmitryScaletta
}, { 'url': 'https://m.twitch.tv/clip/FaintLightGullWholeWheat', 'only_matching': True, }] def _real_extract(self, url): slug = self._match_id(url) clip = self._download_gql( slug, [{ 'operationName': 'ShareClipRenderStatus', 'var...
inline this in the return, it can be in the big traversal, e.g.: ```py **traverse_obj(clip, { 'categories': ('game', 'displayName', {str}, filter, all, filter), }), ```
'only_matching': True, }, { 'url': 'https://m.twitch.tv/clip/FaintLightGullWholeWheat', 'only_matching': True, }] def _real_extract(self, url): slug = self._match_id(url) clip = self._download_gql( slug, [{ 'operationName': 'ShareClipRend...
@@ -1135,81 +1161,68 @@ def _real_extract(self, url): 'sig': clip['playbackAccessToken']['signature'], 'token': clip['playbackAccessToken']['value'], } - - data = self._download_base_gql( - video_id, { - 'query': '''{ - clip(slug: "%s") { - broadca...
yt_dlp/extractor/twitch.py
26
Python
0.714
suggestion
177
51
51
false
[ie/twitch:clips] Extract portrait formats
12,763
yt-dlp/yt-dlp
132,642
Python
bashonly
DmitryScaletta
'variables': {'slug': slug}, }], 'Downloading clip GraphQL')[0]['data']['clip'] if not clip: raise ExtractorError( 'This clip is no longer available', expected=True) access_query = { 'sig': clip['playbackAccessToken']['sig...
`from yt_dlp.utils.traversal import traverse_obj, value` ```suggestion default_aspect_ratio = float_or_none(asset_default.get('aspectRatio')) formats.extend(traverse_obj(asset_default, ('videoQualities', lambda _, v: url_or_none(v['sourceURL']), { 'url': ('sourceURL', {update_url_query(q...
'operationName': 'ShareClipRenderStatus', 'variables': {'slug': slug}, }], 'Downloading clip GraphQL')[0]['data']['clip'] if not clip: raise ExtractorError( 'This clip is no longer available', expected=True) access_que...
@@ -1135,81 +1161,68 @@ def _real_extract(self, url): 'sig': clip['playbackAccessToken']['signature'], 'token': clip['playbackAccessToken']['value'], } - - data = self._download_base_gql( - video_id, { - 'query': '''{ - clip(slug: "%s") { - broadca...
yt_dlp/extractor/twitch.py
26
Python
0.786
suggestion
568
51
51
false
[ie/twitch:clips] Extract portrait formats
12,763
yt-dlp/yt-dlp
132,642
Python
bashonly
DmitryScaletta
'sig': clip['playbackAccessToken']['signature'], 'token': clip['playbackAccessToken']['value'], } asset_default = traverse_obj(clip, ('assets', 0, {dict})) or {} asset_portrait = traverse_obj(clip, ('assets', 1, {dict})) or {} formats = [] default_aspect_...
I don't like having `portrait-best` for the format ID if all of the other formats (including the best default format) are just `(portrait-)?{quality}` ```suggestion for traverse_obj(asset_portrait, ('videoQualities', lambda _, v: url_or_none(v['sourceURL'])): formats.append({ 'ur...
'token': clip['playbackAccessToken']['value'], } asset_default = traverse_obj(clip, ('assets', 0, {dict})) or {} asset_portrait = traverse_obj(clip, ('assets', 1, {dict})) or {} formats = [] default_aspect_ratio = float_or_none(asset_default.get('aspectRatio')) ...
@@ -1135,81 +1163,68 @@ def _real_extract(self, url): 'sig': clip['playbackAccessToken']['signature'], 'token': clip['playbackAccessToken']['value'], } - - data = self._download_base_gql( - video_id, { - 'query': '''{ - clip(slug: "%s") { - broadca...
yt_dlp/extractor/twitch.py
26
Python
0.786
suggestion
692
51
51
false
[ie/twitch:clips] Extract portrait formats
12,763
yt-dlp/yt-dlp
132,642
Python
bashonly
DmitryScaletta
formats.append({ 'url': update_url_query(source, access_query), 'format_id': join_nonempty('portrait', 'best' if i == 0 else quality.get('quality')), 'height': int_or_none(quality.get('quality')), 'fps': float_or_none(qualit...
```suggestion thumb_asset_default_url = url_or_none(asset_default.get('thumbnailURL')) if thumb_asset_default_url: thumbnails.append({ 'id': 'default', 'url': thumb_asset_default_url, 'preference': 0, }) if thumb_ass...
'format_id': join_nonempty('portrait', source.get('quality')), 'height': int_or_none(source.get('quality')), 'fps': float_or_none(source.get('frameRate')), 'aspect_ratio': portrait_aspect_ratio, 'quality': -2, }) thumbn...
@@ -1135,81 +1163,68 @@ def _real_extract(self, url): 'sig': clip['playbackAccessToken']['signature'], 'token': clip['playbackAccessToken']['value'], } - - data = self._download_base_gql( - video_id, { - 'query': '''{ - clip(slug: "%s") { - broadca...
yt_dlp/extractor/twitch.py
26
Python
0.857
suggestion
867
51
51
false
[ie/twitch:clips] Extract portrait formats
12,763
yt-dlp/yt-dlp
132,642
Python
bashonly
DmitryScaletta
'id': 'portrait', 'url': thumb_asset_portrait_url, 'preference': -1, }) thumb_default_url = url_or_none(clip.get('thumbnailURL')) if thumb_default_url and thumb_default_url != thumb_asset_default_url: thumbnails.append({ ...
```suggestion 'creators': ('broadcaster', 'displayName', {str}, filter, all), ```
'url': thumb_asset_portrait_url, 'preference': -1, }) thumb_default_url = url_or_none(clip.get('thumbnailURL')) if thumb_default_url and thumb_default_url != thumb_asset_default_url: thumbnails.append({ 'id': 'small', ...
@@ -1135,81 +1163,71 @@ def _real_extract(self, url): 'sig': clip['playbackAccessToken']['signature'], 'token': clip['playbackAccessToken']['value'], } - - data = self._download_base_gql( - video_id, { - 'query': '''{ - clip(slug: "%s") { - broadca...
yt_dlp/extractor/twitch.py
26
Python
0.714
suggestion
99
36
35
false
[ie/twitch:clips] Extract portrait formats
12,763
yt-dlp/yt-dlp
132,642
Python
bashonly
DmitryScaletta
import datetime import json from .common import InfoExtractor class IvooxIE(InfoExtractor): _VALID_URL = ( r'https?://(?:www\.)?ivoox\.com/.*_rf_(?P<id>[0-9]+)_1\.html', r'https?://go\.ivoox\.com/rf/(?P<id>[0-9]+)', ) _TESTS = [ { 'url': 'https://www.ivoox.com/dex-08x3...
```suggestion r'https?://(?:www\.)?ivoox\.com/(?:\w{2}/)?[^/?#]+_rf_(?P<id>[0-9]+)_1\.html', ``` Please also add a test (can be `only_matching`) for the en sub pages: https://www.ivoox.com/en/campodelgas-28-03-2025-audios-mp3_rf_144036942_1.html
from .common import InfoExtractor from ..utils import int_or_none, parse_iso8601, url_or_none, urljoin from ..utils.traversal import traverse_obj class IvooxIE(InfoExtractor): _VALID_URL = ( r'https?://(?:www\.)?ivoox\.com/(?:\w{2}/)?[^/?#]+_rf_(?P<id>[0-9]+)_1\.html', r'https?://go\.ivoox\.com/rf...
@@ -0,0 +1,125 @@ +import datetime +import json + +from .common import InfoExtractor + + +class IvooxIE(InfoExtractor): + _VALID_URL = ( + r'https?://(?:www\.)?ivoox\.com/.*_rf_(?P<id>[0-9]+)_1\.html',
yt_dlp/extractor/ivoox.py
9
Python
0.786
suggestion
256
34
34
false
[ie/ivoox] Add extractor
12,768
yt-dlp/yt-dlp
132,642
Python
seproDev
NeonMan
) _TESTS = [ { 'url': 'https://www.ivoox.com/dex-08x30-rostros-del-mal-los-asesinos-en-audios-mp3_rf_143594959_1.html', 'md5': 'f3cc6b8db8995e0c95604deb6a8f0f2f', 'info_dict': { # For videos, only the 'id' and 'ext' fields are required to RUN the test:...
Those tests seem incomplete. Did you actually run them?
_TESTS = [{ 'url': 'https://www.ivoox.com/dex-08x30-rostros-del-mal-los-asesinos-en-audios-mp3_rf_143594959_1.html', 'md5': '993f712de5b7d552459fc66aa3726885', 'info_dict': { 'id': '143594959', 'ext': 'mp3', 'timestamp': 1742731200, 'channel': ...
@@ -0,0 +1,125 @@ +import datetime +import json + +from .common import InfoExtractor + + +class IvooxIE(InfoExtractor): + _VALID_URL = ( + r'https?://(?:www\.)?ivoox\.com/.*_rf_(?P<id>[0-9]+)_1\.html', + r'https?://go\.ivoox\.com/rf/(?P<id>[0-9]+)', + ) + _TESTS = [ + { + 'url':...
yt_dlp/extractor/ivoox.py
26
Python
0.214
question
55
51
51
false
[ie/ivoox] Add extractor
12,768
yt-dlp/yt-dlp
132,642
Python
seproDev
NeonMan
} metadata_url = f'https://vcore-web.ivoox.com/v1/public/audios/{media_id}/download-url' download_json = self._download_json(metadata_url, media_id, headers=headers) download_url = download_json['data']['downloadUrl'] url = f'https://ivoox.com{download_url}' # Formats ...
We can simplify this by making use of the nuxt data directly and using the `_search_json_ld` helper: ```suggestion data = traverse_obj(self._search_nuxt_data(webpage, media_id), ('data', 'audio')) formats = [] direct_download = self._download_json( f'https://vcore-web.ivoox.co...
from .common import InfoExtractor from ..utils import int_or_none, parse_iso8601, url_or_none, urljoin from ..utils.traversal import traverse_obj class IvooxIE(InfoExtractor): _VALID_URL = ( r'https?://(?:www\.)?ivoox\.com/(?:\w{2}/)?[^/?#]+_rf_(?P<id>[0-9]+)_1\.html', r'https?://go\.ivoox\.com/rf...
@@ -0,0 +1,125 @@ +import datetime +import json + +from .common import InfoExtractor + + +class IvooxIE(InfoExtractor): + _VALID_URL = ( + r'https?://(?:www\.)?ivoox\.com/.*_rf_(?P<id>[0-9]+)_1\.html', + r'https?://go\.ivoox\.com/rf/(?P<id>[0-9]+)', + ) + _TESTS = [ + { + 'url':...
yt_dlp/extractor/ivoox.py
26
Python
0.857
security
2,001
27
79
false
[ie/ivoox] Add extractor
12,768
yt-dlp/yt-dlp
132,642
Python
seproDev
NeonMan
import datetime import json from .common import InfoExtractor class IvooxIE(InfoExtractor): _VALID_URL = ( r'https?://(?:www\.)?ivoox\.com/.*_rf_(?P<id>[0-9]+)_1\.html', r'https?://go\.ivoox\.com/rf/(?P<id>[0-9]+)', ) _TESTS = [ { 'url': 'https://www.ivoox.com/dex-08x3...
```suggestion from .common import InfoExtractor from ..utils import int_or_none, parse_iso8601, url_or_none, urljoin from ..utils.traversal import traverse_obj ```
from .common import InfoExtractor from ..utils import int_or_none, parse_iso8601, url_or_none, urljoin from ..utils.traversal import traverse_obj class IvooxIE(InfoExtractor): _VALID_URL = ( r'https?://(?:www\.)?ivoox\.com/(?:\w{2}/)?[^/?#]+_rf_(?P<id>[0-9]+)_1\.html', r'https?://go\.ivoox\.com/rf...
@@ -0,0 +1,125 @@ +import datetime +import json + +from .common import InfoExtractor
yt_dlp/extractor/ivoox.py
4
Python
0.786
refactor
167
29
29
false
[ie/ivoox] Add extractor
12,768
yt-dlp/yt-dlp
132,642
Python
seproDev
NeonMan
'upload_date': '20250323', 'episode': 'DEx 08x30 Rostros del mal: Los asesinos en serie que aterrorizaron España', 'duration': 11837, 'tags': ['españa', 'asesinos en serie', 'arropiero', 'historia criminal', 'mataviejas'], }, }, { 'url': 'https://go.iv...
2nd traversal is already branching and will return a `list` so we don't need `all` ```suggestion download_paths = { traverse_obj(direct_download, ('data', 'downloadUrl', {str})), *traverse_obj(data, (('downloadUrl', 'mediaUrl'), {str})), } ```
'upload_date': '20250323', 'episode': 'DEx 08x30 Rostros del mal: Los asesinos en serie que aterrorizaron España', 'duration': 11837, 'tags': ['españa', 'asesinos en serie', 'arropiero', 'historia criminal', 'mataviejas'], }, }, { 'url': 'https://go.iv...
@@ -0,0 +1,75 @@ +from .common import InfoExtractor +from ..utils import int_or_none, parse_iso8601, url_or_none, urljoin +from ..utils.traversal import traverse_obj + + +class IvooxIE(InfoExtractor): + _VALID_URL = ( + r'https?://(?:www\.)?ivoox\.com/(?:\w{2}/)?[^/?#]+_rf_(?P<id>[0-9]+)_1\.html', + r'...
yt_dlp/extractor/ivoox.py
26
Python
0.786
suggestion
289
51
51
false
[ie/ivoox] Add extractor
12,768
yt-dlp/yt-dlp
132,642
Python
bashonly
NeonMan
'tags': ['españa', 'asesinos en serie', 'arropiero', 'historia criminal', 'mataviejas'], }, }, { 'url': 'https://go.ivoox.com/rf/143594959', 'only_matching': True, }, { 'url': 'https://www.ivoox.com/en/campodelgas-28-03-2025-audios-mp3_rf_144036942_1.html', 'o...
```suggestion for path in download_paths: ``` should suffice
'tags': ['españa', 'asesinos en serie', 'arropiero', 'historia criminal', 'mataviejas'], }, }, { 'url': 'https://go.ivoox.com/rf/143594959', 'only_matching': True, }, { 'url': 'https://www.ivoox.com/en/campodelgas-28-03-2025-audios-mp3_rf_144036942_1.html', 'o...
@@ -0,0 +1,75 @@ +from .common import InfoExtractor +from ..utils import int_or_none, parse_iso8601, url_or_none, urljoin +from ..utils.traversal import traverse_obj + + +class IvooxIE(InfoExtractor): + _VALID_URL = ( + r'https?://(?:www\.)?ivoox\.com/(?:\w{2}/)?[^/?#]+_rf_(?P<id>[0-9]+)_1\.html', + r'...
yt_dlp/extractor/ivoox.py
26
Python
0.643
suggestion
71
51
51
false
[ie/ivoox] Add extractor
12,768
yt-dlp/yt-dlp
132,642
Python
bashonly
NeonMan
data = traverse_obj(self._search_nuxt_data(webpage, media_id), ('data', 'audio')) direct_download = self._download_json( f'https://vcore-web.ivoox.com/v1/public/audios/{media_id}/download-url', media_id, fatal=False, note='Fetching direct download link', headers={'Referer': url}...
`default` for these too? do we want to warn if we might not even be using these values (since we have the API values we unpack afterward?)
data = self._search_nuxt_data( webpage, media_id, fatal=False, traverse=('data', 0, 'data', 'audio')) direct_download = self._download_json( f'https://vcore-web.ivoox.com/v1/public/audios/{media_id}/download-url', media_id, fatal=False, note='Fetching direct download...
@@ -0,0 +1,75 @@ +from .common import InfoExtractor +from ..utils import int_or_none, parse_iso8601, url_or_none, urljoin +from ..utils.traversal import traverse_obj + + +class IvooxIE(InfoExtractor): + _VALID_URL = ( + r'https?://(?:www\.)?ivoox\.com/(?:\w{2}/)?[^/?#]+_rf_(?P<id>[0-9]+)_1\.html', + r'...
yt_dlp/extractor/ivoox.py
26
Python
0.5
suggestion
138
37
40
false
[ie/ivoox] Add extractor
12,768
yt-dlp/yt-dlp
132,642
Python
bashonly
NeonMan
webpage = self._download_webpage(url, media_id, fatal=False) data = self._search_nuxt_data( webpage, media_id, fatal=False, traverse=('data', 0, 'data', 'audio')) direct_download = self._download_json( f'https://vcore-web.ivoox.com/v1/public/audios/{media_id}/download-u...
```suggestion 'timestamp': parse_iso8601( self._html_search_regex(r'data-prm-pubdate="([^"]+)"', webpage, 'timestamp', default=None)), ```
webpage = self._download_webpage(url, media_id, fatal=False) data = self._search_nuxt_data( webpage, media_id, fatal=False, traverse=('data', 0, 'data', 'audio')) direct_download = self._download_json( f'https://vcore-web.ivoox.com/v1/public/audios/{media_id}/download-u...
@@ -0,0 +1,77 @@ +from .common import InfoExtractor +from ..utils import int_or_none, parse_iso8601, url_or_none, urljoin +from ..utils.traversal import traverse_obj + + +class IvooxIE(InfoExtractor): + _VALID_URL = ( + r'https?://(?:www\.)?ivoox\.com/(?:\w{2}/)?[^/?#]+_rf_(?P<id>[0-9]+)_1\.html', + r'...
yt_dlp/extractor/ivoox.py
26
Python
0.714
suggestion
169
41
42
false
[ie/ivoox] Add extractor
12,768
yt-dlp/yt-dlp
132,642
Python
bashonly
NeonMan
from yt_dlp.utils._utils import UserNotLive from .common import InfoExtractor from ..utils import ( int_or_none, traverse_obj, ) class PartiBaseIE(InfoExtractor): _RECORDING_BASE_URL = 'https://watch.parti.com' _GET_LIVESTREAM_API = 'https://api-backend.parti.com/parti_v2/profile/get_livestream_chan...
Let's match some additional variants to save on potential redirects ```suggestion _VALID_URL = r'https?://(?:www\.)?parti\.com/video/(?P<id>\d+)' ```
from ..utils import UserNotLive, int_or_none, parse_iso8601, url_or_none, urljoin from ..utils.traversal import traverse_obj class PartiBaseIE(InfoExtractor): def _call_api(self, path, video_id, note=None): return self._download_json( f'https://api-backend.parti.com/parti_v2/profile/{path}', v...
@@ -0,0 +1,144 @@ +import datetime + +from yt_dlp.utils._utils import UserNotLive + +from .common import InfoExtractor +from ..utils import ( + int_or_none, + traverse_obj, +) + + +class PartiBaseIE(InfoExtractor): + _RECORDING_BASE_URL = 'https://watch.parti.com' + _GET_LIVESTREAM_API = 'https://api-backen...
yt_dlp/extractor/parti.py
26
Python
0.714
suggestion
156
51
51
false
[ie/parti] Add extractors
12,769
yt-dlp/yt-dlp
132,642
Python
seproDev
benfaerber
def _get_video_info(self, video_id): url = self._GET_LIVESTREAM_API + '/recent/' + video_id data = self._download_json(url, video_id) return traverse_obj(data, { 'channel': ('user_name', {str}), 'thumbnail': ('event_file', {str}), 'categories': ('category...
Imo. no use in using a separate function here ```suggestion def _real_extract(self, url): video_id = self._match_id(url) data = self._call_api(f'get_livestream_channel_info/recent/{video_id}', video_id) formats = self._extract_m3u8_formats( urljoin('https://watch.parti.com'...
}), } class PartiLivestreamIE(PartiBaseIE): IE_NAME = 'parti:livestream' _VALID_URL = r'https?://(?:www\.)?parti\.com/creator/(?P<service>[\w]+)/(?P<id>[\w/-]+)' _TESTS = [{ 'url': 'https://parti.com/creator/parti/Capt_Robs_Adventures', 'info_dict': { 'id': ...
@@ -0,0 +1,144 @@ +import datetime + +from yt_dlp.utils._utils import UserNotLive + +from .common import InfoExtractor +from ..utils import ( + int_or_none, + traverse_obj, +) + + +class PartiBaseIE(InfoExtractor): + _RECORDING_BASE_URL = 'https://watch.parti.com' + _GET_LIVESTREAM_API = 'https://api-backen...
yt_dlp/extractor/parti.py
26
Python
0.857
refactor
839
51
51
false
[ie/parti] Add extractors
12,769
yt-dlp/yt-dlp
132,642
Python
seproDev
benfaerber
import datetime from yt_dlp.utils._utils import UserNotLive from .common import InfoExtractor from ..utils import ( int_or_none, traverse_obj, ) class PartiBaseIE(InfoExtractor): _RECORDING_BASE_URL = 'https://watch.parti.com' _GET_LIVESTREAM_API = 'https://api-backend.parti.com/parti_v2/profile/get...
```suggestion def _call_api(self, path, video_id, note=None): return self._download_json( f'https://api-backend.parti.com/parti_v2/profile/{path}', video_id, note) ```
from .common import InfoExtractor from ..utils import UserNotLive, int_or_none, parse_iso8601, url_or_none, urljoin from ..utils.traversal import traverse_obj class PartiBaseIE(InfoExtractor): def _call_api(self, path, video_id, note=None): return self._download_json( f'https://api-backend.par...
@@ -0,0 +1,144 @@ +import datetime + +from yt_dlp.utils._utils import UserNotLive + +from .common import InfoExtractor +from ..utils import ( + int_or_none, + traverse_obj, +) + + +class PartiBaseIE(InfoExtractor): + _RECORDING_BASE_URL = 'https://watch.parti.com' + _GET_LIVESTREAM_API = 'https://api-backen...
yt_dlp/extractor/parti.py
21
Python
0.714
suggestion
195
46
46
false
[ie/parti] Add extractors
12,769
yt-dlp/yt-dlp
132,642
Python
seproDev
benfaerber
'thumbnail': ('event_file', {str}), 'categories': ('category', {lambda c: [c]}), 'url': ('livestream_recording', {str}), 'title': ('event_title', {str}), 'upload_date': ('event_start_ts', {lambda ts: datetime.date.fromtimestamp(ts).strftime('%Y%m%d')}), ...
There are other URL patterns as well such as `twitter`. We also need to know the service for the `get_user_by_social_media` request ```suggestion _VALID_URL = r'https?://(?:www\.)?parti\.com/creator/(?P<service>[\w]+)/(?P<id>[\w/-]+)' ``` There are additionally URLs such as `https://parti.com/creator/discord/si...
_VALID_URL = r'https?://(?:www\.)?parti\.com/creator/(?P<service>[\w]+)/(?P<id>[\w/-]+)' _TESTS = [{ 'url': 'https://parti.com/creator/parti/Capt_Robs_Adventures', 'info_dict': { 'id': 'Capt_Robs_Adventures', 'ext': 'mp4', 'title': r"re:I'm Live on Parti \d{4}...
@@ -0,0 +1,144 @@ +import datetime + +from yt_dlp.utils._utils import UserNotLive + +from .common import InfoExtractor +from ..utils import ( + int_or_none, + traverse_obj, +) + + +class PartiBaseIE(InfoExtractor): + _RECORDING_BASE_URL = 'https://watch.parti.com' + _GET_LIVESTREAM_API = 'https://api-backen...
yt_dlp/extractor/parti.py
26
Python
0.857
suggestion
379
51
51
false
[ie/parti] Add extractors
12,769
yt-dlp/yt-dlp
132,642
Python
seproDev
benfaerber
'categories': list, 'thumbnail': str, 'channel': str, }, 'params': {'skip_download': 'm3u8'}, }, ] def _get_video_info(self, video_id): url = self._GET_LIVESTREAM_API + '/recent/' + video_id data = self._download_js...
Please add an `only_matching` test for the discord URL
urljoin('https://watch.parti.com', data['livestream_recording']), video_id, 'mp4'), **traverse_obj(data, { 'title': ('event_title', {str}), 'channel': ('user_name', {str}), 'thumbnail': ('event_file', {url_or_none}), 'categories...
@@ -0,0 +1,144 @@ +import datetime + +from yt_dlp.utils._utils import UserNotLive + +from .common import InfoExtractor +from ..utils import ( + int_or_none, + traverse_obj, +) + + +class PartiBaseIE(InfoExtractor): + _RECORDING_BASE_URL = 'https://watch.parti.com' + _GET_LIVESTREAM_API = 'https://api-backen...
yt_dlp/extractor/parti.py
26
Python
0.357
suggestion
54
51
51
false
[ie/parti] Add extractors
12,769
yt-dlp/yt-dlp
132,642
Python
seproDev
benfaerber
return { 'url': url, **extracted, } def _real_extract(self, url): creator = self._match_id(url) creator_id = self._get_creator_id(creator) playback_data = self._get_live_playback_data(creator_id) if not playback_data['is_live']: r...
I would again simplify this in to a single function. One change of note for discord URLs we need to replace the `/` as `%23` (url encoded #) You can also directly pass the timestamp in the info dict. The core code will then populate the `upload_date` ```suggestion def _real_extract(self, url): servic...
from .common import InfoExtractor from ..utils import UserNotLive, int_or_none, parse_iso8601, url_or_none, urljoin from ..utils.traversal import traverse_obj class PartiBaseIE(InfoExtractor): def _call_api(self, path, video_id, note=None): return self._download_json( f'https://api-backend.par...
@@ -0,0 +1,144 @@ +import datetime + +from yt_dlp.utils._utils import UserNotLive + +from .common import InfoExtractor +from ..utils import ( + int_or_none, + traverse_obj, +) + + +class PartiBaseIE(InfoExtractor): + _RECORDING_BASE_URL = 'https://watch.parti.com' + _GET_LIVESTREAM_API = 'https://api-backen...
yt_dlp/extractor/parti.py
26
Python
0.857
security
1,904
27
102
false
[ie/parti] Add extractors
12,769
yt-dlp/yt-dlp
132,642
Python
seproDev
benfaerber
import datetime from yt_dlp.utils._utils import UserNotLive from .common import InfoExtractor from ..utils import ( int_or_none, traverse_obj, ) class PartiBaseIE(InfoExtractor): _RECORDING_BASE_URL = 'https://watch.parti.com' _GET_LIVESTREAM_API = 'https://api-backend.parti.com/parti_v2/profile/get...
Not sure why you went with different styles of imports here ```suggestion from .common import InfoExtractor from ..utils import UserNotLive, int_or_none, parse_iso8601, url_or_none, urljoin from ..utils.traversal import require, traverse_obj ```
from .common import InfoExtractor from ..utils import UserNotLive, int_or_none, parse_iso8601, url_or_none, urljoin from ..utils.traversal import traverse_obj class PartiBaseIE(InfoExtractor): def _call_api(self, path, video_id, note=None): return self._download_json( f'https://api-backend.par...
@@ -0,0 +1,144 @@ +import datetime + +from yt_dlp.utils._utils import UserNotLive + +from .common import InfoExtractor +from ..utils import ( + int_or_none, + traverse_obj, +)
yt_dlp/extractor/parti.py
9
Python
0.857
refactor
250
34
34
false
[ie/parti] Add extractors
12,769
yt-dlp/yt-dlp
132,642
Python
seproDev
benfaerber
def _real_extract(self, url): service, creator_slug = self._match_valid_url(url).group('service', 'id') encoded_creator_slug = creator_slug.replace('/', '%23') creator_id = self._call_api( f'get_user_by_social_media/{service}/{encoded_creator_slug}', creator_slug, n...
If both the url and token are required, we don't need the traversal/arbitrary dict here, we can just let the KeyErrors rip ```suggestion channel_info = data['channel'] formats = self._extract_m3u8_formats( channel_info['playback_url'], creator_slug, live=True, query={ 't...
data = self._call_api( f'get_livestream_channel_info/{creator_id}', creator_id, note='Fetching user profile feed')['channel_info'] if not traverse_obj(data, ('channel', 'is_live', {bool})): raise UserNotLive(video_id=creator_id) channel_info = data['channel...
@@ -0,0 +1,114 @@ + +from .common import InfoExtractor +from ..utils import UserNotLive, int_or_none, parse_iso8601, url_or_none, urljoin +from ..utils.traversal import require, traverse_obj + + +class PartiBaseIE(InfoExtractor): + def _call_api(self, path, video_id, note=None): + return self._download_json( ...
yt_dlp/extractor/parti.py
26
Python
1
security
429
40
27
false
[ie/parti] Add extractors
12,769
yt-dlp/yt-dlp
132,642
Python
bashonly
benfaerber
'upload_date': '20250327', 'is_live': False, 'categories': ['Gaming'], 'thumbnail': 'https://assets.parti.com/351424_eb9e5250-2821-484a-9c5f-ca99aa666c87.png', 'channel': 'ItZTMGG', 'timestamp': 1743044379, }, ...
`filter` before `all` to filter out empty strings. You can also `filter` after `all` to filter out empty lists, but it's not necessary ```suggestion 'categories': ('category_name', {str}, filter, all), ```
'thumbnail': 'https://assets.parti.com/351424_eb9e5250-2821-484a-9c5f-ca99aa666c87.png', 'channel': 'ItZTMGG', 'timestamp': 1743044379, }, 'params': {'skip_download': 'm3u8'}, }] def _real_extract(self, url): video_id = self._match_id(url) dat...
@@ -0,0 +1,113 @@ + +from .common import InfoExtractor +from ..utils import UserNotLive, int_or_none, parse_iso8601, url_or_none, urljoin +from ..utils.traversal import traverse_obj + + +class PartiBaseIE(InfoExtractor): + def _call_api(self, path, video_id, note=None): + return self._download_json( + ...
yt_dlp/extractor/parti.py
26
Python
0.786
suggestion
224
51
51
false
[ie/parti] Add extractors
12,769
yt-dlp/yt-dlp
132,642
Python
bashonly
benfaerber
{ 'url': 'https://parti.com/video/66284', 'info_dict': { 'id': '66284', 'ext': 'mp4', 'title': 'NOW LIVE ', 'upload_date': '20250327', 'is_live': False, 'categories': ['Gaming'], ...
```suggestion return { 'id': video_id, 'formats': self._extract_m3u8_formats( urljoin('https://watch.parti.com', data['livestream_recording']), video_id, 'mp4'), ```
'info_dict': { 'id': '66284', 'ext': 'mp4', 'title': 'NOW LIVE ', 'upload_date': '20250327', 'categories': ['Gaming'], 'thumbnail': 'https://assets.parti.com/351424_eb9e5250-2821-484a-9c5f-ca99aa666c87.png', 'channel': 'ItZTMGG'...
@@ -0,0 +1,113 @@ + +from .common import InfoExtractor +from ..utils import UserNotLive, int_or_none, parse_iso8601, url_or_none, urljoin +from ..utils.traversal import traverse_obj + + +class PartiBaseIE(InfoExtractor): + def _call_api(self, path, video_id, note=None): + return self._download_json( + ...
yt_dlp/extractor/parti.py
26
Python
0.857
refactor
220
51
51
false
[ie/parti] Add extractors
12,769
yt-dlp/yt-dlp
132,642
Python
bashonly
benfaerber
def _real_extract(self, url): service, creator_slug = self._match_valid_url(url).group('service', 'id') encoded_creator_slug = creator_slug.replace('/', '%23') creator_id = self._call_api( f'get_user_by_social_media/{service}/{encoded_creator_slug}', creator_slug, n...
```suggestion return { 'id': creator_slug, 'formats': self._extract_m3u8_formats( channel_info['playback_url'], creator_slug, live=True, query={ 'token': channel_info['playback_auth_token'], 'player_version': '1.17.0', ...
from .common import InfoExtractor from ..utils import UserNotLive, int_or_none, parse_iso8601, url_or_none, urljoin from ..utils.traversal import traverse_obj class PartiBaseIE(InfoExtractor): def _call_api(self, path, video_id, note=None): return self._download_json( f'https://api-backend.par...
@@ -0,0 +1,113 @@ + +from .common import InfoExtractor +from ..utils import UserNotLive, int_or_none, parse_iso8601, url_or_none, urljoin +from ..utils.traversal import traverse_obj + + +class PartiBaseIE(InfoExtractor): + def _call_api(self, path, video_id, note=None): + return self._download_json( + ...
yt_dlp/extractor/parti.py
26
Python
0.857
security
340
36
102
false
[ie/parti] Add extractors
12,769
yt-dlp/yt-dlp
132,642
Python
bashonly
benfaerber
'continuation': continuation, } # TODO: Inconsistency with clickTrackingParams. # Currently we have a fixed ctp contained within context (from ytcfg) # and a ctp in root query for continuation. if ctp: query['clickTracking'] = {'clickTrackingParams': ctp} ...
```suggestion continuation_commands = traverse_obj( continuation_ep, ('commandExecutorCommand', 'commands', ..., {dict})) ```
'continuation': continuation, } # TODO: Inconsistency with clickTrackingParams. # Currently we have a fixed ctp contained within context (from ytcfg) # and a ctp in root query for continuation. if ctp: query['clickTracking'] = {'clickTrackingParams': ctp} ...
@@ -803,13 +803,17 @@ def _extract_next_continuation_data(cls, renderer): @classmethod def _extract_continuation_ep_data(cls, continuation_ep: dict): - if isinstance(continuation_ep, dict): - continuation = try_get( - continuation_ep, lambda x: x['continuationCommand']['toke...
yt_dlp/extractor/youtube/_base.py
26
Python
0.714
suggestion
148
51
51
false
[ie/youtube] Fix playlist continuation extraction
12,777
yt-dlp/yt-dlp
132,642
Python
bashonly
coletdjnz
@classmethod def _extract_next_continuation_data(cls, renderer): next_continuation = try_get( renderer, (lambda x: x['continuations'][0]['nextContinuationData'], lambda x: x['continuation']['reloadContinuationData']), dict) if not next_continuation: ...
```suggestion continuation = traverse_obj(command, ('continuationCommand', 'token', {str})) if not continuation: continue ctp = command.get('clickTrackingParams') return cls._build_api_continuation_query(continuation, ctp) ```
@classmethod def _extract_next_continuation_data(cls, renderer): next_continuation = try_get( renderer, (lambda x: x['continuations'][0]['nextContinuationData'], lambda x: x['continuation']['reloadContinuationData']), dict) if not next_continuation: ...
@@ -803,13 +803,17 @@ def _extract_next_continuation_data(cls, renderer): @classmethod def _extract_continuation_ep_data(cls, continuation_ep: dict): - if isinstance(continuation_ep, dict): - continuation = try_get( - continuation_ep, lambda x: x['continuationCommand']['toke...
yt_dlp/extractor/youtube/_base.py
26
Python
0.786
suggestion
296
51
51
false
[ie/youtube] Fix playlist continuation extraction
12,777
yt-dlp/yt-dlp
132,642
Python
bashonly
coletdjnz
filesystem.add_option( '--no-force-overwrites', action='store_const', dest='overwrites', const=None, help='Do not overwrite the video, but overwrite related files (default)') filesystem.add_option( '-c', '--continue', action='store_true', dest='continue_dl', default=True,...
need to move ` (default)` to `--no-mtime` ```suggestion help='Use the Last-modified header to set the file modification time') ```
filesystem.add_option( '--no-force-overwrites', action='store_const', dest='overwrites', const=None, help='Do not overwrite the video, but overwrite related files (default)') filesystem.add_option( '-c', '--continue', action='store_true', dest='continue_dl', default=True,...
@@ -1421,7 +1422,7 @@ def _alias_callback(option, opt_str, value, parser, opts, nargs): help='Do not use .part files - write directly into output file') filesystem.add_option( '--mtime', - action='store_true', dest='updatetime', default=True, + action='store_true', dest='updatetime'...
yt_dlp/options.py
26
Python
0.786
suggestion
141
51
51
false
No longer enable `--mtime` by default
12,781
yt-dlp/yt-dlp
132,642
Python
bashonly
seproDev
HEADRequest('https://sbs-vod-prod-01.akamaized.net/'), video_id, note='Checking geo-restriction', fatal=False, expected_status=403) if urlh: error_reasons = urlh.headers.get_all('x-error-reason') or [] if 'geo-blocked' in error_reasons: ...
Isn't this problematic if there are multiple forced subtitles for the same language?
HEADRequest('https://sbs-vod-prod-01.akamaized.net/'), video_id, note='Checking geo-restriction', fatal=False, expected_status=403) if urlh: error_reasons = urlh.headers.get_all('x-error-reason') or [] if 'geo-blocked' in error_reasons: ...
@@ -122,6 +122,14 @@ def _real_extract(self, url): if traverse_obj(media, ('partOfSeries', {dict})): media['epName'] = traverse_obj(media, ('title', {str})) + # Need to set different language for forced subs or else they have priority over full subs + fixed_subtitles = {} + ...
yt_dlp/extractor/sbs.py
26
Python
0.214
question
84
51
51
false
[ie/sbs] Fix subtitles extraction
12,785
yt-dlp/yt-dlp
132,642
Python
seproDev
bashonly
from .common import InfoExtractor class FrancaisFacileIE(InfoExtractor): _VALID_URL = r'https?:\/\/francaisfacile\.rfi\.fr\/fr\/(actualit%C3%A9|podcasts\/[^\/]+)\/(?P<id>\d+)-.*' IE_NAME = 'francaisfacile' _TESTS = [ { 'url': 'https://francaisfacile.rfi.fr/fr/podcasts/un-mot-une-histoi...
```suggestion _VALID_URL = r'https?://francaisfacile\.rfi\.fr/fr/(actualit%C3%A9|podcasts/[^/#?]+)/(?P<id>\d+)-' ```
import urllib.parse from .common import InfoExtractor from ..networking.exceptions import HTTPError from ..utils import ( ExtractorError, float_or_none, url_or_none, ) from ..utils.traversal import traverse_obj class FrancaisFacileIE(InfoExtractor): _VALID_URL = r'https?://francaisfacile\.rfi\.fr/[a-...
@@ -0,0 +1,50 @@ +from .common import InfoExtractor + + +class FrancaisFacileIE(InfoExtractor): + _VALID_URL = r'https?:\/\/francaisfacile\.rfi\.fr\/fr\/(actualit%C3%A9|podcasts\/[^\/]+)\/(?P<id>\d+)-.*'
yt_dlp/extractor/francaisfacile.py
5
Python
0.857
suggestion
122
30
30
false
[ie/francaisfacile] Add extractor
12,787
yt-dlp/yt-dlp
132,642
Python
seproDev
mlabeeb03
{ 'url': 'https://francaisfacile.rfi.fr/fr/actualit%C3%A9/20250307-argentine-le-sac-d-un-alpiniste-retrouv%C3%A9-40-ans-apr%C3%A8s-sa-mort', 'md5': 'b8c3a63652d4ae8e8092dda5700c1cd9', 'info_dict': { 'id': '20250307', 'title': 'Argentine: le sac...
Title extraction does not need to be fatal and can be inlined below.
'info_dict': { 'id': 'WBMZ58952-FLE-FR-20250305', 'display_id': '20250305-réconcilier-les-jeunes-avec-la-lecture-grâce-aux-réseaux-sociaux', 'title': 'Réconcilier les jeunes avec la lecture grâce aux réseaux sociaux', 'url': 'https://aod-fle.akamaized.net/fle/soun...
@@ -0,0 +1,50 @@ +from .common import InfoExtractor + + +class FrancaisFacileIE(InfoExtractor): + _VALID_URL = r'https?:\/\/francaisfacile\.rfi\.fr\/fr\/(actualit%C3%A9|podcasts\/[^\/]+)\/(?P<id>\d+)-.*' + IE_NAME = 'francaisfacile' + _TESTS = [ + { + 'url': 'https://francaisfacile.rfi.fr/fr/...
yt_dlp/extractor/francaisfacile.py
26
Python
0.286
refactor
68
34
51
false
[ie/francaisfacile] Add extractor
12,787
yt-dlp/yt-dlp
132,642
Python
seproDev
mlabeeb03
'url': 'https://francaisfacile.rfi.fr/fr/actualit%C3%A9/20250307-argentine-le-sac-d-un-alpiniste-retrouv%C3%A9-40-ans-apr%C3%A8s-sa-mort', 'md5': 'b8c3a63652d4ae8e8092dda5700c1cd9', 'info_dict': { 'id': '20250307', 'title': 'Argentine: le sac d\'un alp...
Instead of blindly searching for a URL that looks like this I would extract the actual json data: ```suggestion data = self._search_json( r'<script[^>]+\bdata-media-id=[^>]+\btype="application/json"[^>]*>', webpage, 'audio data', audio_id) ``` This should be more resistant towards ...
'id': 'WBMZ58952-FLE-FR-20250305', 'display_id': '20250305-réconcilier-les-jeunes-avec-la-lecture-grâce-aux-réseaux-sociaux', 'title': 'Réconcilier les jeunes avec la lecture grâce aux réseaux sociaux', 'url': 'https://aod-fle.akamaized.net/fle/sounds/fr/2025/03/05/6b6af5...
@@ -0,0 +1,50 @@ +from .common import InfoExtractor + + +class FrancaisFacileIE(InfoExtractor): + _VALID_URL = r'https?:\/\/francaisfacile\.rfi\.fr\/fr\/(actualit%C3%A9|podcasts\/[^\/]+)\/(?P<id>\d+)-.*' + IE_NAME = 'francaisfacile' + _TESTS = [ + { + 'url': 'https://francaisfacile.rfi.fr/fr/...
yt_dlp/extractor/francaisfacile.py
26
Python
1
refactor
331
33
51
false
[ie/francaisfacile] Add extractor
12,787
yt-dlp/yt-dlp
132,642
Python
seproDev
mlabeeb03
'ext': 'mp3', }, }, { 'url': 'https://francaisfacile.rfi.fr/fr/actualit%C3%A9/20250305-r%C3%A9concilier-les-jeunes-avec-la-lecture-gr%C3%A2ce-aux-r%C3%A9seaux-sociaux', 'md5': '4f33674cb205744345cc835991100afa', 'info_dict': { ...
With the json data we can now extract some info. Additionally I would use the json ld data as a fallback: ```suggestion return { 'id': audio_id, 'title': self._html_extract_title(webpage), **self._search_json_ld(webpage, audio_id, fatal=False), **traverse_ob...
'duration': 103.15, 'timestamp': 1741177984, 'upload_date': '20250305', }, }, { 'url': 'https://francaisfacile.rfi.fr/fr/actualit%C3%A9/20250307-argentine-le-sac-d-un-alpiniste-retrouv%C3%A9-40-ans-apr%C3%A8s-sa-mort', 'md5': 'b8c3a63652d4ae8e8092dda5700c1...
@@ -0,0 +1,50 @@ +from .common import InfoExtractor + + +class FrancaisFacileIE(InfoExtractor): + _VALID_URL = r'https?:\/\/francaisfacile\.rfi\.fr\/fr\/(actualit%C3%A9|podcasts\/[^\/]+)\/(?P<id>\d+)-.*' + IE_NAME = 'francaisfacile' + _TESTS = [ + { + 'url': 'https://francaisfacile.rfi.fr/fr/...
yt_dlp/extractor/francaisfacile.py
26
Python
0.857
refactor
556
27
51
false
[ie/francaisfacile] Add extractor
12,787
yt-dlp/yt-dlp
132,642
Python
seproDev
mlabeeb03
from .common import InfoExtractor class FrancaisFacileIE(InfoExtractor): _VALID_URL = r'https?:\/\/francaisfacile\.rfi\.fr\/fr\/(actualit%C3%A9|podcasts\/[^\/]+)\/(?P<id>\d+)-.*' IE_NAME = 'francaisfacile' _TESTS = [ { 'url': 'https://francaisfacile.rfi.fr/fr/podcasts/un-mot-une-histoi...
```suggestion from .common import InfoExtractor from ..utils import float_or_none, url_or_none from ..utils.traversal import traverse_obj ```
import urllib.parse from .common import InfoExtractor from ..networking.exceptions import HTTPError from ..utils import ( ExtractorError, float_or_none, url_or_none, ) from ..utils.traversal import traverse_obj class FrancaisFacileIE(InfoExtractor): _VALID_URL = r'https?://francaisfacile\.rfi\.fr/[a-...
@@ -0,0 +1,50 @@ +from .common import InfoExtractor
yt_dlp/extractor/francaisfacile.py
3
Python
0.786
refactor
145
28
28
false
[ie/francaisfacile] Add extractor
12,787
yt-dlp/yt-dlp
132,642
Python
seproDev
mlabeeb03
from .common import InfoExtractor from ..utils import float_or_none, url_or_none from ..utils.traversal import traverse_obj class FrancaisFacileIE(InfoExtractor): _VALID_URL = r'https?://francaisfacile\.rfi\.fr/fr/(actualit%C3%A9|podcasts/[^/#?]+)/(?P<id>\d+)-' IE_NAME = 'francaisfacile' _TESTS = [{ ...
Are we sure this ID will be unique? There's only ever one podcast/post per day?
import urllib.parse from .common import InfoExtractor from ..networking.exceptions import HTTPError from ..utils import ( ExtractorError, float_or_none, url_or_none, ) from ..utils.traversal import traverse_obj class FrancaisFacileIE(InfoExtractor): _VALID_URL = r'https?://francaisfacile\.rfi\.fr/[a-...
@@ -0,0 +1,68 @@ +from .common import InfoExtractor +from ..utils import float_or_none, url_or_none +from ..utils.traversal import traverse_obj + + +class FrancaisFacileIE(InfoExtractor): + _VALID_URL = r'https?://francaisfacile\.rfi\.fr/fr/(actualit%C3%A9|podcasts/[^/#?]+)/(?P<id>\d+)-' + IE_NAME = 'francaisfaci...
yt_dlp/extractor/francaisfacile.py
13
Python
0.357
question
79
38
38
false
[ie/francaisfacile] Add extractor
12,787
yt-dlp/yt-dlp
132,642
Python
bashonly
mlabeeb03
'title': 'Réconcilier les jeunes avec la lecture grâce aux réseaux sociaux', 'url': 'https://aod-fle.akamaized.net/fle/sounds/fr/2025/03/05/6b6af52a-f9ba-11ef-a1f8-005056a97652.mp3', 'ext': 'mp3', 'description': 'md5:b903c63d8585bd59e8cc4d5f80c4272d', 'duratio...
what if there is a `podcasts` and an `actualit%C3%A9` link with the same date?
_VALID_URL = r'https?://francaisfacile\.rfi\.fr/[a-z]{2}/(?:actualit%C3%A9|podcasts/[^/#?]+)/(?P<id>[^/#?]+)' _TESTS = [{ 'url': 'https://francaisfacile.rfi.fr/fr/actualit%C3%A9/20250305-r%C3%A9concilier-les-jeunes-avec-la-lecture-gr%C3%A2ce-aux-r%C3%A9seaux-sociaux', 'md5': '4f33674cb205744345c...
@@ -0,0 +1,68 @@ +from .common import InfoExtractor +from ..utils import float_or_none, url_or_none +from ..utils.traversal import traverse_obj + + +class FrancaisFacileIE(InfoExtractor): + _VALID_URL = r'https?://francaisfacile\.rfi\.fr/fr/(actualit%C3%A9|podcasts/[^/#?]+)/(?P<id>\d+)-' + IE_NAME = 'francaisfaci...
yt_dlp/extractor/francaisfacile.py
26
Python
0.5
question
78
51
51
false
[ie/francaisfacile] Add extractor
12,787
yt-dlp/yt-dlp
132,642
Python
bashonly
mlabeeb03
from .common import InfoExtractor from ..utils import float_or_none, url_or_none from ..utils.traversal import traverse_obj class FrancaisFacileIE(InfoExtractor): _VALID_URL = r'https?://francaisfacile\.rfi\.fr/fr/(actualit%C3%A9|podcasts/[^/#?]+)/(?P<id>\d+)-' IE_NAME = 'francaisfacile' _TESTS = [{ ...
```suggestion _VALID_URL = r'https?://francaisfacile\.rfi\.fr/fr/(actualit%C3%A9|podcasts/[^/#?]+)/(?P<id>[^/#?]+)' ```
import urllib.parse from .common import InfoExtractor from ..networking.exceptions import HTTPError from ..utils import ( ExtractorError, float_or_none, url_or_none, ) from ..utils.traversal import traverse_obj class FrancaisFacileIE(InfoExtractor): _VALID_URL = r'https?://francaisfacile\.rfi\.fr/[a-...
@@ -0,0 +1,68 @@ +from .common import InfoExtractor +from ..utils import float_or_none, url_or_none +from ..utils.traversal import traverse_obj + + +class FrancaisFacileIE(InfoExtractor): + _VALID_URL = r'https?://francaisfacile\.rfi\.fr/fr/(actualit%C3%A9|podcasts/[^/#?]+)/(?P<id>\d+)-'
yt_dlp/extractor/francaisfacile.py
7
Python
0.857
suggestion
125
32
32
false
[ie/francaisfacile] Add extractor
12,787
yt-dlp/yt-dlp
132,642
Python
bashonly
mlabeeb03
'ext': 'mp3', 'description': 'md5:7fd088fbdf4a943bb68cf82462160dca', 'duration': 117.74, 'timestamp': 1741352789, 'upload_date': '20250307', }, }, { 'url': 'https://francaisfacile.rfi.fr/fr/podcasts/un-mot-une-histoire/20250317-le-mot-de-da...
```suggestion display_id = self._match_id(url) try: # yt-dlp's default user-agents are too old and blocked by the site webpage = self._download_webpage(url, display_id, headers={ 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; rv:136.0) Gecko/20100101 Firefox/136.0', ...
}, { 'url': 'https://francaisfacile.rfi.fr/fr/actualit%C3%A9/20250307-argentine-le-sac-d-un-alpiniste-retrouv%C3%A9-40-ans-apr%C3%A8s-sa-mort', 'md5': 'b8c3a63652d4ae8e8092dda5700c1cd9', 'info_dict': { 'id': 'WBMZ59102-FLE-FR-20250307', 'display_id': '20250307-argenti...
@@ -0,0 +1,68 @@ +from .common import InfoExtractor +from ..utils import float_or_none, url_or_none +from ..utils.traversal import traverse_obj + + +class FrancaisFacileIE(InfoExtractor): + _VALID_URL = r'https?://francaisfacile\.rfi\.fr/fr/(actualit%C3%A9|podcasts/[^/#?]+)/(?P<id>\d+)-' + IE_NAME = 'francaisfaci...
yt_dlp/extractor/francaisfacile.py
26
Python
1
refactor
624
41
51
false
[ie/francaisfacile] Add extractor
12,787
yt-dlp/yt-dlp
132,642
Python
bashonly
mlabeeb03