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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
def extract_relay_prefetched_data(_filter):
replay_data = extract_relay_data(_filter)
for require in (replay_data.get('require') or []):
if require[0] == 'RelayPrefetchedStreamCache':
return try_get(require, lambda x: x[3][1]['__bbox']['result']['data... | ```suggestion
playable_url = traverse_obj(
video, key, ('creation_story', 'short_form_video_context', 'playback_video', key))
``` |
def extract_dash_manifest(video, formats):
dash_manifest = video.get('dash_manifest')
if dash_manifest:
formats.extend(self._parse_mpd_formats(
compat_etree_fromstring(urllib.parse.unquote_plus(dash_manifest))))
def process_formats(info):
... | @@ -501,7 +501,7 @@ def parse_graphql_video(video):
q = qualities(['sd', 'hd'])
for key, format_id in (('playable_url', 'sd'), ('playable_url_quality_hd', 'hd'),
('playable_url_dash', '')):
- playable_url = vide... | yt_dlp/extractor/facebook.py | 26 | Python | 0.714 | suggestion | 184 | 51 | 51 | false | [extractor/facebook] Fix Reels Format | 7,564 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | demon071 |
scale_thumbnails_to_max_format_width,
)
class AntennaBaseIE(InfoExtractor):
def _download_and_extract_api_data(self, video_id, netloc, cid=None):
info = self._download_json(f'{self.http_scheme()}//{netloc}{self._API_PATH}',
video_id, query={'cid': cid or video_id})
... | Don't add this to the base class, or else all subclassed extractors will match `Ant1NewsGrWatch` entries in the download archive. Add it to `AntennaGrWatchIE` only | scale_thumbnails_to_max_format_width,
)
class AntennaBaseIE(InfoExtractor):
def _download_and_extract_api_data(self, video_id, netloc, cid=None):
info = self._download_json(f'{self.http_scheme()}//{netloc}{self._API_PATH}',
video_id, query={'cid': cid or video_id})
... | @@ -5,58 +5,73 @@
from ..utils import (
ExtractorError,
determine_ext,
+ make_archive_id,
scale_thumbnails_to_max_format_width,
)
-class Ant1NewsGrBaseIE(InfoExtractor):
+class AntennaBaseIE(InfoExtractor):
def _download_and_extract_api_data(self, video_id, netloc, cid=None):
- url =... | yt_dlp/extractor/antenna.py | 26 | Python | 0.571 | refactor | 163 | 51 | 51 | false | [extractor/antenna] Improvements | 7,584 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | stdedos |
from .common import InfoExtractor
from ..compat import compat_urlparse
from ..utils import (
ExtractorError,
parse_duration,
parse_filesize,
str_to_int,
unified_timestamp,
urlencode_postdata,
)
class PiaproIE(InfoExtractor):
_NETRC_MACHINE = 'piapro'
_VALID_URL = r'https?://piapro\.jp/... | Have you verified this download manually? md5 changing isn't normal | from .common import InfoExtractor
from ..compat import compat_urlparse
from ..utils import (
ExtractorError,
parse_duration,
parse_filesize,
str_to_int,
unified_timestamp,
urlencode_postdata,
)
class PiaproIE(InfoExtractor):
_NETRC_MACHINE = 'piapro'
_VALID_URL = r'https?://piapro\.jp/... | @@ -12,17 +12,23 @@
class PiaproIE(InfoExtractor):
_NETRC_MACHINE = 'piapro'
- _VALID_URL = r'https?://piapro\.jp/t/(?P<id>\w+)/?'
+ _VALID_URL = r'https?://piapro\.jp/(?:t|content)/(?P<id>\w+)/?'
_TESTS = [{
'url': 'https://piapro.jp/t/NXYR',
- 'md5': 'a9d52f27d13bafab7ee34116a7dcfa7... | yt_dlp/extractor/piapro.py | 18 | Python | 0.214 | question | 67 | 43 | 43 | false | fix: Update piapro tests and content url scheme | 7,592 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | FinnRG |
parse_duration,
parse_filesize,
str_to_int,
unified_timestamp,
urlencode_postdata,
)
class PiaproIE(InfoExtractor):
_NETRC_MACHINE = 'piapro'
_VALID_URL = r'https?://piapro\.jp/(?:t|content)/(?P<id>\w+)/?'
_TESTS = [{
'url': 'https://piapro.jp/t/NXYR',
'md5': 'f7c0f7609... | ```suggestion
```
This is mistake in test runner. @bashonly Could you add this to `test\helper.py:sanitize_got_info_dict` in your PR | parse_duration,
parse_filesize,
str_to_int,
unified_timestamp,
urlencode_postdata,
)
class PiaproIE(InfoExtractor):
_NETRC_MACHINE = 'piapro'
_VALID_URL = r'https?://piapro\.jp/(?:t|content)/(?P<id>\w+)/?'
_TESTS = [{
'url': 'https://piapro.jp/t/NXYR',
'md5': 'f7c0f7609... | @@ -12,17 +12,23 @@
class PiaproIE(InfoExtractor):
_NETRC_MACHINE = 'piapro'
- _VALID_URL = r'https?://piapro\.jp/t/(?P<id>\w+)/?'
+ _VALID_URL = r'https?://piapro\.jp/(?:t|content)/(?P<id>\w+)/?'
_TESTS = [{
'url': 'https://piapro.jp/t/NXYR',
- 'md5': 'a9d52f27d13bafab7ee34116a7dcfa7... | yt_dlp/extractor/piapro.py | 26 | Python | 0.786 | security | 136 | 51 | 51 | false | fix: Update piapro tests and content url scheme | 7,592 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | FinnRG |
# Extract relevant bits
air_date = traverse_obj(meta, ('video_obj', 'air_date'), expected_type=str)
channel = meta.get('show_slug')
description = traverse_obj(meta, ('video_obj', 'description'), expected_type=str)
duration = traverse_obj(meta, ('video_obj', 'duration'), expected_... | ```suggestion
meta = self._search_json(r'window\._PBS_KIDS_DEEPLINK\s*=', webpage, 'video info')
formats, subtitles = self._extract_m3u8_formats_and_subtitles(
traverse_obj(meta, ('video_obj', 'URI', {url_or_none})), video_id, ext='mp4')
return {
'id': video_id,
... | import re
from .common import InfoExtractor
from ..compat import compat_str
from ..utils import (
ExtractorError,
determine_ext,
int_or_none,
float_or_none,
js_to_json,
orderedSet,
strip_jsonp,
strip_or_none,
traverse_obj,
unified_strdate,
url_or_none,
US_RATINGS,
)
cl... | @@ -696,3 +698,73 @@ def extract_redirect_urls(info):
'subtitles': subtitles,
'chapters': chapters,
}
+
+
+class PBSKidsIE(InfoExtractor):
+ # https://pbskids.org/video/molly-of-denali/3030407927
+ _VALID_URL = r'https?://(?:www\.)?pbskids\.org/video/(?P<channel>[a-zA-Z\-]+)/(?P... | yt_dlp/extractor/pbs.py | 26 | Python | 1 | refactor | 921 | 27 | 758 | false | [extractor/pbskids] Add support for pbskids.org videos | 7,602 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | snixon |
# Try turning it to 'program - title' naming scheme if possible
alt_title = info.get('program', {}).get('title')
if alt_title:
info['title'] = alt_title + ' - ' + re.sub(r'^' + alt_title + r'[\s\-:]+', '', info['title'])
description = info.get('description') or info.get(
... | ```suggestion
_VALID_URL = r'https?://(?:www\.)?pbskids\.org/video/(?P<channel>[\w-]+)/(?P<id>\d+)'
``` | alt_title = info.get('program', {}).get('title')
if alt_title:
info['title'] = alt_title + ' - ' + re.sub(r'^' + alt_title + r'[\s\-:]+', '', info['title'])
description = info.get('description') or info.get(
'program', {}).get('description') or description
retur... | @@ -696,3 +698,73 @@ def extract_redirect_urls(info):
'subtitles': subtitles,
'chapters': chapters,
}
+
+
+class PBSKidsIE(InfoExtractor):
+ # https://pbskids.org/video/molly-of-denali/3030407927
+ _VALID_URL = r'https?://(?:www\.)?pbskids\.org/video/(?P<channel>[a-zA-Z\-]+)/(?P... | yt_dlp/extractor/pbs.py | 26 | Python | 0.714 | suggestion | 109 | 51 | 51 | false | [extractor/pbskids] Add support for pbskids.org videos | 7,602 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | snixon |
'title': 'Cooper\'s Favorite Place in Nature',
'channel': 'plum-landing',
'duration': 67,
'ext': 'mp4',
'series': 'Plum Landing',
'description': 'md5:657e5fc4356a84ead1c061eb280ff05d',
'categories': ['Episode... | ```suggestion
'channel': ('show_slug', {str}),
``` | 'title': 'Cooper\'s Favorite Place in Nature',
'channel': 'plum-landing',
'duration': 67,
'ext': 'mp4',
'series': 'Plum Landing',
'description': 'md5:657e5fc4356a84ead1c061eb280ff05d',
'categories': ['Episode... | @@ -696,3 +697,61 @@ def extract_redirect_urls(info):
'subtitles': subtitles,
'chapters': chapters,
}
+
+
+class PBSKidsIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?pbskids\.org/video/(?P<channel>[\w-]+)/(?P<id>\d+)'
+ _TESTS = [
+ {
+ 'url': 'https:/... | yt_dlp/extractor/pbs.py | 26 | Python | 0.571 | suggestion | 68 | 34 | 34 | false | [extractor/pbskids] Add support for pbskids.org videos | 7,602 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | snixon |
'description': 'md5:d006b2211633685d8ebc8d03b6d5611e',
'categories': ['Episode'],
'upload_date': '20190718',
}
},
{
'url': 'https://pbskids.org/video/plum-landing/2365205059',
'md5': '92e5d189851a64ae1d0237a965be71f5',
... | ```suggestion
meta = self._search_json(r'window\._PBS_KIDS_DEEPLINK\s*=', webpage, 'video info', video_id)
``` | 'description': 'md5:d006b2211633685d8ebc8d03b6d5611e',
'categories': ['Episode'],
'upload_date': '20190718',
}
},
{
'url': 'https://pbskids.org/video/plum-landing/2365205059',
'md5': '92e5d189851a64ae1d0237a965be71f5',
... | @@ -696,3 +697,61 @@ def extract_redirect_urls(info):
'subtitles': subtitles,
'chapters': chapters,
}
+
+
+class PBSKidsIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?pbskids\.org/video/(?P<channel>[\w-]+)/(?P<id>\d+)'
+ _TESTS = [
+ {
+ 'url': 'https:/... | yt_dlp/extractor/pbs.py | 26 | Python | 0.714 | suggestion | 120 | 44 | 44 | false | [extractor/pbskids] Add support for pbskids.org videos | 7,602 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | snixon |
# info['title'] is often incomplete (e.g. 'Full Episode', 'Episode 5', etc)
# Try turning it to 'program - title' naming scheme if possible
alt_title = info.get('program', {}).get('title')
if alt_title:
info['title'] = alt_title + ' - ' + re.sub(r'^' + alt_title + r'[\s\-:]+'... | we are capturing `channel` and then not doing anything with it
we could extract the value
```py
def _real_extract(self, url):
video_id, channel = self._match_valid_url(url).group('id', 'channel')
```
and then use it as a `channel` fallback in case traversal doesn't return one
```py
r... | # info['title'] is often incomplete (e.g. 'Full Episode', 'Episode 5', etc)
# Try turning it to 'program - title' naming scheme if possible
alt_title = info.get('program', {}).get('title')
if alt_title:
info['title'] = alt_title + ' - ' + re.sub(r'^' + alt_title + r'[\s\-:]+'... | @@ -696,3 +697,61 @@ def extract_redirect_urls(info):
'subtitles': subtitles,
'chapters': chapters,
}
+
+
+class PBSKidsIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?pbskids\.org/video/(?P<channel>[\w-]+)/(?P<id>\d+)' | yt_dlp/extractor/pbs.py | 26 | Python | 0.857 | refactor | 572 | 51 | 51 | false | [extractor/pbskids] Add support for pbskids.org videos | 7,602 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | snixon |
# for one handler in which such protocol (and proxy) is not supported by another handler.
if self._SUPPORTED_URL_SCHEMES is not None and proxy_key not in (*self._SUPPORTED_URL_SCHEMES, 'all'):
continue
if self._SUPPORTED_PROXY_SCHEMES is None:
# Skip ... | I'd do this (+other comment) since type checking isn't really dependant on whether the RH actually supports it or not. But I won't insist.
```py
from types import NoneType
def _check_extensions(self, extensions):
"""Check extensions for unsupported extensions. To be implemented by subclasses."""
... | # This is to allow a case where a proxy may be set for a protocol
# for one handler in which such protocol (and proxy) is not supported by another handler.
if self._SUPPORTED_URL_SCHEMES is not None and proxy_key not in (*self._SUPPORTED_URL_SCHEMES, 'all'):
continue
... | @@ -263,26 +269,25 @@ def _check_proxies(self, proxies):
if scheme not in self._SUPPORTED_PROXY_SCHEMES:
raise UnsupportedRequest(f'Unsupported proxy type: "{scheme}"')
- def _check_cookiejar_extension(self, extensions):
- if not extensions.get('cookiejar'):
- return... | yt_dlp/networking/common.py | 26 | Python | 0.929 | suggestion | 476 | 51 | 51 | false | [networking/rh] Add strict extension checkinge | 7,604 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | coletdjnz |
def handle_response_read_exceptions(e):
if isinstance(e, http.client.IncompleteRead):
raise IncompleteRead(partial=e.partial, cause=e, expected=e.expected) from e
elif isinstance(e, ssl.SSLError):
handle_sslerror(e)
elif isinstance(e, (OSError, EOFError, http.client.HTTPException, *CONTENT_D... | see other comment
```suggestion
def _check_extensions(self, extensions):
extensions.pop('cookies', None)
extensions.pop('timeout', None)
``` | def handle_response_read_exceptions(e):
if isinstance(e, http.client.IncompleteRead):
raise IncompleteRead(partial=e.partial, cause=e, expected=e.expected) from e
elif isinstance(e, ssl.SSLError):
handle_sslerror(e)
elif isinstance(e, (OSError, EOFError, http.client.HTTPException, *CONTENT_D... | @@ -385,6 +385,10 @@ def __init__(self, *, enable_file_urls: bool = False, **kwargs):
if self.enable_file_urls:
self._SUPPORTED_URL_SCHEMES = (*self._SUPPORTED_URL_SCHEMES, 'file')
+ def _check_extensions(self, extensions):
+ self._check_timeout_extension(extensions)
+ self._che... | yt_dlp/networking/_urllib.py | 26 | Python | 0.714 | suggestion | 165 | 51 | 51 | false | [networking/rh] Add strict extension checkinge | 7,604 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | coletdjnz |
if urllib.request._parse_proxy(proxy_url)[0] is None:
raise UnsupportedRequest(f'Proxy "{proxy_url}" missing scheme')
scheme = urllib.parse.urlparse(proxy_url).scheme.lower()
if scheme not in self._SUPPORTED_PROXY_SCHEMES:
raise UnsupportedRequest(f'U... | We need `_validate_` cause we don't want people overriding `validate()`, since we need `wrap_request_errors` to apply. | if urllib.request._parse_proxy(proxy_url)[0] is None:
raise UnsupportedRequest(f'Proxy "{proxy_url}" missing scheme')
scheme = urllib.parse.urlparse(proxy_url).scheme.lower()
if scheme not in self._SUPPORTED_PROXY_SCHEMES:
raise UnsupportedRequest(f'U... | @@ -263,32 +270,22 @@ def _check_proxies(self, proxies):
if scheme not in self._SUPPORTED_PROXY_SCHEMES:
raise UnsupportedRequest(f'Unsupported proxy type: "{scheme}"')
- def _check_cookiejar_extension(self, extensions):
- if not extensions.get('cookiejar'):
- return... | yt_dlp/networking/common.py | 26 | Python | 0.714 | suggestion | 118 | 51 | 51 | false | [networking/rh] Add strict extension checkinge | 7,604 | yt-dlp/yt-dlp | 132,642 | Python | coletdjnz | coletdjnz |
'info_dict': {
'id': 'docs',
'title': 'muse.ai | docs',
'description': 'md5:6c0293431481582739c82ee8902687fa',
'age_limit': 0,
'thumbnail': 'https://muse.ai/static/imgs/poster-img-docs.png',
},
'params': {'allowed_extractors': ['all', '... | why fatal if key don't exit but nonfatal if it isnt url? | 'playlist_mincount': 4,
'info_dict': {
'id': 'docs',
'title': 'muse.ai | docs',
'description': 'md5:6c0293431481582739c82ee8902687fa',
'age_limit': 0,
'thumbnail': 'https://muse.ai/static/imgs/poster-img-docs.png',
},
'params': ... | @@ -0,0 +1,110 @@
+import re
+
+from .common import InfoExtractor
+from ..utils import (
+ determine_ext,
+ float_or_none,
+ int_or_none,
+ js_to_json,
+ traverse_obj,
+ url_or_none,
+)
+
+
+class MuseAIIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?muse\.ai/(?:v|embed)/(?P<id>\w+)'
+ _T... | yt_dlp/extractor/museai.py | 26 | Python | 0.214 | question | 56 | 51 | 51 | false | [ie/MuseAI] Add extractor | 7,614 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | bashonly |
'responsive_web_graphql_exclude_directive_enabled': True,
'verified_phone_label_enabled': False,
'responsive_web_media_download_video_enabled': False,
'responsive_web_graphql_skip_user_profile_image_extensions_enabled': False,
'responsive_w... | ```suggestion
self.report_warning(f'{e.orig_msg}. Falling back to syndication endpoint; some metadata may be missing', video_id=twid)
``` | 'withCommunity': False,
'includePromotedContent': False,
'withVoice': False,
},
'features': {
'creator_subscriptions_tweet_preview_api_enabled': True,
'tweetypie_unmention_optimization_enabled': True,
... | @@ -1190,15 +1199,13 @@ def _real_extract(self, url):
status = self._graphql_to_legacy(
self._call_graphql_api('2ICDjqPd81tulZcYrtpTuQ/TweetResultByRestId', twid), twid)
except ExtractorError as e:
- if self._login_hint() in e.msg:
- r... | yt_dlp/extractor/twitter.py | 26 | Python | 0.714 | suggestion | 155 | 51 | 51 | false | [ie/twitter] Add fallback, improve error handling | 7,621 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | bashonly |
'responsive_web_graphql_skip_user_profile_image_extensions_enabled': False,
'responsive_web_graphql_timeline_navigation_enabled': True,
'responsive_web_enhance_cards_enabled': False
},
'fieldToggles': {
'withArticleRichContentState'... | might be worth splitting this into a function, but not mandatory | },
'features': {
'creator_subscriptions_tweet_preview_api_enabled': True,
'tweetypie_unmention_optimization_enabled': True,
'responsive_web_edit_tweet_api_enabled': True,
'graphql_is_translatable_rweb_tweet_is_translatable_enabled':... | @@ -1189,20 +1191,21 @@ def _build_graphql_query(self, media_id):
def _real_extract(self, url):
twid, selected_index = self._match_valid_url(url).group('id', 'index')
- if not self.is_logged_in and self._configuration_arg('legacy_api'):
- status = traverse_obj(self._call_api(f'statuses... | yt_dlp/extractor/twitter.py | 26 | Python | 0.214 | suggestion | 64 | 51 | 51 | false | [ie/twitter] Add fallback, improve error handling | 7,621 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | bashonly |
if uploader:
title = f'{uploader} - {title}'
uploader_id = user.get('screen_name')
info = {
'id': twid,
'title': title,
'description': description,
'uploader': uploader,
'timestamp': unified_timestamp(status.get('created_at... | ```suggestion
media_id = traverse_obj(media, 'id_str', 'id', (
'video_info', 'variants', ..., 'url',
{functools.partial(re.search, r'_video/(\d+)/')}, 1
), get_all=False, expected_type=str_or_none)
```
(formatting may need change) | if not self._configuration_arg('legacy_api'):
return self._graphql_to_legacy(
self._call_graphql_api('2ICDjqPd81tulZcYrtpTuQ/TweetResultByRestId', twid), twid)
return traverse_obj(self._call_api(f'statuses/show/{twid}.json', twid, {
'cards_plat... | @@ -1231,6 +1234,11 @@ def _real_extract(self, url):
def extract_from_video_info(media):
media_id = traverse_obj(media, 'id_str', 'id', expected_type=str_or_none)
+ if not media_id:
+ # Workaround for syndication fallback
+ media_id = traverse_obj(media, ... | yt_dlp/extractor/twitter.py | 26 | Python | 1 | suggestion | 292 | 51 | 51 | false | [ie/twitter] Add fallback, improve error handling | 7,621 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | bashonly |
'responsive_web_graphql_skip_user_profile_image_extensions_enabled': False,
'responsive_web_graphql_timeline_navigation_enabled': True,
'responsive_web_enhance_cards_enabled': False
},
'fieldToggles': {
'withArticleRichContentState'... | ```suggestion
if not self._configuration_arg('legacy_api'):
return self._graphql_to_legacy(
self._call_graphql_api('2ICDjqPd81tulZcYrtpTuQ/TweetResultByRestId', twid), twid)
return traverse_obj(self._call_api(f'statuses/show/{twid}.json', twid, {
... | 'responsive_web_graphql_skip_user_profile_image_extensions_enabled': False,
'responsive_web_graphql_timeline_navigation_enabled': True,
'responsive_web_enhance_cards_enabled': False
},
'fieldToggles': {
'withArticleRichContentState'... | @@ -1187,22 +1207,39 @@ def _build_graphql_query(self, media_id):
}
}
+ def _extract_status(self, twid):
+ if self.is_logged_in:
+ return self._graphql_to_legacy(
+ self._call_graphql_api('zZXycP0V6H7m-2r0mOnFcA/TweetDetail', twid), twid)
+
+ try:
+ ... | yt_dlp/extractor/twitter.py | 26 | Python | 0.857 | suggestion | 571 | 51 | 51 | false | [ie/twitter] Add fallback, improve error handling | 7,621 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | bashonly |
self._call_graphql_api('zZXycP0V6H7m-2r0mOnFcA/TweetDetail', twid), twid)
try:
if self._configuration_arg('legacy_api'):
status = traverse_obj(self._call_api(f'statuses/show/{twid}.json', twid, {
'cards_platform': 'Web-12',
'in... | ```suggestion
return status
``` | self._call_graphql_api('zZXycP0V6H7m-2r0mOnFcA/TweetDetail', twid), twid)
try:
if not self._configuration_arg('legacy_api'):
return self._graphql_to_legacy(
self._call_graphql_api('2ICDjqPd81tulZcYrtpTuQ/TweetResultByRestId', twid), twid)
... | @@ -1187,22 +1207,39 @@ def _build_graphql_query(self, media_id):
}
}
+ def _extract_status(self, twid):
+ if self.is_logged_in:
+ return self._graphql_to_legacy(
+ self._call_graphql_api('zZXycP0V6H7m-2r0mOnFcA/TweetDetail', twid), twid)
+
+ try:
+ ... | yt_dlp/extractor/twitter.py | 26 | Python | 0.429 | suggestion | 45 | 51 | 51 | false | [ie/twitter] Add fallback, improve error handling | 7,621 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | bashonly |
if self.is_logged_in:
return self._graphql_to_legacy(
self._call_graphql_api('zZXycP0V6H7m-2r0mOnFcA/TweetDetail', twid), twid)
try:
if not self._configuration_arg('legacy_api'):
return self._graphql_to_legacy(
self._call_graph... | ```suggestion
status = self._download_json(
'https://cdn.syndication.twimg.com/tweet-result', twid, 'Downloading syndication JSON',
headers={'User-Agent': 'Googlebot'}, query={'id': twid})
status['extended_entities'] = {'media': status.get('mediaDetails')}
return s... | if self.is_logged_in:
return self._graphql_to_legacy(
self._call_graphql_api('zZXycP0V6H7m-2r0mOnFcA/TweetDetail', twid), twid)
try:
if not self._configuration_arg('legacy_api'):
return self._graphql_to_legacy(
self._call_graph... | @@ -1187,22 +1207,37 @@ def _build_graphql_query(self, media_id):
}
}
- def _real_extract(self, url):
- twid, selected_index = self._match_valid_url(url).group('id', 'index')
- if not self.is_logged_in and self._configuration_arg('legacy_api'):
- status = traverse_obj... | yt_dlp/extractor/twitter.py | 26 | Python | 0.857 | suggestion | 330 | 51 | 51 | false | [ie/twitter] Add fallback, improve error handling | 7,621 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | bashonly |
if vid_data['play'] != 1:
if vid_data.get('status') == 12:
raise ExtractorError(
'%s said: There\'s something wrong in the video.' % self.IE_NAME,
expected=True)
else:
self.raise_geo_restricted(
'... | Should we do this?
```suggestion
clip_url = traverse_obj(data, (('clipsURL', 'mp4PlayUrl'), i, {url_or_none}), get_all=False)
if not clip_url:
continue
``` | if vid_data.get('status') == 12:
raise ExtractorError(
'%s said: There\'s something wrong in the video.' % self.IE_NAME,
expected=True)
else:
self.raise_geo_restricted(
'%s said: The video is only license... | @@ -132,7 +157,7 @@ def _fetch_data(vid_id, mytv=False):
allot = format_data['allot']
data = format_data['data']
- clips_url = data['clipsURL']
+ clip_url = traverse_obj(data, (('clipsURL', 'mp4PlayUrl'), i, {url_or_none}), get_all=False) | yt_dlp/extractor/sohu.py | 26 | Python | 0.857 | question | 212 | 51 | 51 | false | [extractor/sohu] Fix for unsupported base64-encoded url | 7,628 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | c-basalt |
'height': int_or_none(data.get('height')),
'fps': int_or_none(data.get('fps')),
})
playlist.append({
'id': '%s_part%d' % (video_id, i + 1),
'title': title,
'duration': vid_data['data']['clipsDuration'][i... | ```suggestion
r'publishTime:\s*["\'](\d+-\d+-\d+ \d+:\d+)["\']', webpage, 'publish time', fatal=False))
``` | 'width': int_or_none(data.get('width')),
'height': int_or_none(data.get('height')),
'fps': int_or_none(data.get('fps')),
})
playlist.append({
'id': '%s_part%d' % (video_id, i + 1),
'title': title,
... | @@ -193,6 +218,77 @@ def _fetch_data(vid_id, mytv=False):
'entries': playlist,
'id': video_id,
'title': title,
+ 'duration': traverse_obj(vid_data, ('data', 'totalDuration', {float_or_none})),
}
- return info
+ if mytv:
+ ... | yt_dlp/extractor/sohu.py | 26 | Python | 0.714 | suggestion | 125 | 51 | 51 | false | [extractor/sohu] Fix for unsupported base64-encoded url | 7,628 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | c-basalt |
})
playlist.append({
'id': '%s_part%d' % (video_id, i + 1),
'title': title,
'duration': vid_data['data']['clipsDuration'][i],
'formats': formats,
})
if len(playlist) == 1:
info = playlist[0]
... | Is the `str_or_none` transformation necessary? Does the value need to be stringified before calling `unified_timestamp`?
```suggestion
publish_time = traverse_obj(vid_data, ('tv_application_time', {str_or_none}, {unified_timestamp}))
``` | 'fps': int_or_none(data.get('fps')),
})
playlist.append({
'id': '%s_part%d' % (video_id, i + 1),
'title': title,
'duration': vid_data['data']['clipsDuration'][i],
'formats': formats,
})
... | @@ -193,6 +218,77 @@ def _fetch_data(vid_id, mytv=False):
'entries': playlist,
'id': video_id,
'title': title,
+ 'duration': traverse_obj(vid_data, ('data', 'totalDuration', {float_or_none})),
}
- return info
+ if mytv:
+ ... | yt_dlp/extractor/sohu.py | 26 | Python | 0.786 | suggestion | 252 | 51 | 51 | false | [extractor/sohu] Fix for unsupported base64-encoded url | 7,628 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | c-basalt |
'formats': formats,
})
if len(playlist) == 1:
info = playlist[0]
info['id'] = video_id
else:
info = {
'_type': 'multi_video',
'entries': playlist,
'id': video_id,
'title': tit... | Sometimes it is better to only expect `str` instead of transform with `str_or_none` -- e.g. if the value of `subName` is a nested dict, we would be stringifying the entire dict with `str_or_none`. With `str`, it only checks the type and returns `None` if it is not what is expected
```suggestion
'alt_t... | 'duration': vid_data['data']['clipsDuration'][i],
'formats': formats,
})
if len(playlist) == 1:
info = playlist[0]
info['id'] = video_id
else:
info = {
'_type': 'multi_video',
'entries': play... | @@ -193,6 +218,77 @@ def _fetch_data(vid_id, mytv=False):
'entries': playlist,
'id': video_id,
'title': title,
+ 'duration': traverse_obj(vid_data, ('data', 'totalDuration', {float_or_none})),
}
- return info
+ if mytv:
+ ... | yt_dlp/extractor/sohu.py | 26 | Python | 1 | suggestion | 423 | 51 | 51 | false | [extractor/sohu] Fix for unsupported base64-encoded url | 7,628 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | c-basalt |
if len(playlist) == 1:
info = playlist[0]
info['id'] = video_id
else:
info = {
'_type': 'multi_video',
'entries': playlist,
'id': video_id,
'title': title,
'duration': traverse_obj(vid_da... | ```suggestion
'tags': ('data', 'tag', {str.split}),
``` | })
if len(playlist) == 1:
info = playlist[0]
info['id'] = video_id
else:
info = {
'_type': 'multi_video',
'entries': playlist,
'id': video_id,
'title': title,
'duration': trav... | @@ -193,6 +218,77 @@ def _fetch_data(vid_id, mytv=False):
'entries': playlist,
'id': video_id,
'title': title,
+ 'duration': traverse_obj(vid_data, ('data', 'totalDuration', {float_or_none})),
}
- return info
+ if mytv:
+ ... | yt_dlp/extractor/sohu.py | 26 | Python | 0.571 | suggestion | 73 | 51 | 51 | false | [extractor/sohu] Fix for unsupported base64-encoded url | 7,628 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | c-basalt |
'thumbnail': 'http://e3f49eaa46b57.cdn.sohucs.com//group1/M10/83/FA/MTAuMTAuODguODA=/6_14cbccdde5eg104SysCutcloud_78693464_7_0b.jpg',
'tags': ['爱范儿', '爱范品', 'MWC', '手机'],
}
}, {
'note': 'Multipart video',
'url': 'https://tv.sohu.com/v/dXMvMjQyNTYyMTYzLzc4OTEwMzM5LnNod... | ```suggestion
subdomain = 'tv' if re.match(r'\d+/n\d+\.shtml', path) else 'my.tv'
return self.url_result(urljoin(f'http://{subdomain}.sohu.com/', path), SohuIE)
``` | 'upload_date': '20150305',
'thumbnail': 'http://e3f49eaa46b57.cdn.sohucs.com//group1/M10/83/FA/MTAuMTAuODguODA=/6_14cbccdde5eg104SysCutcloud_78693464_7_0b.jpg',
'tags': ['爱范儿', '爱范品', 'MWC', '手机'],
}
}, {
'note': 'Multipart video',
'url': 'https://tv.sohu.... | @@ -193,6 +218,77 @@ def _fetch_data(vid_id, mytv=False):
'entries': playlist,
'id': video_id,
'title': title,
+ 'duration': traverse_obj(vid_data, ('data', 'totalDuration', {float_or_none})),
}
- return info
+ if mytv:
+ ... | yt_dlp/extractor/sohu.py | 26 | Python | 0.714 | suggestion | 183 | 27 | 26 | false | [extractor/sohu] Fix for unsupported base64-encoded url | 7,628 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | c-basalt |
int_or_none,
str_or_none,
url_or_none,
traverse_obj,
determine_ext,
parse_resolution,
urlencode_postdata,
unescapeHTML,
js_to_json,
urljoin,
)
class DouyuBaseIE(InfoExtractor):
_cryptojs_md5 = None
def _get_cryptojs_md5(self, video_id):
for url in [
... | Better to cache on disk. See https://github.com/yt-dlp/yt-dlp/blob/a250b247334ce9f641e709cbb64974da6034a2b3/yt_dlp/extractor/youtube.py#L3124-L3127
or
https://github.com/yt-dlp/yt-dlp/blob/a250b247334ce9f641e709cbb64974da6034a2b3/yt_dlp/extractor/iqiyi.py#L524-L544 | UserNotLive,
determine_ext,
int_or_none,
js_to_json,
parse_resolution,
str_or_none,
traverse_obj,
unescapeHTML,
url_or_none,
urlencode_postdata,
urljoin,
)
class DouyuBaseIE(InfoExtractor):
def _download_cryptojs_md5(self, video_id):
for url in [
'ht... | @@ -1,31 +1,62 @@
import time
import hashlib
-import re
import urllib
+import uuid
from .common import InfoExtractor
+from .openload import PhantomJSwrapper
from ..utils import (
- ExtractorError,
+ UserNotLive,
+ int_or_none,
+ str_or_none,
+ url_or_none,
+ traverse_obj,
+ determine_ext,
+ ... | yt_dlp/extractor/douyutv.py | 26 | Python | 0.5 | performance | 271 | 51 | 51 | false | [extractor/douyutv] fix broken DouyuTV and DouyuShow | 7,652 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | c-basalt |
parse_resolution,
urlencode_postdata,
unescapeHTML,
js_to_json,
urljoin,
)
class DouyuBaseIE(InfoExtractor):
def _download_cryptojs_md5(self, video_id):
for url in [
'https://cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.2/rollups/md5.js',
'https://cdn.bootcdn.ne... | `b` and `c` are never passed as anything else, so we can simplify the signature
```suggestion
def _calc_sign(self, sign_func, video_id, a):
b = uuid.uuid4().hex
c = round(time.time())
js_script = f'{self._get_cryptojs_md5(video_id)};{sign_func};console.log(ub98484234("{a}","{b}","{c}"))... | traverse_obj,
unescapeHTML,
url_or_none,
urlencode_postdata,
urljoin,
)
class DouyuBaseIE(InfoExtractor):
def _download_cryptojs_md5(self, video_id):
for url in [
'https://cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.2/rollups/md5.js',
'https://cdn.bootcdn.net/a... | @@ -1,31 +1,70 @@
import time
import hashlib
-import re
import urllib
+import uuid
from .common import InfoExtractor
+from .openload import PhantomJSwrapper
from ..utils import (
ExtractorError,
+ UserNotLive,
+ int_or_none,
+ str_or_none,
+ url_or_none,
+ traverse_obj,
+ determine_ext,
+ ... | yt_dlp/extractor/douyutv.py | 26 | Python | 0.857 | refactor | 326 | 51 | 51 | false | [extractor/douyutv] fix broken DouyuTV and DouyuShow | 7,652 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | c-basalt |
'url': 'https://www.douyu.com/topic/ydxc?rid=6560603',
'info_dict': {
'id': '6560603',
'display_id': '6560603',
'ext': 'flv',
'title': 're:^阿余:新年快乐恭喜发财! [0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}$',
'description': 're:.*直播时间.*',
'... | This isn't used? (Or if it is used and I am missing it, it would be redundant if the suggestion for `_calc_sign()` is applied)
```suggestion
``` | },
}, {
'url': 'https://www.douyu.com/topic/ydxc?rid=6560603',
'info_dict': {
'id': '6560603',
'display_id': '6560603',
'ext': 'flv',
'title': 're:^阿余:新年快乐恭喜发财! [0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}$',
'description': 're:.*直播... | @@ -85,15 +124,44 @@ class DouyuTVIE(InfoExtractor):
'only_matching': True,
}]
+ def _sign(self, js_sign_func, room_id, video_id):
+ return self._calc_sign(js_sign_func, video_id, room_id, uuid.uuid4().hex, round(time.time()))
+ | yt_dlp/extractor/douyutv.py | 26 | Python | 0.786 | suggestion | 146 | 51 | 51 | false | [extractor/douyutv] fix broken DouyuTV and DouyuShow | 7,652 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | c-basalt |
},
}, {
'url': 'http://www.douyu.com/xiaocang',
'only_matching': True,
}, {
# \"room_id\"
'url': 'http://www.douyu.com/t/lpl',
'only_matching': True,
}]
def _sign(self, js_sign_func, room_id, video_id):
return self._calc_sign(js_sign_func, video_i... | ```suggestion
rate_info = traverse_obj(stream_info, ('multirates', lambda _, v: v['rate'] == rate_id), get_all=False)
``` | 'params': {
'skip_download': True,
},
}, {
'url': 'http://www.douyu.com/xiaocang',
'only_matching': True,
}, {
# \"room_id\"
'url': 'http://www.douyu.com/t/lpl',
'only_matching': True,
}]
def _get_sign_func(self, room_id, video_id):
... | @@ -85,15 +124,44 @@ class DouyuTVIE(InfoExtractor):
'only_matching': True,
}]
+ def _sign(self, js_sign_func, room_id, video_id):
+ return self._calc_sign(js_sign_func, video_id, room_id, uuid.uuid4().hex, round(time.time()))
+
+ def _get_sign_func(self, room_id, video_id):
+ return... | yt_dlp/extractor/douyutv.py | 26 | Python | 0.714 | suggestion | 139 | 51 | 51 | false | [extractor/douyutv] fix broken DouyuTV and DouyuShow | 7,652 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | c-basalt |
traverse_obj(stream_info, 'rtmp_url'), traverse_obj(stream_info, 'rtmp_live'))
if stream_url:
rate_id = traverse_obj(stream_info, ('rate', {int_or_none}))
rate_info = traverse_obj(stream_info, ('multirates', lambda _, v: v.get('rate') == rate_id), get_all=Fals... | Might be better to use regex here to account for variations in JS?
```suggestion
if self._search_regex(r'"videoLoop"\s*:\s*(\d+)', webpage, 'loop', default='') == '1':
raise UserNotLive('The channel is auto-playing VODs', video_id=video_id)
if self._search_regex(r'\$ROOM\.show_status\s*=... | if stream_url:
rate_id = traverse_obj(stream_info, ('rate', {int_or_none}))
rate_info = traverse_obj(stream_info, ('multirates', lambda _, v: v['rate'] == rate_id), get_all=False)
ext = determine_ext(stream_url)
formats.append({
... | @@ -85,15 +124,44 @@ class DouyuTVIE(InfoExtractor):
'only_matching': True,
}]
+ def _sign(self, js_sign_func, room_id, video_id):
+ return self._calc_sign(js_sign_func, video_id, room_id, uuid.uuid4().hex, round(time.time()))
+
+ def _get_sign_func(self, room_id, video_id):
+ return... | yt_dlp/extractor/douyutv.py | 26 | Python | 0.857 | suggestion | 424 | 51 | 51 | false | [extractor/douyutv] fix broken DouyuTV and DouyuShow | 7,652 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | c-basalt |
'rate': 0,
**self._calc_sign(js_sign_func, video_id, room_id),
}
stream_formats = [self._download_json(
f'https://www.douyu.com/lapi/live/getH5Play/{room_id}',
video_id, note="Downloading livestream format",
data=urlencode_postdata(form_data))]... | ```suggestion
'display_id': ('url', {str}, {lambda i: i[1:]}),
'title': ('room_name', {unescapeHTML}),
'description': ('show_details', {str}),
'uploader': ('nickname', {str}),
'thumbnail': ('room_src', {url_or_none}),
``` | form_data = {
'rate': 0,
**self._calc_sign(js_sign_func, video_id, room_id),
}
stream_formats = [self._download_json(
f'https://www.douyu.com/lapi/live/getH5Play/{room_id}',
video_id, note="Downloading livestream format",
data=urlencode... | @@ -102,110 +170,134 @@ def _real_extract(self, url):
'time': int(time.time()),
}
params['auth'] = hashlib.md5(
- f'room/{video_id}?{urllib.parse.urlencode(params)}zNzMV1y4EMxOHS6I5WKm'.encode()).hexdigest()
+ f'room/{room_id}?{urllib.parse.urlencode(params)}zNzMV1y4... | yt_dlp/extractor/douyutv.py | 26 | Python | 0.786 | security | 307 | 51 | 51 | false | [extractor/douyutv] fix broken DouyuTV and DouyuShow | 7,652 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | c-basalt |
_FORMATS = {
'super': '原画',
'high': '超清',
'normal': '高清',
}
_QUALITIES = {
'super': -1,
'high': -2,
'normal': -3,
}
_RESOLUTIONS = {
'super': '1920x1080',
'high': '1280x720',
'normal': '852x480',
}
def _real_extract(s... | ```suggestion
r'<script>\s*window\.\$DATA\s*=', webpage,
``` |
_FORMATS = {
'super': '原画',
'high': '超清',
'normal': '高清',
}
_QUALITIES = {
'super': -1,
'high': -2,
'normal': -3,
}
_RESOLUTIONS = {
'super': '1920x1080',
'high': '1280x720',
'normal': '852x480',
}
def _real_extract(... | @@ -102,110 +170,134 @@ def _real_extract(self, url):
'time': int(time.time()),
}
params['auth'] = hashlib.md5(
- f'room/{video_id}?{urllib.parse.urlencode(params)}zNzMV1y4EMxOHS6I5WKm'.encode()).hexdigest()
+ f'room/{room_id}?{urllib.parse.urlencode(params)}zNzMV1y4... | yt_dlp/extractor/douyutv.py | 26 | Python | 0.571 | suggestion | 74 | 51 | 51 | false | [extractor/douyutv] fix broken DouyuTV and DouyuShow | 7,652 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | c-basalt |
'super': '1920x1080',
'high': '1280x720',
'normal': '852x480',
}
def _real_extract(self, url):
url = url.replace('vmobile.', 'v.')
video_id = self._match_id(url)
webpage = self._download_webpage(url, video_id)
video_info = self._search_json(
... | ```suggestion
for name, url in traverse_obj(url_info, ('data', 'thumb_video', {dict.items}, ...)):
``` | _RESOLUTIONS = {
'super': '1920x1080',
'high': '1280x720',
'normal': '852x480',
}
def _real_extract(self, url):
url = url.replace('vmobile.', 'v.')
video_id = self._match_id(url)
webpage = self._download_webpage(url, video_id)
video_info = self._sea... | @@ -102,110 +170,134 @@ def _real_extract(self, url):
'time': int(time.time()),
}
params['auth'] = hashlib.md5(
- f'room/{video_id}?{urllib.parse.urlencode(params)}zNzMV1y4EMxOHS6I5WKm'.encode()).hexdigest()
+ f'room/{room_id}?{urllib.parse.urlencode(params)}zNzMV1y4... | yt_dlp/extractor/douyutv.py | 26 | Python | 0.714 | suggestion | 112 | 51 | 51 | false | [extractor/douyutv] fix broken DouyuTV and DouyuShow | 7,652 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | c-basalt |
webpage = self._download_webpage(url, video_id)
video_info = self._search_json(
r'<script>window\.\$DATA=', webpage,
'video info', video_id, transform_source=js_to_json)
js_sign_func = self._search_js_sign_func(webpage)
form_data = {
'vid': video_id... | again wondering if this should be `mp4` instead of `ts` | video_id = self._match_id(url)
webpage = self._download_webpage(url, video_id)
video_info = self._search_json(
r'<script>\s*window\.\$DATA\s*=', webpage,
'video info', video_id, transform_source=js_to_json)
js_sign_func = self._search_js_sign_func(webpage)
... | @@ -102,110 +170,134 @@ def _real_extract(self, url):
'time': int(time.time()),
}
params['auth'] = hashlib.md5(
- f'room/{video_id}?{urllib.parse.urlencode(params)}zNzMV1y4EMxOHS6I5WKm'.encode()).hexdigest()
+ f'room/{room_id}?{urllib.parse.urlencode(params)}zNzMV1y4... | yt_dlp/extractor/douyutv.py | 26 | Python | 0.429 | suggestion | 55 | 47 | 50 | false | [extractor/douyutv] fix broken DouyuTV and DouyuShow | 7,652 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | c-basalt |
video_url = traverse_obj(url, ('url', {url_or_none}))
if video_url:
formats.append({
'format': self._FORMATS.get(name),
'format_id': name,
'url': video_url,
'quality': self._QUALITIES.get(name),
... | We only want to transform with `{str_or_none}` when we want to stringify any value that is not `None`, whether it be int or dict, etc
Otherwise we want to just expect type with `{str}`
```suggestion
'title': ('content', 'title', {str}),
'uploader': ('content', 'author', {str}),
... | for name, url in traverse_obj(url_info, ('data', 'thumb_video', {dict.items}, ...)):
video_url = traverse_obj(url, ('url', {url_or_none}))
if video_url:
ext = determine_ext(video_url)
formats.append({
'format': self._FORMATS.get(name),
... | @@ -102,110 +170,134 @@ def _real_extract(self, url):
'time': int(time.time()),
}
params['auth'] = hashlib.md5(
- f'room/{video_id}?{urllib.parse.urlencode(params)}zNzMV1y4EMxOHS6I5WKm'.encode()).hexdigest()
+ f'room/{room_id}?{urllib.parse.urlencode(params)}zNzMV1y4... | yt_dlp/extractor/douyutv.py | 26 | Python | 0.929 | security | 740 | 29 | 32 | false | [extractor/douyutv] fix broken DouyuTV and DouyuShow | 7,652 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | c-basalt |
class DouyuBaseIE(InfoExtractor):
def _download_cryptojs_md5(self, video_id):
for url in [
'https://cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.2/rollups/md5.js',
'https://cdn.bootcdn.net/ajax/libs/crypto-js/3.1.2/rollups/md5.js',
]:
js_code = self._download_we... | I think we can do this
```suggestion
return urllib.parse.parse_qs(result)
```
Unless there are multiple values per param that we need to filter out |
class DouyuBaseIE(InfoExtractor):
def _download_cryptojs_md5(self, video_id):
for url in [
'https://cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.2/rollups/md5.js',
'https://cdn.bootcdn.net/ajax/libs/crypto-js/3.1.2/rollups/md5.js',
]:
js_code = self._download_we... | @@ -1,31 +1,70 @@
import time
import hashlib
-import re
import urllib
+import uuid
from .common import InfoExtractor
+from .openload import PhantomJSwrapper
from ..utils import (
ExtractorError,
+ UserNotLive,
+ int_or_none,
+ str_or_none,
+ url_or_none,
+ traverse_obj,
+ determine_ext,
+ ... | yt_dlp/extractor/douyutv.py | 26 | Python | 0.714 | suggestion | 159 | 51 | 51 | false | [extractor/douyutv] fix broken DouyuTV and DouyuShow | 7,652 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | c-basalt |
'only_matching': True,
}]
def _get_sign_func(self, room_id, video_id):
return self._download_json(
f'https://www.douyu.com/swf_api/homeH5Enc?rids={room_id}', video_id,
note='Getting signing script')['data'][f'room{room_id}']
def _extract_stream_formats(self, stream_... | Looking over this again, I realize we should do this:
```suggestion
ext = determine_ext(stream_url)
formats.append({
'url': stream_url,
'format_id': str_or_none(rate_id),
'ext': 'mp4' if ext == 'm3u8' else ext,
... | 'only_matching': True,
}]
def _get_sign_func(self, room_id, video_id):
return self._download_json(
f'https://www.douyu.com/swf_api/homeH5Enc?rids={room_id}', video_id,
note='Getting signing script')['data'][f'room{room_id}']
def _extract_stream_formats(self, stream_... | @@ -85,15 +126,41 @@ class DouyuTVIE(InfoExtractor):
'only_matching': True,
}]
+ def _get_sign_func(self, room_id, video_id):
+ return self._download_json(
+ f'https://www.douyu.com/swf_api/homeH5Enc?rids={room_id}', video_id,
+ note='Getting signing script')['data'][f'ro... | yt_dlp/extractor/douyutv.py | 26 | Python | 0.857 | refactor | 1,744 | 51 | 51 | false | [extractor/douyutv] fix broken DouyuTV and DouyuShow | 7,652 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | c-basalt |
video_info = self._search_json(
r'<script>\s*window\.\$DATA\s*=', webpage,
'video info', video_id, transform_source=js_to_json)
js_sign_func = self._search_js_sign_func(webpage)
form_data = {
'vid': video_id,
**self._calc_sign(js_sign_func, video... | same deal as the other m3u8 URL comment:
```suggestion
ext = determine_ext(video_url)
formats.append({
'format': self._FORMATS.get(name),
'format_id': name,
'url': video_url,
'quality': self._QUALITI... |
webpage = self._download_webpage(url, video_id)
video_info = self._search_json(
r'<script>\s*window\.\$DATA\s*=', webpage,
'video info', video_id, transform_source=js_to_json)
js_sign_func = self._search_js_sign_func(webpage)
form_data = {
'vid': vi... | @@ -102,110 +169,134 @@ def _real_extract(self, url):
'time': int(time.time()),
}
params['auth'] = hashlib.md5(
- f'room/{video_id}?{urllib.parse.urlencode(params)}zNzMV1y4EMxOHS6I5WKm'.encode()).hexdigest()
- room = self._download_json(
+ f'room/{room_id}?{ur... | yt_dlp/extractor/douyutv.py | 26 | Python | 0.857 | refactor | 1,251 | 45 | 49 | false | [extractor/douyutv] fix broken DouyuTV and DouyuShow | 7,652 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | c-basalt |
def _download_cryptojs_md5(self, video_id):
for url in [
'https://cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.2/rollups/md5.js',
'https://cdn.bootcdn.net/ajax/libs/crypto-js/3.1.2/rollups/md5.js',
]:
js_code = self._download_webpage(
url, video_id... | pls explain the comment to me. I think I understand below regex, but cant seem to understand what the comment is saying | def _download_cryptojs_md5(self, video_id):
for url in [
'https://cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.2/rollups/md5.js',
'https://cdn.bootcdn.net/ajax/libs/crypto-js/3.1.2/rollups/md5.js',
]:
js_code = self._download_webpage(
url, video_id... | @@ -1,31 +1,72 @@
import time
import hashlib
-import re
import urllib
+import uuid
from .common import InfoExtractor
+from .openload import PhantomJSwrapper
from ..utils import (
ExtractorError,
+ UserNotLive,
+ determine_ext,
+ int_or_none,
+ js_to_json,
+ parse_resolution,
+ str_or_none,... | yt_dlp/extractor/douyutv.py | 26 | Python | 0.357 | suggestion | 119 | 51 | 51 | false | [extractor/douyutv] fix broken DouyuTV and DouyuShow | 7,652 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | c-basalt |
'id': (('id', 'id_str', 'mid'), {str_or_none}),
'display_id': ('mblogid', {str_or_none}),
'title': ('page_info', 'media_info', ('video_title', 'kol_title', 'name'), {
lambda i: str_or_none(i) if i else None}), # to avoid catching empty string
... | I'm getting 403 with this url, but it works in the browser | 'formats': self._extract_formats(video_info),
'http_headers': {'Referer': 'https://weibo.com/'},
'_old_archive_ids': [make_archive_id('WeiboMobile', video_id)],
**traverse_obj(video_info, {
'id': (('id', 'id_str', 'mid'), {str_or_none}),
'd... | @@ -1,134 +1,245 @@
-from .common import InfoExtractor
-
-import json
import random
-import re
+import itertools
+import urllib.parse
-from ..compat import (
- compat_parse_qs,
- compat_str,
-)
+from .common import InfoExtractor
from ..utils import (
- js_to_json,
+ int_or_none,
+ str_or_none,
+ u... | yt_dlp/extractor/weibo.py | 26 | Python | 0.214 | suggestion | 58 | 51 | 51 | false | [extractor/weibo] Rewrite to fix extractor | 7,657 | yt-dlp/yt-dlp | 132,642 | Python | coletdjnz | c-basalt |
formats = [i for i in formats if i.get('url')]
if not formats: # fallback, should be barely used
for url in set(traverse_obj(media_info, (..., {url_or_none}))):
if 'label=' in url:
format_id, resolution = self._search_regex(
r'labe... | if removing `WeiboMobileIE`, we need to add an old archive ID field to the info dict. import `make_archive_id` from utils
```suggestion
'http_headers': {'Referer': 'https://weibo.com/'},
'_old_archive_ids': [make_archive_id('WeiboMobile', video_id)],
**traverse_obj(video_info, ... | }))
if not formats: # fallback, should be barely used
for url in set(traverse_obj(media_info, (..., {url_or_none}))):
if 'label=' in url: # filter out non-video urls
format_id, resolution = self._search_regex(
r'label=(\w+)&te... | @@ -1,134 +1,246 @@
-from .common import InfoExtractor
-
-import json
import random
-import re
+import itertools
+import urllib.parse
-from ..compat import (
- compat_parse_qs,
- compat_str,
-)
+from .common import InfoExtractor
from ..utils import (
- js_to_json,
+ int_or_none,
+ str_or_none,
+ u... | yt_dlp/extractor/weibo.py | 26 | Python | 0.786 | suggestion | 326 | 51 | 51 | false | [extractor/weibo] Rewrite to fix extractor | 7,657 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | c-basalt |
self._update_visitor_cookies(video_id)
webpage = self._download_webpage(url, video_id, *args, fatal=fatal, note=note, **kwargs)
return self._parse_json(webpage, video_id, fatal=fatal)
def _extract_formats(self, video_info):
media_info = traverse_obj(video_info, ('page_info',... | in a fallback scenario, is `media_info` a list instead of a dict? | webpage, urlh = self._download_webpage_handle(url, video_id, *args, fatal=fatal, note=note, **kwargs)
if urllib.parse.urlparse(urlh.url).netloc == 'passport.weibo.com':
self._update_visitor_cookies(video_id)
webpage = self._download_webpage(url, video_id, *args, fatal=fatal, note... | @@ -1,134 +1,246 @@
-from .common import InfoExtractor
-
-import json
import random
-import re
+import itertools
+import urllib.parse
-from ..compat import (
- compat_parse_qs,
- compat_str,
-)
+from .common import InfoExtractor
from ..utils import (
- js_to_json,
+ int_or_none,
+ str_or_none,
+ u... | yt_dlp/extractor/weibo.py | 26 | Python | 0.429 | question | 65 | 51 | 51 | false | [extractor/weibo] Rewrite to fix extractor | 7,657 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | c-basalt |
webpage, urlh = self._download_webpage_handle(url, video_id, *args, fatal=fatal, note=note, **kwargs)
if urllib.parse.urlparse(urlh.url).netloc == 'passport.weibo.com':
self._update_visitor_cookies(video_id)
webpage = self._download_webpage(url, video_id, *args, fatal=fatal, note... | We can filter in traversal to save a step
Do the `format` and `format_id` values need to be stringified (e.g. are they `int`)? Otherwise we can just expect type with `{str}` instead of transforming with `{str_or_none}`
```suggestion
formats = traverse_obj(media_info, (
'playback_list', lambda ... |
def _weibo_download_json(self, url, video_id, *args, fatal=True, note='Downloading JSON metadata', **kwargs):
webpage, urlh = self._download_webpage_handle(url, video_id, *args, fatal=fatal, note=note, **kwargs)
if urllib.parse.urlparse(urlh.url).netloc == 'passport.weibo.com':
self._up... | @@ -1,134 +1,246 @@
-from .common import InfoExtractor
-
-import json
import random
-import re
+import itertools
+import urllib.parse
-from ..compat import (
- compat_parse_qs,
- compat_str,
-)
+from .common import InfoExtractor
from ..utils import (
- js_to_json,
+ int_or_none,
+ str_or_none,
+ u... | yt_dlp/extractor/weibo.py | 26 | Python | 1 | suggestion | 1,114 | 51 | 51 | false | [extractor/weibo] Rewrite to fix extractor | 7,657 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | c-basalt |
'format_id': ('label', {str_or_none}),
'ext': ('mime', {mimetype2ext}),
'tbr': ('bitrate', {int_or_none}, {lambda i: i if i else None}),
'vcodec': ('video_codecs', {str_or_none}),
'fps': ('fps', {int_or_none}),
'width': ('wi... | convention is to use `lamba _, v` as in `v`alue, and filtering is non-fatal
```suggestion
'video_details', lambda _, v: v['label'].startswith(format_id), {
``` | 'url': 'url',
'format': ('quality_desc', {str}),
'format_id': ('label', {str}),
'ext': ('mime', {mimetype2ext}),
'tbr': ('bitrate', {int_or_none}, {lambda x: x or None}),
'vcodec': ('video_codecs', {str}),
'f... | @@ -1,134 +1,246 @@
-from .common import InfoExtractor
-
-import json
import random
-import re
+import itertools
+import urllib.parse
-from ..compat import (
- compat_parse_qs,
- compat_str,
-)
+from .common import InfoExtractor
from ..utils import (
- js_to_json,
+ int_or_none,
+ str_or_none,
+ u... | yt_dlp/extractor/weibo.py | 26 | Python | 0.786 | suggestion | 190 | 51 | 51 | false | [extractor/weibo] Rewrite to fix extractor | 7,657 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | c-basalt |
webpage = self._download_webpage(url, video_id, *args, fatal=fatal, note=note, **kwargs)
return self._parse_json(webpage, video_id, fatal=fatal)
def _extract_formats(self, video_info):
media_info = traverse_obj(video_info, ('page_info', 'media_info'))
formats = [{
**... | we don't want to add format URLs if they don't contain `label=` ? | if urllib.parse.urlparse(urlh.url).netloc == 'passport.weibo.com':
self._update_visitor_cookies(video_id)
webpage = self._download_webpage(url, video_id, *args, fatal=fatal, note=note, **kwargs)
return self._parse_json(webpage, video_id, fatal=fatal)
def _extract_formats(sel... | @@ -1,134 +1,246 @@
-from .common import InfoExtractor
-
-import json
import random
-import re
+import itertools
+import urllib.parse
-from ..compat import (
- compat_parse_qs,
- compat_str,
-)
+from .common import InfoExtractor
from ..utils import (
- js_to_json,
+ int_or_none,
+ str_or_none,
+ u... | yt_dlp/extractor/weibo.py | 26 | Python | 0.357 | question | 65 | 51 | 51 | false | [extractor/weibo] Rewrite to fix extractor | 7,657 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | c-basalt |
r'label=(\w+)&template=(\d+x\d+)', url, 'format info',
group=(1, 2), default=(None, None))
formats.append({
'url': url,
'format_id': format_id,
**parse_resolution(resolution),
... | empty string is ok for `title`, core code will handle it and issue a generic title the same as if it were `None`
```suggestion
'title': ('page_info', 'media_info', ('video_title', 'kol_title', 'name'), {str}),
'description': ('text_raw', {str}),
``` | r'label=(\w+)&template=(\d+x\d+)', url, 'format info',
group=(1, 2), default=(None, None))
formats.append({
'url': url,
'format_id': format_id,
**parse_resolution(resolution),
... | @@ -1,134 +1,246 @@
-from .common import InfoExtractor
-
-import json
import random
-import re
+import itertools
+import urllib.parse
-from ..compat import (
- compat_parse_qs,
- compat_str,
-)
+from .common import InfoExtractor
from ..utils import (
- js_to_json,
+ int_or_none,
+ str_or_none,
+ u... | yt_dlp/extractor/weibo.py | 26 | Python | 0.929 | suggestion | 285 | 51 | 51 | false | [extractor/weibo] Rewrite to fix extractor | 7,657 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | c-basalt |
**parse_resolution(resolution),
**traverse_obj(media_info, (
'video_details', lambda _, i: i.get('label', '').startswith(format_id), {
'size': ('size', {int_or_none}),
'tbr': ('bit... | IIRC thumbnail downloads should use the same `http_headers` in the info_dict root. Test this one
```suggestion
'thumbnail': ('page_info', 'page_pic', {url_or_none}),
``` | **parse_resolution(resolution),
**traverse_obj(media_info, (
'video_details', lambda _, v: v['label'].startswith(format_id), {
'size': ('size', {int_or_none}),
'tbr': ('bitrate', {... | @@ -1,134 +1,246 @@
-from .common import InfoExtractor
-
-import json
import random
-import re
+import itertools
+import urllib.parse
-from ..compat import (
- compat_parse_qs,
- compat_str,
-)
+from .common import InfoExtractor
from ..utils import (
- js_to_json,
+ int_or_none,
+ str_or_none,
+ u... | yt_dlp/extractor/weibo.py | 26 | Python | 0.786 | suggestion | 188 | 51 | 51 | false | [extractor/weibo] Rewrite to fix extractor | 7,657 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | c-basalt |
**traverse_obj(media_info, (
'video_details', lambda _, i: i.get('label', '').startswith(format_id), {
'size': ('size', {int_or_none}),
'tbr': ('bitrate', {int_or_none}),
}
... | ```suggestion
'uploader': ('user', 'screen_name', {str}),
``` | **traverse_obj(media_info, (
'video_details', lambda _, v: v['label'].startswith(format_id), {
'size': ('size', {int_or_none}),
'tbr': ('bitrate', {int_or_none}),
}
... | @@ -1,134 +1,246 @@
-from .common import InfoExtractor
-
-import json
import random
-import re
+import itertools
+import urllib.parse
-from ..compat import (
- compat_parse_qs,
- compat_str,
-)
+from .common import InfoExtractor
from ..utils import (
- js_to_json,
+ int_or_none,
+ str_or_none,
+ u... | yt_dlp/extractor/weibo.py | 26 | Python | 0.643 | suggestion | 79 | 51 | 51 | false | [extractor/weibo] Rewrite to fix extractor | 7,657 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | c-basalt |
'size': ('size', {int_or_none}),
'tbr': ('bitrate', {int_or_none}),
}
), get_all=False),
})
return formats
def _parse_video_info(self, video_info, video_id=None):
... | ```suggestion
'uploader_url': ('user', 'profile_url', {lambda x: urljoin('https://weibo.com/', x)}),
``` | 'size': ('size', {int_or_none}),
'tbr': ('bitrate', {int_or_none}),
}
), get_all=False),
})
return formats
def _parse_video_info(self, video_info, video_id=None):
... | @@ -1,134 +1,246 @@
-from .common import InfoExtractor
-
-import json
import random
-import re
+import itertools
+import urllib.parse
-from ..compat import (
- compat_parse_qs,
- compat_str,
-)
+from .common import InfoExtractor
from ..utils import (
- js_to_json,
+ int_or_none,
+ str_or_none,
+ u... | yt_dlp/extractor/weibo.py | 26 | Python | 0.786 | suggestion | 122 | 51 | 51 | false | [extractor/weibo] Rewrite to fix extractor | 7,657 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | c-basalt |
def _parse_video_info(self, video_info, video_id=None):
return {
'id': video_id,
'formats': self._extract_formats(video_info),
'http_headers': {'Referer': 'https://weibo.com/'},
**traverse_obj(video_info, {
'id': (('id', 'id_str', 'mid'), {str_... | `get_all=True` is default, and dict key traversal is overkill when we can just do this
```suggestion
'tags': traverse_obj(video_info, ('topic_struct', ..., 'topic_title', {str})),
``` | def _parse_video_info(self, video_info, video_id=None):
return {
'id': video_id,
'extractor_key': WeiboIE.ie_key(),
'extractor': WeiboIE.IE_NAME,
'formats': self._extract_formats(video_info),
'http_headers': {'Referer': 'https://weibo.com/'},
... | @@ -1,134 +1,246 @@
-from .common import InfoExtractor
-
-import json
import random
-import re
+import itertools
+import urllib.parse
-from ..compat import (
- compat_parse_qs,
- compat_str,
-)
+from .common import InfoExtractor
from ..utils import (
- js_to_json,
+ int_or_none,
+ str_or_none,
+ u... | yt_dlp/extractor/weibo.py | 26 | Python | 0.714 | suggestion | 198 | 51 | 51 | false | [extractor/weibo] Rewrite to fix extractor | 7,657 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | c-basalt |
**traverse_obj(video_info, {
'id': (('id', 'id_str', 'mid'), {str_or_none}),
'display_id': ('mblogid', {str_or_none}),
'title': ('page_info', 'media_info', ('video_title', 'kol_title', 'name'), {
lambda i: str_or_none(i) if i else None}), ... | ```suggestion
_VALID_URL = r'https?://(?:m\.weibo\.cn/status|(?:www\.)?weibo\.com/\d+)/(?P<id>[a-zA-Z0-9]+)'
``` | 'formats': self._extract_formats(video_info),
'http_headers': {'Referer': 'https://weibo.com/'},
'_old_archive_ids': [make_archive_id('WeiboMobile', video_id)],
**traverse_obj(video_info, {
'id': (('id', 'id_str', 'mid'), {str_or_none}),
'd... | @@ -1,134 +1,246 @@
-from .common import InfoExtractor
-
-import json
import random
-import re
+import itertools
+import urllib.parse
-from ..compat import (
- compat_parse_qs,
- compat_str,
-)
+from .common import InfoExtractor
from ..utils import (
- js_to_json,
+ int_or_none,
+ str_or_none,
+ u... | yt_dlp/extractor/weibo.py | 26 | Python | 0.714 | suggestion | 118 | 51 | 51 | false | [extractor/weibo] Rewrite to fix extractor | 7,657 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | c-basalt |
'description': '呃,稍微了解了一下靡烟miya,感觉这东西也太二了 http://t.cn/A6aerGsM ',
'duration': 76,
'timestamp': 1659344278,
'upload_date': '20220801',
'thumbnail': r're:https://.*\.jpg',
'uploader': '君子爱财陈平安',
'uploader_id': '3905382233',
... | ```suggestion
_VALID_URL = r'https?://weibo\.com/u/(?P<id>\d+)'
```
Also, do we want to match any subdomains? | 'timestamp': 1659344278,
'upload_date': '20220801',
'thumbnail': r're:https://.*\.jpg',
'uploader': '君子爱财陈平安',
'uploader_id': '3905382233',
'uploader_url': 'https://weibo.com/u/3905382233',
'view_count': int,
'like_count': i... | @@ -1,134 +1,246 @@
-from .common import InfoExtractor
-
-import json
import random
-import re
+import itertools
+import urllib.parse
-from ..compat import (
- compat_parse_qs,
- compat_str,
-)
+from .common import InfoExtractor
from ..utils import (
- js_to_json,
+ int_or_none,
+ str_or_none,
+ u... | yt_dlp/extractor/weibo.py | 26 | Python | 0.714 | question | 116 | 51 | 51 | false | [extractor/weibo] Rewrite to fix extractor | 7,657 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | c-basalt |
'duration': 53,
'timestamp': 1514264429,
'upload_date': '20171226',
'thumbnail': r're:https://.*\.jpg',
'uploader': '柴犬柴犬',
'uploader_id': '5926682210',
'uploader_url': 'https://weibo.com/u/5926682210',
'view_count': int,
... | ```suggestion
_VALID_URL = r'https?://weibo\.com/tv/show/(?P<id>\d+:\d+)'
```
Should we match any subdomains? | 'upload_date': '20171226',
'thumbnail': r're:https://.*\.jpg',
'uploader': '柴犬柴犬',
'uploader_id': '5926682210',
'uploader_url': 'https://weibo.com/u/5926682210',
'view_count': int,
'like_count': int,
'repost_count': int,
... | @@ -1,134 +1,246 @@
-from .common import InfoExtractor
-
-import json
import random
-import re
+import itertools
+import urllib.parse
-from ..compat import (
- compat_parse_qs,
- compat_str,
-)
+from .common import InfoExtractor
from ..utils import (
- js_to_json,
+ int_or_none,
+ str_or_none,
+ u... | yt_dlp/extractor/weibo.py | 26 | Python | 0.786 | question | 116 | 51 | 51 | false | [extractor/weibo] Rewrite to fix extractor | 7,657 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | c-basalt |
'https://weibo.com/ajax/profile/getWaterFallContent',
uid, query=query, note=f'Downloading videos page {page}')['data']
for video_info in response.get('list', []):
yield self._parse_video_info(video_info)
if (int_or_none(response.get('next_cursor')... | The multiple `entries`/`_entries` var/functions make this hard to read for me.
It could be simplified somewhat and we could eliminate a duplicated first page request like this:
```suggestion
def _fetch_page(self, uid, cursor=0, page=1):
return self._weibo_download_json(
'https://weibo.com... | import random
import itertools
import urllib.parse
from .common import InfoExtractor
from ..utils import (
int_or_none,
make_archive_id,
mimetype2ext,
parse_resolution,
str_or_none,
strip_jsonp,
traverse_obj,
url_or_none,
urlencode_postdata,
urljoin,
)
class WeiboBaseIE(InfoEx... | @@ -1,134 +1,246 @@
-from .common import InfoExtractor
-
-import json
import random
-import re
+import itertools
+import urllib.parse
-from ..compat import (
- compat_parse_qs,
- compat_str,
-)
+from .common import InfoExtractor
from ..utils import (
- js_to_json,
+ int_or_none,
+ str_or_none,
+ u... | yt_dlp/extractor/weibo.py | 26 | Python | 0.857 | refactor | 1,408 | 27 | 242 | false | [extractor/weibo] Rewrite to fix extractor | 7,657 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | c-basalt |
formats = [i for i in formats if i.get('url')]
if not formats: # fallback, should be barely used
for url in set(traverse_obj(media_info, (..., {url_or_none}))):
if 'label=' in url:
format_id, resolution = self._search_regex(
r'labe... | We should also do this, since the `UserIE` is also using this function, so that video downloads are recorded under `WeiboIE` in the download archive
```suggestion
'extractor_key': WeiboIE.ie_key(),
'extractor': WeiboIE.IE_NAME,
'formats': self._extract_formats(video_info),
``` | }))
if not formats: # fallback, should be barely used
for url in set(traverse_obj(media_info, (..., {url_or_none}))):
if 'label=' in url: # filter out non-video urls
format_id, resolution = self._search_regex(
r'label=(\w+)&te... | @@ -1,134 +1,246 @@
-from .common import InfoExtractor
-
-import json
import random
-import re
+import itertools
+import urllib.parse
-from ..compat import (
- compat_parse_qs,
- compat_str,
-)
+from .common import InfoExtractor
from ..utils import (
- js_to_json,
+ int_or_none,
+ str_or_none,
+ u... | yt_dlp/extractor/weibo.py | 26 | Python | 0.857 | refactor | 318 | 51 | 51 | false | [extractor/weibo] Rewrite to fix extractor | 7,657 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | c-basalt |
def _fetch_page(self, uid, cursor=0, page=1):
return self._weibo_download_json(
'https://weibo.com/ajax/profile/getWaterFallContent',
uid, note=f'Downloading videos page {page}',
query={'uid': uid, 'cursor': cursor})['data']
def _entries(self, uid, first_page):
... | ```suggestion
} if uploader else {}
``` |
def _fetch_page(self, uid, cursor=0, page=1):
return self._weibo_download_json(
'https://weibo.com/ajax/profile/getWaterFallContent',
uid, note=f'Downloading videos page {page}',
query={'uid': uid, 'cursor': cursor})['data']
def _entries(self, uid, first_page):
... | @@ -1,134 +1,241 @@
-from .common import InfoExtractor
-
-import json
import random
-import re
+import itertools
+import urllib.parse
-from ..compat import (
- compat_parse_qs,
- compat_str,
-)
+from .common import InfoExtractor
from ..utils import (
- js_to_json,
+ int_or_none,
+ make_archive_id,
+ ... | yt_dlp/extractor/weibo.py | 26 | Python | 0.429 | suggestion | 49 | 29 | 29 | false | [extractor/weibo] Rewrite to fix extractor | 7,657 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | c-basalt |
self.assertEqual(escape_rfc3986('foo bar'), 'foo%20bar')
self.assertEqual(escape_rfc3986('foo%20bar'), 'foo%20bar')
def test_normalize_url(self):
self.assertEqual(
normalize_url('http://wowza.imust.org/srv/vod/telemb/new/UPLOAD/UPLOAD/20224_IncendieHavré_FD.mp4'),
'... | ```suggestion
```
This'd have to be done for the whole file | self.assertEqual(escape_rfc3986('foo bar'), 'foo%20bar')
self.assertEqual(escape_rfc3986('foo%20bar'), 'foo%20bar')
def test_normalize_url(self):
self.assertEqual(
normalize_url('http://wowza.imust.org/srv/vod/telemb/new/UPLOAD/UPLOAD/20224_IncendieHavré_FD.mp4'),
'... | @@ -933,24 +936,46 @@ def test_escape_rfc3986(self):
self.assertEqual(escape_rfc3986('foo bar'), 'foo%20bar')
self.assertEqual(escape_rfc3986('foo%20bar'), 'foo%20bar')
- def test_escape_url(self):
+ def test_normalize_url(self):
self.assertEqual(
- escape_url('http://wowza... | test/test_utils.py | 26 | Python | 0.571 | suggestion | 61 | 51 | 51 | false | [networking] Remove dot segments during URL normalization | 7,662 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | coletdjnz |
self._API_HEADERS['Authorization'] = f'Bearer {guest["auth_token"]}'
def _entries(self, username, user_id, limit=6):
query = {'limit': limit}
for page in itertools.count(1):
videos = self._download_json(
f'{self._API_BASE_URL}/api/users/{user_id}/videos',
... | ```suggestion
if user_info.get('private') and user_info.get('followed_by_me') not in (True, 'true'):
``` | self._API_HEADERS['Authorization'] = f'Bearer {guest["auth_token"]}'
def _entries(self, username, user_id, limit=6):
query = {'limit': limit}
for page in itertools.count(1):
videos = self._download_json(
f'{self._API_BASE_URL}/api/users/{user_id}/videos',
... | @@ -287,9 +278,15 @@ def _entries(self, username, user_id, limit=6):
def _real_extract(self, url):
username = self._match_id(url)
- user_info = self._check_user_info(self._download_json(
+ user_info = traverse_obj(self._download_json(
f'{self._API_BASE_URL}/api/users/by_userna... | yt_dlp/extractor/triller.py | 26 | Python | 0.786 | suggestion | 114 | 51 | 51 | false | [ie/triller] Fix unlisted video extraction | 7,670 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | bashonly |
import re
from .common import InfoExtractor
class RbgTumIE(InfoExtractor):
_VALID_URL = r'https://(live\.rbg\.tum\.de|tum\.live)/w/(?P<id>.+)'
_TESTS = [{
# Combined view
'url': 'https://live.rbg.tum.de/w/cpp/22128',
'md5': '53a5e7b3e07128e33bbf36687fe1c08f',
'info_dict': {
... | ```suggestion
_VALID_URL = r'https://(?:live\.rbg\.tum\.de|tum\.live)/w/(?P<id>.+)'
``` | import re
from .common import InfoExtractor
from ..utils import parse_qs, remove_start, traverse_obj, ExtractorError
class RbgTumIE(InfoExtractor):
_VALID_URL = r'https://(?:live\.rbg\.tum\.de|tum\.live)/w/(?P<id>[^?#]+)'
_TESTS = [{
# Combined view
'url': 'https://live.rbg.tum.de/w/cpp/22128... | @@ -4,7 +4,7 @@
class RbgTumIE(InfoExtractor):
- _VALID_URL = r'https://live\.rbg\.tum\.de/w/(?P<id>.+)'
+ _VALID_URL = r'https://(live\.rbg\.tum\.de|tum\.live)/w/(?P<id>.+)' | yt_dlp/extractor/rbgtum.py | 7 | Python | 0.571 | suggestion | 93 | 32 | 32 | false | [extractor/rbgtum] fix m3u8 regex, add new hostname | 7,690 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | simon300000 |
'title': 'Funktionale Programmierung und Verifikation (IN0003)',
'id': '2022/S/fpv',
},
'params': {
'noplaylist': False,
},
'playlist_count': 13,
}, {
'url': 'https://live.rbg.tum.de/course/2022/W/set',
'info_dict': {
't... | ```suggestion
course_id, hostname = self._match_valid_url(url).group('id', 'hostname')
``` | 'id': '2022/S/fpv',
},
'params': {
'noplaylist': False,
},
'playlist_count': 13,
}, {
'url': 'https://live.rbg.tum.de/old/course/2022/W/set',
'info_dict': {
'title': 'SET FSMPIC',
'id': '2022/W/set',
},
'... | @@ -78,16 +82,21 @@ class RbgTumCourseIE(InfoExtractor):
'noplaylist': False,
},
'playlist_count': 6,
+ }, {
+ # new URL
+ 'url': 'https://tum.live/course/2023/S/linalginfo',
+ 'only_matching': True,
}, ]
def _real_extract(self, url):
course_id... | yt_dlp/extractor/rbgtum.py | 26 | Python | 0.714 | suggestion | 100 | 36 | 51 | false | [extractor/rbgtum] fix m3u8 regex, add new hostname | 7,690 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | simon300000 |
}, {
'url': 'https://live.rbg.tum.de/course/2022/W/set',
'info_dict': {
'title': 'SET FSMPIC',
'id': '2022/W/set',
},
'params': {
'noplaylist': False,
},
'playlist_count': 6,
}, {
# new URL
'url': 'https://tum.li... | ```suggestion
lecture_urls.append(self.url_result(f'{hostname}/w/{lecture_url}', ie=RbgTumIE))
``` | 'url': 'https://live.rbg.tum.de/old/course/2022/W/set',
'info_dict': {
'title': 'SET FSMPIC',
'id': '2022/W/set',
},
'params': {
'noplaylist': False,
},
'playlist_count': 6,
}, {
'url': 'https://tum.live/old/course/2023/S/li... | @@ -78,16 +82,21 @@ class RbgTumCourseIE(InfoExtractor):
'noplaylist': False,
},
'playlist_count': 6,
+ }, {
+ # new URL
+ 'url': 'https://tum.live/course/2023/S/linalginfo',
+ 'only_matching': True,
}, ]
def _real_extract(self, url):
course_id... | yt_dlp/extractor/rbgtum.py | 26 | Python | 0.714 | suggestion | 112 | 29 | 51 | false | [extractor/rbgtum] fix m3u8 regex, add new hostname | 7,690 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | simon300000 |
import re
from .common import InfoExtractor
class RbgTumIE(InfoExtractor):
_VALID_URL = r'https://(live\.rbg\.tum\.de|tum\.live)/w/(?P<id>.+)'
_TESTS = [{
# Combined view
'url': 'https://live.rbg.tum.de/w/cpp/22128',
'md5': '53a5e7b3e07128e33bbf36687fe1c08f',
'info_dict': {
... | ```suggestion
_VALID_URL = r'https://(?:live\.rbg\.tum\.de|tum\.live)/w/(?P<id>[^?#]+)'
```
We don't want to match query. Same issue for other IE | import re
from .common import InfoExtractor
from ..utils import parse_qs, remove_start, traverse_obj, ExtractorError
class RbgTumIE(InfoExtractor):
_VALID_URL = r'https://(?:live\.rbg\.tum\.de|tum\.live)/w/(?P<id>[^?#]+)'
_TESTS = [{
# Combined view
'url': 'https://live.rbg.tum.de/w/cpp/22128... | @@ -4,7 +4,7 @@
class RbgTumIE(InfoExtractor):
- _VALID_URL = r'https://live\.rbg\.tum\.de/w/(?P<id>.+)'
+ _VALID_URL = r'https://(live\.rbg\.tum\.de|tum\.live)/w/(?P<id>.+)' | yt_dlp/extractor/rbgtum.py | 7 | Python | 0.714 | suggestion | 152 | 32 | 32 | false | [extractor/rbgtum] fix m3u8 regex, add new hostname | 7,690 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | simon300000 |
'id': 'I2DL/12349/PRES',
'ext': 'mp4',
'title': 'Lecture 3: Introduction to Neural Networks',
'series': 'Introduction to Deep Learning (IN2346)',
}
}, {
# Camera only
'url': 'https://live.rbg.tum.de/w/fvv-info/16130/CAM',
'md5': 'e04189... | ```suggestion
m3u8 = self._html_search_regex(r'(https://[^"]+\.m3u8[^"]*)', webpage, 'm3u8')
```
Avoid catastrophic backtracking. Similar issue in a lot of places | 'info_dict': {
'id': 'I2DL/12349/PRES',
'ext': 'mp4',
'title': 'Lecture 3: Introduction to Neural Networks',
'series': 'Introduction to Deep Learning (IN2346)',
}
}, {
# Camera only
'url': 'https://live.rbg.tum.de/w/fvv-info/16130/CAM',... | @@ -35,13 +35,17 @@ class RbgTumIE(InfoExtractor):
'title': 'Fachschaftsvollversammlung',
'series': 'Fachschaftsvollversammlung Informatik',
}
+ }, {
+ # new URL
+ 'url': 'https://tum.live/w/linalginfo/27102',
+ 'only_matching': True,
}, ]
def _real... | yt_dlp/extractor/rbgtum.py | 26 | Python | 0.786 | suggestion | 173 | 51 | 51 | false | [extractor/rbgtum] fix m3u8 regex, add new hostname | 7,690 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | simon300000 |
import re
from .common import InfoExtractor
from ..utils import parse_qs
class RbgTumIE(InfoExtractor):
_VALID_URL = r'https://(?:live\.rbg\.tum\.de|tum\.live)/w/(?P<id>[^?#]+)'
_TESTS = [{
# Combined view
'url': 'https://live.rbg.tum.de/w/cpp/22128',
'md5': '53a5e7b3e07128e33bbf36687... | Pls issue a proper error message if these are missing | },
'params': {
'noplaylist': False,
},
'playlist_count': 13,
}, {
'url': 'https://live.rbg.tum.de/?year=2022&term=W&slug=set&view=3',
'info_dict': {
'title': 'SET FSMPIC',
'id': '2022/W/set',
},
'params': {
... | @@ -97,3 +98,37 @@ def _real_extract(self, url):
lecture_urls.append(self.url_result(f'{hostname}/w/{lecture_url}', ie=RbgTumIE))
return self.playlist_result(lecture_urls, course_id, lecture_series_title)
+
+
+class RbgTumNewCourseIE(InfoExtractor):
+ _VALID_URL = r'(?P<hostname>https://(live... | yt_dlp/extractor/rbgtum.py | 26 | Python | 0.357 | suggestion | 53 | 135 | 30 | false | [extractor/rbgtum] fix m3u8 regex, add new hostname | 7,690 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | simon300000 |
'info_dict': {
'id': 'I2DL/12349/PRES',
'ext': 'mp4',
'title': 'Lecture 3: Introduction to Neural Networks',
'series': 'Introduction to Deep Learning (IN2346)',
}
}, {
# Camera only
'url': 'https://live.rbg.tum.de/w/fvv-info/16130/CAM',... | if we don't know the string begins with a quote, `[^"]*` could match a lot more than we are expecting
```suggestion
m3u8 = self._html_search_regex(r'"(https://[^"]+\.m3u8[^"]*)', webpage, 'm3u8')
``` | 'info_dict': {
'id': 'I2DL/12349/PRES',
'ext': 'mp4',
'title': 'Lecture 3: Introduction to Neural Networks',
'series': 'Introduction to Deep Learning (IN2346)',
}
}, {
# Camera only
'url': 'https://live.rbg.tum.de/w/fvv-info/16130/CAM',... | @@ -35,16 +36,19 @@ class RbgTumIE(InfoExtractor):
'title': 'Fachschaftsvollversammlung',
'series': 'Fachschaftsvollversammlung Informatik',
}
+ }, {
+ 'url': 'https://tum.live/w/linalginfo/27102',
+ 'only_matching': True,
}, ]
def _real_extract(self, url)... | yt_dlp/extractor/rbgtum.py | 26 | Python | 0.857 | suggestion | 210 | 51 | 51 | false | [extractor/rbgtum] fix m3u8 regex, add new hostname | 7,690 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | simon300000 |
'id': 'I2DL/12349/PRES',
'ext': 'mp4',
'title': 'Lecture 3: Introduction to Neural Networks',
'series': 'Introduction to Deep Learning (IN2346)',
}
}, {
# Camera only
'url': 'https://live.rbg.tum.de/w/fvv-info/16130/CAM',
'md5': 'e04189... | this can be non-fatal
```suggestion
lecture_title = self._html_search_regex(r'<h1[^>]*>([^<]+)</h1>', webpage, 'title', fatal=False)
``` | 'id': 'I2DL/12349/PRES',
'ext': 'mp4',
'title': 'Lecture 3: Introduction to Neural Networks',
'series': 'Introduction to Deep Learning (IN2346)',
}
}, {
# Camera only
'url': 'https://live.rbg.tum.de/w/fvv-info/16130/CAM',
'md5': 'e04189... | @@ -35,16 +36,19 @@ class RbgTumIE(InfoExtractor):
'title': 'Fachschaftsvollversammlung',
'series': 'Fachschaftsvollversammlung Informatik',
}
+ }, {
+ 'url': 'https://tum.live/w/linalginfo/27102',
+ 'only_matching': True,
}, ]
def _real_extract(self, url)... | yt_dlp/extractor/rbgtum.py | 26 | Python | 0.714 | suggestion | 147 | 51 | 51 | false | [extractor/rbgtum] fix m3u8 regex, add new hostname | 7,690 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | simon300000 |
'title': 'Lecture 3: Introduction to Neural Networks',
'series': 'Introduction to Deep Learning (IN2346)',
}
}, {
# Camera only
'url': 'https://live.rbg.tum.de/w/fvv-info/16130/CAM',
'md5': 'e04189d92ff2f56aedf5cede65d37aad',
'info_dict': {
... | non-fatal
```suggestion
r'<title>(?:TUM-Live \| )([^:<]+):?[^<]*</title>', webpage, 'series', fatal=false)
``` | 'title': 'Lecture 3: Introduction to Neural Networks',
'series': 'Introduction to Deep Learning (IN2346)',
}
}, {
# Camera only
'url': 'https://live.rbg.tum.de/w/fvv-info/16130/CAM',
'md5': 'e04189d92ff2f56aedf5cede65d37aad',
'info_dict': {
... | @@ -35,16 +36,19 @@ class RbgTumIE(InfoExtractor):
'title': 'Fachschaftsvollversammlung',
'series': 'Fachschaftsvollversammlung Informatik',
}
+ }, {
+ 'url': 'https://tum.live/w/linalginfo/27102',
+ 'only_matching': True,
}, ]
def _real_extract(self, url)... | yt_dlp/extractor/rbgtum.py | 26 | Python | 0.714 | suggestion | 125 | 51 | 51 | false | [extractor/rbgtum] fix m3u8 regex, add new hostname | 7,690 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | simon300000 |
}, {
'url': 'https://tum.live/w/linalginfo/27102',
'only_matching': True,
}, ]
def _real_extract(self, url):
video_id = self._match_id(url)
webpage = self._download_webpage(url, video_id)
m3u8 = self._html_search_regex(r'(https://[^"]+\.m3u8[^"]*)', webpage, 'm3u8')... | we can capture the actual hostname as `hostname`, and tighten up the rest of the pattern so that we don't match query/fragments
```suggestion
_VALID_URL = r'https://(?P<hostname>(?:live\.rbg\.tum\.de|tum\.live))/old/course/(?P<id>(?P<year>\d+)/(?P<term>\w+)/(?P<slug>[^/?#]+))'
``` | }, {
'url': 'https://tum.live/w/linalginfo/27102',
'only_matching': True,
}, ]
def _real_extract(self, url):
video_id = self._match_id(url)
webpage = self._download_webpage(url, video_id)
m3u8 = self._html_search_regex(r'"(https://[^"]+\.m3u8[^"]*)', webpage, 'm3u8'... | @@ -57,9 +61,9 @@ def _real_extract(self, url):
class RbgTumCourseIE(InfoExtractor):
- _VALID_URL = r'https://live\.rbg\.tum\.de/course/(?P<id>.+)'
+ _VALID_URL = r'(?P<hostname>https://(?:live\.rbg\.tum\.de|tum\.live))/old/course/(?P<id>(?P<year>[^/]+)/(?P<term>[^/]+)/(?P<slug>.+))' | yt_dlp/extractor/rbgtum.py | 26 | Python | 0.786 | suggestion | 288 | 51 | 51 | false | [extractor/rbgtum] fix m3u8 regex, add new hostname | 7,690 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | simon300000 |
'only_matching': True,
}, ]
def _real_extract(self, url):
course_id, hostname, year, term, slug = self._match_valid_url(url).group('id', 'hostname', 'year', 'term', 'slug')
json = f'{hostname}/api/courses/{slug}/?year={year}&term={term}'
try:
meta = self._download_j... | ```suggestion
meta = self._download_json(
f'https://{hostname}/api/courses/{slug}/', course_id, fatal=False,
query={'year': year, 'term': term}) or {}
lecture_series_title = meta.get('Name')
lectures = [self.url_result(f'https://{hostname}/w/{slug}/{stream_id}', RbgT... | }, ]
def _real_extract(self, url):
course_id, hostname, year, term, slug = self._match_valid_url(url).group('id', 'hostname', 'year', 'term', 'slug')
meta = self._download_json(
f'https://{hostname}/api/courses/{slug}/', course_id, fatal=False,
query={'year': year, 'term... | @@ -78,16 +82,69 @@ class RbgTumCourseIE(InfoExtractor):
'noplaylist': False,
},
'playlist_count': 6,
+ }, {
+ 'url': 'https://tum.live/old/course/2023/S/linalginfo',
+ 'only_matching': True,
}, ]
def _real_extract(self, url):
- course_id = self._match_... | yt_dlp/extractor/rbgtum.py | 26 | Python | 0.786 | suggestion | 920 | 51 | 51 | false | [extractor/rbgtum] fix m3u8 regex, add new hostname | 7,690 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | simon300000 |
json = f'{hostname}/api/courses/{slug}/?year={year}&term={term}'
try:
meta = self._download_json(json, course_id)
lecture_series_title = meta.get('Name')
streams = meta.get('Streams') or []
lecture_urls = [self.url_result(f'{hostname}/w/{slug}/{stream["... | ```suggestion
_VALID_URL = r'https://(?P<hostname>(?:live\.rbg\.tum\.de|tum\.live))/\?'
``` | f'https://{hostname}/api/courses/{slug}/', course_id, fatal=False,
query={'year': year, 'term': term}) or {}
lecture_series_title = meta.get('Name')
lectures = [self.url_result(f'https://{hostname}/w/{slug}/{stream_id}', RbgTumIE)
for stream_id in traverse_obj... | @@ -78,16 +82,69 @@ class RbgTumCourseIE(InfoExtractor):
'noplaylist': False,
},
'playlist_count': 6,
+ }, {
+ 'url': 'https://tum.live/old/course/2023/S/linalginfo',
+ 'only_matching': True,
}, ]
def _real_extract(self, url):
- course_id = self._match_... | yt_dlp/extractor/rbgtum.py | 26 | Python | 0.571 | suggestion | 97 | 51 | 51 | false | [extractor/rbgtum] fix m3u8 regex, add new hostname | 7,690 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | simon300000 |
'noplaylist': False,
},
'playlist_count': 13,
}, {
'url': 'https://live.rbg.tum.de/?year=2022&term=W&slug=set&view=3',
'info_dict': {
'title': 'SET FSMPIC',
'id': '2022/W/set',
},
'params': {
'noplaylist': False,
... | ```suggestion
errors = [key for key in ('year', 'term', 'slug') if not query.get(key)]
if errors:
raise ExtractorError(f'Input URL is missing query parameters: {", ".join(errors)}')
year, term, slug = query['year'][0], query['term'][0], query['slug'][0]
hostname = self._... | import re
from .common import InfoExtractor
from ..utils import parse_qs, remove_start, traverse_obj, ExtractorError
class RbgTumIE(InfoExtractor):
_VALID_URL = r'https://(?:live\.rbg\.tum\.de|tum\.live)/w/(?P<id>[^?#]+)'
_TESTS = [{
# Combined view
'url': 'https://live.rbg.tum.de/w/cpp/22128... | @@ -78,16 +82,69 @@ class RbgTumCourseIE(InfoExtractor):
'noplaylist': False,
},
'playlist_count': 6,
+ }, {
+ 'url': 'https://tum.live/old/course/2023/S/linalginfo',
+ 'only_matching': True,
}, ]
def _real_extract(self, url):
- course_id = self._match_... | yt_dlp/extractor/rbgtum.py | 26 | Python | 1 | refactor | 468 | 27 | 143 | false | [extractor/rbgtum] fix m3u8 regex, add new hostname | 7,690 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | simon300000 |
import re
from .common import InfoExtractor
from ..utils import parse_qs, ExtractorError
class RbgTumIE(InfoExtractor):
_VALID_URL = r'https://(?:live\.rbg\.tum\.de|tum\.live)/w/(?P<id>[^?#]+)'
_TESTS = [{
# Combined view
'url': 'https://live.rbg.tum.de/w/cpp/22128',
'md5': '53a5e7b3e... | ```suggestion
from ..utils import ExtractorError, parse_qs
``` | import re
from .common import InfoExtractor
from ..utils import parse_qs, remove_start, traverse_obj, ExtractorError
class RbgTumIE(InfoExtractor):
_VALID_URL = r'https://(?:live\.rbg\.tum\.de|tum\.live)/w/(?P<id>[^?#]+)'
_TESTS = [{
# Combined view
'url': 'https://live.rbg.tum.de/w/cpp/22128... | @@ -1,10 +1,11 @@
import re
from .common import InfoExtractor
+from ..utils import parse_qs, ExtractorError | yt_dlp/extractor/rbgtum.py | 4 | Python | 0.786 | refactor | 64 | 29 | 29 | false | [extractor/rbgtum] fix m3u8 regex, add new hostname | 7,690 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | simon300000 |
'title': 'Lecture 3: Introduction to Neural Networks',
'series': 'Introduction to Deep Learning (IN2346)',
}
}, {
# Camera only
'url': 'https://live.rbg.tum.de/w/fvv-info/16130/CAM',
'md5': 'e04189d92ff2f56aedf5cede65d37aad',
'info_dict': {
... | on second thought, why don't we just do this
```diff
- lecture_series_title = self._html_search_regex(
- r'<title>(?:TUM-Live \| )([^:<]+):?[^<]*</title>', webpage, 'series', fatal=False)
+ lecture_series_title = remove_start(self._html_extract_title(webpage), 'TUM-Live | ')
```
import `r... | 'title': 'Lecture 3: Introduction to Neural Networks',
'series': 'Introduction to Deep Learning (IN2346)',
}
}, {
# Camera only
'url': 'https://live.rbg.tum.de/w/fvv-info/16130/CAM',
'md5': 'e04189d92ff2f56aedf5cede65d37aad',
'info_dict': {
... | @@ -35,16 +36,19 @@ class RbgTumIE(InfoExtractor):
'title': 'Fachschaftsvollversammlung',
'series': 'Fachschaftsvollversammlung Informatik',
}
+ }, {
+ 'url': 'https://tum.live/w/linalginfo/27102',
+ 'only_matching': True,
}, ]
def _real_extract(self, url)... | yt_dlp/extractor/rbgtum.py | 26 | Python | 0.857 | refactor | 343 | 51 | 51 | false | [extractor/rbgtum] fix m3u8 regex, add new hostname | 7,690 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | simon300000 |
'info_dict': {
'title': 'SET FSMPIC',
'id': '2022/W/set',
},
'params': {
'noplaylist': False,
},
'playlist_count': 6,
}, {
'url': 'https://tum.live/old/course/2023/S/linalginfo',
'only_matching': True,
}, ]
def _rea... | same as above
```suggestion
lecture_series_title = remove_start(self._html_extract_title(webpage), 'TUM-Live | ')
``` | 'title': 'SET FSMPIC',
'id': '2022/W/set',
},
'params': {
'noplaylist': False,
},
'playlist_count': 6,
}, {
'url': 'https://tum.live/old/course/2023/S/linalginfo',
'only_matching': True,
}, ]
def _real_extract(self, url):
... | @@ -78,16 +82,63 @@ class RbgTumCourseIE(InfoExtractor):
'noplaylist': False,
},
'playlist_count': 6,
+ }, {
+ 'url': 'https://tum.live/old/course/2023/S/linalginfo',
+ 'only_matching': True,
}, ]
def _real_extract(self, url):
- course_id = self._match_... | yt_dlp/extractor/rbgtum.py | 26 | Python | 0.786 | refactor | 128 | 51 | 51 | false | [extractor/rbgtum] fix m3u8 regex, add new hostname | 7,690 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | simon300000 |
'id': '2022/W/set',
},
'params': {
'noplaylist': False,
},
'playlist_count': 6,
}, {
'url': 'https://tum.live/old/course/2023/S/linalginfo',
'only_matching': True,
}, ]
def _real_extract(self, url):
course_id, hostname, year, t... | ```suggestion
for lecture_path in re.findall(r'href="(/w/[^/"]+/[^/"]+)"', webpage)]
``` | },
'params': {
'noplaylist': False,
},
'playlist_count': 6,
}, {
'url': 'https://tum.live/old/course/2023/S/linalginfo',
'only_matching': True,
}, ]
def _real_extract(self, url):
course_id, hostname, year, term, slug = self._match_valid_ur... | @@ -78,16 +82,63 @@ class RbgTumCourseIE(InfoExtractor):
'noplaylist': False,
},
'playlist_count': 6,
+ }, {
+ 'url': 'https://tum.live/old/course/2023/S/linalginfo',
+ 'only_matching': True,
}, ]
def _real_extract(self, url):
- course_id = self._match_... | yt_dlp/extractor/rbgtum.py | 26 | Python | 0.714 | suggestion | 114 | 51 | 51 | false | [extractor/rbgtum] fix m3u8 regex, add new hostname | 7,690 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | simon300000 |
if isinstance(e.cause, HTTPError) and e.cause.status == 400:
raise ExtractorError(self._parse_json(
e.cause.response.read().decode(), xid)['error_description'], expected=True)
raise
self._set_dailymotion_cookie('... | ```suggestion
(?:(?:www|touch|geo)\.)?dailymotion\.[a-z]{2,3}/(?:(?:(?:(?:embed|swf|\#)/)|player(?:/\w+)?\.html\?)?video|swf)|
``` | if isinstance(e.cause, HTTPError) and e.cause.status == 400:
raise ExtractorError(self._parse_json(
e.cause.response.read().decode(), xid)['error_description'], expected=True)
raise
self._set_dailymotion_cookie('... | @@ -93,7 +93,7 @@ class DailymotionIE(DailymotionBaseInfoExtractor):
_VALID_URL = r'''(?ix)
https?://
(?:
- (?:(?:www|touch|geo)\.)?dailymotion\.[a-z]{2,3}/(?:(?:(?:(?:embed|swf|\#)/)|player\.html\?)?video|swf)|
+ (... | yt_dlp/extractor/dailymotion.py | 26 | Python | 0.714 | suggestion | 160 | 51 | 51 | false | [extractor/dailymotion] Update URL regex and fix unit tests | 7,692 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | TravisDupes |
https?://
(?:
(?:(?:www|touch|geo)\.)?dailymotion\.[a-z]{2,3}/(?:(?:(?:(?:embed|swf|\#)/)|player(?:/[0-9a-z]*)?\.html\?)?video|swf)|
(?:www\.)?lequipe\.fr/video
)
[/=](?P<i... | single quotes
```suggestion
'tags': ['hollywood', 'celeb', 'celebrity', 'movies', 'red carpet'],
``` | https?://
(?:
(?:(?:www|touch|geo)\.)?dailymotion\.[a-z]{2,3}/(?:(?:(?:(?:embed|swf|\#)/)|player(?:/\w+)?\.html\?)?video|swf)|
(?:www\.)?lequipe\.fr/video
)
[/=](?P<id>[^/?... | @@ -107,13 +107,17 @@ class DailymotionIE(DailymotionBaseInfoExtractor):
'id': 'x5kesuj',
'ext': 'mp4',
'title': 'Office Christmas Party Review – Jason Bateman, Olivia Munn, T.J. Miller',
- 'description': 'Office Christmas Party Review - Jason Bateman, Olivia Munn, T.... | yt_dlp/extractor/dailymotion.py | 26 | Python | 0.714 | suggestion | 115 | 51 | 51 | false | [extractor/dailymotion] Update URL regex and fix unit tests | 7,692 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | TravisDupes |
wnetwork|
ytv
)\.com|
(?:
hgtv|
foodnetwork|
slice|
history|
... | I don't think we should change the URL just because the browser redirects.
yt-dlp can extract from the original URL (no webpage requests) and we want to still test that it is matched | wnetwork|
ytv
)\.com|
(?:
hgtv|
foodnetwork|
slice|
history|
... | @@ -41,7 +41,7 @@ class CorusIE(ThePlatformFeedIE): # XXX: Do not subclass from concrete IE
)
'''
_TESTS = [{
- 'url': 'http://www.hgtv.ca/shows/bryan-inc/videos/movie-night-popcorn-with-bryan-870923331648/',
+ 'url': 'https://www.hgtv.ca/video/bryan-inc... | yt_dlp/extractor/corus.py | 26 | Python | 0.429 | refactor | 183 | 51 | 51 | false | Fixtests | 7,718 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | trainman261 |
canonical = doc.get('canonical')
if not canonical:
continue
entries.append(self.url_result(
base_url + canonical, AENetworksIE.ie_key(), doc.get('id')))
description = None
if self._PLAYLIST_DESCRIPTION_KEY:
description = pl... | Don't add `skip` for geo-retriction | canonical = doc.get('canonical')
if not canonical:
continue
entries.append(self.url_result(
base_url + canonical, AENetworksIE.ie_key(), doc.get('id')))
description = None
if self._PLAYLIST_DESCRIPTION_KEY:
description = pl... | @@ -227,6 +227,7 @@ class AENetworksCollectionIE(AENetworksListBaseIE):
'title': 'America The Story of Us',
},
'playlist_mincount': 12,
+ 'skip': 'probably geo-restricted, redirects to aenetworks.tv for me', | yt_dlp/extractor/aenetworks.py | 26 | Python | 0.214 | suggestion | 35 | 51 | 51 | false | Fixtests | 7,718 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | trainman261 |
from ..utils import (
int_or_none,
parse_age_limit,
try_get,
update_url_query,
)
class AMCNetworksIE(ThePlatformIE): # XXX: Do not subclass from concrete IE
_VALID_URL = r'https?://(?:www\.)?(?P<site>amc|bbcamerica|ifc|(?:we|sundance)tv)\.com/(?P<id>(?:movies|shows(?:/[^/]+)+)/[^/?#&]+)'
_TES... | Avoid extraneous details. Just `404 not available` is sufficient. Not deleting the test implies already that a replacement needs to be found in future. | from ..utils import (
int_or_none,
parse_age_limit,
try_get,
update_url_query,
)
class AMCNetworksIE(ThePlatformIE): # XXX: Do not subclass from concrete IE
_VALID_URL = r'https?://(?:www\.)?(?P<site>amc|bbcamerica|ifc|(?:we|sundance)tv)\.com/(?P<id>(?:movies|shows(?:/[^/]+)+)/[^/?#&]+)'
_TES... | @@ -26,6 +26,7 @@ class AMCNetworksIE(ThePlatformIE): # XXX: Do not subclass from concrete IE
# m3u8 download
'skip_download': True,
},
+ 'skip': 'Returns 404 not available. BBCAmerica requires a sign-in for just about everything, so someone will have to find a link that works... | yt_dlp/extractor/amcnetworks.py | 26 | Python | 0.571 | suggestion | 151 | 51 | 51 | false | Fixtests | 7,718 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | trainman261 |
'ext': 'mp4',
'title': 'An Eagle\'s-Eye View Off Burrard Bridge',
'description': 'Hercules the eagle flies from Vancouver\'s Burrard Bridge down to a nearby park with a mini-camera strapped to his back.',
'upload_date': '20160201',
'timesta... | The title we want is the old one. It's the extractor that's wrong, not the test. | 'id': '2680832926',
'ext': 'mp4',
'title': 'An Eagle\'s-Eye View Off Burrard Bridge',
'description': 'Hercules the eagle flies from Vancouver\'s Burrard Bridge down to a nearby park with a mini-camera strapped to his back.',
'upload_date': ... | @@ -94,9 +95,10 @@ class CBCIE(InfoExtractor):
'skip': 'Geo-restricted to Canada',
}, {
# multiple CBC.APP.Caffeine.initInstance(...)
+ # currently doesn't work, needs a fix.
'url': 'http://www.cbc.ca/news/canada/calgary/dog-indoor-exercise-winter-1.3928238',
'info_dict':... | yt_dlp/extractor/cbc.py | 26 | Python | 0.286 | bug | 80 | 51 | 51 | false | Fixtests | 7,718 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | trainman261 |
'title': 'MSNBC Rachel Maddow (video)',
'description': 're:.*her unique approach to storytelling.*',
},
'playlist': [{
'info_dict': {
'ext': 'mov',
'id': 'pdv_maddow_netcast_mov-12-03-2020-223726',
... | Investigation is needed as to why id changed. | 'title': 'MSNBC Rachel Maddow (video)',
'description': 're:.*her unique approach to storytelling.*',
},
'playlist': [{
'info_dict': {
'ext': 'mov',
'id': 'pdv_maddow_netcast_mov-12-03-2020-223726',
... | @@ -145,12 +150,12 @@ class GenericIE(InfoExtractor):
'playlist': [{
'info_dict': {
'ext': 'm4a',
- 'id': 'c1c879525ce2cb640b344507e682c36d',
+ 'id': '818a5d38-01cd-152f-2231-ee479677fa82', | yt_dlp/extractor/generic.py | 26 | Python | 0.143 | suggestion | 45 | 51 | 51 | false | Fixtests | 7,718 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | trainman261 |
'application': 'NBCSports',
'version': 'v1',
'platform': 'desktop',
'cdn': 'akamai',
'url': video_source['sourceUrl'],
'token': base64.b64encode(token.encode()).decode(),
'resourceId': base64.b64encode(resour... | are you updating these tests by running from master or your patch in #7484? | 'version': 'v1',
'platform': 'desktop',
'cdn': 'akamai',
'url': video_source['sourceUrl'],
'token': base64.b64encode(token.encode()).decode(),
'resourceId': base64.b64encode(resource.encode()).decode(),
}).encode... | @@ -379,14 +380,16 @@ class NBCNewsIE(ThePlatformIE): # XXX: Do not subclass from concrete IE
_TESTS = [
{
'url': 'http://www.nbcnews.com/watch/nbcnews-com/how-twitter-reacted-to-the-snowden-interview-269389891880',
- 'md5': 'cf4bc9e6ce0130f00f545d80ecedd4bf',
+ 'md5': ... | yt_dlp/extractor/nbc.py | 26 | Python | 0.214 | question | 75 | 51 | 51 | false | Fixtests | 7,718 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | trainman261 |
webpage, 'embedding URL', group="embedUrl")
return {
'_type': 'url_transparent',
'url': theplatform_url,
'ie_key': ThePlatformIE.ie_key(),
'display_id': display_id,
}
class NBCOlympicsStreamIE(AdobePassIE):
IE_NAME = 'nbcolympics:str... | this extractor doesn't use ThePlatform |
return {
'_type': 'url_transparent',
'url': theplatform_url,
'ie_key': ThePlatformIE.ie_key(),
'display_id': display_id,
}
class NBCOlympicsStreamIE(AdobePassIE):
IE_NAME = 'nbcolympics:stream'
_VALID_URL = r'https?://stream\.nbcolympics\.com/(?... | @@ -578,6 +589,7 @@ class NBCOlympicsStreamIE(AdobePassIE):
'params': {
'skip_download': 'm3u8',
},
+ 'skip': 'redirects to nbcolympics.com. Possibly geo-restricted?', | yt_dlp/extractor/nbc.py | 26 | Python | 0.143 | refactor | 38 | 51 | 51 | false | Fixtests | 7,718 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | trainman261 |
'series': xpath_text(video_data, 'seriesTitle'),
'season_number': int_or_none(xpath_text(video_data, 'seasonNumber')),
'episode_number': int_or_none(xpath_text(video_data, 'episodeNumber')),
'duration': int_or_none(xpath_text(video_data, 'videoLength'), 1000),
... | this extractor is not ThePlatform-related | 'series': xpath_text(video_data, 'seriesTitle'),
'season_number': int_or_none(xpath_text(video_data, 'seasonNumber')),
'episode_number': int_or_none(xpath_text(video_data, 'episodeNumber')),
'duration': int_or_none(xpath_text(video_data, 'videoLength'), 1000),
... | @@ -187,6 +189,7 @@ class ParamountPressExpressIE(InfoExtractor):
'thumbnail': r're:^https://.+\.jpg',
'tags': [],
},
+ 'skip': 'geo-restricted', | yt_dlp/extractor/cbs.py | 26 | Python | 0.143 | refactor | 41 | 51 | 51 | false | Fixtests | 7,718 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | trainman261 |
_TESTS = []
def _real_extract(self, url):
domain, video_id = self._match_valid_url(url).groups()
return self._extract_aetn_info(domain, 'id', video_id, url)
class BiographyIE(AENetworksBaseIE):
_VALID_URL = r'https?://(?:www\.)?biography\.com/video/(?P<id>[^/?#&]+)'
_TESTS = [{
... | ```suggestion
'skip': '404 Not Found',
``` | domain, video_id = self._match_valid_url(url).groups()
return self._extract_aetn_info(domain, 'id', video_id, url)
class BiographyIE(AENetworksBaseIE):
_VALID_URL = r'https?://(?:www\.)?biography\.com/video/(?P<id>[^/?#&]+)'
_TESTS = [{
'url': 'https://www.biography.com/video/vincent-v... | @@ -338,6 +341,7 @@ class BiographyIE(AENetworksBaseIE):
'skip_download': True,
},
'add_ie': ['ThePlatform'],
+ 'skip': 'page returns 404. I haven"t been able to find the video anywhere else on the site. Possibly also geo-restricted for all I can tell, AE network seems to be odd he... | yt_dlp/extractor/aenetworks.py | 26 | Python | 0.571 | suggestion | 52 | 36 | 33 | false | Fixtests | 7,718 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | trainman261 |
'url': 'http://www.cbc.ca/22minutes/videos/22-minutes-update/22-minutes-update-episode-4',
'md5': '162adfa070274b144f4fdc3c3b8207db',
'info_dict': {
'id': '2414435309',
'ext': 'mp4',
'title': '22 Minutes Update: What Not To Wear Quebec',
'descripti... | ```suggestion
'skip': '404 Not Found',
``` | # with clipId, feed available via tpfeed.cbc.ca and feed.theplatform.com
'url': 'http://www.cbc.ca/22minutes/videos/22-minutes-update/22-minutes-update-episode-4',
'md5': '162adfa070274b144f4fdc3c3b8207db',
'info_dict': {
'id': '2414435309',
'ext': 'mp4',
... | @@ -65,6 +65,7 @@ class CBCIE(InfoExtractor):
'uploader': 'CBCC-NEW',
'timestamp': 255977160,
},
+ 'skip': 'test returns 404, and visiting the site redirects to the cbc archives page. The video can still be found here: https://www.cbc.ca/player/play/2487345465 , but that would ... | yt_dlp/extractor/cbc.py | 26 | Python | 0.571 | suggestion | 52 | 51 | 51 | false | Fixtests | 7,718 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | trainman261 |
_VALID_URL = r'''(?x)
(?:
cbs:|
https?://(?:www\.)?(?:
cbs\.com/(?:shows|movies)/(?:video|[^/]+/video|[^/]+)/|
colbertlateshow\.com/(?:video|podcasts)/)
)(?P<id>[\w-]+)'''
# All tests are blocked outside US
_TESTS = [{
'url': '... | ```suggestion
'skip': 'Subscription required',
``` | _VALID_URL = r'''(?x)
(?:
cbs:|
https?://(?:www\.)?(?:
cbs\.com/(?:shows|movies)/(?:video|[^/]+/video|[^/]+)/|
colbertlateshow\.com/(?:video|podcasts)/)
)(?P<id>[\w-]+)'''
# All tests are blocked outside US
_TESTS = [{
'url': '... | @@ -101,6 +101,7 @@ class CBSIE(CBSBaseIE):
# m3u8 download
'skip_download': True,
},
+ 'skip': 'geo-restricted, and needs a subscription', | yt_dlp/extractor/cbs.py | 26 | Python | 0.571 | suggestion | 60 | 51 | 51 | false | Fixtests | 7,718 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | trainman261 |
'timestamp': 1639015200,
'upload_date': '20211209',
'uploader': 'CBSI-NEW',
},
'params': {
# m3u8 download
'skip_download': True,
},
'skip': 'geo-restricted, and needs a subscription',
}, {
'url': 'https://www.cbs.co... | ```suggestion
'skip': '404 Not Found',
``` | 'timestamp': 1639015200,
'upload_date': '20211209',
'uploader': 'CBSI-NEW',
},
'params': {
# m3u8 download
'skip_download': True,
},
'skip': 'Subscription required',
}, {
'url': 'https://www.cbs.com/shows/video/sZH1M... | @@ -117,6 +118,7 @@ class CBSIE(CBSBaseIE):
},
'expected_warnings': [
'This content expired on', 'No video formats found', 'Requested format is not available'],
+ 'skip': 'returns 404, plus videos here are generally geo-restricted', | yt_dlp/extractor/cbs.py | 26 | Python | 0.571 | suggestion | 52 | 51 | 51 | false | Fixtests | 7,718 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | trainman261 |
from .common import InfoExtractor
from ..utils import smuggle_url
class CNBCIE(InfoExtractor):
_VALID_URL = r'https?://video\.cnbc\.com/gallery/\?video=(?P<id>[0-9]+)'
_TEST = {
'url': 'http://video.cnbc.com/gallery/?video=3000503714',
'info_dict': {
'id': '3000503714',
... | ```suggestion
'skip': 'Dead link',
``` | from .common import InfoExtractor
from ..utils import smuggle_url
class CNBCIE(InfoExtractor):
_VALID_URL = r'https?://video\.cnbc\.com/gallery/\?video=(?P<id>[0-9]+)'
_TEST = {
'url': 'http://video.cnbc.com/gallery/?video=3000503714',
'info_dict': {
'id': '3000503714',
... | @@ -19,6 +19,7 @@ class CNBCIE(InfoExtractor):
# m3u8 download
'skip_download': True,
},
+ 'skip': 'web site doesn"t play the video either, returns error 232011. Possibly geo-restricted to US, seeing that this happens to every video on my end here? Test fails at downloading the... | yt_dlp/extractor/cnbc.py | 22 | Python | 0.429 | suggestion | 48 | 47 | 47 | false | Fixtests | 7,718 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | trainman261 |
'_type': 'url_transparent',
'ie_key': 'ThePlatform',
'url': smuggle_url(
'http://link.theplatform.com/s/gZWlPC/media/guid/2408950221/%s?mbr=true&manifest=m3u' % video_id,
{'force_smil_url': True}),
'id': video_id,
}
class CNBCVide... | ```suggestion
'skip': 'Dead link',
``` | '_type': 'url_transparent',
'ie_key': 'ThePlatform',
'url': smuggle_url(
'http://link.theplatform.com/s/gZWlPC/media/guid/2408950221/%s?mbr=true&manifest=m3u' % video_id,
{'force_smil_url': True}),
'id': video_id,
}
class CNBCVide... | @@ -49,6 +50,7 @@ class CNBCVideoIE(InfoExtractor):
'params': {
'skip_download': True,
},
+ 'skip': 'web site doesn"t play the video either, returns error 232011. Possibly geo-restricted to US, seeing that this happens to every video on my end here? Test fails at downloading the m3... | yt_dlp/extractor/cnbc.py | 26 | Python | 0.429 | suggestion | 48 | 42 | 42 | false | Fixtests | 7,718 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | trainman261 |
/(?:[^/]+/)*
(?:
video\.html\?.*?\bv=|
videos?/(?:[^/]+/)*(?:[a-z0-9-]+-)?
)
(?P<id>
[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}... | ```suggestion
# FIXME: yt-dlp wrongly raises for geo restriction
``` | /(?:[^/]+/)*
(?:
video\.html\?.*?\bv=|
videos?/(?:[^/]+/)*(?:[a-z0-9-]+-)?
)
(?P<id>
[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}... | @@ -54,6 +54,8 @@ class CorusIE(ThePlatformFeedIE): # XXX: Do not subclass from concrete IE
'skip_download': True,
},
'expected_warnings': ['Failed to parse JSON'],
+ # this needs to be fixed. I can access the page and play the video without any issues,
+ # but yt-dlp tells... | yt_dlp/extractor/corus.py | 26 | Python | 0.571 | bug | 78 | 51 | 51 | false | Fixtests | 7,718 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | trainman261 |
'url': 'http://phihag.de/2014/youtube-dl/rss2.xml',
'info_dict': {
'id': 'https://phihag.de/2014/youtube-dl/rss2.xml',
'title': 'Zero Punctuation',
'description': 're:.*groundbreaking video review series.*'
},
'playlist_minc... | ```suggestion
'skip': 'Dead link',
``` | 'url': 'http://phihag.de/2014/youtube-dl/rss2.xml',
'info_dict': {
'id': 'https://phihag.de/2014/youtube-dl/rss2.xml',
'title': 'Zero Punctuation',
'description': 're:.*groundbreaking video review series.*'
},
'playlist_minc... | @@ -133,6 +137,7 @@ class GenericIE(InfoExtractor):
'upload_date': '20201204',
},
}],
+ 'skip': 'url does not seem to exist anymore. the enclosed feed still does, though.', | yt_dlp/extractor/generic.py | 26 | Python | 0.571 | suggestion | 52 | 51 | 51 | false | Fixtests | 7,718 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | trainman261 |
'url': 'http://api.new.livestream.com/accounts/1570303/events/1585861/videos/4719370.smil',
'info_dict': {
'id': '4719370',
'ext': 'mp4',
'title': '571de1fd-47bc-48db-abf9-238872a58d1f',
'formats': 'mincount:3',
},
... | ```suggestion
'skip': '404 Not Found',
``` | 'url': 'http://api.new.livestream.com/accounts/1570303/events/1585861/videos/4719370.smil',
'info_dict': {
'id': '4719370',
'ext': 'mp4',
'title': '571de1fd-47bc-48db-abf9-238872a58d1f',
'formats': 'mincount:3',
},
... | @@ -267,6 +272,7 @@ class GenericIE(InfoExtractor):
'params': {
'skip_download': True,
},
+ 'skip': 'returns 404, and the link from the comment redirects to telegraaf.nl/video. Unfortunately I understand too little dutch to find an alternative link for testing.' | yt_dlp/extractor/generic.py | 26 | Python | 0.571 | suggestion | 56 | 51 | 51 | false | Fixtests | 7,718 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | trainman261 |
# iframe
'url': 'https://static3.mediasetplay.mediaset.it/player/index.html?appKey=5ad3966b1de1c4000d5cec48&programGuid=FAFU000000665924&id=665924',
'only_matching': True,
}, {
'url': 'mediaset:FAFU000000665924',
'only_matching': True,
}]
_WEBPAGE_TESTS = [{
#... | ```suggestion
'skip': 'Dead link',
``` | 'url': 'https://static3.mediasetplay.mediaset.it/player/index.html?appKey=5ad3966b1de1c4000d5cec48&programGuid=FAFU000000665924&id=665924',
'only_matching': True,
}, {
'url': 'mediaset:FAFU000000665924',
'only_matching': True,
}]
_WEBPAGE_TESTS = [{
# Mediaset embed
... | @@ -127,7 +128,8 @@ class MediasetIE(ThePlatformBaseIE):
},
'params': {
'skip_download': True,
- }
+ },
+ 'skip': 'there is no video on this page (anymore)', | yt_dlp/extractor/mediaset.py | 26 | Python | 0.429 | suggestion | 48 | 51 | 51 | false | Fixtests | 7,718 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | trainman261 |
from .fox import FOXIE
from ..utils import (
smuggle_url,
url_basename,
)
class NationalGeographicVideoIE(InfoExtractor):
IE_NAME = 'natgeo:video'
_VALID_URL = r'https?://video\.nationalgeographic\.com/.*?'
_TESTS = [
{
'url': 'http://video.nationalgeographic.com/video/news/15... | ```suggestion
'skip': 'Redirects to main page',
``` | from .fox import FOXIE
from ..utils import (
smuggle_url,
url_basename,
)
class NationalGeographicVideoIE(InfoExtractor):
IE_NAME = 'natgeo:video'
_VALID_URL = r'https?://video\.nationalgeographic\.com/.*?'
_TESTS = [
{
'url': 'http://video.nationalgeographic.com/video/news/15... | @@ -24,6 +24,7 @@ class NationalGeographicVideoIE(InfoExtractor):
'uploader': 'NAGS',
},
'add_ie': ['ThePlatform'],
+ 'skip': 'website doesn"t seem to exist', | yt_dlp/extractor/nationalgeographic.py | 26 | Python | 0.571 | suggestion | 65 | 51 | 51 | false | Fixtests | 7,718 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | trainman261 |
'info_dict': {
'id': '0000014b-70a1-dd8c-af7f-f7b559330001',
'ext': 'mp4',
'title': 'Mating Crabs Busted by Sharks',
'description': 'md5:16f25aeffdeba55aaa8ec37e093ad8b3',
'timestamp': 1423523799,
'upload_date': ... | ```suggestion
'skip': 'Redirects to main page',
``` | 'info_dict': {
'id': '0000014b-70a1-dd8c-af7f-f7b559330001',
'ext': 'mp4',
'title': 'Mating Crabs Busted by Sharks',
'description': 'md5:16f25aeffdeba55aaa8ec37e093ad8b3',
'timestamp': 1423523799,
'upload_date': ... | @@ -38,6 +39,7 @@ class NationalGeographicVideoIE(InfoExtractor):
'uploader': 'NAGS',
},
'add_ie': ['ThePlatform'],
+ 'skip': 'website doesn"t seem to exist', | yt_dlp/extractor/nationalgeographic.py | 26 | Python | 0.571 | suggestion | 65 | 51 | 51 | false | Fixtests | 7,718 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | trainman261 |
'_type': 'url_transparent',
'ie_key': 'ThePlatform',
'url': smuggle_url(
'http://link.theplatform.com/s/ngs/media/guid/2423130747/%s?mbr=true' % guid,
{'force_smil_url': True}),
'id': guid,
}
class NationalGeographicTVIE(FOXIE): ... | ```suggestion
'skip': 'Content not available',
``` | '_type': 'url_transparent',
'ie_key': 'ThePlatform',
'url': smuggle_url(
'http://link.theplatform.com/s/ngs/media/guid/2423130747/%s?mbr=true' % guid,
{'force_smil_url': True}),
'id': guid,
}
class NationalGeographicTVIE(FOXIE): ... | @@ -75,6 +77,7 @@ class NationalGeographicTVIE(FOXIE): # XXX: Do not subclass from concrete IE
'params': {
'skip_download': True,
},
+ 'skip': 'redirects. possibly geo-restricted?', | yt_dlp/extractor/nationalgeographic.py | 26 | Python | 0.571 | suggestion | 60 | 30 | 30 | false | Fixtests | 7,718 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | trainman261 |
'duration': parse_duration(video_data.get('duration')),
'timestamp': unified_timestamp(video_data.get('datePublished')),
'formats': formats,
'subtitles': subtitles,
}
class NBCOlympicsIE(InfoExtractor):
IE_NAME = 'nbcolympics'
_VALID_URL = r'https?://www... | ```suggestion
'skip': '404 Not Found',
``` | 'timestamp': unified_timestamp(video_data.get('datePublished')),
'formats': formats,
'subtitles': subtitles,
}
class NBCOlympicsIE(InfoExtractor):
IE_NAME = 'nbcolympics'
_VALID_URL = r'https?://www\.nbcolympics\.com/videos?/(?P<id>[0-9a-z-]+)'
_TEST = {
... | @@ -535,6 +545,7 @@ class NBCOlympicsIE(InfoExtractor):
'upload_date': '20160815',
'uploader': 'NBCU-SPORTS',
},
+ 'skip': 'geo-restricted, and also now returns 404. Other videos seem to be restricted as well (error 232403)', | yt_dlp/extractor/nbc.py | 26 | Python | 0.571 | suggestion | 52 | 51 | 51 | false | Fixtests | 7,718 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | trainman261 |
_VALID_URL = r'https?://stream\.nbcolympics\.com/(?P<id>[0-9a-z-]+)'
_TESTS = [
{
'note': 'Tokenized m3u8 source URL',
'url': 'https://stream.nbcolympics.com/womens-soccer-group-round-11',
'info_dict': {
'id': '2019740',
'ext': 'mp4',
... | ```suggestion
'skip': 'Livestream',
``` | _TESTS = [
{
'note': 'Tokenized m3u8 source URL',
'url': 'https://stream.nbcolympics.com/womens-soccer-group-round-11',
'info_dict': {
'id': '2019740',
'ext': 'mp4',
'title': r"re:Women's Group Stage - Netherlands vs\. Brazi... | @@ -589,6 +601,7 @@ class NBCOlympicsStreamIE(AdobePassIE):
'params': {
'skip_download': 'm3u8',
},
+ 'skip': 'redirects to nbcolympics.com. Possibly geo-restricted?', | yt_dlp/extractor/nbc.py | 26 | Python | 0.571 | suggestion | 53 | 51 | 51 | false | Fixtests | 7,718 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | trainman261 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.