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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
from .common import InfoExtractor
from ..utils import float_or_none, url_or_none
from ..utils.traversal import traverse_obj
class FrancaisFacileIE(InfoExtractor):
_VALID_URL = r'https?://francaisfacile\.rfi\.fr/fr/(actualit%C3%A9|podcasts/[^/#?]+)/(?P<id>\d+)-'
IE_NAME = 'francaisfacile'
_TESTS = [{
... | ```suggestion
from ..utils import (
ExtractorError,
float_or_none,
url_or_none,
)
``` | import urllib.parse
from .common import InfoExtractor
from ..networking.exceptions import HTTPError
from ..utils import (
ExtractorError,
float_or_none,
url_or_none,
)
from ..utils.traversal import traverse_obj
class FrancaisFacileIE(InfoExtractor):
_VALID_URL = r'https?://francaisfacile\.rfi\.fr/[a-... | @@ -0,0 +1,68 @@
+from .common import InfoExtractor
+from ..utils import float_or_none, url_or_none | yt_dlp/extractor/francaisfacile.py | 2 | Python | 0.929 | refactor | 103 | 27 | 27 | false | [ie/francaisfacile] Add extractor | 12,787 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | mlabeeb03 |
}, {
'url': 'https://francaisfacile.rfi.fr/fr/podcasts/un-mot-une-histoire/20250317-le-mot-de-david-foenkinos-peut-%C3%AAtre',
'md5': 'db83c2cc2589b4c24571c6b6cf14f5f1',
'info_dict': {
'id': 'WBMZ59441-FLE-FR-20250317',
'title': 'Le mot de David Foenkinos: «peut-être»... | ```suggestion
return {
'id': data['mediaId'],
'display_id': display_id,
``` | 'title': 'Argentine: le sac d\'un alpiniste retrouvé 40 ans après sa mort',
'url': 'https://aod-fle.akamaized.net/fle/sounds/fr/2025/03/07/8edf4082-fb46-11ef-8a37-005056bf762b.mp3',
'ext': 'mp3',
'description': 'md5:7fd088fbdf4a943bb68cf82462160dca',
'duration... | @@ -0,0 +1,68 @@
+from .common import InfoExtractor
+from ..utils import float_or_none, url_or_none
+from ..utils.traversal import traverse_obj
+
+
+class FrancaisFacileIE(InfoExtractor):
+ _VALID_URL = r'https?://francaisfacile\.rfi\.fr/fr/(actualit%C3%A9|podcasts/[^/#?]+)/(?P<id>\d+)-'
+ IE_NAME = 'francaisfaci... | yt_dlp/extractor/francaisfacile.py | 26 | Python | 0.714 | suggestion | 113 | 35 | 51 | false | [ie/francaisfacile] Add extractor | 12,787 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | mlabeeb03 |
'timestamp': 1741352789,
'upload_date': '20250307',
},
}, {
'url': 'https://francaisfacile.rfi.fr/fr/podcasts/un-mot-une-histoire/20250317-le-mot-de-david-foenkinos-peut-%C3%AAtre',
'md5': 'db83c2cc2589b4c24571c6b6cf14f5f1',
'info_dict': {
'id': 'W... | ```suggestion
webpage, 'audio data', display_id)
``` | 'info_dict': {
'id': 'WBMZ59102-FLE-FR-20250307',
'display_id': '20250307-argentine-le-sac-d-un-alpiniste-retrouvé-40-ans-après-sa-mort',
'title': 'Argentine: le sac d\'un alpiniste retrouvé 40 ans après sa mort',
'url': 'https://aod-fle.akamaized.net/fle/sounds/f... | @@ -0,0 +1,68 @@
+from .common import InfoExtractor
+from ..utils import float_or_none, url_or_none
+from ..utils.traversal import traverse_obj
+
+
+class FrancaisFacileIE(InfoExtractor):
+ _VALID_URL = r'https?://francaisfacile\.rfi\.fr/fr/(actualit%C3%A9|podcasts/[^/#?]+)/(?P<id>\d+)-'
+ IE_NAME = 'francaisfaci... | yt_dlp/extractor/francaisfacile.py | 26 | Python | 0.571 | suggestion | 66 | 38 | 51 | false | [ie/francaisfacile] Add extractor | 12,787 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | mlabeeb03 |
'url': 'https://francaisfacile.rfi.fr/fr/podcasts/un-mot-une-histoire/20250317-le-mot-de-david-foenkinos-peut-%C3%AAtre',
'md5': 'db83c2cc2589b4c24571c6b6cf14f5f1',
'info_dict': {
'id': 'WBMZ59441-FLE-FR-20250317',
'title': 'Le mot de David Foenkinos: «peut-être» - Un mot... | ```suggestion
webpage = self._download_webpage(url, display_id, impersonate=True)
data = self._search_json(
``` | 'duration': 117.74,
'timestamp': 1741352789,
'upload_date': '20250307',
},
}, {
'url': 'https://francaisfacile.rfi.fr/fr/podcasts/un-mot-une-histoire/20250317-le-mot-de-david-foenkinos-peut-%C3%AAtre',
'md5': 'db83c2cc2589b4c24571c6b6cf14f5f1',
'in... | @@ -0,0 +1,78 @@
+from .common import InfoExtractor
+from ..utils import (
+ ExtractorError,
+ float_or_none,
+ url_or_none,
+)
+from ..utils.traversal import traverse_obj
+
+
+class FrancaisFacileIE(InfoExtractor):
+ _VALID_URL = r'https?://francaisfacile\.rfi\.fr/fr/(actualit%C3%A9|podcasts/[^/#?]+)/(?P<i... | yt_dlp/extractor/francaisfacile.py | 26 | Python | 0.714 | suggestion | 136 | 41 | 50 | false | [ie/francaisfacile] Add extractor | 12,787 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | mlabeeb03 |
from .common import InfoExtractor
from ..utils import (
ExtractorError,
float_or_none,
url_or_none,
)
from ..utils.traversal import traverse_obj
class FrancaisFacileIE(InfoExtractor):
_VALID_URL = r'https?://francaisfacile\.rfi\.fr/fr/(actualit%C3%A9|podcasts/[^/#?]+)/(?P<id>[^/#?]+)'
_TESTS = [{
... | ```suggestion
_VALID_URL = r'https?://francaisfacile\.rfi\.fr/fr/(?:actualit%C3%A9|podcasts/[^/#?]+)/(?P<id>[^/#?]+)'
``` | import urllib.parse
from .common import InfoExtractor
from ..networking.exceptions import HTTPError
from ..utils import (
ExtractorError,
float_or_none,
url_or_none,
)
from ..utils.traversal import traverse_obj
class FrancaisFacileIE(InfoExtractor):
_VALID_URL = r'https?://francaisfacile\.rfi\.fr/[a-... | @@ -0,0 +1,79 @@
+from .common import InfoExtractor
+from ..utils import (
+ ExtractorError,
+ float_or_none,
+ url_or_none,
+)
+from ..utils.traversal import traverse_obj
+
+
+class FrancaisFacileIE(InfoExtractor):
+ _VALID_URL = r'https?://francaisfacile\.rfi\.fr/fr/(actualit%C3%A9|podcasts/[^/#?]+)/(?P<i... | yt_dlp/extractor/francaisfacile.py | 11 | Python | 0.857 | suggestion | 127 | 36 | 36 | false | [ie/francaisfacile] Add extractor | 12,787 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | mlabeeb03 |
from .common import InfoExtractor
from ..utils import (
ExtractorError,
float_or_none,
url_or_none,
)
from ..utils.traversal import traverse_obj
class FrancaisFacileIE(InfoExtractor):
_VALID_URL = r'https?://francaisfacile\.rfi\.fr/fr/(?:actualit%C3%A9|podcasts/[^/#?]+)/(?P<id>[^/#?]+)'
_TESTS = [... | ```suggestion
_VALID_URL = r'https?://francaisfacile\.rfi\.fr/[a-z]{2}/(?:actualit%C3%A9|podcasts/[^/#?]+)/(?P<id>[^/#?]+)'
``` | import urllib.parse
from .common import InfoExtractor
from ..networking.exceptions import HTTPError
from ..utils import (
ExtractorError,
float_or_none,
url_or_none,
)
from ..utils.traversal import traverse_obj
class FrancaisFacileIE(InfoExtractor):
_VALID_URL = r'https?://francaisfacile\.rfi\.fr/[a-... | @@ -0,0 +1,79 @@
+from .common import InfoExtractor
+from ..utils import (
+ ExtractorError,
+ float_or_none,
+ url_or_none,
+)
+from ..utils.traversal import traverse_obj
+
+
+class FrancaisFacileIE(InfoExtractor):
+ _VALID_URL = r'https?://francaisfacile\.rfi\.fr/fr/(?:actualit%C3%A9|podcasts/[^/#?]+)/(?P... | yt_dlp/extractor/francaisfacile.py | 11 | Python | 0.857 | suggestion | 133 | 36 | 36 | false | [ie/francaisfacile] Add extractor | 12,787 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | mlabeeb03 |
'title': 'Argentine: le sac d\'un alpiniste retrouvé 40 ans après sa mort',
'url': 'https://aod-fle.akamaized.net/fle/sounds/fr/2025/03/07/8edf4082-fb46-11ef-8a37-005056bf762b.mp3',
'ext': 'mp3',
'description': 'md5:7fd088fbdf4a943bb68cf82462160dca',
'duration... | ```suggestion
display_id = self._match_id(url)
try: # yt-dlp's default user-agents are too old and blocked by the site
``` | 'url': 'https://francaisfacile.rfi.fr/fr/actualit%C3%A9/20250307-argentine-le-sac-d-un-alpiniste-retrouv%C3%A9-40-ans-apr%C3%A8s-sa-mort',
'md5': 'b8c3a63652d4ae8e8092dda5700c1cd9',
'info_dict': {
'id': 'WBMZ59102-FLE-FR-20250307',
'display_id': '20250307-argentine-le-sac... | @@ -0,0 +1,79 @@
+from .common import InfoExtractor
+from ..utils import (
+ ExtractorError,
+ float_or_none,
+ url_or_none,
+)
+from ..utils.traversal import traverse_obj
+
+
+class FrancaisFacileIE(InfoExtractor):
+ _VALID_URL = r'https?://francaisfacile\.rfi\.fr/[a-z]{2}/(?:actualit%C3%A9|podcasts/[^/#?]... | yt_dlp/extractor/francaisfacile.py | 26 | Python | 0.786 | suggestion | 144 | 51 | 51 | false | [ie/francaisfacile] Add extractor | 12,787 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | mlabeeb03 |
'timestamp': 1742210897,
'upload_date': '20250317',
},
}]
def _real_extract(self, url):
display_id = self._match_id(url)
try: # yt-dlp's default user-agents are too old and blocked by the site
webpage = self._download_webpage(url, display_id, header... | for audio-only http formats we need to do this:
```suggestion
'display_id': display_id,
'vcodec': 'none',
'title': self._html_extract_title(webpage),
``` | 'description': 'md5:3fe35fae035803df696bfa7af2496e49',
'duration': 198.96,
'timestamp': 1742210897,
'upload_date': '20250317',
},
}]
def _real_extract(self, url):
display_id = urllib.parse.unquote(self._match_id(url))
try: # yt-dlp's def... | @@ -0,0 +1,84 @@
+from .common import InfoExtractor
+from ..networking.exceptions import HTTPError
+from ..utils import (
+ ExtractorError,
+ float_or_none,
+ url_or_none,
+)
+from ..utils.traversal import traverse_obj
+
+
+class FrancaisFacileIE(InfoExtractor):
+ _VALID_URL = r'https?://francaisfacile\.rfi... | yt_dlp/extractor/francaisfacile.py | 26 | Python | 0.786 | refactor | 194 | 34 | 37 | false | [ie/francaisfacile] Add extractor | 12,787 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | mlabeeb03 |
import re
from .common import InfoExtractor
from ..utils import (
parse_duration,
traverse_obj,
unified_timestamp,
)
class RTVSIE(InfoExtractor):
IE_NAME = 'stvr'
_VALID_URL = r'https?://(?:www\.)?(rtvs|stvr)\.sk/(?:radio|televizia)/archiv(?:/\d+)?/(?P<id>\d+)/?(?:[#?]|$)'
_TESTS = [{
... | Let's use a non capturing group
```suggestion
_VALID_URL = r'https?://(?:www\.)?(?:rtvs|stvr)\.sk/(?:radio|televizia)/archiv(?:/\d+)?/(?P<id>\d+)/?(?:[#?]|$)'
``` | import re
from .common import InfoExtractor
from ..utils import (
parse_duration,
traverse_obj,
unified_timestamp,
)
class RTVSIE(InfoExtractor):
IE_NAME = 'stvr'
IE_DESC = 'Slovak Television and Radio (formerly RTVS)'
_VALID_URL = r'https?://(?:www\.)?(?:rtvs|stvr)\.sk/(?:radio|televizia)/ar... | @@ -9,7 +9,8 @@
class RTVSIE(InfoExtractor):
- _VALID_URL = r'https?://(?:www\.)?rtvs\.sk/(?:radio|televizia)/archiv(?:/\d+)?/(?P<id>\d+)/?(?:[#?]|$)'
+ IE_NAME = 'stvr'
+ _VALID_URL = r'https?://(?:www\.)?(rtvs|stvr)\.sk/(?:radio|televizia)/archiv(?:/\d+)?/(?P<id>\d+)/?(?:[#?]|$)' | yt_dlp/extractor/rtvs.py | 13 | Python | 0.786 | suggestion | 169 | 38 | 38 | false | [ie/stvr] Rename extractor from RTVS to STVR | 12,788 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | mireq |
import re
from .common import InfoExtractor
from ..utils import (
parse_duration,
traverse_obj,
unified_timestamp,
)
class RTVSIE(InfoExtractor):
IE_NAME = 'stvr'
_VALID_URL = r'https?://(?:www\.)?(?:rtvs|stvr)\.sk/(?:radio|televizia)/archiv(?:/\d+)?/(?P<id>\d+)/?(?:[#?]|$)'
_TESTS = [{
... | ```suggestion
IE_NAME = 'stvr'
IE_DESC = 'Slovak Television and Radio (formerly RTVS)'
``` | import re
from .common import InfoExtractor
from ..utils import (
parse_duration,
traverse_obj,
unified_timestamp,
)
class RTVSIE(InfoExtractor):
IE_NAME = 'stvr'
IE_DESC = 'Slovak Television and Radio (formerly RTVS)'
_VALID_URL = r'https?://(?:www\.)?(?:rtvs|stvr)\.sk/(?:radio|televizia)/ar... | @@ -9,7 +9,8 @@
class RTVSIE(InfoExtractor):
- _VALID_URL = r'https?://(?:www\.)?rtvs\.sk/(?:radio|televizia)/archiv(?:/\d+)?/(?P<id>\d+)/?(?:[#?]|$)'
+ IE_NAME = 'stvr' | yt_dlp/extractor/rtvs.py | 12 | Python | 0.714 | suggestion | 101 | 37 | 37 | false | [ie/stvr] Rename extractor from RTVS to STVR | 12,788 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | mireq |
from .common import InfoExtractor
from ..utils import (
int_or_none,
strip_or_none,
try_get,
urljoin,
)
class On24IE(InfoExtractor):
IE_NAME = 'on24'
IE_DESC = 'ON24'
_ID_RE = r'(?P<id>\d{7})'
_KEY_RE = r'(?P<key>[0-9A-F]{32})'
_URL_BASE_RE = r'https?://event\.on24\.com'
_URL_... | why bother with the target param even
```suggestion
rf'{_URL_BASE_RE}/eventRegistration/EventLobbyServlet/?\?{_URL_QUERY_RE}',
``` | from .common import InfoExtractor
from ..utils import (
int_or_none,
strip_or_none,
try_get,
urljoin,
)
class On24IE(InfoExtractor):
IE_NAME = 'on24'
IE_DESC = 'ON24'
_ID_RE = r'(?P<id>\d{7})'
_KEY_RE = r'(?P<key>[0-9A-F]{32})'
_URL_BASE_RE = r'https?://event\.on24\.com'
_URL_... | @@ -11,12 +11,15 @@ class On24IE(InfoExtractor):
IE_NAME = 'on24'
IE_DESC = 'ON24'
- _VALID_URL = r'''(?x)
- https?://event\.on24\.com/(?:
- wcc/r/(?P<id_1>\d{7})/(?P<key_1>[0-9A-F]{32})|
- eventRegistration/(?:console/EventConsoleApollo|Ev... | yt_dlp/extractor/on24.py | 21 | Python | 0.714 | question | 141 | 46 | 46 | false | [ie/on24] Support `mainEvent` URLs | 12,800 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | bashonly |
return merge_dicts(clean_info, jw_data, json_ld_data)
class LRTRadioIE(LRTBaseIE):
_VALID_URL = r'https?://(?:www\.)?lrt\.lt/radioteka/irasas/(?P<id>[0-9]+)/(?P<path>[^?#/]+)'
_TESTS = [{
# m3u8 download
'url': 'https://www.lrt.lt/radioteka/irasas/2000359728/nemarios-eiles-apie-pragaru... | Being explicit is more maintainable
```suggestion
video_id, path = self._match_valid_url(url).group('id', 'path')
``` | return merge_dicts(clean_info, jw_data, json_ld_data)
class LRTRadioIE(LRTBaseIE):
_VALID_URL = r'https?://(?:www\.)?lrt\.lt/radioteka/irasas/(?P<id>\d+)/(?P<path>[^?#/]+)'
_TESTS = [{
# m3u8 download
'url': 'https://www.lrt.lt/radioteka/irasas/2000359728/nemarios-eiles-apie-pragarus-i... | @@ -106,3 +109,43 @@ def _real_extract(self, url):
}
return merge_dicts(clean_info, jw_data, json_ld_data)
+
+
+class LRTRadioIE(LRTBaseIE):
+ _VALID_URL = r'https?://(?:www\.)?lrt\.lt/radioteka/irasas/(?P<id>[0-9]+)/(?P<path>[^?#/]+)'
+ _TESTS = [{
+ # m3u8 download
+ 'url': 'ht... | yt_dlp/extractor/lrt.py | 26 | Python | 0.714 | suggestion | 128 | 42 | 41 | false | [ie/LRTRadio] Add extractor | 12,801 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | subrat-lima |
from .common import InfoExtractor
from ..utils import (
clean_html,
merge_dicts,
str_or_none,
traverse_obj,
unified_timestamp,
url_or_none,
)
class LRTBaseIE(InfoExtractor):
def _extract_js_var(self, webpage, var_name, default=None):
return self._search_regex(
fr'{var_... | ```suggestion
from .common import InfoExtractor
``` | from .common import InfoExtractor
from ..utils import (
clean_html,
merge_dicts,
str_or_none,
traverse_obj,
unified_timestamp,
url_or_none,
urljoin,
)
class LRTBaseIE(InfoExtractor):
def _extract_js_var(self, webpage, var_name, default=None):
return self._search_regex(
... | @@ -1,8 +1,11 @@
+
from .common import InfoExtractor | yt_dlp/extractor/lrt.py | 2 | Python | 0.643 | refactor | 53 | 27 | 27 | false | [ie/LRTRadio] Add extractor | 12,801 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | subrat-lima |
_TESTS = [{
# m3u8 download
'url': 'https://www.lrt.lt/radioteka/irasas/2000359728/nemarios-eiles-apie-pragarus-ir-skaistyklas-su-aiste-kiltinaviciute',
'info_dict': {
'id': '2000359728',
'ext': 'm4a',
'title': 'Nemarios eilės: apie pragarus ir skaistyklas... | I would inline most of these values
```suggestion
media = self._download_json(
'https://www.lrt.lt/radioteka/api/media', video_id,
query={'url': f'/mediateka/irasas/{video_id}/{path}'})
``` | _TESTS = [{
# m3u8 download
'url': 'https://www.lrt.lt/radioteka/irasas/2000359728/nemarios-eiles-apie-pragarus-ir-skaistyklas-su-aiste-kiltinaviciute',
'info_dict': {
'id': '2000359728',
'ext': 'm4a',
'title': 'Nemarios eilės: apie pragarus ir skaistyklas... | @@ -106,3 +109,43 @@ def _real_extract(self, url):
}
return merge_dicts(clean_info, jw_data, json_ld_data)
+
+
+class LRTRadioIE(LRTBaseIE):
+ _VALID_URL = r'https?://(?:www\.)?lrt\.lt/radioteka/irasas/(?P<id>[0-9]+)/(?P<path>[^?#/]+)'
+ _TESTS = [{
+ # m3u8 download
+ 'url': 'ht... | yt_dlp/extractor/lrt.py | 26 | Python | 0.786 | suggestion | 228 | 37 | 36 | false | [ie/LRTRadio] Add extractor | 12,801 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | subrat-lima |
'id': '2000359728',
'ext': 'm4a',
'title': 'Nemarios eilės: apie pragarus ir skaistyklas su Aiste Kiltinavičiūte',
'description': 'md5:5eee9a0e86a55bf547bd67596204625d',
'timestamp': 1726143120,
'upload_date': '20240912',
'tags': list,
... | always good to check type, and I like filtering out empty strings too
```suggestion
'tags': ('tags', ..., 'name', {str}, filter),
``` | 'id': '2000359728',
'ext': 'm4a',
'title': 'Nemarios eilės: apie pragarus ir skaistyklas su Aiste Kiltinavičiūte',
'description': 'md5:5eee9a0e86a55bf547bd67596204625d',
'timestamp': 1726143120,
'upload_date': '20240912',
'tags': 'count... | @@ -106,3 +109,43 @@ def _real_extract(self, url):
}
return merge_dicts(clean_info, jw_data, json_ld_data)
+
+
+class LRTRadioIE(LRTBaseIE):
+ _VALID_URL = r'https?://(?:www\.)?lrt\.lt/radioteka/irasas/(?P<id>[0-9]+)/(?P<path>[^?#/]+)'
+ _TESTS = [{
+ # m3u8 download
+ 'url': 'ht... | yt_dlp/extractor/lrt.py | 26 | Python | 0.857 | suggestion | 148 | 33 | 32 | false | [ie/LRTRadio] Add extractor | 12,801 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | subrat-lima |
'ext': 'm4a',
'title': 'Nemarios eilės: apie pragarus ir skaistyklas su Aiste Kiltinavičiūte',
'description': 'md5:5eee9a0e86a55bf547bd67596204625d',
'timestamp': 1726143120,
'upload_date': '20240912',
'tags': list,
'thumbnail': r're:ht... | `{lambda x: [x]}` can return `[None]`, since transformations are always called (even if the path starts to return `None` before the transformation).
Here we can use `all`, which in a traversal path will reset branching and return a list of all results (and since we weren't branching, it will just be a list of the 1 ... | 'ext': 'm4a',
'title': 'Nemarios eilės: apie pragarus ir skaistyklas su Aiste Kiltinavičiūte',
'description': 'md5:5eee9a0e86a55bf547bd67596204625d',
'timestamp': 1726143120,
'upload_date': '20240912',
'tags': 'count:5',
'thumbnail': r'... | @@ -106,3 +109,43 @@ def _real_extract(self, url):
}
return merge_dicts(clean_info, jw_data, json_ld_data)
+
+
+class LRTRadioIE(LRTBaseIE):
+ _VALID_URL = r'https?://(?:www\.)?lrt\.lt/radioteka/irasas/(?P<id>[0-9]+)/(?P<path>[^?#/]+)'
+ _TESTS = [{
+ # m3u8 download
+ 'url': 'ht... | yt_dlp/extractor/lrt.py | 26 | Python | 0.857 | suggestion | 502 | 32 | 31 | false | [ie/LRTRadio] Add extractor | 12,801 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | subrat-lima |
'timestamp': 1726143120,
'upload_date': '20240912',
'tags': list,
'thumbnail': r're:https?://.+/.+\.jpe?g',
'categories': list,
},
}, {
'url': 'https://www.lrt.lt/radioteka/irasas/2000304654/vakaras-su-knyga-svetlana-aleksijevic-cernobylio-... | we can use `urljoin` here which simplifies things and handles url validation for us
```suggestion
'thumbnail': ('playlist_item', 'image', {urljoin('https://www.lrt.lt')}),
``` | 'timestamp': 1726143120,
'upload_date': '20240912',
'tags': 'count:5',
'thumbnail': r're:https?://.+/.+\.jpe?g',
'categories': ['Daiktiniai įrodymai'],
},
}, {
'url': 'https://www.lrt.lt/radioteka/irasas/2000304654/vakaras-su-knyga-svetlana... | @@ -106,3 +109,43 @@ def _real_extract(self, url):
}
return merge_dicts(clean_info, jw_data, json_ld_data)
+
+
+class LRTRadioIE(LRTBaseIE):
+ _VALID_URL = r'https?://(?:www\.)?lrt\.lt/radioteka/irasas/(?P<id>[0-9]+)/(?P<path>[^?#/]+)'
+ _TESTS = [{
+ # m3u8 download
+ 'url': 'ht... | yt_dlp/extractor/lrt.py | 26 | Python | 0.929 | suggestion | 190 | 29 | 28 | false | [ie/LRTRadio] Add extractor | 12,801 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | subrat-lima |
'timestamp': 1726143120,
'upload_date': '20240912',
'tags': list,
'thumbnail': r're:https?://.+/.+\.jpe?g',
'categories': list,
},
}, {
'url': 'https://www.lrt.lt/radioteka/irasas/2000304654/vakaras-su-knyga-svetlana-aleksijevic-cernobylio-... | I think I may have mentioned this in another PR of yours that I generally don't like calling the `_extract_*_formats*` helpers in traversal transformations (again because they are always called). Just saying it again in case I am misremembering authors. But here it is fine since we always need to call it and it's alway... | 'timestamp': 1726143120,
'upload_date': '20240912',
'tags': 'count:5',
'thumbnail': r're:https?://.+/.+\.jpe?g',
'categories': ['Daiktiniai įrodymai'],
},
}, {
'url': 'https://www.lrt.lt/radioteka/irasas/2000304654/vakaras-su-knyga-svetlana... | @@ -106,3 +109,43 @@ def _real_extract(self, url):
}
return merge_dicts(clean_info, jw_data, json_ld_data)
+
+
+class LRTRadioIE(LRTBaseIE):
+ _VALID_URL = r'https?://(?:www\.)?lrt\.lt/radioteka/irasas/(?P<id>[0-9]+)/(?P<path>[^?#/]+)'
+ _TESTS = [{
+ # m3u8 download
+ 'url': 'ht... | yt_dlp/extractor/lrt.py | 26 | Python | 0.643 | security | 327 | 29 | 28 | false | [ie/LRTRadio] Add extractor | 12,801 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | subrat-lima |
continue
tags.append(tag_name)
clean_info = {
'description': clean_html(media.get('content')),
'tags': tags,
}
return merge_dicts(clean_info, jw_data, json_ld_data)
class LRTRadioIE(LRTBaseIE):
_VALID_URL = r'https?://(?:www\.)?lrt\.lt/... | For `tags` and `categories` avoid using `list` as the value. Use the actual value, or if the line gets too long, then you can use `'count:6'` etc | continue
tags.append(tag_name)
clean_info = {
'description': clean_html(media.get('content')),
'tags': tags,
}
return merge_dicts(clean_info, jw_data, json_ld_data)
class LRTRadioIE(LRTBaseIE):
_VALID_URL = r'https?://(?:www\.)?lrt\.lt/... | @@ -106,3 +109,43 @@ def _real_extract(self, url):
}
return merge_dicts(clean_info, jw_data, json_ld_data)
+
+
+class LRTRadioIE(LRTBaseIE):
+ _VALID_URL = r'https?://(?:www\.)?lrt\.lt/radioteka/irasas/(?P<id>[0-9]+)/(?P<path>[^?#/]+)'
+ _TESTS = [{
+ # m3u8 download
+ 'url': 'ht... | yt_dlp/extractor/lrt.py | 26 | Python | 0.571 | refactor | 145 | 50 | 49 | false | [ie/LRTRadio] Add extractor | 12,801 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | subrat-lima |
from .common import InfoExtractor
from ..utils import (
clean_html,
merge_dicts,
str_or_none,
traverse_obj,
unified_timestamp,
url_or_none,
)
class LRTBaseIE(InfoExtractor):
def _extract_js_var(self, webpage, var_name, default=None):
return self._search_regex(
fr'{var_... | ```suggestion
url_or_none,
urljoin,
``` | from .common import InfoExtractor
from ..utils import (
clean_html,
merge_dicts,
str_or_none,
traverse_obj,
unified_timestamp,
url_or_none,
urljoin,
)
class LRTBaseIE(InfoExtractor):
def _extract_js_var(self, webpage, var_name, default=None):
return self._search_regex(
... | @@ -1,8 +1,11 @@
+
from .common import InfoExtractor
from ..utils import (
clean_html,
merge_dicts,
+ str_or_none,
traverse_obj,
+ unified_timestamp,
url_or_none, | yt_dlp/extractor/lrt.py | 8 | Python | 0.571 | suggestion | 50 | 33 | 33 | false | [ie/LRTRadio] Add extractor | 12,801 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | subrat-lima |
if primary_artists:
info['artists'] = primary_artists
if info.get('artists'):
info['artists'] = list(set(info['artists']))
return info
def _call_api(self, type_, token, note='API', params={}):
return self._download_json(
self._API_URL, t... | We want the formats to be extracted lazily which is why we were smuggling the `id`'s and `encrypted_media_url`s in `url_transparent` results | 'language': ('language', {lambda x: ISO639Utils.short2long(x.casefold()) or 'und'}),
'webpage_url': ('perma_url', {url_or_none}),
'artists': ('more_info', 'artistMap', 'primary_artists', ..., 'name', {str}, filter, all),
})
if webpage_url := info.get('webpage_url') or... | @@ -89,16 +118,16 @@ def _call_api(self, type_, token, note='API', params={}):
def _yield_songs(self, playlist_data):
for song_data in traverse_obj(playlist_data, ('songs', lambda _, v: v['id'] and v['perma_url'])):
song_info = self._extract_song(song_data)
- url = smuggle_url(song... | yt_dlp/extractor/jiosaavn.py | 26 | Python | 0.571 | refactor | 140 | 51 | 51 | false | [ie/jiosaavn] enhancement: add artist and podcast support | 12,803 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | subrat-lima |
from .common import InfoExtractor
from ..utils import ExtractorError
class RoyaIE(InfoExtractor):
_VALID_URL = r'https?://roya\.tv/live-stream/(?P<id>\d+)'
_TESTS = [{
'url': 'https://roya.tv/live-stream/1',
'info_dict': {
'id': '1',
'title': r're:Roya TV \d{4}-\d{2}-\d... | Let's name this `RoyaLiveIE`, as `RoyaIE` would be the extractor for vods
```suggestion
class RoyaLiveIE(InfoExtractor):
``` | from .common import InfoExtractor
from ..utils.traversal import traverse_obj
class RoyaLiveIE(InfoExtractor):
_VALID_URL = r'https?://roya\.tv/live-stream/(?P<id>\d+)'
_TESTS = [{
'url': 'https://roya.tv/live-stream/1',
'info_dict': {
'id': '1',
'title': r're:Roya TV \d... | @@ -0,0 +1,61 @@
+from .common import InfoExtractor
+from ..utils import ExtractorError
+
+
+class RoyaIE(InfoExtractor): | yt_dlp/extractor/roya.py | 5 | Python | 0.786 | refactor | 127 | 30 | 30 | false | [ie/RoyaLive] Add extractor | 12,817 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | CasperMcFadden95 |
'live_status': 'is_live',
},
}, {
'url': 'https://roya.tv/live-stream/21',
'info_dict': {
'id': '21',
'title': r're:Roya News \d{4}-\d{2}-\d{2} \d{2}:\d{2}',
'ext': 'mp4',
'is_live': True,
'live_status': 'is_live',
... | As the URL is required this can just be fatal
```suggestion
stream_url = self._download_json(
f'https://ticket.roya-tv.com/api/v5/fastchannel/{media_id}', media_id)['data']['secured_url']
``` | },
}, {
'url': 'https://roya.tv/live-stream/21',
'info_dict': {
'id': '21',
'title': r're:Roya News \d{4}-\d{2}-\d{2} \d{2}:\d{2}',
'ext': 'mp4',
'live_status': 'is_live',
},
}, {
'url': 'https://roya.tv/live-stream/10000',
... | @@ -0,0 +1,61 @@
+from .common import InfoExtractor
+from ..utils import ExtractorError
+
+
+class RoyaIE(InfoExtractor):
+ _VALID_URL = r'https?://roya\.tv/live-stream/(?P<id>\d+)'
+ _TESTS = [{
+ 'url': 'https://roya.tv/live-stream/1',
+ 'info_dict': {
+ 'id': '1',
+ 'title':... | yt_dlp/extractor/roya.py | 26 | Python | 0.786 | suggestion | 215 | 49 | 31 | false | [ie/RoyaLive] Add extractor | 12,817 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | CasperMcFadden95 |
}, {
'url': 'https://roya.tv/live-stream/21',
'info_dict': {
'id': '21',
'title': r're:Roya News \d{4}-\d{2}-\d{2} \d{2}:\d{2}',
'ext': 'mp4',
'is_live': True,
'live_status': 'is_live',
},
}, {
'url': 'https://roya.tv/li... | We can simplify this with `traverse_obj`
```suggestion
title = traverse_obj(
self._download_json('https://backend.roya.tv/api/v01/channels/schedule-pagination', media_id),
('data', 0, 'channel', lambda _, v: str(v['id']) == media_id, 'title', {str}, any))
``` | 'url': 'https://roya.tv/live-stream/21',
'info_dict': {
'id': '21',
'title': r're:Roya News \d{4}-\d{2}-\d{2} \d{2}:\d{2}',
'ext': 'mp4',
'live_status': 'is_live',
},
}, {
'url': 'https://roya.tv/live-stream/10000',
'only_matchi... | @@ -0,0 +1,61 @@
+from .common import InfoExtractor
+from ..utils import ExtractorError
+
+
+class RoyaIE(InfoExtractor):
+ _VALID_URL = r'https?://roya\.tv/live-stream/(?P<id>\d+)'
+ _TESTS = [{
+ 'url': 'https://roya.tv/live-stream/1',
+ 'info_dict': {
+ 'id': '1',
+ 'title':... | yt_dlp/extractor/roya.py | 26 | Python | 0.857 | refactor | 296 | 47 | 29 | false | [ie/RoyaLive] Add extractor | 12,817 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | CasperMcFadden95 |
'live_status': 'is_live',
},
}, {
'url': 'https://roya.tv/live-stream/10000',
'only_matching': True,
}]
def _real_extract(self, url):
media_id = self._match_id(url)
stream_json = self._download_json(f'https://ticket.roya-tv.com/api/v5/fastchannel/{media_i... | The URL will always contain `live-stream`
```suggestion
'is_live': True,
``` | from .common import InfoExtractor
from ..utils.traversal import traverse_obj
class RoyaLiveIE(InfoExtractor):
_VALID_URL = r'https?://roya\.tv/live-stream/(?P<id>\d+)'
_TESTS = [{
'url': 'https://roya.tv/live-stream/1',
'info_dict': {
'id': '1',
'title': r're:Roya TV \d... | @@ -0,0 +1,61 @@
+from .common import InfoExtractor
+from ..utils import ExtractorError
+
+
+class RoyaIE(InfoExtractor):
+ _VALID_URL = r'https?://roya\.tv/live-stream/(?P<id>\d+)'
+ _TESTS = [{
+ 'url': 'https://roya.tv/live-stream/1',
+ 'info_dict': {
+ 'id': '1',
+ 'title':... | yt_dlp/extractor/roya.py | 26 | Python | 0.571 | suggestion | 91 | 40 | 44 | false | [ie/RoyaLive] Add extractor | 12,817 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | CasperMcFadden95 |
'ext': 'mp4',
'is_live': True,
'live_status': 'is_live',
},
}, {
'url': 'https://roya.tv/live-stream/10000',
'only_matching': True,
}]
def _real_extract(self, url):
media_id = self._match_id(url)
stream_json = self._download_json(f... | m3u8 playlists need to be extracted
```suggestion
'formats': self._extract_m3u8_formats(stream_url, media_id, 'mp4', m3u8_id='hls', live=True),
``` | from .common import InfoExtractor
from ..utils.traversal import traverse_obj
class RoyaLiveIE(InfoExtractor):
_VALID_URL = r'https?://roya\.tv/live-stream/(?P<id>\d+)'
_TESTS = [{
'url': 'https://roya.tv/live-stream/1',
'info_dict': {
'id': '1',
'title': r're:Roya TV \d... | @@ -0,0 +1,61 @@
+from .common import InfoExtractor
+from ..utils import ExtractorError
+
+
+class RoyaIE(InfoExtractor):
+ _VALID_URL = r'https?://roya\.tv/live-stream/(?P<id>\d+)'
+ _TESTS = [{
+ 'url': 'https://roya.tv/live-stream/1',
+ 'info_dict': {
+ 'id': '1',
+ 'title':... | yt_dlp/extractor/roya.py | 26 | Python | 0.786 | refactor | 162 | 42 | 44 | false | [ie/RoyaLive] Add extractor | 12,817 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | CasperMcFadden95 |
from .common import InfoExtractor
from ..utils import ExtractorError
class RoyaIE(InfoExtractor):
_VALID_URL = r'https?://roya\.tv/live-stream/(?P<id>\d+)'
_TESTS = [{
'url': 'https://roya.tv/live-stream/1',
'info_dict': {
'id': '1',
'title': r're:Roya TV \d{4}-\d{2}-\d... | ```suggestion
from ..utils.traversal import traverse_obj
``` | from .common import InfoExtractor
from ..utils.traversal import traverse_obj
class RoyaLiveIE(InfoExtractor):
_VALID_URL = r'https?://roya\.tv/live-stream/(?P<id>\d+)'
_TESTS = [{
'url': 'https://roya.tv/live-stream/1',
'info_dict': {
'id': '1',
'title': r're:Roya TV \d... | @@ -0,0 +1,61 @@
+from .common import InfoExtractor
+from ..utils import ExtractorError | yt_dlp/extractor/roya.py | 2 | Python | 0.571 | suggestion | 62 | 27 | 27 | false | [ie/RoyaLive] Add extractor | 12,817 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | CasperMcFadden95 |
'ext': 'mp4',
'is_live': True,
'live_status': 'is_live',
},
}, {
'url': 'https://roya.tv/live-stream/21',
'info_dict': {
'id': '21',
'title': r're:Roya News \d{4}-\d{2}-\d{2} \d{2}:\d{2}',
'ext': 'mp4',
'is_l... | ```suggestion
self._download_json('https://backend.roya.tv/api/v01/channels/schedule-pagination', media_id, fatal=False),
``` | 'ext': 'mp4',
'live_status': 'is_live',
},
}, {
'url': 'https://roya.tv/live-stream/21',
'info_dict': {
'id': '21',
'title': r're:Roya News \d{4}-\d{2}-\d{2} \d{2}:\d{2}',
'ext': 'mp4',
'live_status': 'is_live',
... | @@ -0,0 +1,45 @@
+from .common import InfoExtractor
+from ..utils.traversal import traverse_obj
+
+
+class RoyaLiveIE(InfoExtractor):
+ _VALID_URL = r'https?://roya\.tv/live-stream/(?P<id>\d+)'
+ _TESTS = [{
+ 'url': 'https://roya.tv/live-stream/1',
+ 'info_dict': {
+ 'id': '1',
+ ... | yt_dlp/extractor/roya.py | 26 | Python | 0.714 | suggestion | 139 | 35 | 33 | false | [ie/RoyaLive] Add extractor | 12,817 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | CasperMcFadden95 |
**traverse_obj(node, {
'author': ('user', 'displayName', {str}),
'author_id': ('user', 'username', {str}),
'timestamp': ('created', {parse_iso8601}),
}),
})
return {
'id': track_id,
'... | I would also guard against empty strings since the old code would've done the same (if not for the typo)
```suggestion
'tags': ('tags', ..., 'tag', 'name', {str}, filter, all, filter),
'artists': ('featuringArtistList', ..., {str}, filter, all, filter),
``` | **traverse_obj(node, {
'author': ('user', 'displayName', {str}),
'author_id': ('user', 'username', {str}),
'timestamp': ('created', {parse_iso8601}),
}),
})
return {
'id': track_id,
'... | @@ -182,47 +183,39 @@ def _real_extract(self, url):
self.raise_login_required(metadata_available=True)
comments = []
- for edge in (try_get(cloudcast, lambda x: x['comments']['edges']) or []):
- node = edge.get('node') or {}
+ for node in traverse_obj(cloudcast, ('commen... | yt_dlp/extractor/mixcloud.py | 26 | Python | 0.786 | suggestion | 293 | 51 | 51 | false | [ie/mixcloud] Refactor extractor | 12,830 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | WouterGordts |
from .jtbc import (
JTBCIE,
JTBCProgramIE,
)
from .jwplatform import JWPlatformIE
from .kakao import KakaoIE
from .kaltura import KalturaIE
from .kankanews import KankaNewsIE
from .karaoketv import KaraoketvIE
from .kelbyone import KelbyOneIE
from .kenh14 import (
Kenh14PlaylistIE,
Kenh14VideoIE,
)
from... | ```suggestion
from .kika import (
KikaIE,
KikaPlaylistIE,
)
``` | from .jtbc import (
JTBCIE,
JTBCProgramIE,
)
from .jwplatform import JWPlatformIE
from .kakao import KakaoIE
from .kaltura import KalturaIE
from .kankanews import KankaNewsIE
from .karaoketv import KaraoketvIE
from .kelbyone import KelbyOneIE
from .kenh14 import (
Kenh14PlaylistIE,
Kenh14VideoIE,
)
from... | @@ -960,7 +960,7 @@
)
from .kicker import KickerIE
from .kickstarter import KickStarterIE
-from .kika import KikaIE
+from .kika import KikaIE, KikaPlaylistIE | yt_dlp/extractor/_extractors.py | 26 | Python | 0.571 | suggestion | 76 | 51 | 51 | false | [ie/kika] Add playlist extractor | 12,832 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | 1100101 |
'format_id': ext,
**traverse_obj(media, {
'width': ('frameWidth', {int_or_none}),
'height': ('frameHeight', {int_or_none}),
# NB: filesize is 0 if unknown, bitrate is -1 if unknown
'fi... | Use the md5 or a partial regex | yield {
'url': stream_url,
'format_id': ext,
**traverse_obj(media, {
'width': ('frameWidth', {int_or_none}),
'height': ('frameHeight', {int_or_none}),
# NB: filesize is 0 i... | @@ -124,3 +124,45 @@ def _extract_formats(self, media_info, video_id):
'vbr': ('bitrateVideo', {int_or_none}, {lambda x: None if x == -1 else x}),
}),
}
+
+
+class KikaPlaylistIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?kika\.de/[\w-]+/(?P<id>... | yt_dlp/extractor/kika.py | 26 | Python | 0.143 | suggestion | 30 | 51 | 51 | false | [ie/kika] Add playlist extractor | 12,832 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | 1100101 |
'"Gorbar and the Valley of the Seven Light Towers". Als er die Spielkonsole anschaltet, '
'schießt ein greller, weißer Lichtstrahl aus dem Bildschirm. Marcus befindet sich plötzlich '
'im Videospiel in der Rolle seines Lieblingshelden "Gorbar the Magnificent". Sowohl Marcus, '
... | ```suggestion
playlist_id = self._match_id(url)
``` | 'description': 'md5:7b9d7f65561b82fa512f2cfb553c397d',
},
'playlist_count': 100,
}]
def _entries(self, playlist_url, playlist_id):
for page in itertools.count(1):
data = self._download_json(playlist_url, playlist_id, note=f'Downloading page {page}')
f... | @@ -124,3 +124,45 @@ def _extract_formats(self, media_info, video_id):
'vbr': ('bitrateVideo', {int_or_none}, {lambda x: None if x == -1 else x}),
}),
}
+
+
+class KikaPlaylistIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?kika\.de/[\w-]+/(?P<id>... | yt_dlp/extractor/kika.py | 26 | Python | 0.571 | suggestion | 61 | 31 | 31 | false | [ie/kika] Add playlist extractor | 12,832 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | 1100101 |
'schießt ein greller, weißer Lichtstrahl aus dem Bildschirm. Marcus befindet sich plötzlich '
'im Videospiel in der Rolle seines Lieblingshelden "Gorbar the Magnificent". Sowohl Marcus, '
'als auch Gorbar, der sich nun in Marcus\' Zuhause befindet, stehen beide vor großen Herausforde... | ```suggestion
brand_data = self._download_json(
f'https://www.kika.de/_next-api/proxy/v1/brands/{playlist_id}', playlist_id)
``` | },
'playlist_count': 100,
}]
def _entries(self, playlist_url, playlist_id):
for page in itertools.count(1):
data = self._download_json(playlist_url, playlist_id, note=f'Downloading page {page}')
for item in traverse_obj(data, ('content', lambda _, v: url_or_none(... | @@ -124,3 +124,45 @@ def _extract_formats(self, media_info, video_id):
'vbr': ('bitrateVideo', {int_or_none}, {lambda x: None if x == -1 else x}),
}),
}
+
+
+class KikaPlaylistIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?kika\.de/[\w-]+/(?P<id>... | yt_dlp/extractor/kika.py | 26 | Python | 0.714 | suggestion | 151 | 30 | 30 | false | [ie/kika] Add playlist extractor | 12,832 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | 1100101 |
_TESTS = [{
'url': 'https://www.kika.de/marcus-level/marcus-level-102',
'info_dict': {
'id': 'marcus-level-102',
'title': 'Marcus Level',
'description': 'Marcus bekommt die neue Version seines Lieblingsvideospiels: '
'"Gorbar and the Valley of the Sev... | I would move this function out, rename it to `_entries`, and make it less fatal:
```suggestion
def _entries(self, playlist_url, playlist_id):
while playlist_url:
data = self._download_json(playlist_url, playlist_id)
for item in traverse_obj(data, ('content', lambda _, v: url_or_... | _VALID_URL = r'https?://(?:www\.)?kika\.de/[\w-]+/(?P<id>[a-z-]+\d+)'
_TESTS = [{
'url': 'https://www.kika.de/logo/logo-die-welt-und-ich-562',
'info_dict': {
'id': 'logo-die-welt-und-ich-562',
'title': 'logo!',
'description': 'md5:7b9d7f65561b82fa512f2cfb553c... | @@ -124,3 +124,45 @@ def _extract_formats(self, media_info, video_id):
'vbr': ('bitrateVideo', {int_or_none}, {lambda x: None if x == -1 else x}),
}),
}
+
+
+class KikaPlaylistIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?kika\.de/[\w-]+/(?P<id>... | yt_dlp/extractor/kika.py | 26 | Python | 0.857 | refactor | 920 | 38 | 38 | false | [ie/kika] Add playlist extractor | 12,832 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | 1100101 |
},
'playlist_count': 100,
}]
def _entries(self, playlist_url, playlist_id):
while playlist_url:
data = self._download_json(playlist_url, playlist_id)
for item in traverse_obj(data, ('content', lambda _, v: url_or_none(v['api']['url']))):
yield sel... | ```suggestion
return self.playlist_result(
self._entries(brand_data['videoSubchannel']['videosPageUrl'], playlist_id),
playlist_id, title=brand_data.get('title'), description=brand_data.get('description'))
``` | 'description': 'md5:7b9d7f65561b82fa512f2cfb553c397d',
},
'playlist_count': 100,
}]
def _entries(self, playlist_url, playlist_id):
for page in itertools.count(1):
data = self._download_json(playlist_url, playlist_id, note=f'Downloading page {page}')
f... | @@ -124,3 +124,41 @@ def _extract_formats(self, media_info, video_id):
'vbr': ('bitrateVideo', {int_or_none}, {lambda x: None if x == -1 else x}),
}),
}
+
+
+class KikaPlaylistIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?kika\.de/[\w-]+/(?P<id>... | yt_dlp/extractor/kika.py | 26 | Python | 0.786 | suggestion | 245 | 27 | 31 | false | [ie/kika] Add playlist extractor | 12,832 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | 1100101 |
'uploader': 'Jérémie Mercier',
'uploader_id': 'UCeN_qQV829NYf0pvPJhW5dQ',
'like_count': int,
'upload_date': '20211218',
'thumbnail': 'https://scw.divulg.org/cb-medias4/images/0z4Kms8pi8I/maxres.jpg',
},
'params': {'skip_download': True},
}]... | ```suggestion
fmts, subs = self._extract_mpd_formats_and_subtitles(mpd_url, video_id, mpd_id='dash', fatal=False)
``` | 'uploader': 'Jérémie Mercier',
'uploader_id': 'UCeN_qQV829NYf0pvPJhW5dQ',
'like_count': int,
'upload_date': '20211218',
'thumbnail': 'https://scw.divulg.org/cb-medias4/images/0z4Kms8pi8I/maxres.jpg',
},
'params': {'skip_download': True},
}]... | @@ -44,16 +46,15 @@ def _real_extract(self, url):
'url': sub_url,
})
- mpd_url = try_get(video_json, lambda x: x['dashManifest']['url'])
- if mpd_url:
- fmts, subs = self._extract_mpd_formats_and_subtitles(mpd_url, video_id)
+ if mpd_url := traverse_obj(vi... | yt_dlp/extractor/crowdbunker.py | 26 | Python | 0.786 | refactor | 131 | 51 | 51 | false | [ie/CrowdBunker] Make format extraction non-fatal | 12,836 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | seproDev |
},
'params': {'skip_download': True},
}]
def _real_extract(self, url):
video_id = self._match_id(url)
data_json = self._download_json(
f'https://api.divulg.org/post/{video_id}/details', video_id,
headers={'accept': 'application/json, text/plain, */*'})
... | ```suggestion
fmts, subs = self._extract_m3u8_formats_and_subtitles(m3u8_url, video_id, m3u8_id='hls', fatal=False)
``` | },
'params': {'skip_download': True},
}]
def _real_extract(self, url):
video_id = self._match_id(url)
data_json = self._download_json(
f'https://api.divulg.org/post/{video_id}/details', video_id,
headers={'accept': 'application/json, text/plain, */*'})
... | @@ -44,16 +46,15 @@ def _real_extract(self, url):
'url': sub_url,
})
- mpd_url = try_get(video_json, lambda x: x['dashManifest']['url'])
- if mpd_url:
- fmts, subs = self._extract_mpd_formats_and_subtitles(mpd_url, video_id)
+ if mpd_url := traverse_obj(vi... | yt_dlp/extractor/crowdbunker.py | 26 | Python | 0.786 | refactor | 133 | 51 | 51 | false | [ie/CrowdBunker] Make format extraction non-fatal | 12,836 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | seproDev |
formats = []
for ext, ext_info in (video.get('ua') or {}).items():
if isinstance(ext_info, dict):
for height, video_info in ext_info.items():
if not traverse_obj(video_info, ('meta', 'h', {int_or_none})):
video_info.setdefault('meta... | Unnecessary; core code does this. The old code would use the `ext` var here if it wasn't "timeline" -- should we do the same if it isn't "timeline" or "audio"?
```suggestion
'ext': ext if not (is_timeline or is_audio) else None,
``` | for format_type, format_info in (video.get('ua') or {}).items():
if isinstance(format_info, dict):
for height, video_info in format_info.items():
if not traverse_obj(video_info, ('meta', 'h', {int_or_none})):
video_info.setdefault('meta', {... | @@ -179,29 +195,32 @@ def _real_extract(self, url):
meta = video_info.get('meta') or {}
if not video_info.get('url'):
continue
+ # With default query parms returns m3u8 varients which are duplicates, without returns tar files
+ if ext ... | yt_dlp/extractor/rumble.py | 26 | Python | 0.857 | suggestion | 255 | 51 | 51 | false | [ie/rumble] Improve format extraction | 12,838 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | seproDev |
sys_msg = traverse_obj(video, ('sys', 'msg'))
if sys_msg:
self.report_warning(sys_msg, video_id=video_id)
if video.get('live') == 0:
live_status = 'not_live' if video.get('livestream_has_dvr') is None else 'was_live'
elif video.get('live') == 1:
live_... | sp
```suggestion
# With default query params returns m3u8 variants which are duplicates, without returns tar files
``` | if sys_msg:
self.report_warning(sys_msg, video_id=video_id)
if video.get('live') == 0:
live_status = 'not_live' if video.get('livestream_has_dvr') is None else 'was_live'
elif video.get('live') == 1:
live_status = 'is_upcoming' if video.get('livestream_has_dv... | @@ -179,29 +195,32 @@ def _real_extract(self, url):
meta = video_info.get('meta') or {}
if not video_info.get('url'):
continue
+ # With default query parms returns m3u8 varients which are duplicates, without returns tar files | yt_dlp/extractor/rumble.py | 26 | Python | 0.714 | refactor | 137 | 51 | 51 | false | [ie/rumble] Improve format extraction | 12,838 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | seproDev |
if isinstance(err, self._BAD_OPTION):
self.error(str(err))
raise
return self.check_values(self.values, self.largs)
def _generate_error_message(self, msg):
msg = f'{self.get_prog_name()}: error: {str(msg).strip()}\n'
return f'{s... | ```suggestion
assert formatter, 'Formatter can not be None'
``` | if isinstance(err, self._BAD_OPTION):
self.error(str(err))
raise
return self.check_values(self.values, self.largs)
def _generate_error_message(self, msg):
msg = f'{self.get_prog_name()}: error: {str(msg).strip()}\n'
return f'{s... | @@ -215,6 +224,22 @@ def _match_long_opt(self, opt):
return e.possibilities[0]
raise
+ def format_option_help(self, formatter=None):
+ assert formatter, '' | yt_dlp/options.py | 26 | Python | 0.571 | suggestion | 73 | 51 | 51 | false | Add `--preset-alias` option | 12,839 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | seproDev |
class _YoutubeDLHelpFormatter(optparse.IndentedHelpFormatter):
def __init__(self):
# No need to wrap help messages if we're on a wide console
max_width = shutil.get_terminal_size().columns or 80
# The % is chosen to get a pretty output in README.md
super().__init__(width=max_width, ... | ```suggestion
'mkv': ['--merge-output-format', 'mkv', '--remux', 'mkv'],
'sleep': ['--sleep-subtitles', '5', '--sleep-requests', '0.75', '--sleep-interval', '10', '--max-sleep-interval', '20'],
}
``` |
class _YoutubeDLHelpFormatter(optparse.IndentedHelpFormatter):
def __init__(self):
# No need to wrap help messages if we're on a wide console
max_width = shutil.get_terminal_size().columns or 80
# The % is chosen to get a pretty output in README.md
super().__init__(width=max_width, ... | @@ -150,6 +150,14 @@ def format_option_strings(option):
return opts
+_PRESET_ALIASES = {
+ 'mp3': ['-f', 'ba[acodec=mp3]/ba/b', '-x', '--audio-format', 'mp3'],
+ 'aac': ['-f', 'ba[acodec*=aac]/ba[acodec^=mp4a.40.]/ba/b', '-x', '--audio-format', 'aac'],
+ 'mp4': ['--merge-output-format', 'mp4', '--... | yt_dlp/options.py | 26 | Python | 0.786 | suggestion | 211 | 51 | 51 | false | Add `--preset-alias` option | 12,839 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | seproDev |
return self.check_values(self.values, self.largs)
def _generate_error_message(self, msg):
msg = f'{self.get_prog_name()}: error: {str(msg).strip()}\n'
return f'{self.get_usage()}\n{msg}' if self.usage else msg
def error(self, msg):
raise optparse.OptParseError(self._generate_er... | to be consistent with other headings
```suggestion
heading = formatter.format_heading('Preset Aliases')
``` | return self.check_values(self.values, self.largs)
def _generate_error_message(self, msg):
msg = f'{self.get_prog_name()}: error: {str(msg).strip()}\n'
return f'{self.get_usage()}\n{msg}' if self.usage else msg
def error(self, msg):
raise optparse.OptParseError(self._generate_er... | @@ -215,6 +224,22 @@ def _match_long_opt(self, opt):
return e.possibilities[0]
raise
+ def format_option_help(self, formatter=None):
+ assert formatter, 'Formatter can not be None'
+ formatted_help = super().format_option_help(formatter=formatter)
+ formatter.inde... | yt_dlp/options.py | 26 | Python | 0.714 | suggestion | 118 | 51 | 51 | false | Add `--preset-alias` option | 12,839 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | seproDev |
'2023': ['prefer-vp9-sort'],
},
}, help=(
'Options that can help keep compatibility with youtube-dl or youtube-dlc '
'configurations by reverting some of the changes made in yt-dlp. '
'See "Differences in default behavior" for details'))
genera... | ```suggestion
'See the "Preset Aliases" section at the end for more info. '
``` | '2023': ['prefer-vp9-sort'],
},
}, help=(
'Options that can help keep compatibility with youtube-dl or youtube-dlc '
'configurations by reverting some of the changes made in yt-dlp. '
'See "Differences in default behavior" for details'))
genera... | @@ -518,6 +550,15 @@ def _alias_callback(option, opt_str, value, parser, opts, nargs):
'Alias options can trigger more aliases; so be careful to avoid defining recursive options. '
f'As a safety measure, each alias may be triggered a maximum of {_YoutubeDLOptionParser.ALIAS_TRIGGER_LIMIT} time... | yt_dlp/options.py | 26 | Python | 0.571 | suggestion | 93 | 51 | 51 | false | Add `--preset-alias` option | 12,839 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | seproDev |
},
}, help=(
'Options that can help keep compatibility with youtube-dl or youtube-dlc '
'configurations by reverting some of the changes made in yt-dlp. '
'See "Differences in default behavior" for details'))
general.add_option(
'--alias', metavar='ALI... | ```suggestion
'This option can be used multiple times'))
``` | },
}, help=(
'Options that can help keep compatibility with youtube-dl or youtube-dlc '
'configurations by reverting some of the changes made in yt-dlp. '
'See "Differences in default behavior" for details'))
general.add_option(
'--alias', metavar='ALI... | @@ -518,6 +550,15 @@ def _alias_callback(option, opt_str, value, parser, opts, nargs):
'Alias options can trigger more aliases; so be careful to avoid defining recursive options. '
f'As a safety measure, each alias may be triggered a maximum of {_YoutubeDLOptionParser.ALIAS_TRIGGER_LIMIT} time... | yt_dlp/options.py | 26 | Python | 0.643 | suggestion | 74 | 51 | 51 | false | Add `--preset-alias` option | 12,839 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | seproDev |
'2021': ['2022', 'no-certifi', 'filename-sanitization'],
'2022': ['2023', 'no-external-downloader-progress', 'playlist-match-filter', 'prefer-legacy-http-handler', 'manifest-filesize-approx'],
'2023': ['prefer-vp9-sort'],
},
}, help=(
'Opti... | ```suggestion
'Applies a predefined set of options. e.g. --preset-alias mp3. '
``` | '2021': ['2022', 'no-certifi', 'filename-sanitization'],
'2022': ['2023', 'no-external-downloader-progress', 'playlist-match-filter', 'prefer-legacy-http-handler', 'manifest-filesize-approx'],
'2023': ['prefer-vp9-sort'],
},
}, help=(
'Opti... | @@ -518,6 +550,15 @@ def _alias_callback(option, opt_str, value, parser, opts, nargs):
'Alias options can trigger more aliases; so be careful to avoid defining recursive options. '
f'As a safety measure, each alias may be triggered a maximum of {_YoutubeDLOptionParser.ALIAS_TRIGGER_LIMIT} time... | yt_dlp/options.py | 26 | Python | 0.571 | suggestion | 96 | 51 | 51 | false | Add `--preset-alias` option | 12,839 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | seproDev |
_VALID_URL = r'(?:https?://audycje\.tokfm\.pl/podcast/|tokfm:podcast:)(?P<id>\d+),?'
IE_NAME = 'tokfm:podcast'
_TESTS = [{
'url': 'https://audycje.tokfm.pl/podcast/91275,-Systemowy-rasizm-Czy-zamieszki-w-USA-po-morderstwie-w-Minneapolis-doprowadza-do-zmian-w-sluzbach-panstwowych',
'info_dict... | If there are no other formats available, could you remove the for loop? | _VALID_URL = r'(?:https?://audycje\.tokfm\.pl/podcast/|tokfm:podcast:)(?P<id>\d+),?'
IE_NAME = 'tokfm:podcast'
_TESTS = [{
'url': 'https://audycje.tokfm.pl/podcast/91275,-Systemowy-rasizm-Czy-zamieszki-w-USA-po-morderstwie-w-Minneapolis-doprowadza-do-zmian-w-sluzbach-panstwowych',
'info_dict... | @@ -165,7 +165,7 @@ def _real_extract(self, url):
metadata = metadata[0]
formats = []
- for ext in ('aac', 'mp3'):
+ for ext in ('mp3',): | yt_dlp/extractor/agora.py | 26 | Python | 0.286 | question | 71 | 51 | 51 | false | [ie/TokFMPodcast] Fix formats extraction | 12,842 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | selfisekai |
'series': 'Analizy',
},
}]
def _real_extract(self, url):
media_id = self._match_id(url)
# in case it breaks see this but it returns a lot of useless data
# https://api.podcast.radioagora.pl/api4/getPodcasts?podcast_id=100091&with_guests=true&with_leaders_for_mobile=... | I would even further simplify this. Remove the `formats` var init above, inline the `url`/`ext`/codec fields in the return (`acodec` is redundant now, core code will set it from `ext`)
```suggestion
mp3_url = self._download_json(
'https://api.podcast.radioagora.pl/api4/getSongUrl',
... | 'series': 'Analizy',
},
}]
def _real_extract(self, url):
media_id = self._match_id(url)
# in case it breaks see this but it returns a lot of useless data
# https://api.podcast.radioagora.pl/api4/getPodcasts?podcast_id=100091&with_guests=true&with_leaders_for_mobile=... | @@ -165,18 +165,16 @@ def _real_extract(self, url):
metadata = metadata[0]
formats = []
- for ext in ('aac', 'mp3'):
- url_data = self._download_json(
- f'https://api.podcast.radioagora.pl/api4/getSongUrl?podcast_id={media_id}&device_id={uuid.uuid4()}&ppre=false&audi... | yt_dlp/extractor/agora.py | 26 | Python | 1 | refactor | 746 | 51 | 51 | false | [ie/TokFMPodcast] Fix formats extraction | 12,842 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | selfisekai |
"""
Update target information
Can be created by `query_update()` or manually.
Attributes:
tag The release tag that will be updated to. If from query_update,
the value is after API resolution and update spec processing.
The... | I don't think these noqa changes are correct https://docs.astral.sh/ruff/linter/#full-suppression-comment-specification | """
Update target information
Can be created by `query_update()` or manually.
Attributes:
tag The release tag that will be updated to. If from query_update,
the value is after API resolution and update spec processing.
The... | @@ -202,7 +202,7 @@ class UpdateInfo:
requested_version: str | None = None
commit: str | None = None
- binary_name: str | None = _get_binary_name() # noqa: RUF009: Always returns the same value | yt_dlp/update.py | 26 | Python | 0.429 | style | 119 | 51 | 51 | false | [cleanup] Misc (for 2025-04) | 12,844 | yt-dlp/yt-dlp | 132,642 | Python | gamer191 | seproDev |
}, { # YandexVideo
'url': 'https://yandex.ru/video/preview/5275069442094787341',
'only_matching': True,
}, { # youtube
'url': 'https://yandex.ru/video/preview/?filmId=16658118429797832897&from=tabbar&p=1&text=%D0%BF%D1%80%D0%BE%D1%81%D0%BC%D0%BE%D1%82%D1%80+%D1%84%D1%80%D0%B0%D0%B3%D0%... | line too long; using builtin `id`
```suggestion
redirect = self._search_json(
r'(?:var|let|const)\s+it\s*=', webpage, 'redirect', video_id, default={}).get('retpath')
``` | }, { # YandexVideo
'url': 'https://yandex.ru/video/preview/5275069442094787341',
'only_matching': True,
}, { # youtube
'url': 'https://yandex.ru/video/preview/?filmId=16658118429797832897&from=tabbar&p=1&text=%D0%BF%D1%80%D0%BE%D1%81%D0%BC%D0%BE%D1%82%D1%80+%D1%84%D1%80%D0%B0%D0%B3%D0%... | @@ -186,7 +188,21 @@ def _real_extract(self, url):
return self.url_result(data_json['video']['url'])
-class ZenYandexIE(InfoExtractor):
+class ZenYandexBaseIE(InfoExtractor):
+ def _fetch_ssr_data(self, url, video_id):
+ webpage = self._download_webpage(url, video_id)
+ redirect = self._se... | yt_dlp/extractor/yandexvideo.py | 26 | Python | 0.714 | refactor | 194 | 51 | 51 | false | [ie/dzen.ru] Rework extractors | 12,852 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | seproDev |
}, { # youtube
'url': 'https://yandex.ru/video/preview/?filmId=16658118429797832897&from=tabbar&p=1&text=%D0%BF%D1%80%D0%BE%D1%81%D0%BC%D0%BE%D1%82%D1%80+%D1%84%D1%80%D0%B0%D0%B3%D0%BC%D0%B5%D0%BD%D1%82%D0%B0+%D0%BC%D0%B0%D0%BB%D0%B5%D0%BD%D1%8C%D0%BA%D0%B8%D0%B9+%D0%BF%D1%80%D0%B8%D0%BD%D1%86+%D0%BC%D1%8B... | shouldn't we return the new `video_id` too? | }, { # youtube
'url': 'https://yandex.ru/video/preview/?filmId=16658118429797832897&from=tabbar&p=1&text=%D0%BF%D1%80%D0%BE%D1%81%D0%BC%D0%BE%D1%82%D1%80+%D1%84%D1%80%D0%B0%D0%B3%D0%BC%D0%B5%D0%BD%D1%82%D0%B0+%D0%BC%D0%B0%D0%BB%D0%B5%D0%BD%D1%8C%D0%BA%D0%B8%D0%B9+%D0%BF%D1%80%D0%B8%D0%BD%D1%86+%D0%BC%D1%8B... | @@ -186,7 +188,21 @@ def _real_extract(self, url):
return self.url_result(data_json['video']['url'])
-class ZenYandexIE(InfoExtractor):
+class ZenYandexBaseIE(InfoExtractor):
+ def _fetch_ssr_data(self, url, video_id):
+ webpage = self._download_webpage(url, video_id)
+ redirect = self._se... | yt_dlp/extractor/yandexvideo.py | 26 | Python | 0.286 | question | 43 | 51 | 51 | false | [ie/dzen.ru] Rework extractors | 12,852 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | seproDev |
'thumbnail': 're:^https://avatars.dzeninfra.ru/',
'uploader': 'TechInsider',
'upload_date': '20210123',
'timestamp': 1611378221,
'view_count': int,
'duration': 243,
'tags': ['опыт', 'эксперимент', 'огонь'],
},
'params': ... | ```suggestion
{url_or_none}, {update_url_query(query={'dzen_dash': []})})))
```
would work too | 'description': 'md5:053ad3c61b5596d510c9a199dc8ee633',
'thumbnail': 're:^https://avatars.dzeninfra.ru/',
'uploader': 'TechInsider',
'upload_date': '20210123',
'timestamp': 1611378221,
'view_count': int,
'duration': 243,
'tag... | @@ -252,44 +275,55 @@ class ZenYandexIE(InfoExtractor):
def _real_extract(self, url):
video_id = self._match_id(url)
- webpage = self._download_webpage(url, video_id)
- redirect = self._search_json(r'var it\s*=', webpage, 'redirect', id, default={}).get('retpath')
- if redirect:
- ... | yt_dlp/extractor/yandexvideo.py | 26 | Python | 0.714 | suggestion | 109 | 51 | 51 | false | [ie/dzen.ru] Rework extractors | 12,852 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | seproDev |
'url': 'https://zen.yandex.ru/media/id/606fd806cc13cb3c58c05cf5/novyi-samsung-fold-3-moskvich-barahlit-612f93b7f8d48e7e945792a2?from=channel&rid=2286618386.482.1630817595976.42360',
'only_matching': True,
}, {
'url': 'https://dzen.ru/media/id/606fd806cc13cb3c58c05cf5/novyi-samsung-fold-3-mos... | i would set `quality` outside of the `for` loop | }, {
'url': 'https://zen.yandex.ru/media/id/606fd806cc13cb3c58c05cf5/novyi-samsung-fold-3-moskvich-barahlit-612f93b7f8d48e7e945792a2?from=channel&rid=2286618386.482.1630817595976.42360',
'only_matching': True,
}, {
'url': 'https://dzen.ru/media/id/606fd806cc13cb3c58c05cf5/novyi-samsung-f... | @@ -252,44 +275,55 @@ class ZenYandexIE(InfoExtractor):
def _real_extract(self, url):
video_id = self._match_id(url)
- webpage = self._download_webpage(url, video_id)
- redirect = self._search_json(r'var it\s*=', webpage, 'redirect', id, default={}).get('retpath')
- if redirect:
- ... | yt_dlp/extractor/yandexvideo.py | 26 | Python | 0.214 | suggestion | 47 | 51 | 51 | false | [ie/dzen.ru] Rework extractors | 12,852 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | seproDev |
# Test that the playlist extractor finishes extracting when the
# channel has more than one page of entries
'url': 'https://zen.yandex.ru/tatyanareva',
'info_dict': {
'id': 'tatyanareva',
'description': 'md5:92e56fa730a932ca2483ba5c2186ad96',
'title': ... | ```suggestion
'items', lambda _, v: url_or_none(v['link']),
)):
``` | 'playlist_count': 18,
}, {
# Test that the playlist extractor finishes extracting when the
# channel has more than one page of entries
'url': 'https://zen.yandex.ru/tatyanareva',
'info_dict': {
'id': 'tatyanareva',
'description': 'md5:92e56fa730a932ca2... | @@ -348,43 +381,30 @@ class ZenYandexChannelIE(InfoExtractor):
'playlist_mincount': 657,
}]
- def _entries(self, item_id, server_state_json, server_settings_json):
- items = (traverse_obj(server_state_json, ('feed', 'items', ...))
- or traverse_obj(server_settings_json, ('expor... | yt_dlp/extractor/yandexvideo.py | 26 | Python | 0.571 | suggestion | 98 | 47 | 50 | false | [ie/dzen.ru] Rework extractors | 12,852 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | seproDev |
import json
from .common import InfoExtractor
from ..utils import clean_html, extract_attributes, remove_end, unified_timestamp, url_or_none
from ..utils.traversal import find_elements, traverse_obj
class TvwBaseIE(InfoExtractor):
def _get_title(self, webpage):
return remove_end(self._og_search_title(web... | this is overkill; `_get_description` especially so | import json
from .common import InfoExtractor
from ..utils import (
clean_html,
extract_attributes,
parse_qs,
remove_end,
require,
unified_timestamp,
url_or_none,
)
from ..utils.traversal import find_element, find_elements, traverse_obj
class TvwIE(InfoExtractor):
IE_NAME = 'tvw'
... | @@ -1,11 +1,19 @@
import json
from .common import InfoExtractor
-from ..utils import clean_html, remove_end, unified_timestamp, url_or_none
-from ..utils.traversal import traverse_obj
+from ..utils import clean_html, extract_attributes, remove_end, unified_timestamp, url_or_none
+from ..utils.traversal import find_... | yt_dlp/extractor/tvw.py | 14 | Python | 0.357 | suggestion | 50 | 39 | 39 | false | [ie/tvw:News] Add extractor | 12,907 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | fries1234 |
import json
from .common import InfoExtractor
from ..utils import clean_html, extract_attributes, remove_end, unified_timestamp, url_or_none
from ..utils.traversal import find_elements, traverse_obj
class TvwBaseIE(InfoExtractor):
def _get_title(self, webpage):
return remove_end(self._og_search_title(web... | revert after removing baseclass | import json
from .common import InfoExtractor
from ..utils import (
clean_html,
extract_attributes,
parse_qs,
remove_end,
require,
unified_timestamp,
url_or_none,
)
from ..utils.traversal import find_element, find_elements, traverse_obj
class TvwIE(InfoExtractor):
IE_NAME = 'tvw'
... | @@ -1,11 +1,19 @@
import json
from .common import InfoExtractor
-from ..utils import clean_html, remove_end, unified_timestamp, url_or_none
-from ..utils.traversal import traverse_obj
+from ..utils import clean_html, extract_attributes, remove_end, unified_timestamp, url_or_none
+from ..utils.traversal import find_... | yt_dlp/extractor/tvw.py | 16 | Python | 0.071 | suggestion | 31 | 41 | 41 | false | [ie/tvw:News] Add extractor | 12,907 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | fries1234 |
'authorization': 'embedder',
'wsc-api-key': '7WhiEBzijpritypp8bqcU7pfU9uicDR',
},
data=json.dumps({
'clientID': client_id,
'eventID': video_id,
'showStreams': True,
}).encode())['data']
formats =... | revert after removing baseclass | 'timestamp': 1745006400,
'upload_date': '20250418',
'location': 'Hayner Media Center',
'categories': ['Legislative Review'],
},
}]
def _real_extract(self, url):
display_id = self._match_id(url)
webpage = self._download_webpage(url, display... | @@ -103,8 +111,8 @@ def _real_extract(self, url):
'display_id': display_id,
'formats': formats,
'subtitles': subtitles,
- 'title': remove_end(self._og_search_title(webpage, default=None), ' - TVW'),
- 'description': self._og_search_description(webpage, defaul... | yt_dlp/extractor/tvw.py | 26 | Python | 0.071 | suggestion | 31 | 51 | 51 | false | [ie/tvw:News] Add extractor | 12,907 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | fries1234 |
formats.extend(fmts)
self._merge_subtitles(subs, target=subtitles)
if caption_url := traverse_obj(video_data, ('captionPath', {url_or_none})):
subtitles.setdefault('en', []).append({'url': caption_url, 'ext': 'vtt'})
return {
'id': video_id,
'... | ```suggestion
IE_NAME = 'tvw:news'
``` | video_data = self._download_json(
'https://api.v3.invintus.com/v2/Event/getDetailed', video_id,
headers={
'authorization': 'embedder',
'wsc-api-key': '7WhiEBzijpritypp8bqcU7pfU9uicDR',
},
data=json.dumps({
'clientID'... | @@ -115,3 +123,44 @@ def _real_extract(self, url):
'is_live': ('eventStatus', {lambda x: x == 'live'}),
}),
}
+
+
+class TvwNewsIE(TvwBaseIE):
+ IE_NAME = 'Tvw:News' | yt_dlp/extractor/tvw.py | 26 | Python | 0.429 | suggestion | 44 | 51 | 51 | false | [ie/tvw:News] Add extractor | 12,907 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | fries1234 |
self._merge_subtitles(subs, target=subtitles)
if caption_url := traverse_obj(video_data, ('captionPath', {url_or_none})):
subtitles.setdefault('en', []).append({'url': caption_url, 'ext': 'vtt'})
return {
'id': video_id,
'display_id': display_id,
... | IMO we can trust that they won't use fake month numerals... and if they do, who cares?
```suggestion
_VALID_URL = r'https?://(?:www\.)?tvw\.org/\d{4}/\d{2}/(?P<id>[^/?#]+)'
``` | 'https://api.v3.invintus.com/v2/Event/getDetailed', video_id,
headers={
'authorization': 'embedder',
'wsc-api-key': '7WhiEBzijpritypp8bqcU7pfU9uicDR',
},
data=json.dumps({
'clientID': client_id,
'eventID': vi... | @@ -115,3 +123,44 @@ def _real_extract(self, url):
'is_live': ('eventStatus', {lambda x: x == 'live'}),
}),
}
+
+
+class TvwNewsIE(TvwBaseIE):
+ IE_NAME = 'Tvw:News'
+ _VALID_URL = r'https?://(?:www\.)?tvw\.org/(\d{4})/(0[1-9]|1[0-2])/(?P<id>[^/?#]+)' | yt_dlp/extractor/tvw.py | 26 | Python | 0.786 | suggestion | 183 | 51 | 51 | false | [ie/tvw:News] Add extractor | 12,907 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | fries1234 |
TVCIE,
TVCArticleIE,
)
from .tver import TVerIE
from .tvigle import TvigleIE
from .tviplayer import TVIPlayerIE
from .tvland import TVLandIE
from .tvn24 import TVN24IE
from .tvnoe import TVNoeIE
from .tvopengr import (
TVOpenGrEmbedIE,
TVOpenGrWatchIE,
)
from .tvp import (
TVPIE,
TVPEmbedIE,
... | will need to resolve merge conflict here | TVCArticleIE,
)
from .tver import TVerIE
from .tvigle import TvigleIE
from .tviplayer import TVIPlayerIE
from .tvland import TVLandIE
from .tvn24 import TVN24IE
from .tvnoe import TVNoeIE
from .tvopengr import (
TVOpenGrEmbedIE,
TVOpenGrWatchIE,
)
from .tvp import (
TVPIE,
TVPEmbedIE,
TVPStreamI... | @@ -2237,7 +2237,7 @@
TVPlayIE,
)
from .tvplayer import TVPlayerIE
-from .tvw import TvwIE
+from .tvw import TvwIE, TvwNewsIE | yt_dlp/extractor/_extractors.py | 26 | Python | 0.071 | suggestion | 40 | 51 | 51 | false | [ie/tvw:News] Add extractor | 12,907 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | fries1234 |
import json
from .common import InfoExtractor
from ..utils import clean_html, extract_attributes, remove_end, unified_timestamp, url_or_none
from ..utils.traversal import find_elements, traverse_obj
class TvwBaseIE(InfoExtractor):
def _get_title(self, webpage):
return remove_end(self._og_search_title(web... | line getting long, use parenthesized import group | import json
from .common import InfoExtractor
from ..utils import (
clean_html,
extract_attributes,
parse_qs,
remove_end,
require,
unified_timestamp,
url_or_none,
)
from ..utils.traversal import find_element, find_elements, traverse_obj
class TvwIE(InfoExtractor):
IE_NAME = 'tvw'
... | @@ -1,11 +1,19 @@
import json
from .common import InfoExtractor
-from ..utils import clean_html, remove_end, unified_timestamp, url_or_none
-from ..utils.traversal import traverse_obj
+from ..utils import clean_html, extract_attributes, remove_end, unified_timestamp, url_or_none | yt_dlp/extractor/tvw.py | 4 | Python | 0.143 | suggestion | 49 | 29 | 29 | false | [ie/tvw:News] Add extractor | 12,907 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | fries1234 |
'upload_date': '19991228',
'display_id': 'home-warranties-workgroup-2',
'categories': ['Legislative'],
},
}, {
'url': 'https://tvw.org/video/washington-to-washington-a-new-space-race-2022041111/?eventID=2022041111',
'md5': '6f5551090b351aba10c0d08a881b4f30... | I did get a Cloudflare anti-bot 403 challenge when using the default user agent. I put a newer browser user agent here. Is there a best practice for something like this? | 'thumbnail': r're:^https?://.*\.(?:jpe?g|png)$',
'description': 'md5:861396cc523c9641d0dce690bc5c35f3',
'timestamp': 946389600,
'upload_date': '19991228',
'display_id': 'home-warranties-workgroup-2',
'categories': ['Legislative'],
},
},... | @@ -79,7 +79,10 @@ class TvwIE(InfoExtractor):
def _real_extract(self, url):
display_id = self._match_id(url)
- webpage = self._download_webpage(url, display_id)
+ # Use a newer user agent as the default yt-dlp one triggers the Cloudflare anti-bot challenge
+ webpage = self._downloa... | yt_dlp/extractor/tvw.py | 26 | Python | 0.429 | question | 169 | 51 | 51 | false | [ie/tvw:News] Add extractor | 12,907 | yt-dlp/yt-dlp | 132,642 | Python | fries1234 | fries1234 |
import json
from .common import InfoExtractor
from ..utils import (
clean_html,
extract_attributes,
parse_qs,
remove_end,
require,
unified_timestamp,
url_or_none,
)
from ..utils.traversal import find_element, find_elements, traverse_obj
class TvwIE(InfoExtractor):
IE_NAME = 'tvw'
... | that pattern would allow for `https://tvw.org/watchID123123` etc
I think we should do this:
```suggestion
_VALID_URL = [
r'https?://(?:www\.)?tvw\.org/video/(?P<id>[^/?#]+)',
r'https?://(?:www\.)?tvw\.org/watch/?\?(?:[^#]+&)?eventID=(?P<id>\d+)',
]
``` | import json
from .common import InfoExtractor
from ..utils import (
clean_html,
extract_attributes,
parse_qs,
remove_end,
require,
unified_timestamp,
url_or_none,
)
from ..utils.traversal import find_element, find_elements, traverse_obj
class TvwIE(InfoExtractor):
IE_NAME = 'tvw'
... | @@ -10,12 +10,12 @@
unified_timestamp,
url_or_none,
)
-from ..utils.traversal import find_element, traverse_obj
+from ..utils.traversal import find_element, find_elements, traverse_obj
class TvwIE(InfoExtractor):
IE_NAME = 'tvw'
- _VALID_URL = r'https?://(?:www\.)?tvw\.org/video/(?P<id>[^/?#]+)'... | yt_dlp/extractor/tvw.py | 18 | Python | 0.857 | suggestion | 285 | 43 | 43 | false | [ie/tvw:News] Add extractor | 12,907 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | fries1234 |
formats.extend(fmts)
self._merge_subtitles(subs, target=subtitles)
if caption_url := traverse_obj(video_data, ('captionPath', {url_or_none})):
subtitles.setdefault('en', []).append({'url': caption_url, 'ext': 'vtt'})
return {
'id': video_id,
'... | ```suggestion
IE_NAME = 'tvw:news'
``` | formats.extend(fmts)
self._merge_subtitles(subs, target=subtitles)
if caption_url := traverse_obj(video_data, ('captionPath', {url_or_none})):
subtitles.setdefault('en', []).append({'url': caption_url, 'ext': 'vtt'})
return {
'id': video_id,
'... | @@ -125,6 +142,51 @@ def _real_extract(self, url):
}
+class TvwNewsIE(InfoExtractor):
+ IE_NAME = 'tvw:News' | yt_dlp/extractor/tvw.py | 26 | Python | 0.429 | suggestion | 44 | 51 | 51 | false | [ie/tvw:News] Add extractor | 12,907 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | fries1234 |
},
'playlist_count': 1,
}, {
'url': 'https://tvw.org/2023/09/5th-annual-tvw-open-thank-you/',
'info_dict': {
'id': '5th-annual-tvw-open-thank-you',
'title': '5th Annual TVW Open THANK YOU!',
'description': 'md5:5306eef5b03c87108797cb6261c5f16c',
... | ```suggestion
video_ids, playlist_id,
playlist_title=remove_end(self._og_search_title(webpage, default=None), ' - TVW'),
playlist_description=self._og_search_description(webpage, default=None),
getter=lambda x: f'https://tvw.org/watch?eventID={x}', ie=TvwIE)
``` | },
'playlist_count': 1,
}]
def _real_extract(self, url):
playlist_id = self._match_id(url)
webpage = self._download_webpage(url, playlist_id)
video_ids = traverse_obj(webpage, (
{find_elements(cls='invintus-player', html=True)}, ..., {extract_attributes}, 'd... | @@ -125,6 +142,51 @@ def _real_extract(self, url):
}
+class TvwNewsIE(InfoExtractor):
+ IE_NAME = 'tvw:News'
+ _VALID_URL = r'https?://(?:www\.)?tvw\.org/\d{4}/\d{2}/(?P<id>[^/?#]+)'
+ _TESTS = [{
+ 'url': 'https://tvw.org/2024/01/the-impact-issues-to-watch-in-the-2024-legislative-session/'... | yt_dlp/extractor/tvw.py | 26 | Python | 0.857 | suggestion | 315 | 51 | 51 | false | [ie/tvw:News] Add extractor | 12,907 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | fries1234 |
media_key = broadcast['media_key']
source = self._call_api(
f'live_video_stream/status/{media_key}', media_key)['source']
m3u8_url = source.get('noRedirectPlaybackUrl') or source['location']
if '/live_video_stream/geoblocked/' in m3u8_url:
self.raise_geo_restrict... | since twitter names change, let's avoid using `md5:` values in the descriptions
you can use `re:` if the line gets too long, e.g. `r're:Twitter Space participated by stupid dipshit.{50}'` |
media_key = broadcast['media_key']
source = self._call_api(
f'live_video_stream/status/{media_key}', media_key)['source']
m3u8_url = source.get('noRedirectPlaybackUrl') or source['location']
if '/live_video_stream/geoblocked/' in m3u8_url:
self.raise_geo_restrict... | @@ -1717,35 +1717,37 @@ class TwitterSpacesIE(TwitterBaseIE):
_VALID_URL = TwitterBaseIE._BASE_REGEX + r'i/spaces/(?P<id>[0-9a-zA-Z]{13})'
_TESTS = [{
- 'url': 'https://twitter.com/i/spaces/1RDxlgyvNXzJL',
+ 'url': 'https://twitter.com/i/spaces/1OwxWwQOPlNxQ',
'info_dict': {
- ... | yt_dlp/extractor/twitter.py | 26 | Python | 0.571 | refactor | 190 | 51 | 51 | false | [ie/twitter:spaces] Improve metadata extraction | 12,911 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | doe1080 |
formats = self._extract_m3u8_formats(
source, metadata['media_key'], 'm4a' if is_audio_space else 'mp4',
# XXX: Some audio-only Spaces need ffmpeg as downloader
entry_protocol='m3u8' if is_audio_space else 'm3u8_native',
live=is_live, headers=h... | `release_timestamp` is what is used by `--wait-for-video`, so we want it to be the `scheduled_start` at least before the livestream starts | formats = self._extract_m3u8_formats(
source, metadata['media_key'], 'm4a' if is_audio_space else 'mp4',
# XXX: Some audio-only Spaces need ffmpeg as downloader
entry_protocol='m3u8' if is_audio_space else 'm3u8_native',
live=is_live, headers=h... | @@ -1861,18 +1867,22 @@ def _real_extract(self, url):
return {
'id': space_id,
- 'title': metadata.get('title'),
'description': f'Twitter Space participated by {participants}',
- 'uploader': traverse_obj(
- metadata, ('creator_results', 'result',... | yt_dlp/extractor/twitter.py | 26 | Python | 0.571 | suggestion | 138 | 51 | 51 | false | [ie/twitter:spaces] Improve metadata extraction | 12,911 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | doe1080 |
if not is_live:
fmt['container'] = 'm4a_dash'
participants = ', '.join(traverse_obj(
space_data, ('participants', 'speakers', ..., 'display_name'))) or 'nobody yet'
if not formats and live_status == 'post_live':
self.raise_no_formats(... | a little longer line here is fine
```suggestion
'thumbnail': ('profile_image_url_https', {lambda x: x.replace('_normal', '_400x400')}, {url_or_none}),
``` | if not is_live:
fmt['container'] = 'm4a_dash'
participants = ', '.join(traverse_obj(
space_data, ('participants', 'speakers', ..., 'display_name'))) or 'nobody yet'
if not formats and live_status == 'post_live':
self.raise_no_formats(... | @@ -1861,18 +1867,22 @@ def _real_extract(self, url):
return {
'id': space_id,
- 'title': metadata.get('title'),
'description': f'Twitter Space participated by {participants}',
- 'uploader': traverse_obj(
- metadata, ('creator_results', 'result',... | yt_dlp/extractor/twitter.py | 26 | Python | 0.786 | suggestion | 173 | 47 | 46 | false | [ie/twitter:spaces] Improve metadata extraction | 12,911 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | doe1080 |
source, metadata['media_key'], 'm4a' if is_audio_space else 'mp4',
# XXX: Some audio-only Spaces need ffmpeg as downloader
entry_protocol='m3u8' if is_audio_space else 'm3u8_native',
live=is_live, headers=headers, fatal=False) if source else []
... | What about this?
```suggestion
# started_at is None when stream is_upcoming so fallback to scheduled_start for --wait-for-video
'release_timestamp': (('started_at', 'scheduled_start'), {int_or_none(scale=1000)}, any),
'timestamp': ('created_at', {int_or_none(scale=100... | is_audio_space = source and 'audio-space' in source
formats = self._extract_m3u8_formats(
source, metadata['media_key'], 'm4a' if is_audio_space else 'mp4',
# XXX: Some audio-only Spaces need ffmpeg as downloader
entry_protocol='m3u8' if is_audio_s... | @@ -1861,18 +1865,20 @@ def _real_extract(self, url):
return {
'id': space_id,
- 'title': metadata.get('title'),
'description': f'Twitter Space participated by {participants}',
- 'uploader': traverse_obj(
- metadata, ('creator_results', 'result',... | yt_dlp/extractor/twitter.py | 26 | Python | 0.786 | question | 330 | 51 | 51 | false | [ie/twitter:spaces] Improve metadata extraction | 12,911 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | doe1080 |
'id': '27-02energyfreedombyenergyclub7295762520814874625',
'ext': 'mp4',
'title': '27.02 Energy Freedom by Energy Club',
'description': 'md5:1292e6f31df998914c293787a02c3b91',
'duration': 6420,
'timestamp': 1739445333,
'upload_date': '2... | I don't like reusing `url`
```suggestion
for fmt_url in traverse_obj(prog_fmts, ('streamingLocations', ..., 'url', {url_or_none})):
formats.append({
'url': fmt_url,
``` | }, {
'url': 'https://www.linkedin.com/events/27-02energyfreedombyenergyclub7295762520814874625/comments/',
'info_dict': {
'id': '27-02energyfreedombyenergyclub7295762520814874625',
'ext': 'mp4',
'title': '27.02 Energy Freedom by Energy Club',
'descript... | @@ -271,3 +272,76 @@ def _real_extract(self, url):
entries, course_slug,
course_data.get('title'),
course_data.get('description'))
+
+
+class LinkedInEventsIE(InfoExtractor):
+ IE_NAME = 'linkedin:events'
+ _VALID_URL = r'https?://(?:www\.)?linkedin\.com/events/(?P<id>[\w-]+... | yt_dlp/extractor/linkedin.py | 26 | Python | 0.786 | suggestion | 221 | 51 | 51 | false | [ie/linkedin:events] Add extractor | 12,926 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | seproDev |
'id': 'c64916eb-10fb-46a9-9a19-8c4b7ed064e7',
'ext': 'mp4',
'title': 'PAULINHO LOKO NA LOCO!',
'description': 'live on na loco',
'uploader_id': '2MDO7Z1DPM',
'channel': 'paulinholokobr',
'channel_follower_count': int,
'comme... | Is `Mozilla` deliberately omitted from the beginning of the UA?
```suggestion
_CLIENT_ID = 'TlwKp1zmF6eKFpcisn3FyR18WkhcPkZtzwPVEEC3'
_CLIENT_SECRET = 'Kp7tYlUN7LXvtcSpwYvIitgYcLparbtsQSe5AdyyCdiEJBP53Vt9J8eB4AsLdChIpcO2BM19RA3HsGtqDJFjWmwoonvMSG3ZQmnS8x1YIM8yl82xMXZGbE3NKiqmgBVU'
_USER_AGENT = '5.0 (Wi... | 'id': 'c64916eb-10fb-46a9-9a19-8c4b7ed064e7',
'ext': 'mp4',
'title': 'PAULINHO LOKO NA LOCO!',
'description': 'live on na loco',
'uploader_id': '2MDO7Z1DPM',
'channel': 'paulinholokobr',
'channel_follower_count': int,
'comme... | @@ -57,11 +61,56 @@ class LocoIE(InfoExtractor):
},
}]
+ # From _app.js
+ CLIENT_ID = 'TlwKp1zmF6eKFpcisn3FyR18WkhcPkZtzwPVEEC3'
+ CLIENT_SCRET = 'Kp7tYlUN7LXvtcSpwYvIitgYcLparbtsQSe5AdyyCdiEJBP53Vt9J8eB4AsLdChIpcO2BM19RA3HsGtqDJFjWmwoonvMSG3ZQmnS8x1YIM8yl82xMXZGbE3NKiqmgBVU'
+ USER_AGENT = ... | yt_dlp/extractor/loco.py | 26 | Python | 0.857 | security | 422 | 51 | 51 | false | [ie/loco] Fix extractor | 12,934 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | seproDev |
'series': 'GTA 5',
'timestamp': 1740612872,
'modified_timestamp': 1740613037,
'upload_date': '20250226',
'modified_date': '20250226',
},
}]
# From _app.js
CLIENT_ID = 'TlwKp1zmF6eKFpcisn3FyR18WkhcPkZtzwPVEEC3'
CLIENT_SCRET = 'Kp7tYlUN7... | ```suggestion
'client_id': self._CLIENT_ID,
'client_secret': self._CLIENT_SECRET,
``` | 'series': 'GTA 5',
'timestamp': 1740612872,
'modified_timestamp': 1740613037,
'upload_date': '20250226',
'modified_date': '20250226',
},
}, {
# Requires video authorization
'url': 'https://loco.com/stream/ac854641-ae0f-497c-a8ea-419... | @@ -57,11 +61,56 @@ class LocoIE(InfoExtractor):
},
}]
+ # From _app.js
+ CLIENT_ID = 'TlwKp1zmF6eKFpcisn3FyR18WkhcPkZtzwPVEEC3'
+ CLIENT_SCRET = 'Kp7tYlUN7LXvtcSpwYvIitgYcLparbtsQSe5AdyyCdiEJBP53Vt9J8eB4AsLdChIpcO2BM19RA3HsGtqDJFjWmwoonvMSG3ZQmnS8x1YIM8yl82xMXZGbE3NKiqmgBVU'
+ USER_AGENT = ... | yt_dlp/extractor/loco.py | 26 | Python | 0.714 | security | 120 | 51 | 51 | false | [ie/loco] Fix extractor | 12,934 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | seproDev |
'modified_date': '20250226',
},
}]
# From _app.js
CLIENT_ID = 'TlwKp1zmF6eKFpcisn3FyR18WkhcPkZtzwPVEEC3'
CLIENT_SCRET = 'Kp7tYlUN7LXvtcSpwYvIitgYcLparbtsQSe5AdyyCdiEJBP53Vt9J8eB4AsLdChIpcO2BM19RA3HsGtqDJFjWmwoonvMSG3ZQmnS8x1YIM8yl82xMXZGbE3NKiqmgBVU'
USER_AGENT = '5.0 (Windows N... | ```suggestion
'os_ver': self._USER_AGENT,
'app_ver': self._USER_AGENT,
``` | 'modified_date': '20250226',
},
}, {
# Requires video authorization
'url': 'https://loco.com/stream/ac854641-ae0f-497c-a8ea-4195f6d8cc53',
'md5': '0513edf85c1e65c9521f555f665387d5',
'info_dict': {
'id': 'ac854641-ae0f-497c-a8ea-4195f6d8cc53',
... | @@ -57,11 +61,56 @@ class LocoIE(InfoExtractor):
},
}]
+ # From _app.js
+ CLIENT_ID = 'TlwKp1zmF6eKFpcisn3FyR18WkhcPkZtzwPVEEC3'
+ CLIENT_SCRET = 'Kp7tYlUN7LXvtcSpwYvIitgYcLparbtsQSe5AdyyCdiEJBP53Vt9J8eB4AsLdChIpcO2BM19RA3HsGtqDJFjWmwoonvMSG3ZQmnS8x1YIM8yl82xMXZGbE3NKiqmgBVU'
+ USER_AGENT = ... | yt_dlp/extractor/loco.py | 26 | Python | 0.786 | suggestion | 109 | 51 | 51 | false | [ie/loco] Fix extractor | 12,934 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | seproDev |
# From _app.js
CLIENT_ID = 'TlwKp1zmF6eKFpcisn3FyR18WkhcPkZtzwPVEEC3'
CLIENT_SCRET = 'Kp7tYlUN7LXvtcSpwYvIitgYcLparbtsQSe5AdyyCdiEJBP53Vt9J8eB4AsLdChIpcO2BM19RA3HsGtqDJFjWmwoonvMSG3ZQmnS8x1YIM8yl82xMXZGbE3NKiqmgBVU'
USER_AGENT = '5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) ... | ```suggestion
'user-agent': self._USER_AGENT,
``` | # Requires video authorization
'url': 'https://loco.com/stream/ac854641-ae0f-497c-a8ea-4195f6d8cc53',
'md5': '0513edf85c1e65c9521f555f665387d5',
'info_dict': {
'id': 'ac854641-ae0f-497c-a8ea-4195f6d8cc53',
'ext': 'mp4',
'title': 'DUAS CONTAS DESAFIANTE... | @@ -57,11 +61,56 @@ class LocoIE(InfoExtractor):
},
}]
+ # From _app.js
+ CLIENT_ID = 'TlwKp1zmF6eKFpcisn3FyR18WkhcPkZtzwPVEEC3'
+ CLIENT_SCRET = 'Kp7tYlUN7LXvtcSpwYvIitgYcLparbtsQSe5AdyyCdiEJBP53Vt9J8eB4AsLdChIpcO2BM19RA3HsGtqDJFjWmwoonvMSG3ZQmnS8x1YIM8yl82xMXZGbE3NKiqmgBVU'
+ USER_AGENT = ... | yt_dlp/extractor/loco.py | 26 | Python | 0.643 | suggestion | 67 | 51 | 51 | false | [ie/loco] Fix extractor | 12,934 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | seproDev |
def _is_jwt_expired(self, token):
return jwt_decode_hs256(token)['exp'] - time.time() < 300
def _get_access_token(self, video_id):
access_token = try_call(lambda: self._get_cookies('https://loco.com')['access_token'].value)
if access_token and not self._is_jwt_expired(access_token):
... | ```suggestion
'X-CLIENT-ID': self._CLIENT_ID,
'X-CLIENT-SECRET': self._CLIENT_SECRET,
``` | 'ext': 'mp4',
'title': 'DUAS CONTAS DESAFIANTE, RUSH TOP 1 NO BRASIL!',
'description': 'md5:aa77818edd6fe00dd4b6be75cba5f826',
'uploader_id': '7Y9JNAZC3Q',
'channel': 'ayellol',
'channel_follower_count': int,
'comment_count': int,
... | @@ -57,11 +61,56 @@ class LocoIE(InfoExtractor):
},
}]
+ # From _app.js
+ CLIENT_ID = 'TlwKp1zmF6eKFpcisn3FyR18WkhcPkZtzwPVEEC3'
+ CLIENT_SCRET = 'Kp7tYlUN7LXvtcSpwYvIitgYcLparbtsQSe5AdyyCdiEJBP53Vt9J8eB4AsLdChIpcO2BM19RA3HsGtqDJFjWmwoonvMSG3ZQmnS8x1YIM8yl82xMXZGbE3NKiqmgBVU'
+ USER_AGENT = ... | yt_dlp/extractor/loco.py | 26 | Python | 0.714 | security | 124 | 51 | 51 | false | [ie/loco] Fix extractor | 12,934 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | seproDev |
'id': 'c64916eb-10fb-46a9-9a19-8c4b7ed064e7',
'ext': 'mp4',
'title': 'PAULINHO LOKO NA LOCO!',
'description': 'live on na loco',
'uploader_id': '2MDO7Z1DPM',
'channel': 'paulinholokobr',
'channel_follower_count': int,
'comme... | ```suggestion
_USER_AGENT = 'Mozilla 5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Safari/537.36'
``` | 'id': 'c64916eb-10fb-46a9-9a19-8c4b7ed064e7',
'ext': 'mp4',
'title': 'PAULINHO LOKO NA LOCO!',
'description': 'live on na loco',
'uploader_id': '2MDO7Z1DPM',
'channel': 'paulinholokobr',
'channel_follower_count': int,
'comme... | @@ -57,11 +61,56 @@ class LocoIE(InfoExtractor):
},
}]
+ # From _app.js
+ _CLIENT_ID = 'TlwKp1zmF6eKFpcisn3FyR18WkhcPkZtzwPVEEC3'
+ _CLIENT_SECRET = 'Kp7tYlUN7LXvtcSpwYvIitgYcLparbtsQSe5AdyyCdiEJBP53Vt9J8eB4AsLdChIpcO2BM19RA3HsGtqDJFjWmwoonvMSG3ZQmnS8x1YIM8yl82xMXZGbE3NKiqmgBVU'
+ _USER_AGEN... | yt_dlp/extractor/loco.py | 26 | Python | 0.786 | suggestion | 151 | 51 | 51 | false | [ie/loco] Fix extractor | 12,934 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | seproDev |
'modified_date': '20250226',
},
}]
# From _app.js
_CLIENT_ID = 'TlwKp1zmF6eKFpcisn3FyR18WkhcPkZtzwPVEEC3'
_CLIENT_SECRET = 'Kp7tYlUN7LXvtcSpwYvIitgYcLparbtsQSe5AdyyCdiEJBP53Vt9J8eB4AsLdChIpcO2BM19RA3HsGtqDJFjWmwoonvMSG3ZQmnS8x1YIM8yl82xMXZGbE3NKiqmgBVU'
_USER_AGENT = '5.0 (Windo... | ```suggestion
'os_ver': self._USER_AGENT[8:],
'app_ver': self._USER_AGENT[8:],
``` | 'modified_date': '20250226',
},
}, {
# Requires video authorization
'url': 'https://loco.com/stream/ac854641-ae0f-497c-a8ea-4195f6d8cc53',
'md5': '0513edf85c1e65c9521f555f665387d5',
'info_dict': {
'id': 'ac854641-ae0f-497c-a8ea-4195f6d8cc53',
... | @@ -57,11 +61,56 @@ class LocoIE(InfoExtractor):
},
}]
+ # From _app.js
+ _CLIENT_ID = 'TlwKp1zmF6eKFpcisn3FyR18WkhcPkZtzwPVEEC3'
+ _CLIENT_SECRET = 'Kp7tYlUN7LXvtcSpwYvIitgYcLparbtsQSe5AdyyCdiEJBP53Vt9J8eB4AsLdChIpcO2BM19RA3HsGtqDJFjWmwoonvMSG3ZQmnS8x1YIM8yl82xMXZGbE3NKiqmgBVU'
+ _USER_AGEN... | yt_dlp/extractor/loco.py | 26 | Python | 0.786 | suggestion | 117 | 51 | 51 | false | [ie/loco] Fix extractor | 12,934 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | seproDev |
import json
import re
import time
from .common import InfoExtractor
from ..utils import (
ExtractorError,
determine_ext,
js_to_json,
traverse_obj,
)
class IPrimaIE(InfoExtractor):
_VALID_URL = r'https?://(?!cnn)(?:[^/]+)\.iprima\.cz/(?:[^/]+/)*(?P<id>[^/?#&]+)'
_GEO_BYPASS = False
_NETRC_... | let's just inline these since they're only used once now
```suggestion
``` | import json
import re
import time
from .common import InfoExtractor
from ..utils import (
ExtractorError,
determine_ext,
js_to_json,
traverse_obj,
)
class IPrimaIE(InfoExtractor):
_VALID_URL = r'https?://(?!cnn)(?:[^/]+)\.iprima\.cz/(?:[^/]+/)*(?P<id>[^/?#&]+)'
_GEO_BYPASS = False
_NETRC_... | @@ -6,17 +7,16 @@
ExtractorError,
determine_ext,
js_to_json,
- parse_qs,
traverse_obj,
- urlencode_postdata,
)
class IPrimaIE(InfoExtractor):
_VALID_URL = r'https?://(?!cnn)(?:[^/]+)\.iprima\.cz/(?:[^/]+/)*(?P<id>[^/?#&]+)'
_GEO_BYPASS = False
_NETRC_MACHINE = 'iprima'
- ... | yt_dlp/extractor/iprima.py | 19 | Python | 0.643 | suggestion | 76 | 44 | 44 | false | [ie/iprima] Fix login support | 12,937 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | baierjan |
'url': 'http://www.iprima.cz/filmy/desne-rande',
'only_matching': True,
}, {
'url': 'https://zoom.iprima.cz/10-nejvetsich-tajemstvi-zahad/posvatna-mista-a-stavby',
'only_matching': True,
}, {
'url': 'https://krimi.iprima.cz/mraz-0/sebevrazdy',
'only_matching': Tru... | inline this too
```suggestion
``` | }, {
'url': 'https://zoom.iprima.cz/10-nejvetsich-tajemstvi-zahad/posvatna-mista-a-stavby',
'only_matching': True,
}, {
'url': 'https://krimi.iprima.cz/mraz-0/sebevrazdy',
'only_matching': True,
}, {
'url': 'https://cool.iprima.cz/derava-silnice-nevadi',
'only... | @@ -86,46 +86,20 @@ def _perform_login(self, username, password):
if self.access_token:
return
- login_page = self._download_webpage(
- f'{self._AUTH_ROOT}/oauth2/login', None, note='Downloading login page',
- errnote='Downloading login page failed')
+ token_r... | yt_dlp/extractor/iprima.py | 26 | Python | 0.429 | suggestion | 35 | 51 | 51 | false | [ie/iprima] Fix login support | 12,937 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | baierjan |
'url': 'https://zoom.iprima.cz/10-nejvetsich-tajemstvi-zahad/posvatna-mista-a-stavby',
'only_matching': True,
}, {
'url': 'https://krimi.iprima.cz/mraz-0/sebevrazdy',
'only_matching': True,
}, {
'url': 'https://cool.iprima.cz/derava-silnice-nevadi',
'only_matching... | inline this too
```suggestion
token_data = self._download_json(
``` | }, {
'url': 'https://krimi.iprima.cz/mraz-0/sebevrazdy',
'only_matching': True,
}, {
'url': 'https://cool.iprima.cz/derava-silnice-nevadi',
'only_matching': True,
}, {
'url': 'https://love.iprima.cz/laska-az-za-hrob/slib-dany-bratrovi',
'only_matching': True,
... | @@ -86,46 +86,20 @@ def _perform_login(self, username, password):
if self.access_token:
return
- login_page = self._download_webpage(
- f'{self._AUTH_ROOT}/oauth2/login', None, note='Downloading login page',
- errnote='Downloading login page failed')
+ token_r... | yt_dlp/extractor/iprima.py | 26 | Python | 0.571 | suggestion | 78 | 51 | 51 | false | [ie/iprima] Fix login support | 12,937 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | baierjan |
'only_matching': True,
}, {
'url': 'https://krimi.iprima.cz/mraz-0/sebevrazdy',
'only_matching': True,
}, {
'url': 'https://cool.iprima.cz/derava-silnice-nevadi',
'only_matching': True,
}, {
'url': 'https://love.iprima.cz/laska-az-za-hrob/slib-dany-bratrovi',
... | ```suggestion
'https://ucet.iprima.cz/api/session/create', None,
``` | 'url': 'https://krimi.iprima.cz/mraz-0/sebevrazdy',
'only_matching': True,
}, {
'url': 'https://cool.iprima.cz/derava-silnice-nevadi',
'only_matching': True,
}, {
'url': 'https://love.iprima.cz/laska-az-za-hrob/slib-dany-bratrovi',
'only_matching': True,
}]
... | @@ -86,46 +86,20 @@ def _perform_login(self, username, password):
if self.access_token:
return
- login_page = self._download_webpage(
- f'{self._AUTH_ROOT}/oauth2/login', None, note='Downloading login page',
- errnote='Downloading login page failed')
+ token_r... | yt_dlp/extractor/iprima.py | 26 | Python | 0.571 | suggestion | 82 | 51 | 51 | false | [ie/iprima] Fix login support | 12,937 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | baierjan |
'url': 'https://krimi.iprima.cz/mraz-0/sebevrazdy',
'only_matching': True,
}, {
'url': 'https://cool.iprima.cz/derava-silnice-nevadi',
'only_matching': True,
}, {
'url': 'https://love.iprima.cz/laska-az-za-hrob/slib-dany-bratrovi',
'only_matching': True,
}]
... | ```suggestion
data=json.dumps({
'email': username,
'password': password,
'deviceName': 'Windows Chrome',
}).encode(), headers={'content-type': 'application/json'})
``` | }, {
'url': 'https://cool.iprima.cz/derava-silnice-nevadi',
'only_matching': True,
}, {
'url': 'https://love.iprima.cz/laska-az-za-hrob/slib-dany-bratrovi',
'only_matching': True,
}]
def _perform_login(self, username, password):
if self.access_token:
... | @@ -86,46 +86,20 @@ def _perform_login(self, username, password):
if self.access_token:
return
- login_page = self._download_webpage(
- f'{self._AUTH_ROOT}/oauth2/login', None, note='Downloading login page',
- errnote='Downloading login page failed')
+ token_r... | yt_dlp/extractor/iprima.py | 26 | Python | 1 | suggestion | 245 | 51 | 51 | false | [ie/iprima] Fix login support | 12,937 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | baierjan |
'only_matching': True,
}, {
'url': 'https://love.iprima.cz/laska-az-za-hrob/slib-dany-bratrovi',
'only_matching': True,
}]
def _perform_login(self, username, password):
if self.access_token:
return
token_request_data = json.dumps({
'email': u... | I don't like that we "expect" this error; if the token flow fails we should get bug reports. Let's just let the KeyError rip if need be and also check that the token is truthy
```suggestion
self.access_token = token_data['accessToken']['value']
if not self.access_token:
raise ExtractorE... | 'url': 'https://love.iprima.cz/laska-az-za-hrob/slib-dany-bratrovi',
'only_matching': True,
}]
def _perform_login(self, username, password):
if self.access_token:
return
token_data = self._download_json(
'https://ucet.iprima.cz/api/session/create', None,... | @@ -86,46 +86,20 @@ def _perform_login(self, username, password):
if self.access_token:
return
- login_page = self._download_webpage(
- f'{self._AUTH_ROOT}/oauth2/login', None, note='Downloading login page',
- errnote='Downloading login page failed')
+ token_r... | yt_dlp/extractor/iprima.py | 26 | Python | 1 | bug | 361 | 51 | 51 | false | [ie/iprima] Fix login support | 12,937 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | baierjan |
'url': 'https://prima.iprima.cz/porady/jak-se-stavi-sen/rodina-rathousova-praha',
'only_matching': True,
}, {
'url': 'http://www.iprima.cz/filmy/desne-rande',
'only_matching': True,
}, {
'url': 'https://zoom.iprima.cz/10-nejvetsich-tajemstvi-zahad/posvatna-mista-a-stavby'... | ```suggestion
note='Logging in', errnote='Failed to log in',
``` | 'url': 'https://prima.iprima.cz/porady/jak-se-stavi-sen/rodina-rathousova-praha',
'only_matching': True,
}, {
'url': 'http://www.iprima.cz/filmy/desne-rande',
'only_matching': True,
}, {
'url': 'https://zoom.iprima.cz/10-nejvetsich-tajemstvi-zahad/posvatna-mista-a-stavby'... | @@ -86,48 +84,18 @@ def _perform_login(self, username, password):
if self.access_token:
return
- login_page = self._download_webpage(
- f'{self._AUTH_ROOT}/oauth2/login', None, note='Downloading login page',
- errnote='Downloading login page failed')
-
- login... | yt_dlp/extractor/iprima.py | 26 | Python | 0.571 | bug | 78 | 51 | 51 | false | [ie/iprima] Fix login support | 12,937 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | baierjan |
yield field, f'expected exactly {val} items, got {got_num}'
return
if not isinstance(got, str):
yield field, f'expected {str.__name__}, got {type(got).__name__}'
return
if op == 're':
if not re.match(val, got):
yield field... | ```suggestion
yield field, f'expected hash {val}, got {hash_val}'
``` | yield field, f'expected exactly {val} items, got {got_num}'
return
if not isinstance(got, str):
yield field, f'expected {str.__name__}, got {type(got).__name__}'
return
if op == 're':
if not re.match(val, got):
yield field... | @@ -148,7 +148,7 @@ def _iter_differences(got, expected, field):
if op == 'md5':
hash_val = md5(got)
if hash_val != val:
- yield field, f'expected hash {val}, got {hash_val}'
+ yield field, f'expected hash {val}, got {hash_val} (raw value: {got})' | test/helper.py | 26 | Python | 0.571 | suggestion | 87 | 51 | 51 | false | [ie/youtube:tab] Extract continuation from empty page | 12,938 | yt-dlp/yt-dlp | 132,642 | Python | coletdjnz | coletdjnz |
import re
import time
import urllib.parse
from .common import InfoExtractor
from ..utils import ExtractorError, int_or_none, url_or_none, urlencode_postdata
from ..utils.traversal import traverse_obj
class GetCourseRuPlayerIE(InfoExtractor):
_VALID_URL = r'https?://(player02\.getcourse\.ru|cf-api-2\.vhcdn\.com)/... | this needs to be non-capturing
```suggestion
_VALID_URL = r'https?://(?:player02\.getcourse\.ru|cf-api-2\.vhcdn\.com)/sign-player/?\?(?:[^#]+&)?json=[^#&]+'
``` | import re
import time
import urllib.parse
from .common import InfoExtractor
from ..utils import ExtractorError, int_or_none, url_or_none, urlencode_postdata
from ..utils.traversal import traverse_obj
class GetCourseRuPlayerIE(InfoExtractor):
_VALID_URL = r'https?://(?:player02\.getcourse\.ru|cf-api-2\.vhcdn\.com... | @@ -8,7 +8,7 @@
class GetCourseRuPlayerIE(InfoExtractor):
- _VALID_URL = r'https?://player02\.getcourse\.ru/sign-player/?\?(?:[^#]+&)?json=[^#&]+'
+ _VALID_URL = r'https?://(player02\.getcourse\.ru|cf-api-2\.vhcdn\.com)/sign-player/?\?(?:[^#]+&)?json=[^#&]+' | yt_dlp/extractor/getcourseru.py | 11 | Python | 0.714 | suggestion | 167 | 36 | 36 | false | [ie/GetCourseRu] Fix extractors | 12,943 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | troex |
import re
import time
import urllib.parse
from .common import InfoExtractor
from ..utils import ExtractorError, int_or_none, url_or_none, urlencode_postdata
from ..utils.traversal import traverse_obj
class GetCourseRuPlayerIE(InfoExtractor):
_VALID_URL = r'https?://(?:player02\.getcourse\.ru|cf-api-2\.vhcdn\.com... | ```suggestion
'url': 'https://cf-api-2.vhcdn.com/sign-player/?json=example',
``` | import re
import time
import urllib.parse
from .common import InfoExtractor
from ..utils import ExtractorError, int_or_none, url_or_none, urlencode_postdata
from ..utils.traversal import traverse_obj
class GetCourseRuPlayerIE(InfoExtractor):
_VALID_URL = r'https?://(?:player02\.getcourse\.ru|cf-api-2\.vhcdn\.com... | @@ -20,6 +20,16 @@ class GetCourseRuPlayerIE(InfoExtractor):
'duration': 1693,
},
'skip': 'JWT expired',
+ }, {
+ 'url': 'https://cf-api-2.vhcdn.com/sign-player/?json=eyJ2aWRlb19oYXNoIjoiOGFmZDdjNDg5OTUyMTA4ZTAwZjAxOTU5MGYzNzExZjMiLCJ1c2VyX2lkIjo0MjI3MDg4MDMsInN1Yl9sb2dpbl91c2Vy... | yt_dlp/extractor/getcourseru.py | 24 | Python | 0.571 | suggestion | 90 | 49 | 49 | false | [ie/GetCourseRu] Fix extractors | 12,943 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | troex |
'ext': 'mp4',
'title': 'Clase inédita',
'duration': 335.817,
'thumbnail': r're:https://img2\.rtve\.es/v/.*\.png',
'series': 'El coro de la cárcel',
},
'params': {
'skip_download': True,
},
}
def _real_extract(self, ... | ```suggestion
_VALID_URL = r'https?://(?:www\.)?rtve\.es/play/videos/(?P<id>[\w-]+)/?(?:[?#]|$)'
``` | 'info_dict': {
'id': '572515',
'ext': 'mp4',
'title': 'Clase inédita',
'duration': 335.817,
'thumbnail': r're:https://img2\.rtve\.es/v/.*\.png',
'series': 'El coro de la cárcel',
},
'params': {
'skip_download': T... | @@ -371,3 +371,55 @@ def _real_extract(self, url):
raise ExtractorError('The webpage doesn\'t contain any video', expected=True)
return self.url_result(play_url, ie=RTVEALaCartaIE.ie_key())
+
+
+class RTVEProgramIE(RTVEBaseIE):
+ IE_NAME = 'rtve.es:program'
+ IE_DESC = 'RTVE.es program'
+ ... | yt_dlp/extractor/rtve.py | 26 | Python | 0.714 | suggestion | 106 | 51 | 51 | false | [ie/rtve] Add program extractor | 12,955 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | meGAmeS1 |
'page': current_page,
'size': 60,
}
videos_data = self._download_json(
f'https://www.rtve.es/api/programas/{program_id}/videos?{urllib.parse.urlencode(params)}',
program_slug,
)
... | I'd move this out in to a dedicated function and yield to allow for lazy extraction
```suggestion
def _entries(self, program_id):
total_page_count = 1
current_page = 1
while current_page <= total_page_count:
videos_data = self._download_json(
f'https://www.... | query={
'type': 39816,
'page': page_num,
'size': 60,
})
def _entries(self, page_data):
for video in traverse_obj(page_data, ('page', 'items', lambda _, v: url_or_none(v['htmlUrl']))):
yield self.url_result(
... | @@ -371,3 +371,55 @@ def _real_extract(self, url):
raise ExtractorError('The webpage doesn\'t contain any video', expected=True)
return self.url_result(play_url, ie=RTVEALaCartaIE.ie_key())
+
+
+class RTVEProgramIE(RTVEBaseIE):
+ IE_NAME = 'rtve.es:program'
+ IE_DESC = 'RTVE.es program'
+ ... | yt_dlp/extractor/rtve.py | 26 | Python | 1 | refactor | 1,783 | 31 | 40 | false | [ie/rtve] Add program extractor | 12,955 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | meGAmeS1 |
f'https://www.rtve.es/api/programas/{program_id}/videos?{urllib.parse.urlencode(params)}',
program_slug,
)
current_page += 1
total_page_count = traverse_obj(videos_data, ('page', 'totalPages'), default=1)
entries.ext... | ```suggestion
program_slug = self._match_id(url)
program_page = self._download_webpage(url, program_slug)
program_id = self._html_search_meta('DC.identifier', program_page, 'Program ID', fatal=False)
return self.playlist_result(
self._entries(program_id), program_id,... | })
def _entries(self, page_data):
for video in traverse_obj(page_data, ('page', 'items', lambda _, v: url_or_none(v['htmlUrl']))):
yield self.url_result(
video['htmlUrl'], RTVEALaCartaIE, url_transparent=True,
**traverse_obj(video, {
... | @@ -371,3 +371,55 @@ def _real_extract(self, url):
raise ExtractorError('The webpage doesn\'t contain any video', expected=True)
return self.url_result(play_url, ie=RTVEALaCartaIE.ie_key())
+
+
+class RTVEProgramIE(RTVEBaseIE):
+ IE_NAME = 'rtve.es:program'
+ IE_DESC = 'RTVE.es program'
+ ... | yt_dlp/extractor/rtve.py | 26 | Python | 0.857 | refactor | 365 | 27 | 36 | false | [ie/rtve] Add program extractor | 12,955 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | meGAmeS1 |
'id': '572515',
'ext': 'mp4',
'title': 'Clase inédita',
'duration': 335.817,
'thumbnail': r're:https://img2\.rtve\.es/v/.*\.png',
'series': 'El coro de la cárcel',
},
'params': {
'skip_download': True,
},
}
... | ```suggestion
IE_DESC = 'RTVE.es programs'
``` | 'url': 'https://www.rtve.es/television/20091103/video-inedito-del-8o-programa/299020.shtml',
'info_dict': {
'id': '572515',
'ext': 'mp4',
'title': 'Clase inédita',
'duration': 335.817,
'thumbnail': r're:https://img2\.rtve\.es/v/.*\.png',
... | @@ -371,3 +371,58 @@ def _real_extract(self, url):
raise ExtractorError('The webpage doesn\'t contain any video', expected=True)
return self.url_result(play_url, ie=RTVEALaCartaIE.ie_key())
+
+
+class RTVEProgramIE(RTVEBaseIE):
+ IE_NAME = 'rtve.es:program'
+ IE_DESC = 'RTVE.es program' | yt_dlp/extractor/rtve.py | 26 | Python | 0.571 | suggestion | 52 | 51 | 51 | false | [ie/rtve] Add program extractor | 12,955 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | meGAmeS1 |
'timestamp': 1665507240,
'upload_date': '20221011',
'release_year': 2025,
},
}, {
'url': 'http://www.raiplay.it/video/2016/11/gazebotraindesi-efebe701-969c-4593-92f3-285f0d1ce750.html?',
'only_matching': True,
}, {
# subtitles at 'subtitlesArra... | can we do this please
```diff
- if not self.get_param('allow_unplayable_formats'):
- if traverse_obj(media, ('rights_management', 'rights', 'drm')):
- self.report_drm(video_id)
+ if traverse_obj(media, ('rights_management', 'rights', 'drm')):
+ self.report_drm(vi... | 'episode': 'Ad ogni costo',
'timestamp': 1665507240,
'upload_date': '20221011',
'release_year': 2025,
},
}, {
'url': 'http://www.raiplay.it/video/2016/11/gazebotraindesi-efebe701-969c-4593-92f3-285f0d1ce750.html?',
'only_matching': True,
},... | @@ -341,7 +361,7 @@ def _real_extract(self, url):
f'{base}.json', video_id, 'Downloading video JSON')
if not self.get_param('allow_unplayable_formats'):
- if traverse_obj(media, (('program_info', None), 'rights_management', 'rights', 'drm')):
+ if traverse_obj(media, ('righ... | yt_dlp/extractor/rai.py | 26 | Python | 0.786 | suggestion | 333 | 51 | 51 | false | [ie/RaiPlay] Fix DRM detection | 12,971 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | DTrombett |
'params': {'skip_download': True},
'expected_warnings': ['Video not available. Likely due to geo-restriction.'],
}, {
# 1500 quality
'url': 'https://www.raiplay.it/video/2012/09/S1E11---Tutto-cio-che-luccica-0cab3323-732e-45d6-8e86-7704acab6598.html',
'md5': 'a634d20e8ab2d437... | ```suggestion
# checking program_info gives false positive for DRM
'url': 'https://www.raiplay.it/video/2022/10/Ad-ogni-costo---Un-giorno-in-Pretura---Puntata-del-15102022-1dfd1295-ea38-4bac-b51e-f87e2881693b.html',
``` | 'params': {'skip_download': True},
'expected_warnings': ['Video not available. Likely due to geo-restriction.'],
}, {
# 1500 quality
'url': 'https://www.raiplay.it/video/2012/09/S1E11---Tutto-cio-che-luccica-0cab3323-732e-45d6-8e86-7704acab6598.html',
'md5': 'a634d20e8ab2d437... | @@ -321,6 +321,26 @@ class RaiPlayIE(RaiBaseIE):
'timestamp': 1348495020,
'upload_date': '20120924',
},
+ }, {
+ 'url': 'https://www.raiplay.it/video/2022/10/Ad-ogni-costo---Un-giorno-in-Pretura---Puntata-del-15102022-1dfd1295-ea38-4bac-b51e-f87e2881693b.html', | yt_dlp/extractor/rai.py | 26 | Python | 0.786 | suggestion | 238 | 51 | 51 | false | [ie/RaiPlay] Fix DRM detection | 12,971 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | DTrombett |
url_basename,
url_or_none,
urlencode_postdata,
urljoin,
)
from ..utils.traversal import find_element, traverse_obj
class NiconicoBaseIE(InfoExtractor):
_GEO_BYPASS = False
_GEO_COUNTRIES = ['JP']
_LOGIN_BASE = 'https://account.nicovideo.jp'
_NETRC_MACHINE = 'niconico'
def raise_lo... | ```suggestion
'Logging in', 'Unable to log in', headers={
``` | url_basename,
url_or_none,
urlencode_postdata,
urljoin,
)
from ..utils.traversal import find_element, traverse_obj
class NiconicoBaseIE(InfoExtractor):
_GEO_BYPASS = False
_GEO_COUNTRIES = ['JP']
_LOGIN_BASE = 'https://account.nicovideo.jp'
_NETRC_MACHINE = 'niconico'
@property
... | @@ -33,13 +32,72 @@
urlencode_postdata,
urljoin,
)
+from ..utils.traversal import find_element, traverse_obj
-class NiconicoIE(InfoExtractor):
+class NiconicoBaseIE(InfoExtractor):
+ _GEO_BYPASS = False
+ _GEO_COUNTRIES = ['JP']
+ _LOGIN_BASE = 'https://account.nicovideo.jp'
+ _NETRC_MACHINE ... | yt_dlp/extractor/niconico.py | 26 | Python | 0.571 | suggestion | 75 | 51 | 51 | false | [ie/niconico] Fix login support | 13,008 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | doe1080 |
def raise_login_error(self, error, default, expected=True):
raise ExtractorError(f'Unable to login: {error or default}', expected=expected)
def _perform_login(self, username, password):
if self._get_cookies('https://www.nicovideo.jp').get('user_session'):
return
self._requ... | IMO it's okay to break this up to make it more readable:
```suggestion
data_layer = self._search_json(
r'NicoGoogleTagManagerDataLayer\s*=\s*\[', webpage, 'data layer', None, fatal=False)
if traverse_obj(data_layer, ('user', 'login_status')) == 'login':
return
```
... |
@property
def is_logged_in(self):
return bool(self._get_cookies('https://www.nicovideo.jp').get('user_session'))
def _raise_login_error(self, message, expected=True):
raise ExtractorError(f'Unable to login: {message}', expected=expected)
def _perform_login(self, username, password):
... | @@ -33,13 +32,72 @@
urlencode_postdata,
urljoin,
)
+from ..utils.traversal import find_element, traverse_obj
-class NiconicoIE(InfoExtractor):
+class NiconicoBaseIE(InfoExtractor):
+ _GEO_BYPASS = False
+ _GEO_COUNTRIES = ['JP']
+ _LOGIN_BASE = 'https://account.nicovideo.jp'
+ _NETRC_MACHINE ... | yt_dlp/extractor/niconico.py | 26 | Python | 0.857 | suggestion | 471 | 51 | 51 | false | [ie/niconico] Fix login support | 13,008 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | doe1080 |
if traverse_obj(self._search_json(
r'NicoGoogleTagManagerDataLayer\s*=\s*\[',
webpage, 'data layer', None, fatal=False,
), ('user', 'login_status', {lambda x: x == 'login'})):
return
if err_msg := traverse_obj(webpage, (
{find_element(cls='notice... | Why do we need to download the webpage again? `urlh.url` is the current location of what was read as `mfa`. Can't we just do this?
```suggestion
err_msg = traverse_obj(mfa, ({find_element(cls='pageMainMsg')}, {clean_html}))
``` | 'mail_tel': username,
'password': password,
}))
if self.is_logged_in:
return
elif err_msg := traverse_obj(webpage, (
{find_element(cls='notice error')}, {find_element(cls='notice__text')}, {clean_html},
)):
self._ra... | @@ -33,13 +32,72 @@
urlencode_postdata,
urljoin,
)
+from ..utils.traversal import find_element, traverse_obj
-class NiconicoIE(InfoExtractor):
+class NiconicoBaseIE(InfoExtractor):
+ _GEO_BYPASS = False
+ _GEO_COUNTRIES = ['JP']
+ _LOGIN_BASE = 'https://account.nicovideo.jp'
+ _NETRC_MACHINE ... | yt_dlp/extractor/niconico.py | 26 | Python | 0.786 | question | 246 | 51 | 51 | false | [ie/niconico] Fix login support | 13,008 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | doe1080 |
qualities,
remove_start,
str_or_none,
try_get,
unescapeHTML,
unified_timestamp,
update_url_query,
url_basename,
url_or_none,
urlencode_postdata,
urljoin,
)
from ..utils.traversal import find_element, traverse_obj
class NiconicoBaseIE(InfoExtractor):
_GEO_BYPASS = False
... | ```suggestion
def _raise_login_error(self, error, default, expected=True):
``` | qualities,
remove_start,
str_or_none,
try_get,
unescapeHTML,
unified_timestamp,
update_url_query,
url_basename,
url_or_none,
urlencode_postdata,
urljoin,
)
from ..utils.traversal import find_element, traverse_obj
class NiconicoBaseIE(InfoExtractor):
_GEO_BYPASS = False
... | @@ -33,13 +32,71 @@
urlencode_postdata,
urljoin,
)
+from ..utils.traversal import find_element, traverse_obj
-class NiconicoIE(InfoExtractor):
+class NiconicoBaseIE(InfoExtractor):
+ _GEO_BYPASS = False
+ _GEO_COUNTRIES = ['JP']
+ _LOGIN_BASE = 'https://account.nicovideo.jp'
+ _NETRC_MACHINE ... | yt_dlp/extractor/niconico.py | 26 | Python | 0.714 | suggestion | 84 | 51 | 51 | false | [ie/niconico] Fix login support | 13,008 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | doe1080 |
def raise_login_error(self, error, default, expected=True):
raise ExtractorError(f'Unable to login: {error or default}', expected=expected)
def _perform_login(self, username, password):
if self.is_logged_in:
return
self._request_webpage(
f'{self._LOGIN_BASE}/log... | ```suggestion
self._raise_login_error(err_msg, 'Invalid username or password')
``` | def _raise_login_error(self, message, expected=True):
raise ExtractorError(f'Unable to login: {message}', expected=expected)
def _perform_login(self, username, password):
if self.is_logged_in:
return
self._request_webpage(
f'{self._LOGIN_BASE}/login', None, 'Req... | @@ -33,13 +32,71 @@
urlencode_postdata,
urljoin,
)
+from ..utils.traversal import find_element, traverse_obj
-class NiconicoIE(InfoExtractor):
+class NiconicoBaseIE(InfoExtractor):
+ _GEO_BYPASS = False
+ _GEO_COUNTRIES = ['JP']
+ _LOGIN_BASE = 'https://account.nicovideo.jp'
+ _NETRC_MACHINE ... | yt_dlp/extractor/niconico.py | 26 | Python | 0.786 | suggestion | 96 | 51 | 51 | false | [ie/niconico] Fix login support | 13,008 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | doe1080 |
'mail_tel': username,
'password': password,
}),
)
if self.is_logged_in:
return
if err_msg := traverse_obj(webpage, (
{find_element(cls='notice error')}, {find_element(cls='notice__text')}, {clean_html},
)):
... | ```suggestion
self._raise_login_error(err_msg, 'MFA session expired')
``` | 'mail_tel': username,
'password': password,
}))
if self.is_logged_in:
return
elif err_msg := traverse_obj(webpage, (
{find_element(cls='notice error')}, {find_element(cls='notice__text')}, {clean_html},
)):
self._ra... | @@ -33,13 +32,71 @@
urlencode_postdata,
urljoin,
)
+from ..utils.traversal import find_element, traverse_obj
-class NiconicoIE(InfoExtractor):
+class NiconicoBaseIE(InfoExtractor):
+ _GEO_BYPASS = False
+ _GEO_COUNTRIES = ['JP']
+ _LOGIN_BASE = 'https://account.nicovideo.jp'
+ _NETRC_MACHINE ... | yt_dlp/extractor/niconico.py | 26 | Python | 0.714 | suggestion | 91 | 51 | 51 | false | [ie/niconico] Fix login support | 13,008 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | doe1080 |
if self.is_logged_in:
return
if err_msg := traverse_obj(webpage, (
{find_element(cls='notice error')}, {find_element(cls='notice__text')}, {clean_html},
)):
self.raise_login_error(err_msg, 'Invalid username or password')
elif 'oneTimePw' in webpage:
... | ```suggestion
self._raise_login_error(err_msg, 'MFA challenge failed')
``` | if self.is_logged_in:
return
elif err_msg := traverse_obj(webpage, (
{find_element(cls='notice error')}, {find_element(cls='notice__text')}, {clean_html},
)):
self._raise_login_error(err_msg or 'Invalid username or password')
elif 'oneTimePw' in webpag... | @@ -33,13 +32,71 @@
urlencode_postdata,
urljoin,
)
+from ..utils.traversal import find_element, traverse_obj
-class NiconicoIE(InfoExtractor):
+class NiconicoBaseIE(InfoExtractor):
+ _GEO_BYPASS = False
+ _GEO_COUNTRIES = ['JP']
+ _LOGIN_BASE = 'https://account.nicovideo.jp'
+ _NETRC_MACHINE ... | yt_dlp/extractor/niconico.py | 26 | Python | 0.714 | bug | 92 | 51 | 51 | false | [ie/niconico] Fix login support | 13,008 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | doe1080 |
if err_msg := traverse_obj(webpage, (
{find_element(cls='notice error')}, {find_element(cls='notice__text')}, {clean_html},
)):
self.raise_login_error(err_msg, 'Invalid username or password')
elif 'oneTimePw' in webpage:
post_url = self._search_regex(
... | ```suggestion
self._raise_login_error(None, 'Unexpected login error', expected=False)
``` | elif err_msg := traverse_obj(webpage, (
{find_element(cls='notice error')}, {find_element(cls='notice__text')}, {clean_html},
)):
self._raise_login_error(err_msg or 'Invalid username or password')
elif 'oneTimePw' in webpage:
post_url = self._search_regex(
... | @@ -33,13 +32,71 @@
urlencode_postdata,
urljoin,
)
+from ..utils.traversal import find_element, traverse_obj
-class NiconicoIE(InfoExtractor):
+class NiconicoBaseIE(InfoExtractor):
+ _GEO_BYPASS = False
+ _GEO_COUNTRIES = ['JP']
+ _LOGIN_BASE = 'https://account.nicovideo.jp'
+ _NETRC_MACHINE ... | yt_dlp/extractor/niconico.py | 26 | Python | 0.857 | suggestion | 103 | 51 | 51 | false | [ie/niconico] Fix login support | 13,008 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | doe1080 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.