before_code
stringlengths
14
465k
reviewer_comment
stringlengths
16
64.5k
after_code
stringlengths
9
467k
diff_context
stringlengths
0
97k
file_path
stringlengths
5
226
comment_line
int32
0
26
language
stringclasses
37 values
quality_score
float32
0.07
1
comment_type
stringclasses
9 values
comment_length
int32
16
64.5k
before_lines
int32
1
17.2k
after_lines
int32
1
12.1k
is_negative
bool
2 classes
pr_title
stringlengths
1
308
pr_number
int32
1
299k
repo_name
stringclasses
533 values
repo_stars
int64
321
419k
repo_language
stringclasses
27 values
reviewer_username
stringlengths
0
39
author_username
stringlengths
2
39
import re from urllib import parse from .common import InfoExtractor from ..utils import ( extract_attributes, unified_timestamp, url_or_none, ) from ..utils.traversal import traverse_obj class N1InfoAssetIE(InfoExtractor): _VALID_URL = r'https?://best-vod\.umn\.cdn\.united\.cloud/stream\?asset=(?P<i...
```suggestion import urllib.parse ```
import re import urllib.parse from .common import InfoExtractor from ..utils import ( extract_attributes, unified_timestamp, url_or_none, ) from ..utils.traversal import traverse_obj class N1InfoAssetIE(InfoExtractor): _VALID_URL = r'https?://best-vod\.umn\.cdn\.united\.cloud/stream\?asset=(?P<id>[^&...
@@ -1,4 +1,5 @@ import re +from urllib import parse
yt_dlp/extractor/n1.py
2
Python
0.429
suggestion
39
27
27
false
[ie/N1Info:article] Fix extractor
13,865
yt-dlp/yt-dlp
132,642
Python
bashonly
u-spec-png
'timestamp': timestamp, 'thumbnail': self._html_search_meta('thumbnailURL', webpage), 'formats': self._extract_m3u8_formats( f'https://cdn-uc.brid.tv/live/partners/{site_id}/streaming/{video_id}/{video_id}.m3u8', ...
```suggestion hostname = urllib.parse.urlparse(url).hostname ```
'title': title, 'timestamp': timestamp, 'thumbnail': self._html_search_meta('thumbnailURL', webpage), 'formats': self._extract_m3u8_formats( f'https://cdn-uc.brid.tv/live/partners/{site_id}/streaming/{video_id}/{vide...
@@ -191,10 +182,13 @@ def _real_extract(self, url): for embedded_video in embedded_videos: video_data = extract_attributes(embedded_video) url = video_data.get('src') or '' - if url.startswith('https://www.youtube.com'): + hostname = parse.urlparse(url).hostname
yt_dlp/extractor/n1.py
26
Python
0.571
suggestion
78
41
42
false
[ie/N1Info:article] Fix extractor
13,865
yt-dlp/yt-dlp
132,642
Python
bashonly
u-spec-png
'url': 'https://n1info.rs/vesti/vuciceva-turneja-po-srbiji-najavljuje-kontrarevoluciju-preti-svom-narodu-vredja-novinare/', 'info_dict': { 'id': '2025974', 'ext': 'mp4', 'title': 'Vučićeva turneja po Srbiji: Najavljuje kontrarevoluciju, preti svom narodu, vređa novina...
gives nicer errors ```suggestion site_id = self._search_regex( r'partners/(\d+)', self._html_search_meta('contentUrl', webpage, fatal=True), 'site ID') ```
'url': 'https://n1info.rs/vesti/vuciceva-turneja-po-srbiji-najavljuje-kontrarevoluciju-preti-svom-narodu-vredja-novinare/', 'info_dict': { 'id': '2025974', 'ext': 'mp4', 'title': 'Vučićeva turneja po Srbiji: Najavljuje kontrarevoluciju, preti svom narodu, vređa novina...
@@ -155,12 +144,14 @@ def _real_extract(self, url): video_id = self._match_id(url) webpage = self._download_webpage(url, video_id) - title = self._html_search_regex(r'<h1[^>]+>(.+?)</h1>', webpage, 'title') - timestamp = unified_timestamp(self._html_search_meta('article:published_time'...
yt_dlp/extractor/n1.py
26
Python
0.857
suggestion
195
51
51
false
[ie/N1Info:article] Fix extractor
13,865
yt-dlp/yt-dlp
132,642
Python
bashonly
u-spec-png
if streaks_id and not streaks_id.startswith('ref:'): streaks_id = f'ref:{streaks_id}' # Deprecated Brightcove extraction reachable w/extractor-arg or fallback; errors are expected if backend == 'brightcove' or not streaks_id: if backend != 'brightcove': s...
```suggestion **self._extract_from_streaks_api(project_id, streaks_id, { ```
streaks_id = traverse_obj(video_info, ('streaks', 'videoRefID', {str})) if streaks_id and not streaks_id.startswith('ref:'): streaks_id = f'ref:{streaks_id}' # Deprecated Brightcove extraction reachable w/extractor-arg or fallback; errors are expected if backend == 'brightco...
@@ -223,10 +229,14 @@ def _real_extract(self, url): 'ie_key': 'BrightcoveNew', } + project_id = traverse_obj(video_info, ('streaks', 'projectID', {str}, {require('project ID')})) + key_idx = dt.datetime.now(tz=dt.timezone.utc).month % 6 or 6 + return { ...
yt_dlp/extractor/tver.py
26
Python
0.643
refactor
90
35
36
false
[ie/TVer] Extract Streaks API info
13,885
yt-dlp/yt-dlp
132,642
Python
bashonly
bashonly
brightcove_id = f'ref:{brightcove_id}' streaks_id = traverse_obj(video_info, ('streaks', 'videoRefID', {str})) if streaks_id and not streaks_id.startswith('ref:'): streaks_id = f'ref:{streaks_id}' # Deprecated Brightcove extraction reachable w/extractor-arg or fallback;...
since the JS uses `getMonth` rather than `getUTCMonth`, do we really need `tz=dt.timezone.utc`?
if brightcove_id and not brightcove_id.isdecimal(): brightcove_id = f'ref:{brightcove_id}' streaks_id = traverse_obj(video_info, ('streaks', 'videoRefID', {str})) if streaks_id and not streaks_id.startswith('ref:'): streaks_id = f'ref:{streaks_id}' # Deprecated ...
@@ -223,10 +229,14 @@ def _real_extract(self, url): 'ie_key': 'BrightcoveNew', } + project_id = video_info['streaks']['projectID'] + key_idx = dt.datetime.now(tz=dt.timezone.utc).month % 6 or 6
yt_dlp/extractor/tver.py
26
Python
0.429
question
95
38
39
false
[ie/TVer] Extract Streaks API info
13,885
yt-dlp/yt-dlp
132,642
Python
doe1080
bashonly
brightcove_id = f'ref:{brightcove_id}' streaks_id = traverse_obj(video_info, ('streaks', 'videoRefID', {str})) if streaks_id and not streaks_id.startswith('ref:'): streaks_id = f'ref:{streaks_id}' # Deprecated Brightcove extraction reachable w/extractor-arg or fallback;...
```suggestion key_idx = dt.datetime.utcfromtimestamp(time_seconds(hours=9)).month % 6 or 6 ```
brightcove_id = f'ref:{brightcove_id}' streaks_id = traverse_obj(video_info, ('streaks', 'videoRefID', {str})) if streaks_id and not streaks_id.startswith('ref:'): streaks_id = f'ref:{streaks_id}' # Deprecated Brightcove extraction reachable w/extractor-arg or fallback;...
@@ -223,10 +230,14 @@ def _real_extract(self, url): 'ie_key': 'BrightcoveNew', } + project_id = video_info['streaks']['projectID'] + key_idx = dt.datetime.fromtimestamp(time_seconds(hours=9)).month % 6 or 6
yt_dlp/extractor/tver.py
26
Python
0.714
suggestion
104
38
38
false
[ie/TVer] Extract Streaks API info
13,885
yt-dlp/yt-dlp
132,642
Python
doe1080
bashonly
'playable_in_embed': True, 'tags': [], 'thumbnail': r're:https?://i\.ytimg\.com/.+', 'timestamp': 1724306170, 'upload_date': '20240822', 'uploader': 'ㅇㅇ', 'uploader_id': '@으아-v1k', 'uploader_url': 'https://www.youtube.com/@으...
did you actually run this test? it's missing several fields
'playable_in_embed': True, 'tags': [], 'thumbnail': r're:https?://i\.ytimg\.com/.+', 'timestamp': 1724306170, 'upload_date': '20240822', 'uploader': 'ㅇㅇ', 'uploader_id': '@으아-v1k', 'uploader_url': 'https://www.youtube.com/@으...
@@ -1666,6 +1666,21 @@ class YoutubeIE(YoutubeBaseInfoExtractor): 'view_count': int, }, 'params': {'skip_download': True}, + }, { + # Youtube Music Auto-generated description with dot in artist name + 'url': 'https://music.youtube.com/watch?v=DbCvuSGfR3Y', + 'info_...
yt_dlp/extractor/youtube/_video.py
26
Python
0.214
question
59
51
51
false
[ie/youtube] Fix auto-generated metadata extraction
13,896
yt-dlp/yt-dlp
132,642
Python
bashonly
TheQWERTYCodr
need_caps_langs.difference_update(automatic_captions) if not (need_subs_langs or need_caps_langs): break if skipped_subs_clients and (need_subs_langs or need_caps_langs): self._report_pot_subtitles_skipped(video_id, True, msg=join_nonempty( f'...
snide remarks don't belong in code comments
if not trans_code: continue orig_trans_code = trans_code if caption_track.get('kind') != 'asr' and trans_code != 'und': if not get_translated_subs: continue tra...
@@ -4192,20 +4207,15 @@ def process_language(container, base_url, lang_code, sub_name, client_name, quer # Youtube Music Auto-generated description if (video_description or '').strip().endswith('\nAuto-generated by YouTube.'): - # XXX: Causes catastrophic backtracking if description has "...
yt_dlp/extractor/youtube/_video.py
26
Python
0.071
suggestion
43
51
51
false
[ie/youtube] Fix auto-generated metadata extraction
13,896
yt-dlp/yt-dlp
132,642
Python
bashonly
TheQWERTYCodr
f'{video_id}: There are missing subtitles languages because a PO token was not provided.', need_subs_langs and f'Subtitles for these languages are missing: {", ".join(need_subs_langs)}.', need_caps_langs and f'Automatic captions for {len(need_caps_langs)} languages are mi...
see `MgNrAu2pzNs` for an example of why we still need the `.+?` also you should actually run the other "Youtube Music Auto-generated description" tests ```suggestion (?:.+?Released\ on\s*:\s*(?P<release_date>\d{4}-\d{2}-\d{2}))? ```
trans_code += f'-{lang_code}' trans_name += format_field(lang_name, None, ' from %s') if lang_code == f'a-{orig_trans_code}': # Set audio language based on original subtitles for f in formats: ...
@@ -4192,20 +4207,15 @@ def process_language(container, base_url, lang_code, sub_name, client_name, quer # Youtube Music Auto-generated description if (video_description or '').strip().endswith('\nAuto-generated by YouTube.'): - # XXX: Causes catastrophic backtracking if description has "...
yt_dlp/extractor/youtube/_video.py
26
Python
0.857
suggestion
258
51
51
false
[ie/youtube] Fix auto-generated metadata extraction
13,896
yt-dlp/yt-dlp
132,642
Python
bashonly
TheQWERTYCodr
import re import urllib.parse from .common import InfoExtractor from ..utils import js_to_json, url_or_none from ..utils.traversal import traverse_obj _DOMAINS = ( 'aloula.sba.sa', 'bahry.com', 'maraya.sba.net.ae', 'sat7plus.org', ) _LANGUAGES = ( 'ar', 'en', 'fa', ) class FaulioBase(In...
move to baseclass ```suggestion from ..utils.traversal import traverse_obj ```
import re import urllib.parse from .common import InfoExtractor from ..utils import int_or_none, js_to_json, url_or_none from ..utils.traversal import traverse_obj class FaulioBaseIE(InfoExtractor): _DOMAINS = ( 'aloula.sba.sa', 'bahry.com', 'maraya.sba.net.ae', 'sat7plus.org', ...
@@ -5,15 +5,124 @@ from ..utils import js_to_json, url_or_none from ..utils.traversal import traverse_obj +_DOMAINS = ( + 'aloula.sba.sa', + 'bahry.com', + 'maraya.sba.net.ae', + 'sat7plus.org', +)
yt_dlp/extractor/faulio.py
14
Python
0.643
suggestion
81
39
39
false
[ie/Faulio] Add extractor
13,907
yt-dlp/yt-dlp
132,642
Python
bashonly
CasperMcFadden95
import re import urllib.parse from .common import InfoExtractor from ..utils import js_to_json, url_or_none from ..utils.traversal import traverse_obj _DOMAINS = ( 'aloula.sba.sa', 'bahry.com', 'maraya.sba.net.ae', 'sat7plus.org', ) _LANGUAGES = ( 'ar', 'en', 'fa', ) class FaulioBase(In...
- move `_LANGUAGES` inside baseclass - baseclass name must end in `IE` ```suggestion class FaulioBaseIE(InfoExtractor): ```
import re import urllib.parse from .common import InfoExtractor from ..utils import int_or_none, js_to_json, url_or_none from ..utils.traversal import traverse_obj class FaulioBaseIE(InfoExtractor): _DOMAINS = ( 'aloula.sba.sa', 'bahry.com', 'maraya.sba.net.ae', 'sat7plus.org', ...
@@ -5,15 +5,124 @@ from ..utils import js_to_json, url_or_none from ..utils.traversal import traverse_obj +_DOMAINS = ( + 'aloula.sba.sa', + 'bahry.com', + 'maraya.sba.net.ae', + 'sat7plus.org', +) -class FaulioLiveIE(InfoExtractor): - _DOMAINS = ( - 'aloula.sba.sa', - 'bahry.com', - ...
yt_dlp/extractor/faulio.py
22
Python
0.786
refactor
129
47
47
false
[ie/Faulio] Add extractor
13,907
yt-dlp/yt-dlp
132,642
Python
bashonly
CasperMcFadden95
'sat7plus.org', ) _LANGUAGES = ( 'ar', 'en', 'fa', ) class FaulioBase(InfoExtractor): def _get_headers(self, url): origin = f'{urllib.parse.urlparse(url).scheme}://{urllib.parse.urlparse(url).netloc}' return { 'Referer': origin, 'Origin': origin, } ...
```suggestion class FaulioIE(FaulioBaseIE): ```
'bahry.com', 'maraya.sba.net.ae', 'sat7plus.org', ) _LANGUAGES = ('ar', 'en', 'fa') _BASE_URL_RE = fr'https?://(?:{"|".join(map(re.escape, _DOMAINS))})/(?:(?:{"|".join(_LANGUAGES)})/)?' def _get_headers(self, url): parsed_url = urllib.parse.urlparse(url) return {...
@@ -5,15 +5,124 @@ from ..utils import js_to_json, url_or_none from ..utils.traversal import traverse_obj +_DOMAINS = ( + 'aloula.sba.sa', + 'bahry.com', + 'maraya.sba.net.ae', + 'sat7plus.org', +) -class FaulioLiveIE(InfoExtractor): - _DOMAINS = ( - 'aloula.sba.sa', - 'bahry.com', - ...
yt_dlp/extractor/faulio.py
26
Python
0.429
suggestion
49
51
51
false
[ie/Faulio] Add extractor
13,907
yt-dlp/yt-dlp
132,642
Python
bashonly
CasperMcFadden95
self._merge_subtitles(subs, target=subtitles) for f in formats: f['http_headers'] = headers return { 'id': f'{urllib.parse.urlparse(api_base).hostname}_{video_id}', **traverse_obj(traverse_obj(video_info, ('blocks', 0)), { 'display_id': (...
```suggestion class FaulioLiveIE(FaulioBaseIE): ```
'thumbnail': r're:^https?://.*\.jpg$', 'duration': 2492, 'age_limit': 0, }, }, { 'url': 'https://aloula.sba.sa/en/episode/0', 'only_matching': True, }] def _real_extract(self, url): video_id = self._match_id(url) api_base = self._g...
@@ -5,15 +5,124 @@ from ..utils import js_to_json, url_or_none from ..utils.traversal import traverse_obj +_DOMAINS = ( + 'aloula.sba.sa', + 'bahry.com', + 'maraya.sba.net.ae', + 'sat7plus.org', +) -class FaulioLiveIE(InfoExtractor): - _DOMAINS = ( - 'aloula.sba.sa', - 'bahry.com', - ...
yt_dlp/extractor/faulio.py
26
Python
0.571
suggestion
53
51
51
false
[ie/Faulio] Add extractor
13,907
yt-dlp/yt-dlp
132,642
Python
bashonly
CasperMcFadden95
import re import urllib.parse from .common import InfoExtractor from ..utils import js_to_json, url_or_none from ..utils.traversal import traverse_obj _DOMAINS = ( 'aloula.sba.sa', 'bahry.com', 'maraya.sba.net.ae', 'sat7plus.org', ) _LANGUAGES = ( 'ar', 'en', 'fa', ) class FaulioBase(In...
```suggestion _DOMAINS = ( 'aloula.sba.sa', 'bahry.com', 'maraya.sba.net.ae', 'sat7plus.org', ) _LANGUAGES = ('ar', 'en', 'fa') _BASE_URL_RE = fr'https?://(?:{"|".join(map(re.escape, _DOMAINS))})/(?:(?:{"|".join(_LANGUAGES)})/)?' def _get_headers(self, url)...
import re import urllib.parse from .common import InfoExtractor from ..utils import int_or_none, js_to_json, url_or_none from ..utils.traversal import traverse_obj class FaulioBaseIE(InfoExtractor): _DOMAINS = ( 'aloula.sba.sa', 'bahry.com', 'maraya.sba.net.ae', 'sat7plus.org', ...
@@ -5,15 +5,124 @@ from ..utils import js_to_json, url_or_none from ..utils.traversal import traverse_obj +_DOMAINS = ( + 'aloula.sba.sa', + 'bahry.com', + 'maraya.sba.net.ae', + 'sat7plus.org', +) -class FaulioLiveIE(InfoExtractor): - _DOMAINS = ( - 'aloula.sba.sa', - 'bahry.com', - ...
yt_dlp/extractor/faulio.py
19
Python
0.786
security
326
44
44
false
[ie/Faulio] Add extractor
13,907
yt-dlp/yt-dlp
132,642
Python
bashonly
CasperMcFadden95
) _LANGUAGES = ( 'ar', 'en', 'fa', ) class FaulioBase(InfoExtractor): def _get_headers(self, url): origin = f'{urllib.parse.urlparse(url).scheme}://{urllib.parse.urlparse(url).netloc}' return { 'Referer': origin, 'Origin': origin, } def _get_api_ba...
```suggestion _VALID_URL = fr'{FaulioBaseIE._BASE_URL_RE}(?:episode|media)/(?P<id>[a-zA-Z0-9-]+)' ```
'maraya.sba.net.ae', 'sat7plus.org', ) _LANGUAGES = ('ar', 'en', 'fa') _BASE_URL_RE = fr'https?://(?:{"|".join(map(re.escape, _DOMAINS))})/(?:(?:{"|".join(_LANGUAGES)})/)?' def _get_headers(self, url): parsed_url = urllib.parse.urlparse(url) return { 'Referer...
@@ -5,15 +5,124 @@ from ..utils import js_to_json, url_or_none from ..utils.traversal import traverse_obj +_DOMAINS = ( + 'aloula.sba.sa', + 'bahry.com', + 'maraya.sba.net.ae', + 'sat7plus.org', +) -class FaulioLiveIE(InfoExtractor): - _DOMAINS = ( - 'aloula.sba.sa', - 'bahry.com', - ...
yt_dlp/extractor/faulio.py
26
Python
0.714
suggestion
107
51
51
false
[ie/Faulio] Add extractor
13,907
yt-dlp/yt-dlp
132,642
Python
bashonly
CasperMcFadden95
for f in formats: f['http_headers'] = headers return { 'id': f'{urllib.parse.urlparse(api_base).hostname}_{video_id}', **traverse_obj(traverse_obj(video_info, ('blocks', 0)), { 'display_id': ('slug',), 'title': ('title',), ...
```suggestion _VALID_URL = fr'{FaulioBaseIE._BASE_URL_RE}live/(?P<id>[a-zA-Z0-9-]+)' ```
'duration': 2492, 'age_limit': 0, }, }, { 'url': 'https://aloula.sba.sa/en/episode/0', 'only_matching': True, }] def _real_extract(self, url): video_id = self._match_id(url) api_base = self._get_api_base(url, video_id) video_info = sel...
@@ -5,15 +5,124 @@ from ..utils import js_to_json, url_or_none from ..utils.traversal import traverse_obj +_DOMAINS = ( + 'aloula.sba.sa', + 'bahry.com', + 'maraya.sba.net.ae', + 'sat7plus.org', +) -class FaulioLiveIE(InfoExtractor): - _DOMAINS = ( - 'aloula.sba.sa', - 'bahry.com', - ...
yt_dlp/extractor/faulio.py
26
Python
0.571
suggestion
94
51
51
false
[ie/Faulio] Add extractor
13,907
yt-dlp/yt-dlp
132,642
Python
bashonly
CasperMcFadden95
from .common import InfoExtractor from ..utils import js_to_json, url_or_none from ..utils.traversal import traverse_obj _DOMAINS = ( 'aloula.sba.sa', 'bahry.com', 'maraya.sba.net.ae', 'sat7plus.org', ) _LANGUAGES = ( 'ar', 'en', 'fa', ) class FaulioBase(InfoExtractor): def _get_hea...
```suggestion parsed_url = urllib.parse.urlparse(url) return { 'Referer': url, 'Origin': f'{parsed_url.scheme}://{parsed_url.hostname}' } ```
from .common import InfoExtractor from ..utils import int_or_none, js_to_json, url_or_none from ..utils.traversal import traverse_obj class FaulioBaseIE(InfoExtractor): _DOMAINS = ( 'aloula.sba.sa', 'bahry.com', 'maraya.sba.net.ae', 'sat7plus.org', ) _LANGUAGES = ('ar', 'e...
@@ -5,15 +5,124 @@ from ..utils import js_to_json, url_or_none from ..utils.traversal import traverse_obj +_DOMAINS = ( + 'aloula.sba.sa', + 'bahry.com', + 'maraya.sba.net.ae', + 'sat7plus.org', +) -class FaulioLiveIE(InfoExtractor): - _DOMAINS = ( - 'aloula.sba.sa', - 'bahry.com', - ...
yt_dlp/extractor/faulio.py
26
Python
0.714
suggestion
195
51
51
false
[ie/Faulio] Add extractor
13,907
yt-dlp/yt-dlp
132,642
Python
bashonly
CasperMcFadden95
_LANGUAGES = ( 'ar', 'en', 'fa', ) class FaulioBase(InfoExtractor): def _get_headers(self, url): origin = f'{urllib.parse.urlparse(url).scheme}://{urllib.parse.urlparse(url).netloc}' return { 'Referer': origin, 'Origin': origin, } def _get_api_base(...
and unindent below ```suggestion _TESTS = [{ ```
) _LANGUAGES = ('ar', 'en', 'fa') _BASE_URL_RE = fr'https?://(?:{"|".join(map(re.escape, _DOMAINS))})/(?:(?:{"|".join(_LANGUAGES)})/)?' def _get_headers(self, url): parsed_url = urllib.parse.urlparse(url) return { 'Referer': url, 'Origin': f'{parsed_url.scheme}:/...
@@ -5,15 +5,124 @@ from ..utils import js_to_json, url_or_none from ..utils.traversal import traverse_obj +_DOMAINS = ( + 'aloula.sba.sa', + 'bahry.com', + 'maraya.sba.net.ae', + 'sat7plus.org', +) -class FaulioLiveIE(InfoExtractor): - _DOMAINS = ( - 'aloula.sba.sa', - 'bahry.com', - ...
yt_dlp/extractor/faulio.py
26
Python
0.571
suggestion
55
51
51
false
[ie/Faulio] Add extractor
13,907
yt-dlp/yt-dlp
132,642
Python
bashonly
CasperMcFadden95
r'window\.__NUXT__\.config=', webpage, 'config', video_id, transform_source=js_to_json) return config_data['public']['TRANSLATIONS_API_URL'] class FaulioIE(FaulioBase): _VALID_URL = fr'https?://(?:{"|".join(map(re.escape, _DOMAINS))})/(?:(?:{"|".join(map(re.escape, _LANGUAGES))})/)?(?:episode|...
and unindent below ```suggestion }, { ```
class FaulioIE(FaulioBaseIE): _VALID_URL = fr'{FaulioBaseIE._BASE_URL_RE}(?:episode|media)/(?P<id>[a-zA-Z0-9-]+)' _TESTS = [{ 'url': 'https://aloula.sba.sa/en/episode/29102', 'info_dict': { 'id': 'aloula.faulio.com_29102', 'ext': 'mp4', 'display_id': 'هذا-مكان...
@@ -5,15 +5,124 @@ from ..utils import js_to_json, url_or_none from ..utils.traversal import traverse_obj +_DOMAINS = ( + 'aloula.sba.sa', + 'bahry.com', + 'maraya.sba.net.ae', + 'sat7plus.org', +) -class FaulioLiveIE(InfoExtractor): - _DOMAINS = ( - 'aloula.sba.sa', - 'bahry.com', - ...
yt_dlp/extractor/faulio.py
26
Python
0.429
suggestion
48
51
51
false
[ie/Faulio] Add extractor
13,907
yt-dlp/yt-dlp
132,642
Python
bashonly
CasperMcFadden95
'url': 'https://bahry.com/en/media/1191', 'info_dict': { 'id': 'bahry.faulio.com_1191', 'ext': 'mp4', 'display_id': 'Episode-4-1191', 'title': 'Episode 4', 'episode': 'Episode 4', 'description': '', ...
line too long, use regex or md5
'title': 'الحلقة 4', 'episode': 'الحلقة 4', 'description': '', 'series': 'هذا مكانك', 'season': 'Season 3', 'season_number': 3, 'episode_number': 4, 'thumbnail': r're:^https?://.*\.jpg$', 'duration': 4855, ...
@@ -5,15 +5,124 @@ from ..utils import js_to_json, url_or_none from ..utils.traversal import traverse_obj +_DOMAINS = ( + 'aloula.sba.sa', + 'bahry.com', + 'maraya.sba.net.ae', + 'sat7plus.org', +) -class FaulioLiveIE(InfoExtractor): - _DOMAINS = ( - 'aloula.sba.sa', - 'bahry.com', - ...
yt_dlp/extractor/faulio.py
26
Python
0.143
refactor
31
51
51
false
[ie/Faulio] Add extractor
13,907
yt-dlp/yt-dlp
132,642
Python
bashonly
CasperMcFadden95
'season_number': 1, 'episode_number': 4, 'thumbnail': str, 'duration': 1653, 'age_limit': 0, }, }, { 'url': 'https://maraya.sba.net.ae/en/episode/127735', 'info_dict': { 'i...
```suggestion }, }] ```
}, }, { 'url': 'https://bahry.com/en/media/1191', 'info_dict': { 'id': 'bahry.faulio.com_1191', 'ext': 'mp4', 'display_id': 'Episode-4-1191', 'title': 'Episode 4', 'episode': 'Episode 4', 'description': '', '...
@@ -5,15 +5,124 @@ from ..utils import js_to_json, url_or_none from ..utils.traversal import traverse_obj +_DOMAINS = ( + 'aloula.sba.sa', + 'bahry.com', + 'maraya.sba.net.ae', + 'sat7plus.org', +) -class FaulioLiveIE(InfoExtractor): - _DOMAINS = ( - 'aloula.sba.sa', - 'bahry.com', - ...
yt_dlp/extractor/faulio.py
26
Python
0.429
suggestion
38
51
51
false
[ie/Faulio] Add extractor
13,907
yt-dlp/yt-dlp
132,642
Python
bashonly
CasperMcFadden95
def _real_extract(self, url): video_id = self._match_id(url) api_base = self._get_api_base(url, video_id) channel = traverse_obj( self._download_json(f'{api_base}/channels', video_id), (lambda k, v: v['url'] == video_id, any)) headers = self._get_headers(url...
instead of adding to every format dict this can go in the root of the info dict (inline in the return)
'title': str, 'description': str, 'ext': 'mp4', 'live_status': 'is_live', }, 'params': { 'skip_download': 'Livestream', }, }, { 'url': 'https://sat7plus.org/live/pars', 'info_dict': { 'id': 'sat7.faulio.c...
@@ -69,30 +178,30 @@ class FaulioLiveIE(InfoExtractor): def _real_extract(self, url): video_id = self._match_id(url) - webpage = self._download_webpage(url, video_id) - - config_data = self._search_json( - r'window\.__NUXT__\.config=', webpage, 'config', video_id, transform_sour...
yt_dlp/extractor/faulio.py
26
Python
0.429
suggestion
102
37
51
false
[ie/Faulio] Add extractor
13,907
yt-dlp/yt-dlp
132,642
Python
bashonly
CasperMcFadden95
{ 'url': 'https://maraya.sba.net.ae/en/episode/127735', 'info_dict': { 'id': 'maraya.faulio.com_127735', 'ext': 'mp4', 'display_id': 'عبدالله-الهاجري---عبدالرحمن-المطروشي-127735', 'title': 'عبدالله الهاجري - عبدالرحمن المطرو...
can be non-fatal since it's only metadata ```suggestion video_info = self._download_json(f'{api_base}/video/{video_id}', video_id, fatal=False) ```
'title': 'Episode 4', 'episode': 'Episode 4', 'description': '', 'series': 'Wild Water', 'season': 'Season 1', 'season_number': 1, 'episode_number': 4, 'thumbnail': r're:^https?://.*\.jpg$', 'duration': 1653, ...
@@ -5,15 +5,124 @@ from ..utils import js_to_json, url_or_none from ..utils.traversal import traverse_obj +_DOMAINS = ( + 'aloula.sba.sa', + 'bahry.com', + 'maraya.sba.net.ae', + 'sat7plus.org', +) -class FaulioLiveIE(InfoExtractor): - _DOMAINS = ( - 'aloula.sba.sa', - 'bahry.com', - ...
yt_dlp/extractor/faulio.py
26
Python
0.714
suggestion
158
51
51
false
[ie/Faulio] Add extractor
13,907
yt-dlp/yt-dlp
132,642
Python
bashonly
CasperMcFadden95
hls_url, video_id, 'mp4', m3u8_id='hls', fatal=False, headers=headers) formats.extend(fmts) self._merge_subtitles(subs, target=subtitles) if mpd_url := traverse_obj(player_info, ('settings', 'protocols', 'dash', {url_or_none})): fmts, subs = self._extract_mpd...
check the type ```suggestion 'display_id': ('slug', {str}), 'title': ('title', {str}), 'episode': ('title', {str}), 'description': ('description', {str}), 'series': ('program_title', {str}), 'season_number': ('season_...
'display_id': 'ep-13-ADHD-18165', 'title': 'ADHD and creativity', 'episode': 'ADHD and creativity', 'description': '', 'series': 'ADHD Podcast', 'season': 'Season 1', 'season_number': 1, 'episode_number': 13, 'th...
@@ -5,15 +5,124 @@ from ..utils import js_to_json, url_or_none from ..utils.traversal import traverse_obj +_DOMAINS = ( + 'aloula.sba.sa', + 'bahry.com', + 'maraya.sba.net.ae', + 'sat7plus.org', +) -class FaulioLiveIE(InfoExtractor): - _DOMAINS = ( - 'aloula.sba.sa', - 'bahry.com', - ...
yt_dlp/extractor/faulio.py
26
Python
0.929
suggestion
596
51
51
false
[ie/Faulio] Add extractor
13,907
yt-dlp/yt-dlp
132,642
Python
bashonly
CasperMcFadden95
'title': 'Episode 4', 'episode': 'Episode 4', 'description': '', 'series': 'Wild Water', 'season': 'Season 1', 'season_number': 1, 'episode_number': 4, 'thumbnail': str, 'durat...
use regex for `thumbnail`. `str` is only acceptable where the value is expected to be completely different every time the test is run, e.g. livestreams
'season_number': 3, 'episode_number': 4, 'thumbnail': r're:^https?://.*\.jpg$', 'duration': 4855, 'age_limit': 3, }, }, { 'url': 'https://bahry.com/en/media/1191', 'info_dict': { 'id': 'bahry.faulio.com_1191', ...
@@ -5,15 +5,124 @@ from ..utils import js_to_json, url_or_none from ..utils.traversal import traverse_obj +_DOMAINS = ( + 'aloula.sba.sa', + 'bahry.com', + 'maraya.sba.net.ae', + 'sat7plus.org', +) -class FaulioLiveIE(InfoExtractor): - _DOMAINS = ( - 'aloula.sba.sa', - 'bahry.com', - ...
yt_dlp/extractor/faulio.py
26
Python
0.571
suggestion
154
51
51
false
[ie/Faulio] Add extractor
13,907
yt-dlp/yt-dlp
132,642
Python
bashonly
CasperMcFadden95
_LANGUAGES = ( 'ar', 'en', 'fa', ) class FaulioBase(InfoExtractor): def _get_headers(self, url): origin = f'{urllib.parse.urlparse(url).scheme}://{urllib.parse.urlparse(url).netloc}' return { 'Referer': origin, 'Origin': origin, } def _get_api_base...
can we add `only_matching` tests for the other 2 domains?
'sat7plus.org', ) _LANGUAGES = ('ar', 'en', 'fa') _BASE_URL_RE = fr'https?://(?:{"|".join(map(re.escape, _DOMAINS))})/(?:(?:{"|".join(_LANGUAGES)})/)?' def _get_headers(self, url): parsed_url = urllib.parse.urlparse(url) return { 'Referer': url, 'Origin':...
@@ -5,15 +5,124 @@ from ..utils import js_to_json, url_or_none from ..utils.traversal import traverse_obj +_DOMAINS = ( + 'aloula.sba.sa', + 'bahry.com', + 'maraya.sba.net.ae', + 'sat7plus.org', +) -class FaulioLiveIE(InfoExtractor): - _DOMAINS = ( - 'aloula.sba.sa', - 'bahry.com', - ...
yt_dlp/extractor/faulio.py
26
Python
0.357
question
57
51
51
false
[ie/Faulio] Add extractor
13,907
yt-dlp/yt-dlp
132,642
Python
bashonly
CasperMcFadden95
'id': 'sat7.faulio.com_18165', 'ext': 'mp4', 'display_id': 'ep-13-ADHD-18165', 'title': 'ADHD and creativity', 'episode': 'ADHD and creativity', 'description': '', 'series': 'ADHD Podcast', 'season': 'Season 1', ...
```suggestion video_id = self._match_id(url) api_base = self._get_api_base(url, video_id) video_info = self._download_json(f'{api_base}/video/{video_id}', video_id, fatal=False) player_info = self._download_json(f'{api_base}/video/{video_id}/player', video_id) ```
'id': 'sat7.faulio.com_18165', 'ext': 'mp4', 'display_id': 'ep-13-ADHD-18165', 'title': 'ADHD and creativity', 'episode': 'ADHD and creativity', 'description': '', 'series': 'ADHD Podcast', 'season': 'Season 1', ...
@@ -2,18 +2,154 @@ import urllib.parse from .common import InfoExtractor -from ..utils import js_to_json, url_or_none +from ..utils import int_or_none, js_to_json, url_or_none from ..utils.traversal import traverse_obj -class FaulioLiveIE(InfoExtractor): +class FaulioBaseIE(InfoExtractor): _DOMAINS = ( ...
yt_dlp/extractor/faulio.py
26
Python
0.786
suggestion
301
51
51
false
[ie/Faulio] Add extractor
13,907
yt-dlp/yt-dlp
132,642
Python
bashonly
CasperMcFadden95
from .common import InfoExtractor from ..utils import ( ISO639Utils, clean_html, determine_ext, float_or_none, int_or_none, join_nonempty, url_or_none, ) from ..utils.traversal import traverse_obj class AdobeTVVideoIE(InfoExtractor): IE_NAME = 'adobe:tv' _VALID_URL = r'https?://vid...
Unless you have an example URL where the ID isn't numeric, let's keep the pattern the same ```suggestion _VALID_URL = r'https?://video\.tv\.adobe\.com/v/(?P<id>\d+)' ```
from .common import InfoExtractor from ..utils import ( ISO639Utils, clean_html, determine_ext, float_or_none, int_or_none, join_nonempty, url_or_none, ) from ..utils.traversal import traverse_obj class AdobeTVVideoIE(InfoExtractor): IE_NAME = 'adobetv' _VALID_URL = r'https?://vide...
@@ -1,297 +1,100 @@ -import functools -import re - from .common import InfoExtractor from ..utils import ( ISO639Utils, - OnDemandPagedList, + clean_html, + determine_ext, float_or_none, int_or_none, join_nonempty, - parse_duration, - str_or_none, - str_to_int, - unified_strda...
yt_dlp/extractor/adobetv.py
16
Python
0.714
suggestion
176
41
41
false
[ie/adobetv] Fix extractor
13,917
yt-dlp/yt-dlp
132,642
Python
bashonly
doe1080
from .common import InfoExtractor from ..utils import ( ISO639Utils, clean_html, determine_ext, float_or_none, int_or_none, join_nonempty, url_or_none, ) from ..utils.traversal import traverse_obj class AdobeTVVideoIE(InfoExtractor): IE_NAME = 'adobe:tv' _VALID_URL = r'https?://vid...
```suggestion _EMBED_REGEX = [r'<iframe[^>]+src=[\'"](?P<url>(?:https?:)?//video\.tv\.adobe\.com/v/\d+)'] ``` ```suggestion _EMBED_REGEX = [r'<iframe[^>]+src=[\'"](?P<url>(?:https?:)?//video\.tv\.adobe\.com/v/\d+(?:/[^\'"]+)?)'] ```
from .common import InfoExtractor from ..utils import ( ISO639Utils, clean_html, determine_ext, float_or_none, int_or_none, join_nonempty, url_or_none, ) from ..utils.traversal import traverse_obj class AdobeTVVideoIE(InfoExtractor): IE_NAME = 'adobetv' _VALID_URL = r'https?://vide...
@@ -1,297 +1,100 @@ -import functools -import re - from .common import InfoExtractor from ..utils import ( ISO639Utils, - OnDemandPagedList, + clean_html, + determine_ext, float_or_none, int_or_none, join_nonempty, - parse_duration, - str_or_none, - str_to_int, - unified_strda...
yt_dlp/extractor/adobetv.py
17
Python
0.786
suggestion
247
42
42
false
[ie/adobetv] Fix extractor
13,917
yt-dlp/yt-dlp
132,642
Python
bashonly
doe1080
'title': 'S335 - Beyond Personalization: Creating Intent-Based Experiences at Scale', 'description': 'Beyond Personalization: Creating Intent-Based Experiences at Scale', 'duration': 2906.8, 'thumbnail': r're:https?://images-tv\.adobe\.com/.+\.jpg', }, }] ...
no need to unpack ```suggestion fmt.update(traverse_obj(source, { ```
'title': 'S335 - Beyond Personalization: Creating Intent-Based Experiences at Scale', 'description': 'Beyond Personalization: Creating Intent-Based Experiences at Scale', 'duration': 2906.8, 'thumbnail': r're:https?://images-tv\.adobe\.com/.+\.jpg', }, }] ...
@@ -1,297 +1,100 @@ -import functools -import re - from .common import InfoExtractor from ..utils import ( ISO639Utils, - OnDemandPagedList, + clean_html, + determine_ext, float_or_none, int_or_none, join_nonempty, - parse_duration, - str_or_none, - str_to_int, - unified_strda...
yt_dlp/extractor/adobetv.py
26
Python
0.571
suggestion
88
51
51
false
[ie/adobetv] Fix extractor
13,917
yt-dlp/yt-dlp
132,642
Python
bashonly
doe1080
for source in traverse_obj(video_data, ( 'sources', lambda _, v: v['format'] != 'playlist' and url_or_none(v['src']), )): source_url = self._proto_relative_url(source['src']) if determine_ext(source_url) == 'm3u8': fmts = self._extract_m3u8_formats( ...
needs to be non-fatal (can't do `translation['language_medium']`)
for source in traverse_obj(video_data, ( 'sources', lambda _, v: v['format'] != 'playlist' and url_or_none(v['src']), )): source_url = self._proto_relative_url(source['src']) if determine_ext(source_url) == 'm3u8': fmts = self._extract_m3u8_formats( ...
@@ -1,297 +1,100 @@ -import functools -import re - from .common import InfoExtractor from ..utils import ( ISO639Utils, - OnDemandPagedList, + clean_html, + determine_ext, float_or_none, int_or_none, join_nonempty, - parse_duration, - str_or_none, - str_to_int, - unified_strda...
yt_dlp/extractor/adobetv.py
26
Python
0.357
suggestion
65
42
42
false
[ie/adobetv] Fix extractor
13,917
yt-dlp/yt-dlp
132,642
Python
bashonly
doe1080
term_allow_color = os.getenv('TERM', '').lower() != 'dumb' base_no_color = bool(os.getenv('NO_COLOR')) def process_color_policy(stream): stream_name = {sys.stdout: 'stdout', sys.stderr: 'stderr'}[stream] policy = traverse_obj(self.params, ('color', (stream_name, None), {...
Should we do this? If `system_deprecation` is truthy, we're either already telling them to update or we're telling them they can't update. ```suggestion elif self.params.get('warn_when_outdated'): ```
term_allow_color = os.getenv('TERM', '').lower() != 'dumb' base_no_color = bool(os.getenv('NO_COLOR')) def process_color_policy(stream): stream_name = {sys.stdout: 'stdout', sys.stderr: 'stderr'}[stream] policy = traverse_obj(self.params, ('color', (stream_name, None), ...
@@ -704,6 +705,10 @@ def process_color_policy(stream): if system_deprecation: self.deprecated_feature(system_deprecation.replace('\n', '\n ')) + if self.params.get('warn_when_outdated'):
yt_dlp/YoutubeDL.py
26
Python
0.857
question
211
51
51
false
Warn when yt-dlp is severely outdated
13,937
yt-dlp/yt-dlp
132,642
Python
bashonly
seproDev
'sleep_interval': opts.sleep_interval, 'max_sleep_interval': opts.max_sleep_interval, 'sleep_interval_subtitles': opts.sleep_interval_subtitles, 'external_downloader': opts.external_downloader, 'download_ranges': opts.download_ranges, 'force_keyframes_at_cuts': opts.force...
`warn_when_outdated` should be added to the `YoutubeDL` docstring too
'sleep_interval': opts.sleep_interval, 'max_sleep_interval': opts.max_sleep_interval, 'sleep_interval_subtitles': opts.sleep_interval_subtitles, 'external_downloader': opts.external_downloader, 'download_ranges': opts.download_ranges, 'force_keyframes_at_cuts': opts.force...
@@ -974,6 +974,7 @@ def parse_options(argv=None): '_warnings': warnings, '_deprecation_warnings': deprecation_warnings, 'compat_opts': opts.compat_opts, + 'warn_when_outdated': opts.update_self is None,
yt_dlp/__init__.py
26
Python
0.429
suggestion
69
51
51
false
Warn when yt-dlp is severely outdated
13,937
yt-dlp/yt-dlp
132,642
Python
bashonly
seproDev
if libc_ver < (2, 35): return EXE_MSG_TMPL.format('system glibc version < 2.35', 'issues/13858', STOP_MSG) return None return f'Support for Python version {major}.{minor} has been deprecated. {PYTHON_MSG}' def _get_version_age_warning(): # Only yt-dlp guarantees a stable release a...
since we are suppressing all Exceptions and this code is only running for releases where we control the version number, what if we simplified/condensed this a little bit? ```suggestion with contextlib.suppress(Exception): last_updated = dt.date(*version_tuple(__version__)[:3]) if last_updated < ...
if libc_ver < (2, 35): return EXE_MSG_TMPL.format('system glibc version < 2.35', 'issues/13858', STOP_MSG) return None return f'Support for Python version {major}.{minor} has been deprecated. {PYTHON_MSG}' def _get_outdated_warning(): # Only yt-dlp guarantees a stable release at l...
@@ -171,6 +172,29 @@ def _get_system_deprecation(): return f'Support for Python version {major}.{minor} has been deprecated. {PYTHON_MSG}' +def _get_version_age_warning(): + # Only yt-dlp guarantees a stable release at least every 3 months + if not ORIGIN.startswith('yt-dlp/'): + return None + + ...
yt_dlp/update.py
26
Python
1
suggestion
751
51
51
false
Warn when yt-dlp is severely outdated
13,937
yt-dlp/yt-dlp
132,642
Python
bashonly
seproDev
categories = [cat.strip() for cat in categories.split(',') if cat.strip()] return { 'id': video_id, 'title': title, 'upload_date': upload_date, 'uploader_id': uploader_id, 'thumbnail': self._og_search_thumbnail(webpage), 'categorie...
```suggestion def _correct_title(self, title, /): return title.partition(' - Videos')[0] if title else None ```
categories = [cat.strip() for cat in categories.split(',') if cat.strip()] return { 'id': video_id, 'title': title, 'upload_date': upload_date, 'uploader_id': uploader_id, 'thumbnail': self._og_search_thumbnail(webpage), 'categorie...
@@ -183,6 +169,9 @@ class MotherlessPaginatedIE(InfoExtractor): def _correct_path(self, url, item_id): raise NotImplementedError('This method must be implemented by subclasses') + def _correct_title(self, title, /): + return title.partition(' - Videos')[0]
yt_dlp/extractor/motherless.py
26
Python
0.714
suggestion
126
51
51
false
[ie/motherless] Fix extractor
13,960
yt-dlp/yt-dlp
132,642
Python
bashonly
Grub4K
'ext': 'mp4', 'upload_date': '20250809', 'thumbnail': 'https://cdn.cms.mtv.hu/wp-content/uploads/sites/4/2025/08/Idojaras-jelentes-35-1.jpg', }, }, { # hirado - subcategory 'url': 'https://hirado.hu/belfold/video/2025/08/09/nyitott-porta-napok-2025/', ...
can we do this instead: ```py webpage = self._download_webpage(url, display_id) player_data = self._search_json( r'loadPlayer\((?:\s*["\'][^"\']+["\']\s*,)?', webpage, 'player data', mobj) video_id = str(player_data['contentId']) ``` &nbsp; and then below: ```diff @...
'display_id': 'idojaras-jelentes-2025-augusztus-9-2230', 'ext': 'mp4', 'upload_date': '20250809', 'thumbnail': 'https://cdn.cms.mtv.hu/wp-content/uploads/sites/4/2025/08/Idojaras-jelentes-35-1.jpg', }, }, { # hirado - subcategory 'url': 'https:...
@@ -134,7 +77,7 @@ def _real_extract(self, url): webpage = self._download_webpage(url, display_id) player_data_str = self._html_search_regex( - r'mtva_player_manager\.player\(document.getElementById\(.*\),\s?(\{.*\}).*\);', webpage, 'player data') + r'loadPlayer\(\s*(?:["\'][^"...
yt_dlp/extractor/mediaklikk.py
26
Python
0.857
refactor
868
51
51
false
[ie/mediaklikk] Fix extractor
13,975
yt-dlp/yt-dlp
132,642
Python
bashonly
zhallgato
import urllib.parse from .common import InfoExtractor from ..utils import ( ExtractorError, traverse_obj, unified_strdate, url_or_none, ) class MediaKlikkIE(InfoExtractor): _VALID_URL = r'''(?x)https?://(?:www\.)? (?:mediaklikk|m4sport|hirado)\.hu/.*?(?:videok?|cikk)/ ...
this one fails for me with "Unable to extract player data" dead link? or am I geo-blocked?
import urllib.parse from .common import InfoExtractor from ..utils import ( ExtractorError, traverse_obj, unified_strdate, url_or_none, ) class MediaKlikkIE(InfoExtractor): _VALID_URL = r'''(?x)https?://(?:www\.)? (?:mediaklikk|m4sport|hirado)\.hu/.*?(?:videok?|cikk)/ ...
@@ -11,121 +11,64 @@ class MediaKlikkIE(InfoExtractor): _VALID_URL = r'''(?x)https?://(?:www\.)? - (?:mediaklikk|m4sport|hirado|petofilive)\.hu/.*?(?:videok?|cikk)/ + (?:mediaklikk|m4sport|hirado)\.hu/.*?(?:videok?|cikk)/ (?:(?P<year>[0-9]{4...
yt_dlp/extractor/mediaklikk.py
20
Python
0.286
bug
93
45
45
false
[ie/mediaklikk] Fix extractor
13,975
yt-dlp/yt-dlp
132,642
Python
bashonly
zhallgato
import itertools import urllib.parse from .common import InfoExtractor from ..utils import ( clean_html, int_or_none, parse_iso8601, update_url_query, url_or_none, ) from ..utils.traversal import traverse_obj class TuneInBaseIE(InfoExtractor): def _call_api(self, item_id, endpoint=None, note=...
I would write it like this ```py def _call_api(self, item_id, endpoint=None, note='Downloading JSON metadata', query=None): return self._download_json( join_nonempty('https://api.tunein.com/profiles', item_id, endpoint, delim='/'), item_id, note=note, query=query) ```
import functools import urllib.parse from .common import InfoExtractor from ..utils import ( OnDemandPagedList, UnsupportedError, clean_html, int_or_none, join_nonempty, parse_iso8601, update_url_query, url_or_none, ) from ..utils.traversal import traverse_obj class TuneInBaseIE(InfoE...
@@ -1,244 +1,332 @@ +import itertools import urllib.parse from .common import InfoExtractor from ..utils import ( - OnDemandPagedList, - determine_ext, + clean_html, + int_or_none, parse_iso8601, - traverse_obj, + update_url_query, + url_or_none, ) +from ..utils.traversal import traverse...
yt_dlp/extractor/tunein.py
20
Python
0.786
suggestion
313
45
45
false
[ie/tunein] Fix extractors
13,981
yt-dlp/yt-dlp
132,642
Python
bashonly
doe1080
from .common import InfoExtractor from ..utils import ( clean_html, int_or_none, parse_iso8601, update_url_query, url_or_none, ) from ..utils.traversal import traverse_obj class TuneInBaseIE(InfoExtractor): def _call_api(self, item_id, endpoint=None, note='Downloading JSON metadata', query=Non...
formatting, and let's traverse the response below ```suggestion }) ```
from .common import InfoExtractor from ..utils import ( OnDemandPagedList, UnsupportedError, clean_html, int_or_none, join_nonempty, parse_iso8601, update_url_query, url_or_none, ) from ..utils.traversal import traverse_obj class TuneInBaseIE(InfoExtractor): def _call_api(self, ite...
@@ -1,244 +1,332 @@ +import itertools import urllib.parse from .common import InfoExtractor from ..utils import ( - OnDemandPagedList, - determine_ext, + clean_html, + int_or_none, parse_iso8601, - traverse_obj, + update_url_query, + url_or_none, ) +from ..utils.traversal import traverse...
yt_dlp/extractor/tunein.py
26
Python
0.571
suggestion
85
51
51
false
[ie/tunein] Fix extractors
13,981
yt-dlp/yt-dlp
132,642
Python
bashonly
doe1080
int_or_none, parse_iso8601, update_url_query, url_or_none, ) from ..utils.traversal import traverse_obj class TuneInBaseIE(InfoExtractor): def _call_api(self, item_id, endpoint=None, note='Downloading JSON metadata', query=None): path = f'/{endpoint}' if endpoint else '' return se...
let's filter here ```suggestion for stream in traverse_obj(streams, ('body', lambda _, v: url_or_none(v['url']))): ```
UnsupportedError, clean_html, int_or_none, join_nonempty, parse_iso8601, update_url_query, url_or_none, ) from ..utils.traversal import traverse_obj class TuneInBaseIE(InfoExtractor): def _call_api(self, item_id, endpoint=None, note='Downloading JSON metadata', fatal=False, query=None)...
@@ -1,244 +1,332 @@ +import itertools import urllib.parse from .common import InfoExtractor from ..utils import ( - OnDemandPagedList, - determine_ext, + clean_html, + int_or_none, parse_iso8601, - traverse_obj, + update_url_query, + url_or_none, ) +from ..utils.traversal import traverse...
yt_dlp/extractor/tunein.py
26
Python
0.714
suggestion
129
51
51
false
[ie/tunein] Fix extractors
13,981
yt-dlp/yt-dlp
132,642
Python
bashonly
doe1080
path = f'/{endpoint}' if endpoint else '' return self._download_json( f'https://api.tunein.com/profiles/{item_id}{path}', item_id, note=note, query=query) def _extract_formats_and_subtitles(self, content_id): streams = self._download_json( 'https://opml.radiotime.co...
```suggestion formats.append(traverse_obj(stream, { 'abr': ('bitrate', {int_or_none}), 'ext': ('media_type', {str}), 'url': ('url', {self._proto_relative_url}), })) ```
class TuneInBaseIE(InfoExtractor): def _call_api(self, item_id, endpoint=None, note='Downloading JSON metadata', fatal=False, query=None): return self._download_json( join_nonempty('https://api.tunein.com/profiles', item_id, endpoint, delim='/'), item_id, note=note, fatal=fatal, que...
@@ -1,244 +1,332 @@ +import itertools import urllib.parse from .common import InfoExtractor from ..utils import ( - OnDemandPagedList, - determine_ext, + clean_html, + int_or_none, parse_iso8601, - traverse_obj, + update_url_query, + url_or_none, ) +from ..utils.traversal import traverse...
yt_dlp/extractor/tunein.py
26
Python
0.929
suggestion
266
51
51
false
[ie/tunein] Fix extractors
13,981
yt-dlp/yt-dlp
132,642
Python
bashonly
doe1080
'https://opml.radiotime.com/Tune.ashx', content_id, query={ 'formats': 'mp3,aac,ogg,flash,hls', 'id': content_id, 'render': 'json', }, )['body'] formats, subtitles = [], {} for stream in streams: if stream.get('...
```suggestion _VALID_URL = r'https?://tunein\.com/radio/[^/?#]+(?P<id>s\d+)' ```
def _extract_formats_and_subtitles(self, content_id): streams = self._download_json( 'https://opml.radiotime.com/Tune.ashx', content_id, query={ 'formats': 'mp3,aac,ogg,flash,hls', 'id': content_id, 'render': 'json', }) formats...
@@ -1,244 +1,332 @@ +import itertools import urllib.parse from .common import InfoExtractor from ..utils import ( - OnDemandPagedList, - determine_ext, + clean_html, + int_or_none, parse_iso8601, - traverse_obj, + update_url_query, + url_or_none, ) +from ..utils.traversal import traverse...
yt_dlp/extractor/tunein.py
26
Python
0.571
suggestion
86
51
51
false
[ie/tunein] Fix extractors
13,981
yt-dlp/yt-dlp
132,642
Python
bashonly
doe1080
'title': str, 'alt_title': 'The biggest new pop and all-day vibes', 'channel_follower_count': int, 'description': 'md5:ee2c56794844610d045f8caf5ff34d0c', 'location': 'London, UK', 'live_status': 'is_live', 'thumbnail': r're:https?://.+'...
don't need `any`, right? ```suggestion 'location': ('Properties', 'Location', 'DisplayName', {str}), ```
'ext': 'm4a', 'title': str, 'alt_title': 'The biggest new pop and all-day vibes', 'channel_follower_count': int, 'description': 'md5:ee2c56794844610d045f8caf5ff34d0c', 'location': 'London, UK', 'live_status': 'is_live', 'thu...
@@ -1,244 +1,332 @@ +import itertools import urllib.parse from .common import InfoExtractor from ..utils import ( - OnDemandPagedList, - determine_ext, + clean_html, + int_or_none, parse_iso8601, - traverse_obj, + update_url_query, + url_or_none, ) +from ..utils.traversal import traverse...
yt_dlp/extractor/tunein.py
26
Python
0.714
suggestion
123
51
51
false
[ie/tunein] Fix extractors
13,981
yt-dlp/yt-dlp
132,642
Python
bashonly
doe1080
'playlist_mincount': 35, }] def _entries(self, podcast_id): for page in itertools.count(): contents = self._call_api( podcast_id, 'contents', f'Downloading page {page + 1}', query={ 'filter': 't:free', 'limit': ...
it's always best to use a `PagedList` if we can; this makes options like `--playlist-items` work much more efficiently
}, 'playlist_mincount': 35, }] @classmethod def suitable(cls, url): return False if TuneInPodcastEpisodeIE.suitable(url) else super().suitable(url) def _fetch_page(self, url, podcast_id, page=0): items = self._call_api( podcast_id, 'contents', f'Downloading ...
@@ -1,244 +1,332 @@ +import itertools import urllib.parse from .common import InfoExtractor from ..utils import ( - OnDemandPagedList, - determine_ext, + clean_html, + int_or_none, parse_iso8601, - traverse_obj, + update_url_query, + url_or_none, ) +from ..utils.traversal import traverse...
yt_dlp/extractor/tunein.py
26
Python
0.571
performance
118
51
51
false
[ie/tunein] Fix extractors
13,981
yt-dlp/yt-dlp
132,642
Python
bashonly
doe1080
'id': 't174556405', 'ext': 'mp3', 'title': 'B&T Extra: Ohhh Yeah, It\'s Sexy Time', 'alt_title': 'Westwood One >', 'cast': 'count:2', 'description': 'md5:6828234f410ab88c85655495c5fcfa88', 'display_id': '174556405', 'duratio...
is `series` alone worth the extra API call? can we at least make it non-fatal?
'id': 't174556405', 'ext': 'mp3', 'title': 'B&T Extra: Ohhh Yeah, It\'s Sexy Time', 'alt_title': 'Westwood One >', 'cast': 'count:2', 'description': 'md5:6828234f410ab88c85655495c5fcfa88', 'display_id': '174556405', 'duratio...
@@ -1,244 +1,332 @@ +import itertools import urllib.parse from .common import InfoExtractor from ..utils import ( - OnDemandPagedList, - determine_ext, + clean_html, + int_or_none, parse_iso8601, - traverse_obj, + update_url_query, + url_or_none, ) +from ..utils.traversal import traverse...
yt_dlp/extractor/tunein.py
26
Python
0.357
question
78
51
51
false
[ie/tunein] Fix extractors
13,981
yt-dlp/yt-dlp
132,642
Python
bashonly
doe1080
'alt_title': 'Westwood One >', 'cast': 'count:2', 'description': 'md5:6828234f410ab88c85655495c5fcfa88', 'display_id': '174556405', 'duration': 1203, 'series': 'The BOB & TOM Show Free Podcast', 'series_id': 'p20069', 'thumb...
metadata-only request should be non-fatal
'alt_title': 'Westwood One >', 'cast': 'count:2', 'description': 'md5:6828234f410ab88c85655495c5fcfa88', 'display_id': '174556405', 'duration': 1203, 'series': 'The BOB & TOM Show Free Podcast', 'series_id': 'p20069', 'thumb...
@@ -1,244 +1,332 @@ +import itertools import urllib.parse from .common import InfoExtractor from ..utils import ( - OnDemandPagedList, - determine_ext, + clean_html, + int_or_none, parse_iso8601, - traverse_obj, + update_url_query, + url_or_none, ) +from ..utils.traversal import traverse...
yt_dlp/extractor/tunein.py
26
Python
0.143
suggestion
41
51
51
false
[ie/tunein] Fix extractors
13,981
yt-dlp/yt-dlp
132,642
Python
bashonly
doe1080
return { 'id': episode_id, 'display_id': display_id, 'formats': formats, 'series': traverse_obj(self._call_api(series_id), ('Item', 'Title', {clean_html})), 'series_id': series_id, 'subtitles': subtitles, **traverse_obj(self._c...
```suggestion _EMBED_REGEX = [r'<iframe\b[^>]+\bsrc=["\'](?P<url>(?:https?:)?//tunein\.com/embed/player/[^/?#"/']+)'] ```
return { 'id': episode_id, 'display_id': display_id, 'formats': formats, 'series': traverse_obj(self._call_api(series_id), ('Item', 'Title', {clean_html})), 'series_id': series_id, 'subtitles': subtitles, **traverse_obj(self._c...
@@ -1,244 +1,332 @@ +import itertools import urllib.parse from .common import InfoExtractor from ..utils import ( - OnDemandPagedList, - determine_ext, + clean_html, + int_or_none, parse_iso8601, - traverse_obj, + update_url_query, + url_or_none, ) +from ..utils.traversal import traverse...
yt_dlp/extractor/tunein.py
26
Python
0.714
suggestion
127
51
51
false
[ie/tunein] Fix extractors
13,981
yt-dlp/yt-dlp
132,642
Python
bashonly
doe1080
'display_id': '236404354', 'duration': 8330, 'series': 'Lex Fridman Podcast', 'series_id': 'p1153019', 'thumbnail': r're:https?://.+', 'timestamp': 1673458571, 'upload_date': '20230111', }, 'params': {'skip_download': 'L...
```suggestion new_url = urllib.parse.urlunparse(parsed._replace(netloc=parsed.hostname)) if self.suitable(new_url): # Prevent infinite loop in case redirect fails raise UnsupportedError(new_url) return self.url_result(new_url) ```
'display_id': '236404354', 'duration': 8330, 'series': 'Lex Fridman Podcast', 'series_id': 'p1153019', 'thumbnail': r're:https?://.+', 'timestamp': 1673458571, 'upload_date': '20230111', }, 'params': {'skip_download': 'L...
@@ -1,244 +1,332 @@ +import itertools import urllib.parse from .common import InfoExtractor from ..utils import ( - OnDemandPagedList, - determine_ext, + clean_html, + int_or_none, parse_iso8601, - traverse_obj, + update_url_query, + url_or_none, ) +from ..utils.traversal import traverse...
yt_dlp/extractor/tunein.py
26
Python
1
bug
272
27
30
false
[ie/tunein] Fix extractors
13,981
yt-dlp/yt-dlp
132,642
Python
bashonly
doe1080
}] def _real_extract(self, url): station_id = self._match_id(url) formats, subtitles = self._extract_formats_and_subtitles(station_id) return { 'id': station_id, 'formats': formats, 'subtitles': subtitles, **traverse_obj(self._call_api(st...
I'd be in favor of simplifying the regex and overriding `suitable()` ```suggestion _VALID_URL = r'https?://tunein\.com/podcasts(?:/[^/?#]+){1,2}(?P<id>p\d+)' ```
'params': {'skip_download': 'Livestream'}, }] def _real_extract(self, url): station_id = self._match_id(url) formats, subtitles = self._extract_formats_and_subtitles(station_id) return { 'id': station_id, 'formats': formats, 'subtitles': subt...
@@ -1,244 +1,332 @@ +import itertools import urllib.parse from .common import InfoExtractor from ..utils import ( - OnDemandPagedList, - determine_ext, + clean_html, + int_or_none, parse_iso8601, - traverse_obj, + update_url_query, + url_or_none, ) +from ..utils.traversal import traverse...
yt_dlp/extractor/tunein.py
26
Python
0.929
refactor
168
51
51
false
[ie/tunein] Fix extractors
13,981
yt-dlp/yt-dlp
132,642
Python
bashonly
doe1080
contents = self._call_api( podcast_id, 'contents', f'Downloading page {page + 1}', query={ 'filter': 't:free', 'limit': self._PAGE_SIZE, 'offset': page * self._PAGE_SIZE, }) yield from tr...
```suggestion _VALID_URL = r'https?://tunein\.com/podcasts(?:/[^/?#]+){1,2}(?P<series_id>p\d+)/?\?(?:[^#]+&)?(?i:topicid)=(?P<id>\d+)' ```
def suitable(cls, url): return False if TuneInPodcastEpisodeIE.suitable(url) else super().suitable(url) def _fetch_page(self, url, podcast_id, page=0): items = self._call_api( podcast_id, 'contents', f'Downloading page {page + 1}', query={ 'filter': 't:free', ...
@@ -1,244 +1,332 @@ +import itertools import urllib.parse from .common import InfoExtractor from ..utils import ( - OnDemandPagedList, - determine_ext, + clean_html, + int_or_none, parse_iso8601, - traverse_obj, + update_url_query, + url_or_none, ) +from ..utils.traversal import traverse...
yt_dlp/extractor/tunein.py
26
Python
0.857
suggestion
144
51
51
false
[ie/tunein] Fix extractors
13,981
yt-dlp/yt-dlp
132,642
Python
bashonly
doe1080
'thumbnail': ('Image', {url_or_none}), })), } class TuneInPodcastIE(TuneInBaseIE): IE_NAME = 'tunein:podcast:program' _PAGE_SIZE = 20 _VALID_URL = r'https?://tunein\.com/podcasts(?:/[^/?#]+)?/[^/?#]+(?P<id>p\d+)/?(?:\?(?![^#]*(?i:\btopicid)=)[^#]*)?(?:#|$)' _TESTS =...
```suggestion }] @classmethod def suitable(cls, url): return False if TuneInPodcastEpisodeIE.suitable(url) else super().suitable(url) ```
'location': ('Properties', 'Location', 'DisplayName', {str}), 'thumbnail': ('Image', {url_or_none}), })), } class TuneInPodcastIE(TuneInBaseIE): IE_NAME = 'tunein:podcast:program' _PAGE_SIZE = 20 _VALID_URL = r'https?://tunein\.com/podcasts(?:/[^/?#]+){1...
@@ -1,244 +1,332 @@ +import itertools import urllib.parse from .common import InfoExtractor from ..utils import ( - OnDemandPagedList, - determine_ext, + clean_html, + int_or_none, parse_iso8601, - traverse_obj, + update_url_query, + url_or_none, ) +from ..utils.traversal import traverse...
yt_dlp/extractor/tunein.py
26
Python
0.857
suggestion
166
51
51
false
[ie/tunein] Fix extractors
13,981
yt-dlp/yt-dlp
132,642
Python
bashonly
doe1080
'url': 'https://tunein.com/podcasts/World-News/BBC-News-p14/', 'info_dict': { 'id': 'p14', 'title': 'BBC News', }, 'playlist_mincount': 35, }] @classmethod def suitable(cls, url): return False if TuneInPodcastEpisodeIE.suitable(url) else super...
```suggestion for item in traverse_obj(items, (..., 'GuideId', {str}, filter)): yield self.url_result(update_url_query(url, {'topicId': item[1:]})) ```
'url': 'https://tunein.com/podcasts/World-News/BBC-News-p14/', 'info_dict': { 'id': 'p14', 'title': 'BBC News', }, 'playlist_mincount': 35, }] @classmethod def suitable(cls, url): return False if TuneInPodcastEpisodeIE.suitable(url) else super...
@@ -1,244 +1,337 @@ +import functools import urllib.parse from .common import InfoExtractor from ..utils import ( OnDemandPagedList, - determine_ext, + UnsupportedError, + clean_html, + int_or_none, + join_nonempty, parse_iso8601, - traverse_obj, + update_url_query, + url_or_none,...
yt_dlp/extractor/tunein.py
26
Python
0.714
suggestion
174
51
51
false
[ie/tunein] Fix extractors
13,981
yt-dlp/yt-dlp
132,642
Python
bashonly
doe1080
doc, # Do not use yt_dlp.utils.base_url here since it will raise on file:// URLs mpd_base_url=update_url(new_url, query=None, fragment=None).rpartition('/')[0], mpd_url=url) info_dict['live_status'] = 'is_live' if doc.get('t...
Instead of patching it for generic only, I think it's better to fix the base function instead. This makes it so that extractors don't return an incorrect `0` age. If some extractors expect an age of `0` they should use `self._rta_search(webpage) or 0` instead. ```diff diff --git a/yt_dlp/extractor/common.py b/yt_dlp/e...
doc, # Do not use yt_dlp.utils.base_url here since it will raise on file:// URLs mpd_base_url=update_url(new_url, query=None, fragment=None).rpartition('/')[0], mpd_url=url) info_dict['live_status'] = 'is_live' if doc.get('t...
@@ -984,7 +970,7 @@ def _real_extract(self, url): 'title': self._generic_title('', webpage, default='video'), 'description': self._og_search_description(webpage, default=None), 'thumbnail': self._og_search_thumbnail(webpage, default=None), - 'age_limit': self._rta_searc...
yt_dlp/extractor/generic.py
26
Python
0.857
bug
970
51
51
false
[ie] `_rta_search`: Do not assume `age_limit` is `0`
13,985
yt-dlp/yt-dlp
132,642
Python
Grub4K
doe1080
'md5': 'e800bd0baf47286d8b434d07b357247e', 'info_dict': { 'id': '256785003', 'ext': 'mp4', 'title': 'Terraria video 256785003', 'thumbnail': r're:^https?://[^/]*steamstatic\.com', }, ...
already resolved by [#14016](https://github.com/yt-dlp/yt-dlp/pull/14016) please merge master and remove this line ```suggestion ```
https?://(?:www\.)?steamcommunity\.com/sharedfiles/filedetails/\?id=(?P<fileID>[0-9]+) ''' _VIDEO_PAGE_TEMPLATE = 'https://store.steampowered.com/video/%s/' _AGECHECK_TEMPLATE = 'https://store.steampowered.com/agecheck/video/%s/?snr=1_agecheck_agecheck__age-gate&ageDay=1&ageMonth=January&ageYear=197...
@@ -50,6 +50,7 @@ class SteamIE(InfoExtractor): 'params': { 'playlistend': 2, }, + 'expected_warnings': ['Unknown MIME type image/avif in DASH manifest'],
yt_dlp/extractor/steam.py
26
Python
0.786
refactor
135
51
51
false
[ie/steam] Fix extractor
14,008
yt-dlp/yt-dlp
132,642
Python
doe1080
AzartX47
self._set_cookie('steampowered.com', 'birthtime', '944006401') self._set_cookie('steampowered.com', 'lastagecheckage', '1-0-2000') webpage = self._download_webpage(video_url, playlist_id) if re.search('<div[^>]+>Please enter your birth date to continue:</div>', webpage) is not None: ...
can be simplified as below ```diff @@ -1,11 +1,19 @@ +import json import re from .common import InfoExtractor from ..utils import ( ExtractorError, + clean_html, extract_attributes, - get_element_by_class, str_or_none, + url_or_none, +) +from ..utils.traversal import ( + f...
..., {extract_attributes}, 'data-props', {json.loads}, {dict}, )): formats = [] if hls_manifest := traverse_obj(data_prop, ('hlsManifest', {url_or_none})): formats.extend(self._extract_m3u8_formats( hls_manifest, playlist_id, 'mp4', m3u8_id...
@@ -96,15 +96,19 @@ def _real_extract(self, url): } formats = [] if movie: - entry['thumbnail'] = movie.get('data-poster') - for quality in ('', '-hd'): - for ext in ('webm', 'mp4'): - video_url = movie.get(f'...
yt_dlp/extractor/steam.py
26
Python
1
refactor
3,606
51
51
false
[ie/steam] Fix extractor
14,008
yt-dlp/yt-dlp
132,642
Python
doe1080
AzartX47
from .common import InfoExtractor from ..utils import ( ExtractorError, extract_attributes, get_element_by_class, str_or_none, ) class SteamIE(InfoExtractor): _VALID_URL = r'''(?x) https?://(?:store\.steampowered|steamcommunity)\.com/ (?:agecheck/)? (?P<urltype>vide...
`_TESTS` can be more concise ```diff @@ -23,40 +31,18 @@ class SteamIE(InfoExtractor): _AGECHECK_TEMPLATE = 'http://store.steampowered.com/agecheck/video/%s/?snr=1_agecheck_agecheck__age-gate&ageDay=1&ageMonth=January&ageYear=1970' _TESTS = [{ 'url': 'http://store.steampowered.com/video/105600/'...
from .common import InfoExtractor from ..utils import ( ExtractorError, clean_html, extract_attributes, str_or_none, url_or_none, ) from ..utils.traversal import ( find_element, find_elements, traverse_obj, trim_str, ) class SteamIE(InfoExtractor): _VALID_URL = r'''(?x) ...
@@ -25,21 +25,21 @@ class SteamIE(InfoExtractor): 'url': 'http://store.steampowered.com/video/105600/', 'playlist': [ { - 'md5': '695242613303ffa2a4c44c9374ddc067', + 'md5': 'e800bd0baf47286d8b434d07b357247e',
yt_dlp/extractor/steam.py
26
Python
0.857
refactor
1,651
51
51
false
[ie/steam] Fix extractor
14,008
yt-dlp/yt-dlp
132,642
Python
doe1080
AzartX47
ExtractorError, clean_html, extract_attributes, str_or_none, url_or_none, ) from ..utils.traversal import ( find_element, find_elements, traverse_obj, trim_str, ) class SteamIE(InfoExtractor): _VALID_URL = r'''(?x) https?://(?:store\.steampowered|steamcommunity)\.com/ ...
while we're in this extractor, can we upgrade this (as well as `_VIDEO_PAGE_TEMPLATE` above) to be `https` instead of `http`?
ExtractorError, clean_html, extract_attributes, str_or_none, url_or_none, ) from ..utils.traversal import ( find_element, find_elements, traverse_obj, trim_str, ) class SteamIE(InfoExtractor): _VALID_URL = r'''(?x) https?://(?:store\.steampowered|steamcommunity)\.com/ ...
@@ -23,40 +31,18 @@ class SteamIE(InfoExtractor): _AGECHECK_TEMPLATE = 'http://store.steampowered.com/agecheck/video/%s/?snr=1_agecheck_agecheck__age-gate&ageDay=1&ageMonth=January&ageYear=1970'
yt_dlp/extractor/steam.py
26
Python
0.571
refactor
125
51
51
false
[ie/steam] Fix extractor
14,008
yt-dlp/yt-dlp
132,642
Python
bashonly
AzartX47
self._set_cookie('steampowered.com', 'wants_mature_content', '1') self._set_cookie('steampowered.com', 'birthtime', '944006401') self._set_cookie('steampowered.com', 'lastagecheckage', '1-0-2000') webpage = self._download_webpage(video_url, playlist_id) if re.search('<div[^>]+...
We don't need to use `all` here since branching (`...`) guarantees a list result by default (and since we're not using `all` we don't need to use `filter`) ```suggestion for dash_manifest in traverse_obj(data_prop, ('dashManifests', ..., {url_or_none})): ```
self._set_cookie('steampowered.com', 'wants_mature_content', '1') self._set_cookie('steampowered.com', 'birthtime', '944006401') self._set_cookie('steampowered.com', 'lastagecheckage', '1-0-2000') webpage = self._download_webpage(video_url, playlist_id) if re.search('<div[^>]+...
@@ -81,32 +67,31 @@ def _real_extract(self, url): self.report_age_confirmation() webpage = self._download_webpage(video_url, playlist_id) - videos = re.findall(r'(<div[^>]+id=[\'"]highlight_movie_(\d+)[\'"][^>]+>)', webpage) + app_name = traverse_obj(webpage, ({find_element(cls...
yt_dlp/extractor/steam.py
26
Python
0.857
suggestion
273
51
51
false
[ie/steam] Fix extractor
14,008
yt-dlp/yt-dlp
132,642
Python
bashonly
AzartX47
class MedialaanIE(MedialaanBaseIE): _VALID_URL = r'''(?x) https?:// (?: (?:embed\.)?mychannels.video/embed/| embed\.mychannels\.video/(?:s(?:dk|cript)/)?production/| (?:www\.)?(?: ...
```suggestion )/videos?/(?:[^/?#]+/)*[^/?&#]+(?:-|~p) ```
class MedialaanIE(MedialaanBaseIE): _VALID_URL = r'''(?x) https?:// (?: (?:embed\.)?mychannels.video/embed/| embed\.mychannels\.video/(?:s(?:dk|cript)/)?production/| (?:www\.)?(?: ...
@@ -32,7 +90,7 @@ class MedialaanIE(InfoExtractor): tubantia| volkskrant )\.nl - )/video/(?:[^/]+/)*[^/?&#]+~p + )/videos?/(?:[^/]+/)*[^/?&#]+(?:-|~p)
yt_dlp/extractor/medialaan.py
26
Python
0.571
suggestion
87
51
51
false
[ie/medialaan] Rework extractors
14,015
yt-dlp/yt-dlp
132,642
Python
bashonly
doe1080
'ext': 'mp4', 'title': 'Tom Waes blaastest', 'channel': 'De Morgen', 'channel_id': '352', 'description': 'Tom Waes werkt mee aan een alcoholcampagne op Werchter', 'duration': 62, 'genres': ['News'], 'release_date': '20250705...
we can `yield from` here and more importantly, we need to `filter` before the f-string transformation or else we could end up with `/embed/None` URLs and since we're filtering beforehand (and not using `all`) that means everything after the transformation is unnecessary ```suggestion yield from traverse...
'ext': 'mp4', 'title': 'Tom Waes blaastest', 'channel': 'De Morgen', 'channel_id': '352', 'description': 'Tom Waes werkt mee aan een alcoholcampagne op Werchter', 'duration': 62, 'genres': ['News'], 'release_date': '20250705...
@@ -75,51 +194,32 @@ class MedialaanIE(InfoExtractor): 'id': '1576607', 'ext': 'mp4', 'title': 'Tom Waes blaastest', + 'channel': 'De Morgen', + 'channel_id': '352', + 'description': 'Tom Waes werkt mee aan een alcoholcampagne op Werchter', ...
yt_dlp/extractor/medialaan.py
26
Python
1
refactor
578
32
31
false
[ie/medialaan] Rework extractors
14,015
yt-dlp/yt-dlp
132,642
Python
bashonly
doe1080
from .medialaan import MedialaanBaseIE from ..utils import str_or_none from ..utils.traversal import require, traverse_obj class VTMIE(MedialaanBaseIE): _VALID_URL = r'https?://(?:www\.)?vtm\.be/[^/?#]+~v(?P<id>[\da-f-]+)' _TESTS = [{ 'url': 'https://vtm.be/gast-vernielt-genkse-hotelkamer~ve7534523-27...
I like having the actual UUID pattern in here ```suggestion _VALID_URL = r'https?://(?:www\.)?vtm\.be/[^/?#]+~v(?P<id>[\da-f]{8}(?:-[\da-f]{4}){3}-[\da-f]{12})' ```
from .medialaan import MedialaanBaseIE from ..utils import str_or_none from ..utils.traversal import require, traverse_obj class VTMIE(MedialaanBaseIE): _VALID_URL = r'https?://(?:www\.)?vtm\.be/[^/?#]+~v(?P<id>[\da-f]{8}(?:-[\da-f]{4}){3}-[\da-f]{12})' _TESTS = [{ 'url': 'https://vtm.be/gast-vernielt...
@@ -1,60 +1,42 @@ -from .common import InfoExtractor -from ..utils import ( - int_or_none, - parse_iso8601, - try_get, -) +from .medialaan import MedialaanBaseIE +from ..utils import str_or_none +from ..utils.traversal import require, traverse_obj -class VTMIE(InfoExtractor): - _WORKING = False - _VA...
yt_dlp/extractor/vtm.py
7
Python
0.714
suggestion
171
32
32
false
[ie/medialaan] Rework extractors
14,015
yt-dlp/yt-dlp
132,642
Python
bashonly
doe1080
'info_dict': { 'id': '192445', 'ext': 'mp4', 'title': 'Gast vernielt Genkse hotelkamer', 'channel': 'VTM', 'channel_id': '867', 'description': 'md5:75fce957d219646ff1b65ba449ab97b5', 'duration': 74, 'genres': ['Docum...
let's avoid shadowing a stdlib module name ```suggestion video_id = self._match_id(url) ```
'info_dict': { 'id': '192445', 'ext': 'mp4', 'title': 'Gast vernielt Genkse hotelkamer', 'channel': 'VTM', 'channel_id': '867', 'description': 'md5:75fce957d219646ff1b65ba449ab97b5', 'duration': 74, 'genres': ['Docum...
@@ -1,60 +1,42 @@ -from .common import InfoExtractor -from ..utils import ( - int_or_none, - parse_iso8601, - try_get, -) +from .medialaan import MedialaanBaseIE +from ..utils import str_or_none +from ..utils.traversal import require, traverse_obj -class VTMIE(InfoExtractor): - _WORKING = False - _VA...
yt_dlp/extractor/vtm.py
26
Python
0.786
suggestion
102
34
34
false
[ie/medialaan] Rework extractors
14,015
yt-dlp/yt-dlp
132,642
Python
bashonly
doe1080
'channel_id': '867', 'description': 'md5:75fce957d219646ff1b65ba449ab97b5', 'duration': 74, 'genres': ['Documentaries'], 'release_date': '20210119', 'release_timestamp': 1611060180, 'series': 'Op Interventie', 'series_id': '...
```suggestion webpage = self._download_webpage(url, video_id) apollo_state = self._search_json( r'window\.__APOLLO_STATE__\s*=', webpage, 'apollo state', video_id) mychannels_id = traverse_obj(apollo_state, ( f'Video:{{"uuid":"{video_id}"}}', 'myChannelsVideo', {str_...
'channel_id': '867', 'description': 'md5:75fce957d219646ff1b65ba449ab97b5', 'duration': 74, 'genres': ['Documentaries'], 'release_date': '20210119', 'release_timestamp': 1611060180, 'series': 'Op Interventie', 'series_id': '...
@@ -1,60 +1,42 @@ -from .common import InfoExtractor -from ..utils import ( - int_or_none, - parse_iso8601, - try_get, -) +from .medialaan import MedialaanBaseIE +from ..utils import str_or_none +from ..utils.traversal import require, traverse_obj -class VTMIE(InfoExtractor): - _WORKING = False - _VA...
yt_dlp/extractor/vtm.py
26
Python
0.786
suggestion
363
29
29
false
[ie/medialaan] Rework extractors
14,015
yt-dlp/yt-dlp
132,642
Python
bashonly
doe1080
link = video.get('link') if not link: continue uri = video.get('uri') video_id = self._search_regex(r'/videos/(\d+)', uri, 'id', default=None) if uri else None if is_embed: if not video_id: self.report_warnin...
maybe we should always make this request so we can parse the `error_code` and raise w/ a proper msg when referer is required but missing
continue uri = video.get('uri') video_id = self._search_regex(r'/videos/(\d+)', uri, 'id', default=None) if uri else None if is_embed: if not video_id: self.report_warning(f'Skipping due to missing video ID: {link}') ...
@@ -1577,44 +1637,33 @@ def _fetch_page(self, album_id, authorization, hashed_pass, page): if not link: continue uri = video.get('uri') - video_id = self._search_regex(r'/videos/(\d+)', uri, 'video_id', default=None) if uri else None + video_id = self._se...
yt_dlp/extractor/vimeo.py
26
Python
0.714
suggestion
136
51
51
false
[ie/vimeo:album] Support embed-only and non-numeric albums
14,021
yt-dlp/yt-dlp
132,642
Python
bashonly
bashonly
}] def _real_extract(self, url): video_id = self._match_id(url) meta = self._weibo_download_json( 'https://weibo.com/ajax/statuses/show', video_id, query={'id': video_id}) mix_media_info = traverse_obj(meta, ('mix_media_info', 'items', ...)) if not mix_media_info: ...
```suggestion fr'https?://video\.weibo\.com/show/?\?(?:[^#]+&)?fid=(?P<id>{_VIDEO_ID_RE})', ```
}] def _real_extract(self, url): video_id = self._match_id(url) meta = self._weibo_download_json( 'https://weibo.com/ajax/statuses/show', video_id, query={'id': video_id}) mix_media_info = traverse_obj(meta, ('mix_media_info', 'items', ...)) if not mix_media_info: ...
@@ -209,7 +210,11 @@ def _entries(self, mix_media_info): class WeiboVideoIE(WeiboBaseIE): - _VALID_URL = r'https?://(?:www\.)?weibo\.com/tv/show/(?P<id>\d+:(?:[\da-f]{32}|\d{16,}))' + _VIDEO_ID_RE = r'\d+:(?:[\da-f]{32}|\d{16,})' + _VALID_URL = [ + fr'https?://(?:www\.)?weibo\.com/tv/show/(?P<id>{_...
yt_dlp/extractor/weibo.py
26
Python
0.714
suggestion
105
51
51
false
[ie/weibo] Support more URLs and --no-playlist
14,035
yt-dlp/yt-dlp
132,642
Python
bashonly
bashonly
'only_matching': True, }] def _real_extract(self, url): video_id = self._match_id(url) headers = self.geo_verification_headers() webpage, urlh = self._download_webpage_handle(url, video_id, headers=headers) if not self._match_valid_url(urlh.url): return self....
```diff - _VALID_URL = r'https?://(?:www\.)?bilibili\.com/(?:video/|festival/[^/?#]+\?(?:[^#]*&)?bvid=)[aAbB][vV](?P<id>[^/?#&]+)' + _VALID_URL = r'https?://(?:www\.)?bilibili\.com/(?:video/|festival/[^/?#]+\?(?:[^#]*&)?bvid=)(?P<prefix>[aAbB][vV])(?P<id>[^/?#&]+)' ``` ```diff def _real_extract(self, ur...
'skip': 'supporter-only video', }, { 'url': 'https://www.bilibili.com/video/BV1Ks411f7aQ/', 'info_dict': { 'id': 'BV1Ks411f7aQ', 'title': '【BD1080P】狼与香辛料I【华盟】', 'ext': 'mp4', }, 'skip': 'login required', }, { 'url': 'https://www...
@@ -644,7 +644,20 @@ def _real_extract(self, url): headers['Referer'] = url - initial_state = self._search_json(r'window\.__INITIAL_STATE__\s*=', webpage, 'initial state', video_id) + initial_state = self._search_json(r'window\.__INITIAL_STATE__\s*=', webpage, 'initial state', video_id, defau...
yt_dlp/extractor/bilibili.py
26
Python
1
refactor
1,201
51
51
false
[ie/BiliBili] Redirect BiliBiliBangumi AV/BV ID to EPID
14,038
yt-dlp/yt-dlp
132,642
Python
bashonly
junyilou
query=self._sign_wbi(query, video_id), headers=headers) new_url = traverse_obj(detail, ('data', 'View', 'redirect_url', {url_or_none})) if new_url and BiliBiliBangumiIE.suitable(new_url): return self.url_result(new_url, BiliBiliBangumiIE) raise Extract...
Are there any other types of redirection from aid/bvid?
def _real_extract(self, url): video_id, prefix = self._match_valid_url(url).group('id', 'prefix') headers = self.geo_verification_headers() webpage, urlh = self._download_webpage_handle(url, video_id, headers=headers) if not self._match_valid_url(urlh.url): return self.u...
@@ -636,15 +636,29 @@ class BiliBiliIE(BilibiliBaseIE): }] def _real_extract(self, url): - video_id = self._match_id(url) + video_id, prefix = self._match_valid_url(url).group('id', 'prefix') headers = self.geo_verification_headers() webpage, urlh = self._download_webpage_han...
yt_dlp/extractor/bilibili.py
26
Python
0.357
question
55
51
51
false
[ie/BiliBili] Redirect BiliBiliBangumi AV/BV ID to EPID
14,038
yt-dlp/yt-dlp
132,642
Python
grqz
junyilou
'thumbnail': r're:^https?://.*\.(jpg|jpeg|png)$', '_old_archive_ids': ['bilibili 292734508_part1'], }, }], }, { 'note': '301 redirect to bangumi link', 'url': 'https://www.bilibili.com/video/BV1TE411f7f1', 'info_dict': { 'id': '...
can we also add a test for a `BV`-prefixed ID that redirects to bangumi?
'thumbnail': r're:^https?://.*\.(jpg|jpeg|png)$', '_old_archive_ids': ['bilibili 292734508_part1'], }, }], }, { 'note': 'redirect from bvid to bangumi link via redirect_url', 'url': 'https://www.bilibili.com/video/BV1TE411f7f1', 'info_dict'...
@@ -580,7 +580,27 @@ class BiliBiliIE(BilibiliBaseIE): 'duration': 1183.957, 'timestamp': 1571648124, 'upload_date': '20191021', - 'thumbnail': r're:^https?://.*\.(jpg|jpeg|png)$', + 'thumbnail': r're:https?://.*\.(jpg|jpeg|png)$', + }, + }, { + ...
yt_dlp/extractor/bilibili.py
26
Python
0.357
question
72
51
51
false
[ie/BiliBili] Redirect BiliBiliBangumi AV/BV ID to EPID
14,038
yt-dlp/yt-dlp
132,642
Python
bashonly
junyilou
'info_dict': { 'id': 'BV1GJ411x7h7', 'title': '【官方 MV】Never Gonna Give You Up - Rick Astley', 'ext': 'mp4', }, 'skip': 'geo-restricted', }, { 'note': 'has - in the last path segment of the url', 'url': 'https://www.bilibili.com/festival/bh3...
```suggestion if self._search_json(r'\bwindow\._riskdata_\s*=', webpage, 'risk', video_id, default={}).get('v_voucher'): raise ExtractorError('You have exceeded the rate limit. Try again later', expected=True) ```
'info_dict': { 'id': 'BV1GJ411x7h7', 'title': '【官方 MV】Never Gonna Give You Up - Rick Astley', 'ext': 'mp4', }, 'skip': 'geo-restricted', }, { 'note': 'has - in the last path segment of the url', 'url': 'https://www.bilibili.com/festival/bh3...
@@ -636,15 +656,33 @@ class BiliBiliIE(BilibiliBaseIE): }] def _real_extract(self, url): - video_id = self._match_id(url) + video_id, prefix = self._match_valid_url(url).group('id', 'prefix') headers = self.geo_verification_headers() webpage, urlh = self._download_webpage_han...
yt_dlp/extractor/bilibili.py
26
Python
1
refactor
244
51
51
false
[ie/BiliBili] Redirect BiliBiliBangumi AV/BV ID to EPID
14,038
yt-dlp/yt-dlp
132,642
Python
bashonly
junyilou
'description': 'md5:de6ca5d5a2d56849e4021f2bf2850df4', 'duration': 1320, 'series': 'Backstage', 'season_number': 1, 'episode_number': 8, 'episode': '8. episode', 'age_limit': 0, }, 'params': { 'skip_download'...
I'm not a fan of the old code *at all* I don't like returning the JSON LD info in the flat result since it could differ from what `NRKIE` returns I don't like the `assert` (this project's convention is that only developers should ever see an `AssertionError`, not the end user) IMO we should get rid of the old ...
'title': 'Backstage - 8. episode', 'description': 'md5:de6ca5d5a2d56849e4021f2bf2850df4', 'duration': 1320, 'series': 'Backstage', 'season_number': 1, 'episode_number': 8, 'episode': '8. episode', 'age_limit': 0, }, ...
@@ -492,7 +492,8 @@ def _real_extract(self, url): info = self._search_json_ld(webpage, display_id, default={}) nrk_id = info.get('@id') or self._html_search_meta( 'nrk:program-id', webpage, default=None) or self._search_regex( - rf'data-program-id=["\']({NRKTVIE._EPISODE_RE})',...
yt_dlp/extractor/nrk.py
26
Python
1
refactor
1,288
51
51
false
[ie/NRKTVEpisode] Fix ID extraction
14,065
yt-dlp/yt-dlp
132,642
Python
bashonly
runarmod
'age_limit': 6, }, 'params': { 'skip_download': True, }, }, { 'url': 'https://tv.nrk.no/serie/backstage/sesong/1/episode/8', 'info_dict': { 'id': 'MSUI14000816', 'ext': 'mp4', 'title': 'Backstage - 8. episode', ...
The working test-case could have this entry, say after the `'url'` line. It indicates that the test-case is expected to fail if any IE (key) in the list is not `_WORKING`: ```py 'add_ie': [NRKIE.ie_key()], ```
'episode': '2. Kro, krig og kjærlighet', 'age_limit': 6, }, 'params': { 'skip_download': True, }, }, { 'url': 'https://tv.nrk.no/serie/backstage/sesong/1/episode/8', 'info_dict': { 'id': 'MSUI14000816', 'ext': 'mp4',...
@@ -485,26 +485,23 @@ class NRKTVEpisodeIE(InfoExtractor): }]
yt_dlp/extractor/nrk.py
26
Python
0.857
bug
223
51
51
false
[ie/NRKTVEpisode] Fix ID extraction
14,065
yt-dlp/yt-dlp
132,642
Python
dirkf
runarmod
'id': 'MSUI14000816', 'ext': 'mp4', 'title': 'Backstage - 8. episode', 'description': 'md5:de6ca5d5a2d56849e4021f2bf2850df4', 'duration': 1320, 'series': 'Backstage', 'season_number': 1, 'episode_number': 8, 'epi...
```suggestion if not (nrk_id := traverse_obj(NRKTVIE._match_valid_url(urlh.url), 'id')): ```
'info_dict': { 'id': 'MSUI14000816', 'ext': 'mp4', 'title': 'Backstage - 8. episode', 'description': 'md5:de6ca5d5a2d56849e4021f2bf2850df4', 'duration': 1320, 'series': 'Backstage', 'season_number': 1, 'episode_numbe...
@@ -485,26 +485,23 @@ class NRKTVEpisodeIE(InfoExtractor): }] def _real_extract(self, url): - display_id, season_number, episode_number = self._match_valid_url(url).groups() - - webpage = self._download_webpage(url, display_id) - - info = self._search_json_ld(webpage, display_id, defaul...
yt_dlp/extractor/nrk.py
26
Python
0.714
suggestion
102
51
51
false
[ie/NRKTVEpisode] Fix ID extraction
14,065
yt-dlp/yt-dlp
132,642
Python
dirkf
runarmod
'title': 'Backstage - 8. episode', 'description': 'md5:de6ca5d5a2d56849e4021f2bf2850df4', 'duration': 1320, 'series': 'Backstage', 'season_number': 1, 'episode_number': 8, 'episode': '8. episode', 'age_limit': 0, }, ...
You might hope that `get_element_text_by_id()` would do the job, but IIRC it mungs the script body. There are various HTML attribute syntax edge cases that could be handled if it's thought worthwhile. This pattern allows for several such, the main ones that I know of: * whitespace variations * `\b` matches `-` whi...
'ext': 'mp4', 'title': 'Backstage - 8. episode', 'description': 'md5:de6ca5d5a2d56849e4021f2bf2850df4', 'duration': 1320, 'series': 'Backstage', 'season_number': 1, 'episode_number': 8, 'episode': '8. episode', '...
@@ -485,26 +485,23 @@ class NRKTVEpisodeIE(InfoExtractor): }] def _real_extract(self, url): - display_id, season_number, episode_number = self._match_valid_url(url).groups() - - webpage = self._download_webpage(url, display_id) - - info = self._search_json_ld(webpage, display_id, defaul...
yt_dlp/extractor/nrk.py
26
Python
1
bug
727
51
51
false
[ie/NRKTVEpisode] Fix ID extraction
14,065
yt-dlp/yt-dlp
132,642
Python
dirkf
runarmod
'episode': '27.01.2017', 'age_limit': 0, }, 'params': { 'skip_download': True, }, 'skip': 'ProgramRightsHasExpired', }, { 'url': 'https://radio.nrk.no/serie/dagsnytt/NPUB21019315/12-07-2015#', 'only_matching': True, }, { ...
```suggestion _VALID_URL = r'https?://tv\.nrk\.no/serie/(?P<id>[^/?#]+/sesong/(?P<season_number>\d+)/episode/(?P<episode_number>\d+))' ```
'episode': '27.01.2017', 'age_limit': 0, }, 'params': { 'skip_download': True, }, 'skip': 'ProgramRightsHasExpired', }, { 'url': 'https://radio.nrk.no/serie/dagsnytt/NPUB21019315/12-07-2015#', 'only_matching': True, }, { ...
@@ -449,6 +449,7 @@ class NRKTVEpisodeIE(InfoExtractor): _VALID_URL = r'https?://tv\.nrk\.no/serie/(?P<id>[^/]+/sesong/(?P<season_number>\d+)/episode/(?P<episode_number>\d+))'
yt_dlp/extractor/nrk.py
26
Python
0.714
suggestion
144
51
51
false
[ie/NRKTVEpisode] Fix ID extraction
14,065
yt-dlp/yt-dlp
132,642
Python
bashonly
runarmod
def jwt_encode(payload_data, key, *, alg='HS256', headers=None): assert alg in ('HS256',), f'Unsupported algorithm "{alg}"' def jwt_json_bytes(obj): return json.dumps(obj, separators=(',', ':')).encode() def jwt_b64encode(bytestring): return base64.urlsafe_b64encode(bytestring).rstrip(b'='...
String would make more sense to me, in most contexts I'd imagine you would be converting it to a string anyways?
def jwt_encode(payload_data, key, *, alg='HS256', headers=None): assert alg in ('HS256',), f'Unsupported algorithm "{alg}"' def jwt_json_bytes(obj): return json.dumps(obj, separators=(',', ':')).encode() def jwt_b64encode(bytestring): return base64.urlsafe_b64encode(bytestring).rstrip(b'='...
@@ -4739,22 +4739,34 @@ def time_seconds(**kwargs): return time.time() + dt.timedelta(**kwargs).total_seconds() -# create a JSON Web Signature (jws) with HS256 algorithm -# the resulting format is in JWS Compact Serialization # implemented following JWT https://www.rfc-editor.org/rfc/rfc7519.html # implement...
yt_dlp/utils/_utils.py
26
Python
0.357
question
112
51
51
false
[utils] Add improved `jwt_encode` function
14,071
yt-dlp/yt-dlp
132,642
Python
coletdjnz
bashonly
format_url, video_id, ism_id='mss', fatal=False) formats.extend(fmts) self._merge_subtitles(subs, target=subtitles) else: formats.append({ 'format_id': format_type, 'url': format_url, ...
```suggestion 'playerInfo': jwt_encode(player_info, self._JWT_SIGNING_KEY, headers={ 'kid': self._JWT_KEY_ID, }), ```
format_url, video_id, ism_id='mss', fatal=False) formats.extend(fmts) self._merge_subtitles(subs, target=subtitles) else: formats.append({ 'format_id': format_type, 'url': format_url, ...
@@ -98,7 +98,7 @@ def _call_api(self, video_id, client='null', id_token=None, version='v2'): 'Content-Type': 'application/json', }, data=json.dumps({ 'identityToken': id_token or '', - 'playerInfo': jwt_encode_hs256(player_info, self._JWT_SIGNING_KEY, header...
yt_dlp/extractor/vrt.py
26
Python
0.714
suggestion
173
51
51
false
[utils] Add improved `jwt_encode` function
14,071
yt-dlp/yt-dlp
132,642
Python
bashonly
bashonly
app_id = self._match_id(url) self._set_cookie('store.steampowered.com', 'wants_mature_content', '1') self._set_cookie('store.steampowered.com', 'birthtime', '946652401') self._set_cookie('store.steampowered.com', 'lastagecheckage', '1-January-2000') webpage = self._download_web...
something I'm just noticing now... since `app_name` can potentially be `None` or empty: ```suggestion 'title': join_nonempty(app_name, 'video', movie_id, delim=' ')', ```
def _real_extract(self, url): app_id = self._match_id(url) self._set_cookie('store.steampowered.com', 'wants_mature_content', '1') self._set_cookie('store.steampowered.com', 'birthtime', '946652401') self._set_cookie('store.steampowered.com', 'lastagecheckage', '1-January-2000') ...
@@ -76,50 +54,121 @@ def _real_extract(self, url): formats = [] if hls_manifest := traverse_obj(data_prop, ('hlsManifest', {url_or_none})): formats.extend(self._extract_m3u8_formats( - hls_manifest, playlist_id, 'mp4', m3u8_id='hls', fatal=False)) - + ...
yt_dlp/extractor/steam.py
26
Python
0.714
suggestion
189
51
51
false
[ie/steam] Fix extractors
14,093
yt-dlp/yt-dlp
132,642
Python
bashonly
doe1080
{find_elements(cls='highlight_player_item highlight_movie', html=True)}, ..., {extract_attributes}, 'data-props', {json.loads}, {dict}, )): formats = [] if hls_manifest := traverse_obj(data_prop, ('hlsManifest', {url_or_none})): formats.extend(self...
```suggestion _VALID_URL = r'https?://(?:www\.)?steamcommunity\.com/sharedfiles/filedetails(?:/?\?(?:[^#]+&)?id=|/)(?P<id>\d+)' ``` or else we could be matching `/filedetails123456`
for data_prop in traverse_obj(webpage, ( {find_elements(cls='highlight_player_item highlight_movie', html=True)}, ..., {extract_attributes}, 'data-props', {json.loads}, {dict}, )): formats = [] if hls_manifest := traverse_obj(data_prop, ('hlsManifest', {ur...
@@ -76,50 +54,121 @@ def _real_extract(self, url): formats = [] if hls_manifest := traverse_obj(data_prop, ('hlsManifest', {url_or_none})): formats.extend(self._extract_m3u8_formats( - hls_manifest, playlist_id, 'mp4', m3u8_id='hls', fatal=False)) - + ...
yt_dlp/extractor/steam.py
26
Python
0.786
suggestion
188
51
51
false
[ie/steam] Fix extractors
14,093
yt-dlp/yt-dlp
132,642
Python
bashonly
doe1080
'description': 'md5:1b8a103a5d67a3c48d07c065de7e2c63', 'duration': 83, 'like_count': int, 'live_status': 'not_live', 'media_type': 'video', 'playable_in_embed': True, 'tags': 'count:10', 'thumbnail': r're:https?://i\.ytimg\....
with `_search_json`, passing a default value implies `fatal=False` ```suggestion file_id, default={}, transform_source=js_to_json) ```
'comment_count': int, 'description': 'md5:1b8a103a5d67a3c48d07c065de7e2c63', 'duration': 83, 'like_count': int, 'live_status': 'not_live', 'media_type': 'video', 'playable_in_embed': True, 'tags': 'count:10', 'th...
@@ -76,50 +54,121 @@ def _real_extract(self, url): formats = [] if hls_manifest := traverse_obj(data_prop, ('hlsManifest', {url_or_none})): formats.extend(self._extract_m3u8_formats( - hls_manifest, playlist_id, 'mp4', m3u8_id='hls', fatal=False)) - + ...
yt_dlp/extractor/steam.py
26
Python
0.714
suggestion
149
51
51
false
[ie/steam] Fix extractors
14,093
yt-dlp/yt-dlp
132,642
Python
bashonly
doe1080
if confirmation_webpage: confirmed_source_url = extract_attributes( get_element_html_by_id('download-form', confirmation_webpage) or '').get('action') if confirmed_source_url: urlh = request_source_file(confirmed_sou...
use `yt_dlp.utils.parse_qs` ```suggestion subtitles_id = parse_qs(ttsurl).get('vid', [None])[-1] ```
if urlh.headers.get('Content-Disposition'): add_source_format(urlh) else: confirmation_webpage = self._webpage_read_content( urlh, url, video_id, note='Downloading confirmation page', errnote='Unable to confirm download', fa...
@@ -268,10 +268,9 @@ def add_source_format(urlh): subtitles_id = None ttsurl = get_value('ttsurl') if ttsurl: - # the video Id for subtitles will be the last value in the ttsurl - # query string - subtitles_id = ttsurl.encode().decode( - 'unicod...
yt_dlp/extractor/googledrive.py
26
Python
0.786
suggestion
115
51
51
false
[ie/googledrive] Fix subtitles extraction
14,139
yt-dlp/yt-dlp
132,642
Python
bashonly
zakaryan2004
errnote='Unable to download subtitles XML', fatal=False) if self._captions_xml: for f in self._captions_xml.findall('format'): if f.attrib.get('fmt_code') and not f.attrib.get('default'): self._caption_formats_ext.append(f.attrib['fmt_code']) def ...
```suggestion 'name': caption_entry.attrib.get('name') or '', ``` or if we can't get subs at all without this value, should we just `continue` above? (maybe `report_warning` too?)
}, note='Downloading subtitles XML', errnote='Unable to download subtitles XML', fatal=False) if self._captions_xml: for f in self._captions_xml.findall('format'): if f.attrib.get('fmt_code') and not f.attrib.get('default'): self._caption_f...
@@ -129,7 +129,7 @@ def _get_captions_by_type(self, video_id, subtitles_id, caption_type, 'lang': (caption_lang_code if origin_lang_code is None else origin_lang_code), 'type': 'track', - 'name': '', + 'name': ...
yt_dlp/extractor/googledrive.py
26
Python
0.857
suggestion
202
51
51
false
[ie/googledrive] Fix subtitles extraction
14,139
yt-dlp/yt-dlp
132,642
Python
bashonly
zakaryan2004
caption_format_data.append({ 'url': update_url_query(self._BASE_URL_CAPTIONS, query), 'ext': caption_format, }) captions[caption_lang_code] = caption_format_data return captions def _get_subtitles(self, video_id, subtitles_...
```suggestion track = next((t for t in self._captions_xml.findall('track') if t.attrib.get('cantran') == 'true'), None) ```
caption_format_data.append({ 'url': update_url_query(self._BASE_URL_CAPTIONS, query), 'ext': caption_format, }) captions[caption_lang_code] = caption_format_data return captions def _get_subtitles(self, video_id, subtitles_...
@@ -155,14 +160,19 @@ def _get_automatic_captions(self, video_id, subtitles_id, hl): self._download_subtitles_xml(video_id, subtitles_id, hl) if not self._captions_xml: return - track = self._captions_xml.find('track') + track = None + for t in self._captions_xml.find...
yt_dlp/extractor/googledrive.py
26
Python
0.714
suggestion
133
51
51
false
[ie/googledrive] Fix subtitles extraction
14,139
yt-dlp/yt-dlp
132,642
Python
bashonly
zakaryan2004
errnote='Unable to confirm download', fatal=False) if confirmation_webpage: confirmed_source_url = extract_attributes( get_element_html_by_id('download-form', confirmation_webpage) or '').get('action') if confirmed_sourc...
```suggestion subtitles_id = parse_qs(ttsurl).get('vid', [None])[-1] ```
errnote='Unable to confirm download', fatal=False) if confirmation_webpage: confirmed_source_url = extract_attributes( get_element_html_by_id('download-form', confirmation_webpage) or '').get('action') if confirmed_sourc...
@@ -268,10 +274,8 @@ def add_source_format(urlh): subtitles_id = None ttsurl = get_value('ttsurl') if ttsurl: - # the video Id for subtitles will be the last value in the ttsurl - # query string - subtitles_id = ttsurl.encode().decode( - 'unicod...
yt_dlp/extractor/googledrive.py
26
Python
0.571
suggestion
86
51
51
false
[ie/googledrive] Fix subtitles extraction
14,139
yt-dlp/yt-dlp
132,642
Python
bashonly
zakaryan2004
'params': {'skip_download': 'm3u8'}, }] def _real_extract(self, url): video_id = self._match_id(url) response = self._call_api(f'v1/video/{video_id}', video_id) return { 'id': video_id, 'formats': self._extract_m3u8_formats(response['source'], video_id, ...
how can there be a VOD without it having been a livestream?
'params': {'skip_download': 'm3u8'}, }, { # VOD of ongoing livestream (at the time of writing the test, ID rotates every two days) 'url': 'https://kick.com/a-log-burner/videos/5230df84-ea38-46e1-be4f-f5949ae55641', 'info_dict': { 'id': '5230df84-ea38-46e1-be4f-f5949ae5564...
@@ -137,6 +137,9 @@ def _real_extract(self, url): 'categories': ('livestream', 'categories', ..., 'name', {str}), 'view_count': ('views', {int_or_none}), 'age_limit': ('livestream', 'is_mature', {bool}, {lambda x: 18 if x else 0}), + 'live_status': ( + ...
yt_dlp/extractor/kick.py
26
Python
0.214
question
59
51
51
false
[ie/kick:vod] Support ongoing livestream VODs
14,154
yt-dlp/yt-dlp
132,642
Python
bashonly
InvalidUsernameException
import json from .common import InfoExtractor from ..utils import int_or_none, parse_iso8601, try_call, url_or_none from ..utils.traversal import traverse_obj class FrontoBaseIE(InfoExtractor): def _get_auth_headers(self, url): auth_cookie = try_call(lambda: self._get_cookies(url)['frAccessToken'].value)...
```suggestion return traverse_obj(self._get_cookies(url), { 'authorization': ('frAccessToken', 'value', {lambda token: f'Bearer {token}' if token else None}), }) ```
import json from .common import InfoExtractor from ..utils import int_or_none, parse_iso8601, url_or_none from ..utils.traversal import traverse_obj class FrontoBaseIE(InfoExtractor): def _get_auth_headers(self, url): return traverse_obj(self._get_cookies(url), { 'authorization': ('frAccessTo...
@@ -0,0 +1,165 @@ +import json + +from .common import InfoExtractor +from ..utils import int_or_none, parse_iso8601, try_call, url_or_none +from ..utils.traversal import traverse_obj + + +class FrontoBaseIE(InfoExtractor): + def _get_auth_headers(self, url): + auth_cookie = try_call(lambda: self._get_cookies(...
yt_dlp/extractor/frontro.py
15
Python
0.714
security
197
40
40
false
[ie/TheChosen] Add extractors
14,183
yt-dlp/yt-dlp
132,642
Python
bashonly
mrFlamel
import json from .common import InfoExtractor from ..utils import int_or_none, parse_iso8601, try_call, url_or_none from ..utils.traversal import traverse_obj class FrontoBaseIE(InfoExtractor): def _get_auth_headers(self, url): auth_cookie = try_call(lambda: self._get_cookies(url)['frAccessToken'].value)...
could use a generalized `_call_api` method & move graphql queries to class constants
import json from .common import InfoExtractor from ..utils import int_or_none, parse_iso8601, url_or_none from ..utils.traversal import traverse_obj class FrontoBaseIE(InfoExtractor): def _get_auth_headers(self, url): return traverse_obj(self._get_cookies(url), { 'authorization': ('frAccessTo...
@@ -0,0 +1,165 @@ +import json + +from .common import InfoExtractor +from ..utils import int_or_none, parse_iso8601, try_call, url_or_none +from ..utils.traversal import traverse_obj + + +class FrontoBaseIE(InfoExtractor): + def _get_auth_headers(self, url): + auth_cookie = try_call(lambda: self._get_cookies(...
yt_dlp/extractor/frontro.py
23
Python
0.429
suggestion
84
48
48
false
[ie/TheChosen] Add extractors
14,183
yt-dlp/yt-dlp
132,642
Python
bashonly
mrFlamel
'id': '2000420320', 'ext': 'mp4', 'title': 'Kuris senovės romėnų poetas aprašė Narcizo mitą?', 'description': 'Intelektinė viktorina. Ved. Arūnas Valinskas ir Andrius Tapinas.', 'channel': 'Auksinis protas. Vasara', 'thumbnail': 'https://www.lrt.lt...
```suggestion canonical_url = ( self._search_regex(r'\\"(?:article|data)\\":{[^}]*\\"url\\":\\"(/[^"]+)\\"', webpage, 'content', fatal=False) or self._search_regex(r'<link\s+rel="canonical"\s*href="(/[^"]+)"', webpage, 'canonical URL')) ```
'id': '2000420320', 'ext': 'mp4', 'title': 'Kuris senovės romėnų poetas aprašė Narcizo mitą?', 'description': 'Intelektinė viktorina. Ved. Arūnas Valinskas ir Andrius Tapinas.', 'channel': 'Auksinis protas. Vasara', 'thumbnail': 'https://www.lrt.lt...
@@ -31,86 +23,110 @@ class LRTStreamIE(LRTBaseIE): def _real_extract(self, url): video_id = self._match_id(url) webpage = self._download_webpage(url, video_id) - streams_data = self._download_json(self._extract_js_var(webpage, 'tokenURL'), video_id) + + # TODO: Use _search_nextjs_v1...
yt_dlp/extractor/lrt.py
26
Python
0.786
suggestion
276
51
51
false
[ie/lrt] Fix extractors
14,193
yt-dlp/yt-dlp
132,642
Python
bashonly
seproDev
'ext': 'mp4', 'title': '【検証】専門家は、KADOKAWAをどう見るか', 'cast': 'count:3', 'description': 'md5:2c2d4bf77484a4333ec995d676f9a91d', 'release_date': '20240622', 'release_timestamp': 1719088080, 'series': 'NPレポート', 'series_id': '158',...
`cookies` is the default `method` if `_NETRC_MACHINE` is unset ```suggestion f'only the preview is downloaded. {self._login_hint()}', video_id) ```
'ext': 'mp4', 'title': '【検証】専門家は、KADOKAWAをどう見るか', 'cast': 'count:3', 'description': 'md5:2c2d4bf77484a4333ec995d676f9a91d', 'release_date': '20240622', 'release_timestamp': 1719088080, 'series': 'NPレポート', 'series_id': '158',...
@@ -50,7 +50,14 @@ def _real_extract(self, url): webpage = self._download_webpage(url, video_id) fragment = self._search_nextjs_data(webpage, video_id)['props']['pageProps']['fragment'] - m3u8_url = traverse_obj(fragment, ('movie', 'movieUrl', {url_or_none}, {require('m3u8 URL')})) + m...
yt_dlp/extractor/newspicks.py
26
Python
0.714
suggestion
166
46
46
false
[ie/newspicks] Add preview warning for premium videos when unauthenticated
14,197
yt-dlp/yt-dlp
132,642
Python
bashonly
doe1080
}, 'skip': 'Invalid URL', }] def _real_extract(self, url): channel_id = self._match_id(url) media_id = self._extract_url_media_id(url) if not self._yes_playlist(channel_id, media_id, playlist_label='channel'): return self.url_result(f'wistia:{media_id}', 'Wis...
can we make this backwards compatible ```suggestion for video in traverse_obj(series, ('sections', ..., ('videos', 'episodes'), ...)) or [] ```
}, 'skip': 'Invalid URL', }] def _real_extract(self, url): channel_id = self._match_id(url) media_id = self._extract_url_media_id(url) if not self._yes_playlist(channel_id, media_id, playlist_label='channel'): return self.url_result(f'wistia:{media_id}', 'Wis...
@@ -399,7 +408,7 @@ def _real_extract(self, url): entries = [ self.url_result(f'wistia:{video["hashedId"]}', WistiaIE, title=video.get('name')) - for video in traverse_obj(series, ('sections', ..., 'videos', ...)) or [] + for video in traverse_obj(series, ('sections', ..., ...
yt_dlp/extractor/wistia.py
26
Python
0.714
suggestion
158
40
39
false
[ie/wistia] Fixed channel download
14,218
yt-dlp/yt-dlp
132,642
Python
bashonly
Sojiroh
'X': 18, } def _real_extract(self, url): content_id = self._match_id(url) data = self._download_json( 'https://10.com.au/api/v1/videos/' + content_id, content_id) video_data = self._download_json( f'https://vod.ten.com.au/api/videos/bcquery?command=find_...
```suggestion self.raise_geo_restricted(countries=['AU']) if '10play_unsupported' in m3u8_url: raise ExtractorError('Unable to extract stream') ``` If this happens again, this should hopefully prevent yt-dlp downloading useless 10 second files
_AUS_AGES = { 'G': 0, 'PG': 15, 'M': 15, 'MA': 15, 'MA15+': 15, 'R': 18, 'X': 18, } def _real_extract(self, url): content_id = self._match_id(url) data = self._download_json( 'https://10.com.au/api/v1/videos/' + content_id,...
@@ -103,13 +103,13 @@ def _real_extract(self, url): f'https://vod.ten.com.au/api/videos/bcquery?command=find_videos_by_id&video_id={data["altId"]}', content_id, 'Downloading video JSON') m3u8_url = self._request_webpage( - HEADRequest(video_data['items'][0]['HLSURL']), + ...
yt_dlp/extractor/tenplay.py
26
Python
1
refactor
284
51
51
false
[ie/10play] Fix extractor
14,242
yt-dlp/yt-dlp
132,642
Python
gamer191
Sipherdrakon
}, { 'url': 'https://10play.com.au/how-to-stay-married/web-extras/season-1/terrys-talks-ep-1-embracing-change/tpv190915ylupc', 'only_matching': True, }] _GEO_BYPASS = False _AUS_AGES = { 'G': 0, 'PG': 15, 'M': 15, 'MA': 15, 'MA15+': 15, 'R...
Should we just parse the dash manifest instead of the m3u8? So, using `self._extract_mpd_formats` below. If there is an advantage to using the m3u8 we should use the `update_url_query` util.
'upload_date': '20250522', 'season': 'Season 1', 'episode': 'Episode 2', }, 'params': {'skip_download': 'm3u8'}, 'expected_warnings': ['Failed to download m3u8 information: HTTP Error 502'], 'skip': 'video unavailable', }, { 'url': 'https:/...
@@ -103,13 +103,13 @@ def _real_extract(self, url): f'https://vod.ten.com.au/api/videos/bcquery?command=find_videos_by_id&video_id={data["altId"]}', content_id, 'Downloading video JSON') m3u8_url = self._request_webpage( - HEADRequest(video_data['items'][0]['HLSURL']), + ...
yt_dlp/extractor/tenplay.py
26
Python
0.571
refactor
193
51
51
false
[ie/10play] Fix extractor
14,242
yt-dlp/yt-dlp
132,642
Python
seproDev
Sipherdrakon
_GEO_BYPASS = False _AUS_AGES = { 'G': 0, 'PG': 15, 'M': 15, 'MA': 15, 'MA15+': 15, 'R': 18, 'X': 18, } def _real_extract(self, url): content_id = self._match_id(url) data = self._download_json( 'https://10.com.au/api/...
These would be added if they weren't in the query params of the original URL. Is that what is wanted? It's not the same semantics as the former `replace()` formula.
'params': {'skip_download': 'm3u8'}, 'expected_warnings': ['Failed to download m3u8 information: HTTP Error 502'], 'skip': 'video unavailable', }, { 'url': 'https://10play.com.au/how-to-stay-married/web-extras/season-1/terrys-talks-ep-1-embracing-change/tpv190915ylupc', 'only...
@@ -102,14 +102,21 @@ def _real_extract(self, url): video_data = self._download_json( f'https://vod.ten.com.au/api/videos/bcquery?command=find_videos_by_id&video_id={data["altId"]}', content_id, 'Downloading video JSON') + # Convert DASH to HLS using update_url_query m...
yt_dlp/extractor/tenplay.py
26
Python
0.571
suggestion
165
51
51
false
[ie/10play] Fix extractor
14,242
yt-dlp/yt-dlp
132,642
Python
dirkf
Sipherdrakon
'skip': 'video unavailable', }, { 'url': 'https://10play.com.au/how-to-stay-married/web-extras/season-1/terrys-talks-ep-1-embracing-change/tpv190915ylupc', 'only_matching': True, }] _GEO_BYPASS = False _AUS_AGES = { 'G': 0, 'PG': 15, 'M': 15, 'MA'...
```suggestion # Dash URL 403s, changing the m3u8 format works ```
'thumbnail': r're:https://.+/.+\.jpg', 'upload_date': '20250522', 'season': 'Season 1', 'episode': 'Episode 2', }, 'params': {'skip_download': 'm3u8'}, 'expected_warnings': ['Failed to download m3u8 information: HTTP Error 502'], 'skip': 'v...
@@ -102,14 +102,19 @@ def _real_extract(self, url): video_data = self._download_json( f'https://vod.ten.com.au/api/videos/bcquery?command=find_videos_by_id&video_id={data["altId"]}', content_id, 'Downloading video JSON') + # Convert DASH to HLS using update_url_query
yt_dlp/extractor/tenplay.py
26
Python
0.571
suggestion
75
51
51
false
[ie/10play] Fix extractor
14,242
yt-dlp/yt-dlp
132,642
Python
seproDev
Sipherdrakon
'PG': 15, 'M': 15, 'MA': 15, 'MA15+': 15, 'R': 18, 'X': 18, } def _real_extract(self, url): content_id = self._match_id(url) data = self._download_json( 'https://10.com.au/api/v1/videos/' + content_id, content_id) video_data =...
```suggestion raise ExtractorError('Unable to extract stream') ```
'url': 'https://10play.com.au/how-to-stay-married/web-extras/season-1/terrys-talks-ep-1-embracing-change/tpv190915ylupc', 'only_matching': True, }] _GEO_BYPASS = False _AUS_AGES = { 'G': 0, 'PG': 15, 'M': 15, 'MA': 15, 'MA15+': 15, 'R': 18, ...
@@ -102,14 +102,19 @@ def _real_extract(self, url): video_data = self._download_json( f'https://vod.ten.com.au/api/videos/bcquery?command=find_videos_by_id&video_id={data["altId"]}', content_id, 'Downloading video JSON') + # Convert DASH to HLS using update_url_query m...
yt_dlp/extractor/tenplay.py
26
Python
0.786
refactor
80
51
51
false
[ie/10play] Fix extractor
14,242
yt-dlp/yt-dlp
132,642
Python
seproDev
Sipherdrakon
import itertools from .common import InfoExtractor from ..networking import HEADRequest from ..utils import ExtractorError, int_or_none, traverse_obj, update_url_query, url_or_none, urljoin class TenPlayIE(InfoExtractor): IE_NAME = '10play' _VALID_URL = r'https?://(?:www\.)?10(?:play)?\.com\.au/(?:[^/?#]+/)+...
```suggestion from ..utils import ( ExtractorError, int_or_none, update_url_query, url_or_none, urljoin, ) from ..utils.traversal import traverse_obj ```
import itertools from .common import InfoExtractor from ..networking import HEADRequest from ..utils import ( ExtractorError, int_or_none, update_url_query, url_or_none, urljoin, ) from ..utils.traversal import traverse_obj class TenPlayIE(InfoExtractor): IE_NAME = '10play' _VALID_URL = r...
@@ -2,7 +2,7 @@ from .common import InfoExtractor from ..networking import HEADRequest -from ..utils import int_or_none, traverse_obj, url_or_none, urljoin +from ..utils import ExtractorError, int_or_none, traverse_obj, update_url_query, url_or_none, urljoin
yt_dlp/extractor/tenplay.py
5
Python
0.929
refactor
182
30
30
false
[ie/10play] Fix extractor
14,242
yt-dlp/yt-dlp
132,642
Python
bashonly
Sipherdrakon
_AUS_AGES = { 'G': 0, 'PG': 15, 'M': 15, 'MA': 15, 'MA15+': 15, 'R': 18, 'X': 18, } def _real_extract(self, url): content_id = self._match_id(url) data = self._download_json( 'https://10.com.au/api/v1/videos/' + content_id,...
For next clean-up: ```suggestion # Dash URL 404s, changing the m3u8 format works ``` Unless ofc 403 **is** being seen...
'skip': 'video unavailable', }, { 'url': 'https://10play.com.au/how-to-stay-married/web-extras/season-1/terrys-talks-ep-1-embracing-change/tpv190915ylupc', 'only_matching': True, }] _GEO_BYPASS = False _AUS_AGES = { 'G': 0, 'PG': 15, 'M': 15, 'MA'...
@@ -102,14 +109,19 @@ def _real_extract(self, url): video_data = self._download_json( f'https://vod.ten.com.au/api/videos/bcquery?command=find_videos_by_id&video_id={data["altId"]}', content_id, 'Downloading video JSON') + # Dash URL 403s, changing the m3u8 format works
yt_dlp/extractor/tenplay.py
26
Python
0.714
suggestion
132
51
51
false
[ie/10play] Fix extractor
14,242
yt-dlp/yt-dlp
132,642
Python
dirkf
Sipherdrakon
import urllib.parse from .common import InfoExtractor from ..utils import ( ExtractorError, determine_ext, int_or_none, join_nonempty, mimetype2ext, parse_qs, unified_strdate, url_or_none, ) from ..utils.traversal import traverse_obj class FirstTVIE(InfoExtractor): IE_NAME = '1tv'...
Shouldn't this just be a different extractor if we have a different URL structure and none of the code is shared?
import urllib.parse from .common import InfoExtractor from ..utils import ( determine_ext, int_or_none, join_nonempty, mimetype2ext, parse_qs, unified_strdate, url_or_none, ) from ..utils.traversal import require, traverse_obj class FirstTVIE(InfoExtractor): IE_NAME = '1tv' IE_DES...
@@ -16,7 +17,7 @@ class FirstTVIE(InfoExtractor): IE_NAME = '1tv' IE_DESC = 'Первый канал' - _VALID_URL = r'https?://(?:www\.)?(?:sport)?1tv\.ru/(?:[^/?#]+/)+(?P<id>[^/?#]+)' + _VALID_URL = r'https?://(?:www\.)?(?:sport)?1tv\.ru/(?:(?:[^/?#]+/)*(?:(?P<live>live)|(?P<id>[^/?#]+)))'
yt_dlp/extractor/firsttv.py
20
Python
0.429
refactor
113
45
45
false
[ie/1tv:live] Add extractor
14,299
yt-dlp/yt-dlp
132,642
Python
seproDev
swayll
self._merge_subtitles(subs, target=subtitles) yield { **traverse_obj(item, { 'title': ('title', {str}), 'thumbnail': ('poster', {url_or_none}), 'timestamp': ('dvr_begin_at', {int_or_none}), 'uplo...
As there is nothing useful to do otherwise, this can be fatal
}), 'id': video_id, 'formats': formats, 'subtitles': subtitles, } def _real_extract(self, url): display_id = self._match_id(url) webpage = self._download_webpage(url, display_id) playlist_url = urllib.parse.urljoin...
@@ -115,8 +124,31 @@ def _entries(self, items): def _real_extract(self, url): display_id = self._match_id(url) - + is_live = self._match_valid_url(url).group('live') webpage = self._download_webpage(url, display_id) + + if is_live: + mpd_list = self._parse_json(self._do...
yt_dlp/extractor/firsttv.py
26
Python
0.286
suggestion
61
51
51
false
[ie/1tv:live] Add extractor
14,299
yt-dlp/yt-dlp
132,642
Python
seproDev
swayll
'upload_date': ('date_air', {unified_strdate}), 'duration': ('duration', {int_or_none}), }), 'id': video_id, 'formats': formats, 'subtitles': subtitles, } def _real_extract(self, url): displa...
You need to add the extractor to `yt_dlp/extractor/_extractors.py` ```py from .firsttv import ( FirstTVIE, FirstTVLiveIE, ) ```
'duration': ('duration', {int_or_none}), }), 'id': video_id, 'formats': formats, 'subtitles': subtitles, } def _real_extract(self, url): display_id = self._match_id(url) webpage = self._download_webpage...
@@ -129,3 +130,51 @@ def _real_extract(self, url): return self.playlist_result( self._entries(items), display_id, self._og_search_title(webpage, default=None), thumbnail=self._og_search_thumbnail(webpage, default=None)) + + +class FirstTVLiveIE(InfoExtractor):
yt_dlp/extractor/firsttv.py
26
Python
0.786
refactor
143
51
51
false
[ie/1tv:live] Add extractor
14,299
yt-dlp/yt-dlp
132,642
Python
seproDev
swayll
'id': 'live', 'ext': 'mp4', 'title': 'ПЕРВЫЙ КАНАЛ ПРЯМОЙ ЭФИР СМОТРЕТЬ ОНЛАЙН', 'is_live': True, }, }, ] def _real_extract(self, url): display_id = 'live' webpage = self._download_webpage(url, display_id) ...
Why the output args? Also does this actually work for you? I think there is a core bug here.
import urllib.parse from .common import InfoExtractor from ..utils import ( determine_ext, int_or_none, join_nonempty, mimetype2ext, parse_qs, unified_strdate, url_or_none, ) from ..utils.traversal import require, traverse_obj class FirstTVIE(InfoExtractor): IE_NAME = '1tv' IE_DES...
@@ -129,3 +130,51 @@ def _real_extract(self, url): return self.playlist_result( self._entries(items), display_id, self._og_search_title(webpage, default=None), thumbnail=self._og_search_thumbnail(webpage, default=None)) + + +class FirstTVLiveIE(InfoExtractor): + IE_NAME = '1tv-live...
yt_dlp/extractor/firsttv.py
26
Python
0.357
bug
92
36
165
false
[ie/1tv:live] Add extractor
14,299
yt-dlp/yt-dlp
132,642
Python
seproDev
swayll