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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
error = info['errors'][0]
error_code = error.get('code')
if error_code == 'access.denied.geoblocked':
self.raise_geo_restricted(countries=geo_countries)
elif error_code in ('access.denied.missingpackage', 'invalid.token'):
raise ExtractorError(
'Th... | Since this a worldwide site, it doesn't make sense to hardcode a `country`, as is required in the `_DISCO_API_PARAMS` var for extractors subclassed from `DiscoveryPlusBaseIE`:
https://github.com/yt-dlp/yt-dlp/blob/9c13de0dd2e24211ffd5eac7da1388107d2cc7be/yt_dlp/extractor/dplay.py#L1029-L1033
With the change to `_ge... | error = info['errors'][0]
error_code = error.get('code')
if error_code == 'access.denied.geoblocked':
self.raise_geo_restricted(countries=geo_countries)
elif error_code in ('access.denied.missingpackage', 'invalid.token'):
raise ExtractorError(
'Th... | @@ -65,6 +65,7 @@ def _download_video_playback_info(self, disco_base, video_id, headers):
return streaming_list
def _get_disco_api_info(self, url, display_id, disco_host, realm, country, domain=''):
+ country = self.get_param('geo_bypass_country') or country | yt_dlp/extractor/dplay.py | 26 | Python | 0.643 | refactor | 808 | 51 | 51 | false | [extractor/dplay] GlobalCyclingNetworkPlus: Add extractor | 7,360 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | bashonly |
import json
import uuid
from .common import InfoExtractor
from ..compat import compat_HTTPError
from ..utils import (
determine_ext,
ExtractorError,
float_or_none,
int_or_none,
remove_start,
strip_or_none,
try_get,
unified_timestamp,
)
class DPlayBaseIE(InfoExtractor):
_PATH_REGEX... | 27.42 has been observed for other D/D+ sites. I wonder if this has any effect. One could guess that eventually the site could exclude a "too old" client, but also might not like a "too new" one. | 'ext': 'mp4',
'title': 'The Athertons: Mountain Biking\'s Fastest Family',
'description': 'md5:75a81937fcd8b989eec6083a709cd837',
'thumbnail': 'https://us1-prod-images.disco-api.com/2021/03/04/eb9e3026-4849-3001-8281-9356466f0557.png',
'series': 'gcn',
... | @@ -1001,3 +1002,39 @@ class DiscoveryPlusIndiaShowIE(DiscoveryPlusShowBaseIE):
_SHOW_STR = 'show'
_INDEX = 4
_VIDEO_IE = DiscoveryPlusIndiaIE
+
+
+class GlobalCyclingNetworkPlusIE(DiscoveryPlusBaseIE):
+ _VALID_URL = r'https?://plus\.globalcyclingnetwork\.com/watch/(?P<id>\d+)'
+ _TESTS = [{
+ ... | yt_dlp/extractor/dplay.py | 26 | Python | 0.429 | suggestion | 194 | 1,004 | 29 | false | [extractor/dplay] GlobalCyclingNetworkPlus: Add extractor | 7,360 | yt-dlp/yt-dlp | 132,642 | Python | dirkf | bashonly |
_VALID_URL = r'https?://best-vod\.umn\.cdn\.united\.cloud/stream\?asset=(?P<id>[^&]+)'
_TESTS = [{
'url': 'https://best-vod.umn.cdn.united.cloud/stream?asset=ljsottomazilirija3060921-n1info-si-worldwide&stream=hp1400&t=0&player=m3u8v&sp=n1info&u=n1info&p=n1Sh4redSecre7iNf0',
'md5': '28b08b32aeaf... | ```suggestion
_VALID_URL = r'https?://(?:(?:\w+\.)?n1info\.\w+|nova\.rs)/(?:[^/]+/){1,2}(?P<id>[^/]+)'
```
I'd just do this tbh | _VALID_URL = r'https?://best-vod\.umn\.cdn\.united\.cloud/stream\?asset=(?P<id>[^&]+)'
_TESTS = [{
'url': 'https://best-vod.umn.cdn.united.cloud/stream?asset=ljsottomazilirija3060921-n1info-si-worldwide&stream=hp1400&t=0&player=m3u8v&sp=n1info&u=n1info&p=n1Sh4redSecre7iNf0',
'md5': '28b08b32aeaf... | @@ -33,7 +33,7 @@ def _real_extract(self, url):
class N1InfoIIE(InfoExtractor):
IE_NAME = 'N1Info:article'
- _VALID_URL = r'https?://(?:(?:(?:ba|rs|hr)\.)?n1info\.(?:com|si)|nova\.rs)/(?:[^/]+/){1,2}(?P<id>[^/]+)'
+ _VALID_URL = r'https?://(?:(?:(?:ba|rs|hr)\.)?n1info\.(?:com|si|rs|hr|ba)|nova\.rs)/(?:[^/... | yt_dlp/extractor/n1.py | 26 | Python | 0.714 | suggestion | 134 | 51 | 51 | false | [N1] Fix extractor for new player | 7,373 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | u-spec-png |
'url': 'https://n1info.rs/vesti/cuta-biti-u-kosovskoj-mitrovici-znaci-da-te-docekaju-eksplozivnim-napravama/',
'info_dict': {
'id': '1332368',
'ext': 'mp4',
'title': 'Ćuta: Biti u Kosovskoj Mitrovici znači da te dočekaju eksplozivnim napravama',
'upload_da... | ```suggestion
site_id = re.search(r'site:(\d+)', webpage).group(1)
for video_data in re.findall(r'\$bp\("Brid_\d+", (.+)\);', webpage):
``` | 'url': 'https://n1info.rs/vesti/cuta-biti-u-kosovskoj-mitrovici-znaci-da-te-docekaju-eksplozivnim-napravama/',
'info_dict': {
'id': '1332368',
'ext': 'mp4',
'title': 'Ćuta: Biti u Kosovskoj Mitrovici znači da te dočekaju eksplozivnim napravama',
'upload_da... | @@ -105,19 +115,37 @@ def _real_extract(self, url):
title = self._html_search_regex(r'<h1[^>]+>(.+?)</h1>', webpage, 'title')
timestamp = unified_timestamp(self._html_search_meta('article:published_time', webpage))
-
- videos = re.findall(r'(?m)(<video[^>]+>)', webpage)
+ plugin_data =... | yt_dlp/extractor/n1.py | 26 | Python | 0.714 | suggestion | 166 | 51 | 51 | false | [N1] Fix extractor for new player | 7,373 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | u-spec-png |
'id': '1332368',
'ext': 'mp4',
'title': 'Ćuta: Biti u Kosovskoj Mitrovici znači da te dočekaju eksplozivnim napravama',
'upload_date': '20230620',
'timestamp': 1687290536,
'thumbnail': 'https://cdn.brid.tv/live/partners/26827/snapshot/1332368_th_64... | ```suggestion
video_id = self._parse_json(video_data, title)['video']
``` | 'id': '1332368',
'ext': 'mp4',
'title': 'Ćuta: Biti u Kosovskoj Mitrovici znači da te dočekaju eksplozivnim napravama',
'upload_date': '20230620',
'timestamp': 1687290536,
'thumbnail': 'https://cdn.brid.tv/live/partners/26827/snapshot/1332368_th_64... | @@ -105,19 +115,37 @@ def _real_extract(self, url):
title = self._html_search_regex(r'<h1[^>]+>(.+?)</h1>', webpage, 'title')
timestamp = unified_timestamp(self._html_search_meta('article:published_time', webpage))
-
- videos = re.findall(r'(?m)(<video[^>]+>)', webpage)
+ plugin_data =... | yt_dlp/extractor/n1.py | 26 | Python | 0.571 | suggestion | 91 | 51 | 51 | false | [N1] Fix extractor for new player | 7,373 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | u-spec-png |
}]
def _real_extract(self, url):
video_id = self._match_id(url)
webpage = self._download_webpage(url, video_id)
title = self._html_search_regex(r'<h1[^>]+>(.+?)</h1>', webpage, 'title')
timestamp = unified_timestamp(self._html_search_meta('article:published_time', webpage))
... | ```suggestion
entries.append({
'id': video_id,
'title': title,
'timestamp': timestamp,
'thumbnail': self._html_search_meta('thumbnailURL', webpage),
'formats': self._extract_m3u8_formats(
... | }]
def _real_extract(self, url):
video_id = self._match_id(url)
webpage = self._download_webpage(url, video_id)
title = self._html_search_regex(r'<h1[^>]+>(.+?)</h1>', webpage, 'title')
timestamp = unified_timestamp(self._html_search_meta('article:published_time', webpage))
... | @@ -105,19 +115,37 @@ def _real_extract(self, url):
title = self._html_search_regex(r'<h1[^>]+>(.+?)</h1>', webpage, 'title')
timestamp = unified_timestamp(self._html_search_meta('article:published_time', webpage))
-
- videos = re.findall(r'(?m)(<video[^>]+>)', webpage)
+ plugin_data =... | yt_dlp/extractor/n1.py | 26 | Python | 0.857 | refactor | 475 | 51 | 51 | false | [N1] Fix extractor for new player | 7,373 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | u-spec-png |
'thumbnail': 'https://cdn.brid.tv/live/partners/26827/snapshot/1332368_th_6492013a8356f_1687290170.jpg'
},
}, {
'url': 'https://hr.n1info.com/vijesti/pravobraniteljica-o-ubojstvu-u-zagrebu-radi-se-o-doista-nezapamcenoj-situaciji/',
'only_matching': True,
}]
def _real_ext... | ```suggestion
'formats': self._extract_m3u8_formats(
f'https://cdn-uc.brid.tv/live/partners/{site_id}/streaming/{video_id}/{video_id}.m3u8',
video_id, fatal=False),
``` | 'thumbnail': 'https://cdn.brid.tv/live/partners/26827/snapshot/1332368_th_6492013a8356f_1687290170.jpg'
},
}, {
'url': 'https://hr.n1info.com/vijesti/pravobraniteljica-o-ubojstvu-u-zagrebu-radi-se-o-doista-nezapamcenoj-situaciji/',
'only_matching': True,
}]
def _real_ext... | @@ -105,19 +115,34 @@ def _real_extract(self, url):
title = self._html_search_regex(r'<h1[^>]+>(.+?)</h1>', webpage, 'title')
timestamp = unified_timestamp(self._html_search_meta('article:published_time', webpage))
-
- videos = re.findall(r'(?m)(<video[^>]+>)', webpage)
+ plugin_data =... | yt_dlp/extractor/n1.py | 26 | Python | 0.857 | refactor | 240 | 51 | 51 | false | [N1] Fix extractor for new player | 7,373 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | u-spec-png |
_VALID_URL = r'https?://best-vod\.umn\.cdn\.united\.cloud/stream\?asset=(?P<id>[^&]+)'
_TESTS = [{
'url': 'https://best-vod.umn.cdn.united.cloud/stream?asset=ljsottomazilirija3060921-n1info-si-worldwide&stream=hp1400&t=0&player=m3u8v&sp=n1info&u=n1info&p=n1Sh4redSecre7iNf0',
'md5': '28b08b32aeaf... | ```suggestion
_VALID_URL = r'https?://(?:(?:\w+\.)?n1info\.\w+|nova\.rs)/(?:[^/?#]+/){1,2}(?P<id>[^/?#]+)'
``` | _VALID_URL = r'https?://best-vod\.umn\.cdn\.united\.cloud/stream\?asset=(?P<id>[^&]+)'
_TESTS = [{
'url': 'https://best-vod.umn.cdn.united.cloud/stream?asset=ljsottomazilirija3060921-n1info-si-worldwide&stream=hp1400&t=0&player=m3u8v&sp=n1info&u=n1info&p=n1Sh4redSecre7iNf0',
'md5': '28b08b32aeaf... | @@ -33,7 +33,7 @@ def _real_extract(self, url):
class N1InfoIIE(InfoExtractor):
IE_NAME = 'N1Info:article'
- _VALID_URL = r'https?://(?:(?:(?:ba|rs|hr)\.)?n1info\.(?:com|si)|nova\.rs)/(?:[^/]+/){1,2}(?P<id>[^/]+)'
+ _VALID_URL = r'https?://(?:(?:\w+\.)?n1info\.\w+|nova\.rs)/(?:[^/]+/){1,2}(?P<id>[^/]+)' | yt_dlp/extractor/n1.py | 26 | Python | 0.714 | suggestion | 116 | 51 | 51 | false | [N1] Fix extractor for new player | 7,373 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | u-spec-png |
if plugin_data:
site_id = self._html_search_regex(r'site:(\d+)', webpage, 'site id')
for video_data in re.findall(r'\$bp\("Brid_\d+", (.+)\);', webpage):
video_id = self._parse_json(video_data, title)['video']
entries.append({
'id': vid... | ```suggestion
'ie_key': 'N1InfoAsset',
})
``` | if plugin_data:
site_id = self._html_search_regex(r'site:(\d+)', webpage, 'site id')
for video_data in re.findall(r'\$bp\("Brid_\d+", (.+)\);', webpage):
video_id = self._parse_json(video_data, title)['video']
entries.append({
'id': vid... | @@ -105,19 +115,34 @@ def _real_extract(self, url):
title = self._html_search_regex(r'<h1[^>]+>(.+?)</h1>', webpage, 'title')
timestamp = unified_timestamp(self._html_search_meta('article:published_time', webpage))
-
- videos = re.findall(r'(?m)(<video[^>]+>)', webpage)
+ plugin_data =... | yt_dlp/extractor/n1.py | 26 | Python | 0.571 | suggestion | 84 | 44 | 45 | false | [N1] Fix extractor for new player | 7,373 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | u-spec-png |
'thumbnail': r're:^https?://cdn-image\.gtflixtv\.com.*\.jpg.*$'
}
}, {
'url': 'https://pornbox.com/application/watch-page/216045',
'md5': '56cb78bb1d8e0d2dad8b75c278c20098',
'info_dict': {
'id': '216045',
'ext': 'mp4',
'title': 'md5:3e4... | You don't need to skip if doing ignore_no_formats_error, no? | 'tags': 'count:11',
'description': 'md5:589c7f33e183aa8aa939537300efb859',
'thumbnail': r're:^https?://cdn-image\.gtflixtv\.com.*\.jpg.*$'
}
}, {
'url': 'https://pornbox.com/application/watch-page/216045',
'info_dict': {
'id': '216045',
... | @@ -0,0 +1,137 @@
+from .common import InfoExtractor
+from ..utils import (
+ parse_duration,
+ traverse_obj,
+ str_or_none,
+ int_or_none,
+ strip_or_none,
+ parse_iso8601,
+ qualities
+)
+
+
+class PornboxIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?pornbox\.com/application/watch-pag... | yt_dlp/extractor/pornbox.py | 26 | Python | 0.357 | question | 60 | 51 | 51 | false | [Pornbox] New extractor | 7,386 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | niemands |
'age_limit': 18,
'availability': 'premium_only',
'duration': 2710,
'cast': ['Bella Grey', 'Oliver Trunk'],
'tags': 'count:29',
'thumbnail': r're:^https?://cdn-image\.gtflixtv\.com.*\.jpg.*$',
'subtitles': 'count:6'
},
'p... | ```suggestion
cast = traverse_obj(public_data, (('models', 'male_models'), ..., 'model_name'))
```
Inline in `metadata = `too | 'age_limit': 18,
'availability': 'premium_only',
'duration': 2710,
'cast': 'count:3',
'tags': 'count:29',
'thumbnail': r're:^https?://cdn-image\.gtflixtv\.com.*\.jpg.*$',
'subtitles': 'count:6'
},
'params': {
... | @@ -0,0 +1,137 @@
+from .common import InfoExtractor
+from ..utils import (
+ parse_duration,
+ traverse_obj,
+ str_or_none,
+ int_or_none,
+ strip_or_none,
+ parse_iso8601,
+ qualities
+)
+
+
+class PornboxIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?pornbox\.com/application/watch-pag... | yt_dlp/extractor/pornbox.py | 26 | Python | 0.857 | suggestion | 138 | 51 | 51 | false | [Pornbox] New extractor | 7,386 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | niemands |
},
'params': {
'skip_download': True,
'ignore_no_formats_error': True
},
'skip': 'Only for subscribers'
}]
def _real_extract(self, url):
video_id = self._match_id(url)
public_data = self._download_json(f'https://pornbox.com/contents/{vide... | ```suggestion
subtitles = {country_code: [{
'url': f'https://pornbox.com/contents/{video_id}/subtitles/{country_code}',
'ext': 'srt'
}] for country_code in traverse_obj(public_data, ('subtitles', ...)}
``` | },
'params': {
'skip_download': True,
'ignore_no_formats_error': True
},
'expected_warnings': [
'You are either not logged in or do not have access to this scene',
'No video formats found', 'Requested format is not available']
}]
d... | @@ -0,0 +1,137 @@
+from .common import InfoExtractor
+from ..utils import (
+ parse_duration,
+ traverse_obj,
+ str_or_none,
+ int_or_none,
+ strip_or_none,
+ parse_iso8601,
+ qualities
+)
+
+
+class PornboxIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?pornbox\.com/application/watch-pag... | yt_dlp/extractor/pornbox.py | 26 | Python | 0.786 | suggestion | 250 | 51 | 51 | false | [Pornbox] New extractor | 7,386 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | niemands |
'age_limit': 18,
'duration': parse_duration(public_data.get('runtime')),
'cast': cast,
'tags': traverse_obj(public_data, ('niches', ..., 'niche'), default=[]),
'thumbnail': str_or_none(public_data.get('player_poster')),
'subtitles': subtitles,
... | ```suggestion
media_id = traverse_obj(public_data, (
'medias', lambda _, v: v['title'] == 'Full video', 'media_id', {int}), get_all=False)
if not media_id:
self.raise_no_formats('Could not find stream id', video_id=video_id)
``` | }),
'age_limit': 18,
'timestamp': parse_iso8601(traverse_obj(
public_data, ('studios', 'release_date'), 'publish_date')),
'availability': self._availability(needs_auth=True, needs_premium=not is_free_scene),
'subtitles': subtitles,
}
... | @@ -0,0 +1,137 @@
+from .common import InfoExtractor
+from ..utils import (
+ parse_duration,
+ traverse_obj,
+ str_or_none,
+ int_or_none,
+ strip_or_none,
+ parse_iso8601,
+ qualities
+)
+
+
+class PornboxIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?pornbox\.com/application/watch-pag... | yt_dlp/extractor/pornbox.py | 26 | Python | 0.857 | suggestion | 273 | 51 | 32 | false | [Pornbox] New extractor | 7,386 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | niemands |
if (not public_data.get('is_purchased')) or (not is_free_scene):
self.raise_login_required('You are either not logged in or do not have access to this scene',
metadata_available=True, method='cookies')
return metadata
media_id = traverse_obj... | ```py
stream_data = self._download_json(
f'https://pornbox.com/media/{media_id}/stream', video_id, 'Getting manifest urls',
headers={
....
})
``` | from .common import InfoExtractor
from ..compat import functools
from ..utils import (
int_or_none,
parse_duration,
parse_iso8601,
qualities,
str_or_none,
traverse_obj,
url_or_none,
)
class PornboxIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?pornbox\.com/application/watch-page/... | @@ -0,0 +1,137 @@
+from .common import InfoExtractor
+from ..utils import (
+ parse_duration,
+ traverse_obj,
+ str_or_none,
+ int_or_none,
+ strip_or_none,
+ parse_iso8601,
+ qualities
+)
+
+
+class PornboxIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?pornbox\.com/application/watch-pag... | yt_dlp/extractor/pornbox.py | 26 | Python | 0.786 | suggestion | 211 | 42 | 114 | false | [Pornbox] New extractor | 7,386 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | niemands |
headers = {
'Accept': '*/*',
'Accept-Language': 'en-US;q=0.7,en;q=0.3',
'Accept-Encoding': 'gzip, deflate, br',
'X-Requested-With': 'XMLHttpRequest',
'DNT': '1',
'Connection': 'keep-alive',
'Sec-Fetch-Dest': 'empty',
... | ```suggestion
metadata['formats'] = [traverse_obj(q, {
'url': 'src',
'vbr': ('bitrate', {functools.partial(int_or_none, scale=1000)}),
'format_id': ('quality', {str_or_none}),
'quality': ('quality', {get_quality}),
'width': ('size', {lambda x: in... | from .common import InfoExtractor
from ..compat import functools
from ..utils import (
int_or_none,
parse_duration,
parse_iso8601,
qualities,
str_or_none,
traverse_obj,
url_or_none,
)
class PornboxIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?pornbox\.com/application/watch-page/... | @@ -0,0 +1,137 @@
+from .common import InfoExtractor
+from ..utils import (
+ parse_duration,
+ traverse_obj,
+ str_or_none,
+ int_or_none,
+ strip_or_none,
+ parse_iso8601,
+ qualities
+)
+
+
+class PornboxIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?pornbox\.com/application/watch-pag... | yt_dlp/extractor/pornbox.py | 26 | Python | 0.786 | suggestion | 392 | 29 | 114 | false | [Pornbox] New extractor | 7,386 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | niemands |
'age_limit': 18,
'availability': 'premium_only',
'duration': 2710,
'cast': 'count:3',
'tags': 'count:29',
'thumbnail': r're:^https?://cdn-image\.gtflixtv\.com.*\.jpg.*$',
'subtitles': 'count:6'
},
'params': {
... | ```suggestion
is_free_scene = traverse_obj(
public_data, ('price', 'is_available_for_free', {bool}), default=False)
``` | 'upload_date': '20210412',
'age_limit': 18,
'availability': 'premium_only',
'duration': 2710,
'cast': 'count:3',
'tags': 'count:29',
'thumbnail': r're:^https?://cdn-image\.gtflixtv\.com.*\.jpg.*$',
'subtitles': 'count:6'
... | @@ -0,0 +1,106 @@
+from .common import InfoExtractor
+from ..compat import functools
+from ..utils import (
+ parse_duration,
+ traverse_obj,
+ str_or_none,
+ int_or_none,
+ strip_or_none,
+ parse_iso8601,
+ qualities
+)
+
+
+class PornboxIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?po... | yt_dlp/extractor/pornbox.py | 26 | Python | 0.714 | suggestion | 142 | 51 | 51 | false | [Pornbox] New extractor | 7,386 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | niemands |
public_data = self._download_json(f'https://pornbox.com/contents/{video_id}', video_id)
subtitles = {country_code: [{
'url': f'https://pornbox.com/contents/{video_id}/subtitles/{country_code}',
'ext': 'srt'
}] for country_code in traverse_obj(public_data, ('subtitles', ... | ```suggestion
if not public_data.get('is_purchased') or not is_free_scene:
``` |
def _real_extract(self, url):
video_id = self._match_id(url)
public_data = self._download_json(f'https://pornbox.com/contents/{video_id}', video_id)
subtitles = {country_code: [{
'url': f'https://pornbox.com/contents/{video_id}/subtitles/{country_code}',
'ext': 'sr... | @@ -0,0 +1,106 @@
+from .common import InfoExtractor
+from ..compat import functools
+from ..utils import (
+ parse_duration,
+ traverse_obj,
+ str_or_none,
+ int_or_none,
+ strip_or_none,
+ parse_iso8601,
+ qualities
+)
+
+
+class PornboxIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?po... | yt_dlp/extractor/pornbox.py | 26 | Python | 0.571 | suggestion | 88 | 49 | 51 | false | [Pornbox] New extractor | 7,386 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | niemands |
video_id = self._match_id(url)
public_data = self._download_json(f'https://pornbox.com/contents/{video_id}', video_id)
subtitles = {country_code: [{
'url': f'https://pornbox.com/contents/{video_id}/subtitles/{country_code}',
'ext': 'srt'
}] for country_code in t... | ```suggestion
metadata = {
'id': video_id,
**traverse_obj(public_data, {
'title': ('scene_name', {str.strip}),
'description': ('small_description', {str.strip}),
'uploader': 'studio',
'duration': ('runtime', {parse_du... | def _real_extract(self, url):
video_id = self._match_id(url)
public_data = self._download_json(f'https://pornbox.com/contents/{video_id}', video_id)
subtitles = {country_code: [{
'url': f'https://pornbox.com/contents/{video_id}/subtitles/{country_code}',
'ext': 'srt... | @@ -0,0 +1,109 @@
+from .common import InfoExtractor
+from ..compat import functools
+from ..utils import (
+ parse_duration,
+ traverse_obj,
+ str_or_none,
+ int_or_none,
+ strip_or_none,
+ parse_iso8601,
+ qualities
+)
+
+
+class PornboxIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?po... | yt_dlp/extractor/pornbox.py | 26 | Python | 0.929 | security | 847 | 51 | 51 | false | [Pornbox] New extractor | 7,386 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | niemands |
from .common import InfoExtractor
from ..compat import functools
from ..utils import (
parse_duration,
traverse_obj,
str_or_none,
int_or_none,
strip_or_none,
parse_iso8601,
qualities
)
class PornboxIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?pornbox\.com/application/watch-page... | ```suggestion
parse_iso8601,
qualities,
url_or_none,
``` | from .common import InfoExtractor
from ..compat import functools
from ..utils import (
int_or_none,
parse_duration,
parse_iso8601,
qualities,
str_or_none,
traverse_obj,
url_or_none,
)
class PornboxIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?pornbox\.com/application/watch-page/... | @@ -0,0 +1,109 @@
+from .common import InfoExtractor
+from ..compat import functools
+from ..utils import (
+ parse_duration,
+ traverse_obj,
+ str_or_none,
+ int_or_none,
+ strip_or_none,
+ parse_iso8601,
+ qualities | yt_dlp/extractor/pornbox.py | 10 | Python | 0.571 | suggestion | 72 | 35 | 35 | false | [Pornbox] New extractor | 7,386 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | niemands |
public_data = self._download_json(f'https://pornbox.com/contents/{video_id}', video_id)
subtitles = {country_code: [{
'url': f'https://pornbox.com/contents/{video_id}/subtitles/{country_code}',
'ext': 'srt'
}] for country_code in traverse_obj(public_data, ('subtitles', ... | ```suggestion
'availability': self._availability(needs_auth=True, needs_premium=not is_free_scene),
``` | video_id = self._match_id(url)
public_data = self._download_json(f'https://pornbox.com/contents/{video_id}', video_id)
subtitles = {country_code: [{
'url': f'https://pornbox.com/contents/{video_id}/subtitles/{country_code}',
'ext': 'srt'
}] for country_code in t... | @@ -0,0 +1,112 @@
+from .common import InfoExtractor
+from ..compat import functools
+from ..utils import (
+ parse_duration,
+ traverse_obj,
+ str_or_none,
+ int_or_none,
+ parse_iso8601,
+ qualities,
+ url_or_none,
+)
+
+
+class PornboxIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?por... | yt_dlp/extractor/pornbox.py | 26 | Python | 0.714 | security | 117 | 51 | 51 | false | [Pornbox] New extractor | 7,386 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | niemands |
video_id = self._match_id(url)
public_data = self._download_json(f'https://pornbox.com/contents/{video_id}', video_id)
subtitles = {country_code: [{
'url': f'https://pornbox.com/contents/{video_id}/subtitles/{country_code}',
'ext': 'srt'
}] for country_code in t... | ```suggestion
'timestamp': parse_iso8601(traverse_obj(
public_data, ('studios', 'release_date'), 'publish_date')),
``` | def _real_extract(self, url):
video_id = self._match_id(url)
public_data = self._download_json(f'https://pornbox.com/contents/{video_id}', video_id)
subtitles = {country_code: [{
'url': f'https://pornbox.com/contents/{video_id}/subtitles/{country_code}',
'ext': 'srt... | @@ -0,0 +1,112 @@
+from .common import InfoExtractor
+from ..compat import functools
+from ..utils import (
+ parse_duration,
+ traverse_obj,
+ str_or_none,
+ int_or_none,
+ parse_iso8601,
+ qualities,
+ url_or_none,
+)
+
+
+class PornboxIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?por... | yt_dlp/extractor/pornbox.py | 26 | Python | 0.714 | suggestion | 149 | 51 | 51 | false | [Pornbox] New extractor | 7,386 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | niemands |
from .common import InfoExtractor
from ..compat import functools
from ..utils import (
parse_duration,
traverse_obj,
str_or_none,
int_or_none,
parse_iso8601,
qualities,
url_or_none,
)
class PornboxIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?pornbox\.com/application/watch-page/... | ```suggestion
int_or_none,
parse_duration,
parse_iso8601,
qualities,
str_or_none,
traverse_obj,
url_or_none,
``` | from .common import InfoExtractor
from ..compat import functools
from ..utils import (
int_or_none,
parse_duration,
parse_iso8601,
qualities,
str_or_none,
traverse_obj,
url_or_none,
)
class PornboxIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?pornbox\.com/application/watch-page/... | @@ -0,0 +1,112 @@
+from .common import InfoExtractor
+from ..compat import functools
+from ..utils import (
+ parse_duration,
+ traverse_obj,
+ str_or_none,
+ int_or_none,
+ parse_iso8601,
+ qualities,
+ url_or_none, | yt_dlp/extractor/pornbox.py | 10 | Python | 0.714 | suggestion | 148 | 35 | 35 | false | [Pornbox] New extractor | 7,386 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | niemands |
'age_limit': 18,
'availability': 'premium_only',
'duration': 2710,
'cast': 'count:3',
'tags': 'count:29',
'thumbnail': r're:^https?://cdn-image\.gtflixtv\.com.*\.jpg.*$',
'subtitles': 'count:6'
},
'params': {
... | ```suggestion
subtitles = {country_code: [{
'url': f'https://pornbox.com/contents/{video_id}/subtitles/{country_code}',
'ext': 'srt'
}] for country_code in traverse_obj(public_data, ('subtitles', ..., {str}))}
``` | 'upload_date': '20210412',
'age_limit': 18,
'availability': 'premium_only',
'duration': 2710,
'cast': 'count:3',
'tags': 'count:29',
'thumbnail': r're:^https?://cdn-image\.gtflixtv\.com.*\.jpg.*$',
'subtitles': 'count:6'
... | @@ -0,0 +1,112 @@
+from .common import InfoExtractor
+from ..compat import functools
+from ..utils import (
+ parse_duration,
+ traverse_obj,
+ str_or_none,
+ int_or_none,
+ parse_iso8601,
+ qualities,
+ url_or_none,
+)
+
+
+class PornboxIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?por... | yt_dlp/extractor/pornbox.py | 26 | Python | 0.786 | suggestion | 258 | 51 | 51 | false | [Pornbox] New extractor | 7,386 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | niemands |
}] for country_code in traverse_obj(public_data, ('subtitles', ...))}
is_free_scene = traverse_obj(
public_data, ('price', 'is_available_for_free', {bool}), default=False)
metadata = {
'id': video_id,
**traverse_obj(public_data, {
'title': ('... | ```suggestion
self.raise_login_required(
'You are either not logged in or do not have access to this scene', metadata_available=True)
``` | 'ext': 'srt'
}] for country_code in traverse_obj(public_data, ('subtitles', ..., {str}))}
is_free_scene = traverse_obj(
public_data, ('price', 'is_available_for_free', {bool}), default=False)
metadata = {
'id': video_id,
**traverse_obj(public_dat... | @@ -0,0 +1,112 @@
+from .common import InfoExtractor
+from ..compat import functools
+from ..utils import (
+ parse_duration,
+ traverse_obj,
+ str_or_none,
+ int_or_none,
+ parse_iso8601,
+ qualities,
+ url_or_none,
+)
+
+
+class PornboxIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?por... | yt_dlp/extractor/pornbox.py | 26 | Python | 0.714 | suggestion | 168 | 47 | 48 | false | [Pornbox] New extractor | 7,386 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | niemands |
public_data, ('studios', 'release_date'), 'publish_date')),
'availability': self._availability(needs_auth=True, needs_premium=not is_free_scene),
'subtitles': subtitles,
}
if not public_data.get('is_purchased') or not is_free_scene:
self.raise_login_r... | ```suggestion
metadata['formats'] = traverse_obj(stream_data, ('qualities', lambda _, v: v['src'], {
'url': 'src',
'vbr': ('bitrate', {functools.partial(int_or_none, scale=1000)}),
'format_id': ('quality', {str_or_none}),
'quality': ('quality', {get_quality})... | 'timestamp': parse_iso8601(traverse_obj(
public_data, ('studios', 'release_date'), 'publish_date')),
'availability': self._availability(needs_auth=True, needs_premium=not is_free_scene),
'subtitles': subtitles,
}
if not public_data.get('is_purchased')... | @@ -0,0 +1,112 @@
+from .common import InfoExtractor
+from ..compat import functools
+from ..utils import (
+ parse_duration,
+ traverse_obj,
+ str_or_none,
+ int_or_none,
+ parse_iso8601,
+ qualities,
+ url_or_none,
+)
+
+
+class PornboxIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?por... | yt_dlp/extractor/pornbox.py | 26 | Python | 0.786 | suggestion | 396 | 29 | 30 | false | [Pornbox] New extractor | 7,386 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | niemands |
def add_source_format(urlh):
nonlocal title
if not title:
title = self._search_regex(
r'\bfilename="([^"]+)"', urlh.headers.get('Content-Disposition'),
'title', default=None)
formats.append({
... | Should I use `get_element_html_by_id` to obtain the specific element I want so that the regex doesn't get confused with the login page, like `get_element_html_by_id('download-form', confirmation_webpage)`? | errnote='Unable to request %s file' % kind, fatal=False, data=data)
urlh = request_source_file(source_url, 'source')
if urlh:
def add_source_format(urlh):
nonlocal title
if not title:
title = self._search_regex(
... | @@ -237,14 +237,11 @@ def add_source_format(urlh):
urlh, url, video_id, note='Downloading confirmation page',
errnote='Unable to confirm download', fatal=False)
if confirmation_webpage:
- confirm = self._search_regex(
- ... | yt_dlp/extractor/googledrive.py | 26 | Python | 0.643 | question | 205 | 51 | 51 | false | [googledrive] Fix missing "source" format | 7,395 | yt-dlp/yt-dlp | 132,642 | Python | RfadnjdExt | RfadnjdExt |
if not title:
title = self._search_regex(
r'\bfilename="([^"]+)"', urlh.headers.get('Content-Disposition'),
'title', default=None)
formats.append({
# Use redirect URLs as download URLs in order to cal... | imo this just helps code readability
```suggestion
urlh = request_source_file(confirmed_source_url, 'confirmed source', data=b'')
``` | if not title:
title = self._search_regex(
r'\bfilename="([^"]+)"', urlh.headers.get('Content-Disposition'),
'title', default=None)
formats.append({
# Use redirect URLs as download URLs in order to cal... | @@ -237,14 +240,10 @@ def add_source_format(urlh):
urlh, url, video_id, note='Downloading confirmation page',
errnote='Unable to confirm download', fatal=False)
if confirmation_webpage:
- confirm = self._search_regex(
- ... | yt_dlp/extractor/googledrive.py | 26 | Python | 0.714 | suggestion | 160 | 51 | 51 | false | [googledrive] Fix missing "source" format | 7,395 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | RfadnjdExt |
import re
from ..utils import parse_duration, unescapeHTML
from .common import InfoExtractor
class Rule34VideoIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?rule34video\.com/videos/(?P<id>\d+)'
_TESTS = [
{
'url': 'https://rule34video.com/videos/3065157/shot-it-mmd-hmv/',
... | I would write it like this:
```suggestion
for col in get_elements_by_class('col', webpage):
label = clean_html(get_element_by_class('label', col))
if 'Uploaded By:' == label:
uploader = clean_html(get_element_by_class('name', col))
uploader_url = ext... | for col in get_elements_by_class('col', webpage):
label = clean_html(get_element_by_class('label', col))
if label == 'Categories:':
categories = list(map(clean_html, get_elements_by_class('item', col)))
elif label == 'Artist:':
creator = join_n... | @@ -52,6 +76,38 @@ def _real_extract(self, url):
title = self._html_extract_title(webpage)
thumbnail = self._html_search_regex(r'preview_url:\s+\'([^\']+)\'', webpage, 'thumbnail', default=None)
duration = self._html_search_regex(r'"icon-clock"></i>\s+<span>((?:\d+:?)+)', webpage, 'duration',... | yt_dlp/extractor/rule34video.py | 26 | Python | 0.857 | refactor | 684 | 66 | 41 | false | [rule34video] Extract more video information | 7,416 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | gmes78 |
import re
from ..utils import parse_duration, unescapeHTML
from .common import InfoExtractor
class Rule34VideoIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?rule34video\.com/videos/(?P<id>\d+)'
_TESTS = [
{
'url': 'https://rule34video.com/videos/3065157/shot-it-mmd-hmv/',
... | You can get the description from the JSON-LD:
```python
json_ld = self._search_json_ld(webpage, video_id, default={})
description = json_ld.get('description')
```
Though the description should be inlined in the returned info dict.
There are also a couple other variables that can be extracted here. I think they sh... |
def _real_extract(self, url):
video_id = self._match_id(url)
webpage = self._download_webpage(url, video_id)
formats = []
for mobj in re.finditer(r'<a[^>]+href="(?P<video_url>[^"]+download=true[^"]+)".*>(?P<ext>[^\s]+) (?P<quality>[^<]+)p</a>', webpage):
url, ext, qual... | @@ -52,6 +76,38 @@ def _real_extract(self, url):
title = self._html_extract_title(webpage)
thumbnail = self._html_search_regex(r'preview_url:\s+\'([^\']+)\'', webpage, 'thumbnail', default=None)
duration = self._html_search_regex(r'"icon-clock"></i>\s+<span>((?:\d+:?)+)', webpage, 'duration',... | yt_dlp/extractor/rule34video.py | 26 | Python | 0.857 | refactor | 626 | 66 | 51 | false | [rule34video] Extract more video information | 7,416 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | gmes78 |
import re
from ..utils import parse_duration, unescapeHTML
from .common import InfoExtractor
class Rule34VideoIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?rule34video\.com/videos/(?P<id>\d+)'
_TESTS = [
{
'url': 'https://rule34video.com/videos/3065157/shot-it-mmd-hmv/',
... | `creator` should be a string
```suggestion
'creator': join_nonempty(*artists, delim=', ')
```
Import `join_nonempty` from `..utils`. | 'title': 'title',
'view_count': 'view_count',
'like_count': 'like_count',
'duration': 'duration',
'timestamp': 'timestamp',
'description': 'description',
'thumbnail': ('thumbnails', 0, 'url'),
}))... | @@ -60,6 +116,13 @@ def _real_extract(self, url):
'thumbnail': thumbnail,
'duration': parse_duration(duration),
'age_limit': 18,
+ 'like_count': like_count,
+ 'comment_count': comment_count,
+ 'description': description,
+ 'creator': art... | yt_dlp/extractor/rule34video.py | 26 | Python | 0.786 | suggestion | 148 | 66 | 29 | false | [rule34video] Extract more video information | 7,416 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | gmes78 |
import re
from ..utils import parse_duration, unescapeHTML
from .common import InfoExtractor
class Rule34VideoIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?rule34video\.com/videos/(?P<id>\d+)'
_TESTS = [
{
'url': 'https://rule34video.com/videos/3065157/shot-it-mmd-hmv/',
... | I'd say keeping this as `[]` is fine in case there are no categories.
```suggestion
'categories': categories,
``` | 'duration': 'duration',
'timestamp': 'timestamp',
'description': 'description',
'thumbnail': ('thumbnails', 0, 'url'),
})),
'id': video_id,
'formats': formats,
'title': self._html_extract_title(webpage),
... | @@ -60,6 +116,13 @@ def _real_extract(self, url):
'thumbnail': thumbnail,
'duration': parse_duration(duration),
'age_limit': 18,
+ 'like_count': like_count,
+ 'comment_count': comment_count,
+ 'description': description,
+ 'creator': art... | yt_dlp/extractor/rule34video.py | 26 | Python | 0.714 | suggestion | 128 | 66 | 26 | false | [rule34video] Extract more video information | 7,416 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | gmes78 |
import re
from ..utils import parse_duration, unescapeHTML
from .common import InfoExtractor
class Rule34VideoIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?rule34video\.com/videos/(?P<id>\d+)'
_TESTS = [
{
'url': 'https://rule34video.com/videos/3065157/shot-it-mmd-hmv/',
... | Maybe this is a bit cleaner? Not sure
```suggestion
comment_count = int_or_none(self._search_regex(
r'Comments\s+\((\d+)\)', get_element_by_attribute('href', '#tab_comments', webpage),
'comment count', fatal=False))
```
`get_element_by_attribute` and `int_or_none` need to be import... | 'like_count': int,
'comment_count': int,
'timestamp': 1640131200,
'description': '',
'creator': 'WildeerStudio',
'upload_date': '20211222',
'uploader': 'CerZule',
'uploader_url': 'https://rule... | @@ -52,6 +76,38 @@ def _real_extract(self, url):
title = self._html_extract_title(webpage)
thumbnail = self._html_search_regex(r'preview_url:\s+\'([^\']+)\'', webpage, 'thumbnail', default=None)
duration = self._html_search_regex(r'"icon-clock"></i>\s+<span>((?:\d+:?)+)', webpage, 'duration',... | yt_dlp/extractor/rule34video.py | 26 | Python | 0.786 | suggestion | 323 | 66 | 51 | false | [rule34video] Extract more video information | 7,416 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | gmes78 |
join_nonempty,
parse_duration,
remove_end,
str_to_int,
unescapeHTML,
)
from .common import InfoExtractor
class Rule34VideoIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?rule34video\.com/videos/(?P<id>\d+)'
_TESTS = [
{
'url': 'https://rule34video.com/videos/306515... | No need to test for None
```suggestion
``` | join_nonempty,
parse_count,
parse_duration,
unescapeHTML,
)
from ..utils.traversal import traverse_obj
class Rule34VideoIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?rule34video\.com/videos/(?P<id>\d+)'
_TESTS = [
{
'url': 'https://rule34video.com/videos/3065157/shot... | @@ -17,6 +31,13 @@ class Rule34VideoIE(InfoExtractor):
'thumbnail': 'https://rule34video.com/contents/videos_screenshots/3065000/3065157/preview.jpg',
'duration': 347.0,
'age_limit': 18,
+ 'like_count': int,
+ 'comment_count': int,
+ ... | yt_dlp/extractor/rule34video.py | 26 | Python | 0.429 | suggestion | 44 | 51 | 51 | false | [rule34video] Extract more video information | 7,416 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | gmes78 |
'description': 'https://discord.gg/aBqPrHSHvv',
'creator': None,
'uploader': 'Sweet HMV',
'uploader_url': 'https://rule34video.com/members/22119/',
'categories': ['3D', 'MMD', 'iwara'],
'tags': 'count:14'
}
... | This value changed.
```suggestion
'tags': 'count:47'
```
Would mincount be better? | 'timestamp': 1639872000,
'description': 'https://discord.gg/aBqPrHSHvv',
'upload_date': '20211219',
'uploader': 'Sweet HMV',
'uploader_url': 'https://rule34video.com/members/22119/',
'categories': ['3D', 'MMD', 'iwara'],
... | @@ -30,6 +51,13 @@ class Rule34VideoIE(InfoExtractor):
'thumbnail': 'https://rule34video.com/contents/videos_screenshots/3065000/3065296/preview.jpg',
'duration': 938.0,
'age_limit': 18,
+ 'like_count': int,
+ 'comment_count': int,
+ ... | yt_dlp/extractor/rule34video.py | 26 | Python | 0.786 | question | 102 | 51 | 51 | false | [rule34video] Extract more video information | 7,416 | yt-dlp/yt-dlp | 132,642 | Python | seproDev | gmes78 |
uploader = clean_html(get_element_by_class('name', col))
uploader_url = extract_attributes(get_element_html_by_class('name', col) or '').get('href')
json_ld = self._search_json_ld(webpage, video_id, default={})
return {
**traverse_obj(json_ld, ({
... | ```suggestion
'like_count': parse_count(get_element_by_class('voters count', webpage)),
``` | return {
**traverse_obj(self._search_json_ld(webpage, video_id, default={}), ({
'title': 'title',
'view_count': 'view_count',
'like_count': 'like_count',
'duration': 'duration',
'timestamp': 'timestamp',
... | @@ -49,17 +82,49 @@ def _real_extract(self, url):
'quality': quality,
})
- title = self._html_extract_title(webpage)
- thumbnail = self._html_search_regex(r'preview_url:\s+\'([^\']+)\'', webpage, 'thumbnail', default=None)
- duration = self._html_search_regex(r'"icon... | yt_dlp/extractor/rule34video.py | 26 | Python | 0.714 | suggestion | 105 | 37 | 31 | false | [rule34video] Extract more video information | 7,416 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | gmes78 |
'upload_date': '20211222',
'uploader': 'CerZule',
'uploader_url': 'https://rule34video.com/members/36281/',
'categories': ['3D', 'Tomb Raider'],
'tags': 'mincount:40'
}
},
]
def _real_extract(self, url):
... | ```suggestion
categories, creator, uploader, uploader_url = [None] * 4
``` | 'uploader': 'CerZule',
'uploader_url': 'https://rule34video.com/members/36281/',
'categories': ['3D', 'Tomb Raider'],
'tags': 'mincount:40'
}
},
]
def _real_extract(self, url):
video_id = self._match_id(url)
web... | @@ -49,17 +82,49 @@ def _real_extract(self, url):
'quality': quality,
})
- title = self._html_extract_title(webpage)
- thumbnail = self._html_search_regex(r'preview_url:\s+\'([^\']+)\'', webpage, 'thumbnail', default=None)
- duration = self._html_search_regex(r'"icon... | yt_dlp/extractor/rule34video.py | 26 | Python | 0.571 | suggestion | 84 | 51 | 51 | false | [rule34video] Extract more video information | 7,416 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | gmes78 |
for mobj in re.finditer(r'<a[^>]+href="(?P<video_url>[^"]+download=true[^"]+)".*>(?P<ext>[^\s]+) (?P<quality>[^<]+)p</a>', webpage):
url, ext, quality = mobj.groups()
formats.append({
'url': url,
'ext': ext.lower(),
'quality': quality,
... | ```suggestion
return {
**traverse_obj(self._search_json_ld(webpage, video_id, default={}), ({
``` | for mobj in re.finditer(r'<a[^>]+href="(?P<video_url>[^"]+download=true[^"]+)".*>(?P<ext>[^\s]+) (?P<quality>[^<]+)p</a>', webpage):
url, ext, quality = mobj.groups()
formats.append({
'url': url,
'ext': ext.lower(),
'quality': quality,
... | @@ -49,17 +82,49 @@ def _real_extract(self, url):
'quality': quality,
})
- title = self._html_extract_title(webpage)
- thumbnail = self._html_search_regex(r'preview_url:\s+\'([^\']+)\'', webpage, 'thumbnail', default=None)
- duration = self._html_search_regex(r'"icon... | yt_dlp/extractor/rule34video.py | 26 | Python | 0.714 | suggestion | 120 | 51 | 50 | false | [rule34video] Extract more video information | 7,416 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | gmes78 |
for entry in self._rich_entries(content['richItemRenderer']):
yield entry
continuation_list[0] = self._extract_continuation(parent_renderer)
elif content.get('reportHistorySectionRenderer'): # https://www.youtube.com/reporthistory
... | ```suggestion
'richGridRenderer': lambda x: self._extract_entries(x, continuation_list),
``` | for entry in self._rich_entries(content['richItemRenderer']):
yield entry
continuation_list[0] = self._extract_continuation(parent_renderer)
elif content.get('reportHistorySectionRenderer'): # https://www.youtube.com/reporthistory
... | @@ -4898,7 +4898,8 @@ def _extract_entries(self, parent_renderer, continuation_list):
'videoRenderer': lambda x: [self._video_entry(x)],
'playlistRenderer': lambda x: self._grid_entries({'items': [{'playlistRenderer': x}]}),
'channelRenderer': lambda x: sel... | yt_dlp/extractor/youtube.py | 26 | Python | 0.786 | refactor | 114 | 51 | 51 | false | [extractor/youtube:tab] Support short renderers in playlists | 7,425 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | coletdjnz |
'tags': [],
'channel': '99 Percent Invisible',
'uploader_id': '@99percentinvisiblepodcast',
},
'playlist_count': 1,
}, {
# Releases tab, with rich entry playlistRenderers (same as Podcasts tab)
'url': 'https://www.youtube.com/@AHimitsu/releases',
... | ```suggestion
# FIXME: future: YouTube currently doesn't give continuation for this,
``` | 'tags': [],
'channel': '99 Percent Invisible',
'uploader_id': '@99percentinvisiblepodcast',
},
'playlist_count': 1,
}, {
# Releases tab, with rich entry playlistRenderers (same as Podcasts tab)
'url': 'https://www.youtube.com/@AHimitsu/releases',
... | @@ -6390,6 +6391,28 @@ class YoutubeTabIE(YoutubeTabBaseInfoExtractor):
'channel_is_verified': True,
},
'playlist_mincount': 10,
+ }, {
+ # Playlist with only shorts, shown as reel renderers
+ # FIXME future: YouTube currently doesn't give continuation for this, | yt_dlp/extractor/youtube.py | 26 | Python | 0.571 | suggestion | 98 | 51 | 51 | false | [extractor/youtube:tab] Support short renderers in playlists | 7,425 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | coletdjnz |
raise ExtractorError('There was a problem with the auth token')
self._TOKEN_EXPIRY = expiry
def _perform_login(self, username, password):
login = self._download_json(
'https://identitytoolkit.googleapis.com/v1/accounts:signInWithPassword', None,
'Logging in', que... | ```suggestion
login = self._download_json(
'https://identitytoolkit.googleapis.com/v1/accounts:signInWithPassword', None,
'Logging in', query=self._LOGIN_QUERY, headers=self._LOGIN_HEADERS, data=json.dumps({
'returnSecureToken': True,
'email': usernam... | expiry = traverse_obj(value, ({jwt_decode_hs256}, 'exp', {int_or_none}))
if not expiry:
raise ExtractorError('There was a problem with the auth token')
self._TOKEN_EXPIRY = expiry
def _perform_login(self, username, password):
login = self._download_json(
'htt... | @@ -61,30 +63,39 @@ def _TOKEN(self, value):
self._TOKEN_EXPIRY = expiry
def _perform_login(self, username, password):
- login = self._download_json(
- 'https://identitytoolkit.googleapis.com/v1/accounts:signInWithPassword', None,
- 'Logging in', query=self._LOGIN_QUERY, hea... | yt_dlp/extractor/wrestleuniverse.py | 26 | Python | 1 | refactor | 856 | 51 | 51 | false | [extractor/stacommu] Add extractors | 7,432 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | urectanc |
from ..utils import (
int_or_none,
traverse_obj,
url_or_none,
)
class StacommuBaseIE(WrestleUniverseBaseIE):
_NETRC_MACHINE = 'stacommu'
_API_HOST = 'api.stacommu.jp'
_LOGIN_QUERY = {'key': 'AIzaSyCR9czxhH2eWuijEhTNWBZ5MCcOYEUTAhg'}
_LOGIN_HEADERS = {
'Accept': '*/*',
'Cont... | When a login is required, we need to let the users know that `--username`/`--password`/`--netrc` is needed and cookies won't work. This is admittedly a bit cringe, but `method='password'` doesn't belong anywhere in the wrestleuniverse baseclass, so I think it's what we need to do
```suggestion
def _get_formats(... | from ..utils import (
int_or_none,
traverse_obj,
url_or_none,
)
class StacommuBaseIE(WrestleUniverseBaseIE):
_NETRC_MACHINE = 'stacommu'
_API_HOST = 'api.stacommu.jp'
_LOGIN_QUERY = {'key': 'AIzaSyCR9czxhH2eWuijEhTNWBZ5MCcOYEUTAhg'}
_LOGIN_HEADERS = {
'Accept': '*/*',
'Cont... | @@ -0,0 +1,143 @@
+import time
+
+from .wrestleuniverse import WrestleUniverseBaseIE
+from ..utils import (
+ int_or_none,
+ traverse_obj,
+ url_or_none,
+)
+
+
+class StacommuBaseIE(WrestleUniverseBaseIE):
+ _NETRC_MACHINE = 'stacommu'
+ _API_HOST = 'api.stacommu.jp'
+ _LOGIN_QUERY = {'key': 'AIzaSyC... | yt_dlp/extractor/stacommu.py | 26 | Python | 0.857 | suggestion | 568 | 51 | 51 | false | [extractor/stacommu] Add extractors | 7,432 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | urectanc |
data=data, headers=headers, query=query, fatal=fatal)
def _call_encrypted_api(self, video_id, param='', msg='API', data={}, query={}, fatal=True):
if not Cryptodome.RSA:
raise ExtractorError('pycryptodomex not found. Please install', expected=True)
private_key = Cryptodome.R... | IMO this is the better way
```py
def _download_metadata(self, url, video_id, lang, *props_keys):
``` | note=f'Downloading {msg} JSON', errnote=f'Failed to download {msg} JSON',
data=data, headers=headers, query=query, fatal=fatal)
def _call_encrypted_api(self, video_id, param='', msg='API', data={}, query={}, fatal=True):
if not Cryptodome.RSA:
raise ExtractorError('pycry... | @@ -137,12 +142,12 @@ def decrypt(data):
}, query=query, fatal=fatal)
return api_json, decrypt
- def _download_metadata(self, url, video_id, lang, props_key):
- metadata = self._call_api(video_id, msg='metadata', query={'al': lang or 'ja'}, auth=False, fatal=False)
+ def _download_metad... | yt_dlp/extractor/wrestleuniverse.py | 26 | Python | 0.786 | suggestion | 107 | 51 | 51 | false | [extractor/stacommu] Add extractors | 7,432 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | urectanc |
'timestamp': 1682506800,
'upload_date': '20230426',
'thumbnail': 'https://image.stacommu.jp/eMdXtEefR4kEyJJMpAFi7x/eMdXtEefR4kEyJJMpAFi7x',
'cast': 'count:55',
'duration': 312,
'hls_aes': {
'key': '6bbaf241b8e1fd9f59ecf546a70e4ae7',... | ~~after applying the suggestion to `_download_metadata`, we need to do this:~~
```py
url, video_id, 'ja', 'dehydratedState', 'queries', 0, 'state', 'data')
``` | 'info_dict': {
'id': '3hybMByUvzMEqndSeu5LpD',
'ext': 'mp4',
'title': 'スタプラフェス2023〜裏側ほぼ全部見せます〜#10',
'description': 'md5:85494488ccf1dfa1934accdeadd7b340',
'timestamp': 1682506800,
'upload_date': '20230426',
'thumbnail': 'https:/... | @@ -0,0 +1,143 @@
+import time
+
+from .wrestleuniverse import WrestleUniverseBaseIE
+from ..utils import (
+ int_or_none,
+ traverse_obj,
+ url_or_none,
+)
+
+
+class StacommuBaseIE(WrestleUniverseBaseIE):
+ _NETRC_MACHINE = 'stacommu'
+ _API_HOST = 'api.stacommu.jp'
+ _LOGIN_QUERY = {'key': 'AIzaSyC... | yt_dlp/extractor/stacommu.py | 26 | Python | 0.714 | suggestion | 174 | 51 | 51 | false | [extractor/stacommu] Add extractors | 7,432 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | urectanc |
_TESTS = [{
'url': 'https://www.wrestle-universe.com/en/videos/dp8mpjmcKfxzUhEHM2uFws',
'info_dict': {
'id': 'dp8mpjmcKfxzUhEHM2uFws',
'ext': 'mp4',
'title': 'The 3rd “Futari wa Princess” Max Heart Tournament',
'description': 'md5:318d5061e944797fbbb81... | revert after applying [suggestion](https://github.com/yt-dlp/yt-dlp/pull/7432#pullrequestreview-1501752546) for `_download_metadata`
```suggestion
metadata = self._download_metadata(url, video_id, lang, 'videoEpisodeFallbackData')
``` | class WrestleUniverseVODIE(WrestleUniverseBaseIE):
_VALID_URL = WrestleUniverseBaseIE._VALID_URL_TMPL % 'videos'
_TESTS = [{
'url': 'https://www.wrestle-universe.com/en/videos/dp8mpjmcKfxzUhEHM2uFws',
'info_dict': {
'id': 'dp8mpjmcKfxzUhEHM2uFws',
'ext': 'mp4',
... | @@ -182,7 +187,7 @@ class WrestleUniverseVODIE(WrestleUniverseBaseIE):
def _real_extract(self, url):
lang, video_id = self._match_valid_url(url).group('lang', 'id')
- metadata = self._download_metadata(url, video_id, lang, 'videoEpisodeFallbackData')
+ metadata = self._download_metadata(ur... | yt_dlp/extractor/wrestleuniverse.py | 26 | Python | 0.786 | suggestion | 245 | 51 | 51 | false | [extractor/stacommu] Add extractors | 7,432 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | urectanc |
}, {
'note': 'unencrypted HLS',
'url': 'https://www.wrestle-universe.com/en/lives/wUG8hP5iApC63jbtQzhVVx',
'info_dict': {
'id': 'wUG8hP5iApC63jbtQzhVVx',
'ext': 'mp4',
'title': 'GRAND PRINCESS \'22',
'description': 'md5:e4f43d0d4262de3952ff3483... | revert after applying [suggestion](https://github.com/yt-dlp/yt-dlp/pull/7432#pullrequestreview-1501752546) for `_download_metadata`
```suggestion
metadata = self._download_metadata(url, video_id, lang, 'eventFallbackData')
``` | },
'skip': 'No longer available',
}, {
'note': 'unencrypted HLS',
'url': 'https://www.wrestle-universe.com/en/lives/wUG8hP5iApC63jbtQzhVVx',
'info_dict': {
'id': 'wUG8hP5iApC63jbtQzhVVx',
'ext': 'mp4',
'title': 'GRAND PRINCESS \'22',
... | @@ -261,7 +266,7 @@ class WrestleUniversePPVIE(WrestleUniverseBaseIE):
def _real_extract(self, url):
lang, video_id = self._match_valid_url(url).group('lang', 'id')
- metadata = self._download_metadata(url, video_id, lang, 'eventFallbackData')
+ metadata = self._download_metadata(url, vide... | yt_dlp/extractor/wrestleuniverse.py | 26 | Python | 0.786 | suggestion | 238 | 51 | 51 | false | [extractor/stacommu] Add extractors | 7,432 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | urectanc |
data=data, headers=headers, query=query, fatal=fatal)
def _call_encrypted_api(self, video_id, param='', msg='API', data={}, query={}, fatal=True):
if not Cryptodome.RSA:
raise ExtractorError('pycryptodomex not found. Please install', expected=True)
private_key = Cryptodome.R... | revert. this would change the message for wrestleuniverse as well, and 'metadata' is just as accurate, no?
```suggestion
metadata = self._call_api(video_id, msg='metadata', query={'al': lang or 'ja'}, auth=False, fatal=False)
``` | note=f'Downloading {msg} JSON', errnote=f'Failed to download {msg} JSON',
data=data, headers=headers, query=query, fatal=fatal)
def _call_encrypted_api(self, video_id, param='', msg='API', data={}, query={}, fatal=True):
if not Cryptodome.RSA:
raise ExtractorError('pycry... | @@ -137,12 +142,12 @@ def decrypt(data):
}, query=query, fatal=fatal)
return api_json, decrypt
- def _download_metadata(self, url, video_id, lang, props_key):
- metadata = self._call_api(video_id, msg='metadata', query={'al': lang or 'ja'}, auth=False, fatal=False)
+ def _download_metad... | yt_dlp/extractor/wrestleuniverse.py | 26 | Python | 0.857 | security | 240 | 51 | 51 | false | [extractor/stacommu] Add extractors | 7,432 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | urectanc |
raise ExtractorError('pycryptodomex not found. Please install', expected=True)
private_key = Cryptodome.RSA.generate(2048)
cipher = Cryptodome.PKCS1_OAEP.new(private_key, hashAlgo=Cryptodome.SHA1)
def decrypt(data):
if not data:
return None
tr... | ```suggestion
metadata = traverse_obj(nextjs_data, ('props', 'pageProps', *variadic(props_keys), {dict})) or {}
``` | if not Cryptodome.RSA:
raise ExtractorError('pycryptodomex not found. Please install', expected=True)
private_key = Cryptodome.RSA.generate(2048)
cipher = Cryptodome.PKCS1_OAEP.new(private_key, hashAlgo=Cryptodome.SHA1)
def decrypt(data):
if not data:
... | @@ -137,12 +142,12 @@ def decrypt(data):
}, query=query, fatal=fatal)
return api_json, decrypt
- def _download_metadata(self, url, video_id, lang, props_key):
- metadata = self._call_api(video_id, msg='metadata', query={'al': lang or 'ja'}, auth=False, fatal=False)
+ def _download_metad... | yt_dlp/extractor/wrestleuniverse.py | 26 | Python | 0.714 | suggestion | 129 | 51 | 51 | false | [extractor/stacommu] Add extractors | 7,432 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | urectanc |
self.cache.store(self._NETRC_MACHINE, 'device_id', self._DEVICE_ID)
def _refresh_token(self):
refresh = self._download_json(
'https://securetoken.googleapis.com/v1/token', None, 'Refreshing token',
query=self._LOGIN_QUERY, data=urlencode_postdata({
'grant_ty... | This was fine to do; for the best even. Sorry if I was being confusing w/my earlier comment
```suggestion
if auth and self._TOKEN:
``` |
self.cache.store(self._NETRC_MACHINE, 'device_id', self._DEVICE_ID)
def _refresh_token(self):
refresh = self._download_json(
'https://securetoken.googleapis.com/v1/token', None, 'Refreshing token',
query=self._LOGIN_QUERY, data=urlencode_postdata({
'grant_ty... | @@ -113,7 +114,7 @@ def _call_api(self, video_id, param='', msg='API', auth=True, data=None, query={
if data:
headers['Content-Type'] = 'application/json;charset=utf-8'
data = json.dumps(data, separators=(',', ':')).encode()
- if auth and self._TOKEN:
+ if auth: | yt_dlp/extractor/wrestleuniverse.py | 26 | Python | 0.714 | security | 145 | 51 | 51 | false | [extractor/stacommu] Add extractors | 7,432 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | urectanc |
def decrypt(data):
if not data:
return None
try:
return cipher.decrypt(base64.b64decode(data)).decode()
except (ValueError, binascii.Error) as e:
raise ExtractorError(f'Could not decrypt data: {e}')
token = base64.b64e... | ```suggestion
metadata = traverse_obj(nextjs_data, (
('props', 'pageProps', *variadic(props_keys, (str, bytes, dict, set)), {dict})) or {}
``` |
def decrypt(data):
if not data:
return None
try:
return cipher.decrypt(base64.b64decode(data)).decode()
except (ValueError, binascii.Error) as e:
raise ExtractorError(f'Could not decrypt data: {e}')
token = base64.b64e... | @@ -143,11 +144,14 @@ def decrypt(data):
return api_json, decrypt
def _download_metadata(self, url, video_id, lang, props_keys):
- metadata = self._call_api(video_id, msg='video information', query={'al': lang or 'ja'}, auth=False, fatal=False)
+ metadata = self._call_api(video_id, msg='me... | yt_dlp/extractor/wrestleuniverse.py | 26 | Python | 0.714 | suggestion | 173 | 51 | 51 | false | [extractor/stacommu] Add extractors | 7,432 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | urectanc |
else:
mobj = re.search(r'<a href="(?P<url>http://www\.youtube\.com/watch\?v=[^"]+)"><span><strong>External Link:</strong>',
webpage)
if mobj is None:
mobj = re.search(r'<iframe width="100%" src="(?P<url>//www\.youtube-nocookie\.com/embed/[^?"]... | I think we also wanna do this so the test you added is properly detected as a video instead of audio-only
```suggestion
video = mobj.group('type') == 'Video' or traverse_obj(
urls_info, (0, ('contentType', 'MIMEType')), get_all=False) == 'video/mp4'
``` | else:
mobj = re.search(r'<a href="(?P<url>http://www\.youtube\.com/watch\?v=[^"]+)"><span><strong>External Link:</strong>',
webpage)
if mobj is None:
mobj = re.search(r'<iframe width="100%" src="(?P<url>//www\.youtube-nocookie\.com/embed/[^?"]... | @@ -121,7 +131,7 @@ def _real_extract(self, url):
urls_info = self._parse_json(
mobj.group('json_data'), video_id, transform_source=js_to_json)
youtube = mobj.group('type') == 'YouTube'
- video = mobj.group('type') == 'Video' or urls_info[0]['contentType'] == 'video... | yt_dlp/extractor/abc.py | 26 | Python | 1 | suggestion | 285 | 51 | 51 | false | [extractor/abc] Fix #6433 by add 2 re patterns | 7,434 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | meliber |
yield self.url_result(
f'{self._BASE_URL}/{lang}watch/{episode_response["id"]}',
CrunchyrollBetaIE, **CrunchyrollBetaIE._transform_episode_response(episode_response))
return self.playlist_result(
entries(), internal_id,
... | add the new test instead of replacing the old one | yield self.url_result(
f'{self._BASE_URL}/{lang}watch/{episode_response["id"]}',
CrunchyrollBetaIE, **CrunchyrollBetaIE._transform_episode_response(episode_response))
return self.playlist_result(
entries(), internal_id,
... | @@ -490,18 +490,18 @@ class CrunchyrollMusicIE(CrunchyrollBaseIE):
_VALID_URL = r'''(?x)
https?://(?:www\.)?crunchyroll\.com/
(?P<lang>(?:\w{2}(?:-\w{2})?/)?)
- watch/(?P<type>concert|musicvideo)/(?P<id>\w{10})'''
+ watch/(?P<type>concert|musicvideo)/(?P<id>\w+)'''
_TESTS = [{
... | yt_dlp/extractor/crunchyroll.py | 26 | Python | 0.143 | suggestion | 49 | 51 | 51 | false | Modify the regular expression so that it allows downloading videos wi… | 7,439 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | AmanSal1 |
},
'features': {
'graphql_is_translatable_rweb_tweet_is_translatable_enabled': False,
'interactive_text_enabled': True,
'responsive_web_edit_tweet_api_enabled': True,
'responsive_web_enhance_cards_enabled': True,
're... | to_screen is fine, but add `_LOGIN_HINT` too imo | if isinstance(e.cause, urllib.error.HTTPError) and e.cause.code == 404:
self.raise_login_required('Requested tweet may only be available when logged in')
raise
else:
status = self._graphql_to_legacy(
self._call_graphql_api('zZXycP0V... | @@ -1136,19 +1115,22 @@ def _build_graphql_query(self, media_id):
def _real_extract(self, url):
twid, selected_index = self._match_valid_url(url).group('id', 'index')
- if self._configuration_arg('legacy_api') and not self.is_logged_in:
- status = traverse_obj(self._call_api(f'statuses... | yt_dlp/extractor/twitter.py | 26 | Python | 0.214 | suggestion | 48 | 51 | 51 | false | [extractor/twitter] Fix unauthenticated extraction | 7,476 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | bashonly |
return self.url_result(
'https://twitter.com/statuses/' + status_id,
TwitterIE.ie_key(), status_id)
class TwitterIE(TwitterBaseIE):
IE_NAME = 'twitter'
_VALID_URL = TwitterBaseIE._BASE_REGEX + r'(?:(?:i/web|[^/]+)/status|statuses)/(?P<id>\d+)(?:/(?:video|photo)/(?P<index>\d+))?... | ```suggestion
# comment_count, repost_count, view_count are only available with auth
```
All None check can be removed. This one comment is sufficient. | return self.url_result(
'https://twitter.com/statuses/' + status_id,
TwitterIE.ie_key(), status_id)
class TwitterIE(TwitterBaseIE):
IE_NAME = 'twitter'
_VALID_URL = TwitterBaseIE._BASE_REGEX + r'(?:(?:i/web|[^/]+)/status|statuses)/(?P<id>\d+)(?:/(?:video|photo)/(?P<index>\d+))?... | @@ -471,10 +453,10 @@ class TwitterIE(TwitterBaseIE):
'timestamp': 1442188653,
'upload_date': '20150913',
'uploader_url': 'https://twitter.com/freethenipple',
- 'comment_count': int,
- 'repost_count': int,
+ 'comment_count': None, # only available... | yt_dlp/extractor/twitter.py | 26 | Python | 0.786 | security | 168 | 51 | 51 | false | [extractor/twitter] Fix unauthenticated extraction | 7,476 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | bashonly |
r'link\.theplatform\.com/s/((?:[^/?#&]+/)+[^/?#&]+)', smil_url, 'path')
smil_url += '?' if '?' not in smil_url else '&' + 'formats=m3u,mpeg4'
elif mobj.group('config'):
config_url = url + '&form=json'
config_url = config_url.replace('swf/', 'config/')
... | Truncating the query string after the first param seems pretty blunt and inexact
Can we narrow down the conditions when trying to request the url as m3u8 is necessary? Is it a specific URL format? Query params? Can you show an example URL that this works with (e.g. a url result from CBC)?
| webpage, 'smil url', group='url')
path = self._search_regex(
r'link\.theplatform\.com/s/((?:[^/?#&]+/)+[^/?#&]+)', smil_url, 'path')
smil_url += '?' if '?' not in smil_url else '&' + 'formats=m3u,mpeg4'
elif mobj.group('config'):
config_url = u... | @@ -297,6 +300,27 @@ def _real_extract(self, url):
formats, subtitles = self._extract_theplatform_smil(smil_url, video_id)
+ note = 'Downloading m3u8 information'
+ errnote = 'Failed to download m3u8 information'
+ # on at least one site reading just the SMIL data misses some formats a... | yt_dlp/extractor/theplatform.py | 26 | Python | 0.429 | question | 294 | 51 | 51 | false | CBCPlayer | 7,484 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | trainman261 |
smil_url += '?' if '?' not in smil_url else '&' + 'formats=m3u,mpeg4'
elif mobj.group('config'):
config_url = url + '&form=json'
config_url = config_url.replace('swf/', 'config/')
config_url = config_url.replace('onsite/', 'onsite/config/')
config = se... | Another reason we should do this only conditionally: ThePlatform can serve direct mp4/mp3/etc links. Calling `_download_webpage_handle` on a mangled URL could result in the extractor downloading a 100MB+ mp4 file.
Alternatively we could send only a `HEADRequest` and check the mimetype in the response headers | path = self._search_regex(
r'link\.theplatform\.com/s/((?:[^/?#&]+/)+[^/?#&]+)', smil_url, 'path')
smil_url += '?' if '?' not in smil_url else '&' + 'formats=m3u,mpeg4'
elif mobj.group('config'):
config_url = url + '&form=json'
config_url = config_... | @@ -297,6 +300,27 @@ def _real_extract(self, url):
formats, subtitles = self._extract_theplatform_smil(smil_url, video_id)
+ note = 'Downloading m3u8 information'
+ errnote = 'Failed to download m3u8 information'
+ # on at least one site reading just the SMIL data misses some formats a... | yt_dlp/extractor/theplatform.py | 26 | Python | 0.786 | refactor | 313 | 51 | 51 | false | CBCPlayer | 7,484 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | trainman261 |
else:
release_url = 'http://link.theplatform.com/s/%s?mbr=true' % path
smil_url = release_url + '&formats=MPEG4&manifest=f4m'
else:
smil_url = 'http://link.theplatform.com/s/%s?mbr=true' % path
sig = smuggled_data.get('sig')
if sig:
... | use `determine_ext` for something like this
and use single quotes for all strings | if 'releaseUrl' in config:
release_url = config['releaseUrl']
else:
release_url = 'http://link.theplatform.com/s/%s?mbr=true' % path
smil_url = release_url + '&formats=MPEG4&manifest=f4m'
else:
smil_url = 'http://link.theplatform.co... | @@ -297,6 +300,27 @@ def _real_extract(self, url):
formats, subtitles = self._extract_theplatform_smil(smil_url, video_id)
+ note = 'Downloading m3u8 information'
+ errnote = 'Failed to download m3u8 information'
+ # on at least one site reading just the SMIL data misses some formats a... | yt_dlp/extractor/theplatform.py | 26 | Python | 0.429 | suggestion | 84 | 51 | 51 | false | CBCPlayer | 7,484 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | trainman261 |
import re
import time
import hmac
import binascii
import hashlib
from .once import OnceIE
from .adobepass import AdobePassIE
from ..networking import Request
from ..utils import (
determine_ext,
ExtractorError,
float_or_none,
int_or_none,
parse_qs,
unsmuggle_url,
update_url_query,
xpat... | ```suggestion
)
from ..networking import HEADRequest
``` | import re
import time
import hmac
import binascii
import hashlib
from .once import OnceIE
from .adobepass import AdobePassIE
from ..networking import Request
from ..utils import (
determine_ext,
ExtractorError,
float_or_none,
int_or_none,
parse_qs,
unsmuggle_url,
update_url_query,
xpat... | @@ -19,6 +19,8 @@
xpath_with_ns,
mimetype2ext,
find_xpath_attr,
+ urlhandle_detect_ext,
+ HEADRequest,
) | yt_dlp/extractor/theplatform.py | 24 | Python | 0.571 | suggestion | 59 | 49 | 49 | false | CBCPlayer | 7,484 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | trainman261 |
formats, subtitles = self._extract_theplatform_smil(smil_url, video_id)
note = 'Downloading m3u8 information'
errnote = 'Failed to download m3u8 information'
# on at least one site reading just the SMIL data misses some formats as well as subtitles.
# Therefore also read the m3u... | `update_url` can be imported from utils
```suggestion
# With some sites, extracting from manifest URL directly yields more formats
m3u8_url = update_url(url, query='mbr=true&manifest=m3u', fragment=None)
ext = urlhandle_detect_ext(self._request_webpage(
HEADRequest(m3u8_url), vi... | formats, subtitles = self._extract_theplatform_smil(smil_url, video_id)
# With some sites, manifest URL must be forced to extract HLS formats
if not traverse_obj(formats, lambda _, v: v['format_id'].startswith('hls')):
m3u8_url = update_url(url, query='mbr=true&manifest=m3u', fragme... | @@ -297,6 +302,30 @@ def _real_extract(self, url):
formats, subtitles = self._extract_theplatform_smil(smil_url, video_id)
+ note = 'Downloading m3u8 information'
+ errnote = 'Failed to download m3u8 information'
+ # on at least one site reading just the SMIL data misses some formats a... | yt_dlp/extractor/theplatform.py | 26 | Python | 1 | refactor | 628 | 51 | 51 | false | CBCPlayer | 7,484 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | trainman261 |
import re
import time
import hmac
import binascii
import hashlib
from .once import OnceIE
from .adobepass import AdobePassIE
from ..networking import Request
from ..utils import (
determine_ext,
ExtractorError,
float_or_none,
int_or_none,
parse_qs,
unsmuggle_url,
update_url_query,
xpat... | ```suggestion
update_url,
urlhandle_detect_ext,
``` | import re
import time
import hmac
import binascii
import hashlib
from .once import OnceIE
from .adobepass import AdobePassIE
from ..networking import Request
from ..utils import (
determine_ext,
ExtractorError,
float_or_none,
int_or_none,
parse_qs,
unsmuggle_url,
update_url_query,
xpat... | @@ -19,7 +19,9 @@
xpath_with_ns,
mimetype2ext,
find_xpath_attr,
+ urlhandle_detect_ext, | yt_dlp/extractor/theplatform.py | 24 | Python | 0.714 | suggestion | 62 | 49 | 49 | false | CBCPlayer | 7,484 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | trainman261 |
config_url = url + '&form=json'
config_url = config_url.replace('swf/', 'config/')
config_url = config_url.replace('onsite/', 'onsite/config/')
config = self._download_json(config_url, video_id, 'Downloading config')
if 'releaseUrl' in config:
... | Before this patch, ThePlatform extraction for CBC videos yielded only the direct http format, which is why the additional m3u8 formats check is needed.
There are other sites where the m3u8 formats are already extracted initially, and we would be duplicating the formats by extracting them again here.
So we could d... | elif mobj.group('config'):
config_url = url + '&form=json'
config_url = config_url.replace('swf/', 'config/')
config_url = config_url.replace('onsite/', 'onsite/config/')
config = self._download_json(config_url, video_id, 'Downloading config')
if 'rele... | @@ -295,6 +301,15 @@ def _real_extract(self, url):
formats, subtitles = self._extract_theplatform_smil(smil_url, video_id)
+ # With some sites, extracting from manifest URL directly yields more formats
+ m3u8_url = update_url(url, query='mbr=true&manifest=m3u', fragment=None)
+ ext = u... | yt_dlp/extractor/theplatform.py | 26 | Python | 1 | refactor | 1,372 | 51 | 51 | false | CBCPlayer | 7,484 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | trainman261 |
import re
import time
import hmac
import binascii
import hashlib
from .once import OnceIE
from .adobepass import AdobePassIE
from ..networking import Request
from ..utils import (
determine_ext,
ExtractorError,
float_or_none,
int_or_none,
parse_qs,
unsmuggle_url,
update_url_query,
xpat... | ```suggestion
find_xpath_attr,
traverse_obj,
update_url,
``` | import re
import time
import hmac
import binascii
import hashlib
from .once import OnceIE
from .adobepass import AdobePassIE
from ..networking import Request
from ..utils import (
determine_ext,
ExtractorError,
float_or_none,
int_or_none,
parse_qs,
unsmuggle_url,
update_url_query,
xpat... | @@ -19,7 +19,10 @@
xpath_with_ns,
mimetype2ext,
find_xpath_attr,
+ update_url, | yt_dlp/extractor/theplatform.py | 22 | Python | 0.571 | suggestion | 76 | 47 | 47 | false | CBCPlayer | 7,484 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | trainman261 |
elif mobj.group('config'):
config_url = url + '&form=json'
config_url = config_url.replace('swf/', 'config/')
config_url = config_url.replace('onsite/', 'onsite/config/')
config = self._download_json(config_url, video_id, 'Downloading config')
if 'rele... | ```suggestion
m3u8_fmts, m3u8_subs = self._extract_m3u8_formats_and_subtitles(
m3u8_url, video_id, m3u8_id='hls', fatal=False)
``` | elif mobj.group('config'):
config_url = url + '&form=json'
config_url = config_url.replace('swf/', 'config/')
config_url = config_url.replace('onsite/', 'onsite/config/')
config = self._download_json(config_url, video_id, 'Downloading config')
if 'rele... | @@ -295,6 +302,16 @@ def _real_extract(self, url):
formats, subtitles = self._extract_theplatform_smil(smil_url, video_id)
+ # With some sites, manifest URL must be forced to extract HLS formats
+ if not traverse_obj(formats, lambda _, v: v['format_id'].startswith('hls')):
+ m3u8_u... | yt_dlp/extractor/theplatform.py | 26 | Python | 0.786 | refactor | 169 | 51 | 51 | false | CBCPlayer | 7,484 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | trainman261 |
'uploader': 'CBCC-NEW',
'chapters': [
{'end_time': 1196.0, 'start_time': 0.0},
{'end_time': 1398.0, 'start_time': 1196.0},
{'end_time': 1753.0, 'start_time': 1398.0},
{'end_time': 2395.0, 'start_time': 1753.0},
{'end... | ```suggestion
'_format_sort_fields': ('res', 'proto'), # Prioritize direct http formats over HLS
``` | return {
'_type': 'url_transparent',
'ie_key': 'ThePlatform',
'url': smuggle_url(
'http://link.theplatform.com/s/ExhSPC/media/guid/2655402169/%s?mbr=true&formats=MPEG4,FLV,MP3' % video_id, {
'force_smil_url': True
}),
... | @@ -199,6 +238,10 @@ def _real_extract(self, url):
'force_smil_url': True
}),
'id': video_id,
+ # needed because the m3u8 stream bandwidth info is wrong at least sometimes,
+ # making the format chooser prefer a supposedly higher quality file when... | yt_dlp/extractor/cbc.py | 26 | Python | 0.714 | suggestion | 115 | 51 | 51 | false | CBCPlayer | 7,484 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | trainman261 |
'id': '2249992771553',
'ext': 'mp4',
'title': 'The National | Women’s soccer pay, Florida seawater, Swift quake',
'description': 'July 28, 2023 | Canada’s women’s soccer team reaches an interim deal on compensation but says the fight is far from over. The water temperatur... | comment could use some more brevity
`md5` for long description
`count` for chapters
```suggestion
}, {
# Has subtitles
# These broadcasts expire after ~1 month, can find new test URL here:
# https://www.cbc.ca/player/news/TV%20Shows/The%20National/Latest%20Broadcast
'url': 'h... | 'ext': 'mp4',
'title': 'The National | Women’s soccer pay, Florida seawater, Swift quake',
'description': 'md5:adba28011a56cfa47a080ff198dad27a',
'timestamp': 1690596000,
'duration': 2716.333,
'subtitles': {'eng': [{'ext': 'vtt', 'protocol': 'm3u8_... | @@ -186,6 +189,42 @@ class CBCPlayerIE(InfoExtractor):
'timestamp': 1320410746,
'upload_date': '20111104',
'uploader': 'CBCC-NEW',
+ 'thumbnail': 'https://thumbnails.cbc.ca/maven_legacy/thumbnails/277/67/cancer_852x480_2164412612.jpg',
+ 'chapters': [],
+ ... | yt_dlp/extractor/cbc.py | 26 | Python | 1 | suggestion | 1,054 | 51 | 51 | false | CBCPlayer | 7,484 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | trainman261 |
'timestamp': 1383239700,
'upload_date': '20131031',
'uploader': 'CBSI-NEW',
},
'params': {
# rtmp download
'skip_download': True,
},
'skip': '404 Not Found',
}, {
# from http://www.cnet.com/videos/tesla-model-s-a-sec... | this is fine
```suggestion
'skip': '404 Not Found',
``` | 'timestamp': 1383239700,
'upload_date': '20131031',
'uploader': 'CBSI-NEW',
},
'params': {
# rtmp download
'skip_download': True,
},
'skip': '404 Not Found',
}, {
# from http://www.cnet.com/videos/tesla-model-s-a-sec... | @@ -162,7 +166,8 @@ class ThePlatformIE(ThePlatformBaseIE, AdobePassIE):
'params': {
# rtmp download
'skip_download': True,
- }
+ },
+ 'skip': 'cnet no longer seems to use theplatform, at least not in this video', | yt_dlp/extractor/theplatform.py | 26 | Python | 0.571 | suggestion | 66 | 51 | 51 | false | CBCPlayer | 7,484 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | trainman261 |
# from http://www.cnet.com/videos/tesla-model-s-a-second-step-towards-a-cleaner-motoring-future/
'url': 'http://link.theplatform.com/s/kYEXFC/22d_qsQ6MIRT',
'info_dict': {
'id': '22d_qsQ6MIRT',
'ext': 'flv',
'description': 'md5:ac330c9258c04f9d7512cf26b9595409... | ```suggestion
'skip': '404 Not Found',
``` | # from http://www.cnet.com/videos/tesla-model-s-a-second-step-towards-a-cleaner-motoring-future/
'url': 'http://link.theplatform.com/s/kYEXFC/22d_qsQ6MIRT',
'info_dict': {
'id': '22d_qsQ6MIRT',
'ext': 'flv',
'description': 'md5:ac330c9258c04f9d7512cf26b9595409... | @@ -171,7 +176,8 @@ class ThePlatformIE(ThePlatformBaseIE, AdobePassIE):
'description': 'md5:644ad9188d655b742f942bf2e06b002d',
'title': 'HIGHLIGHTS: USA bag first ever series Cup win',
'uploader': 'EGSM',
- }
+ },
+ 'skip': 'no clue where this comes from, and... | yt_dlp/extractor/theplatform.py | 26 | Python | 0.571 | suggestion | 52 | 51 | 51 | false | CBCPlayer | 7,484 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | trainman261 |
'info_dict': {
'id': 'yMBg9E8KFxZD',
'ext': 'mp4',
'description': 'md5:644ad9188d655b742f942bf2e06b002d',
'title': 'HIGHLIGHTS: USA bag first ever series Cup win',
'uploader': 'EGSM',
},
'skip': 'no clue where this comes from, and doesn... | ```suggestion
'skip': '404 Not Found',
``` | 'info_dict': {
'id': 'yMBg9E8KFxZD',
'ext': 'mp4',
'description': 'md5:644ad9188d655b742f942bf2e06b002d',
'title': 'HIGHLIGHTS: USA bag first ever series Cup win',
'uploader': 'EGSM',
},
'skip': '404 Not Found',
}, {
'url': ... | @@ -189,6 +195,7 @@ class ThePlatformIE(ThePlatformBaseIE, AdobePassIE):
'upload_date': '20150701',
'uploader': 'NBCU-NEWS',
},
+ 'skip': 'Error: Player PID "nbcNewsOffsite" is disabled. Again, no clue where this comes from, someone please fix.' | yt_dlp/extractor/theplatform.py | 26 | Python | 0.571 | suggestion | 52 | 51 | 51 | false | CBCPlayer | 7,484 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | trainman261 |
r'link\.theplatform\.com/s/((?:[^/?#&]+/)+[^/?#&]+)', smil_url, 'path')
smil_url += '?' if '?' not in smil_url else '&' + 'formats=m3u,mpeg4'
elif mobj.group('config'):
config_url = url + '&form=json'
config_url = config_url.replace('swf/', 'config/')
... | so `urlhandle_detect_ext(self._request_webpage(...))` is fatal, needs to be fixed
also adjust the errnote so that the test's expected warning can be '`No HLS formats found`'
```suggestion
urlh = self._request_webpage(
HEADRequest(m3u8_url), video_id, 'Checking for HLS formats', 'No HLS... | r'link\.theplatform\.com/s/((?:[^/?#&]+/)+[^/?#&]+)', smil_url, 'path')
smil_url += '?' if '?' not in smil_url else '&' + 'formats=m3u,mpeg4'
elif mobj.group('config'):
config_url = url + '&form=json'
config_url = config_url.replace('swf/', 'config/')
... | @@ -295,6 +302,17 @@ def _real_extract(self, url):
formats, subtitles = self._extract_theplatform_smil(smil_url, video_id)
+ # With some sites, manifest URL must be forced to extract HLS formats
+ if not traverse_obj(formats, lambda _, v: v['format_id'].startswith('hls')):
+ m3u8_u... | yt_dlp/extractor/theplatform.py | 26 | Python | 0.929 | suggestion | 418 | 51 | 51 | false | CBCPlayer | 7,484 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | trainman261 |
elif mobj.group('config'):
config_url = url + '&form=json'
config_url = config_url.replace('swf/', 'config/')
config_url = config_url.replace('onsite/', 'onsite/config/')
config = self._download_json(config_url, video_id, 'Downloading config')
if 'rele... | ```suggestion
if urlh and urlhandle_detect_ext(urlh) == 'm3u8':
``` | elif mobj.group('config'):
config_url = url + '&form=json'
config_url = config_url.replace('swf/', 'config/')
config_url = config_url.replace('onsite/', 'onsite/config/')
config = self._download_json(config_url, video_id, 'Downloading config')
if 'rele... | @@ -295,6 +302,18 @@ def _real_extract(self, url):
formats, subtitles = self._extract_theplatform_smil(smil_url, video_id)
+ # With some sites, manifest URL must be forced to extract HLS formats
+ if not traverse_obj(formats, lambda _, v: v['format_id'].startswith('hls')):
+ m3u8_u... | yt_dlp/extractor/theplatform.py | 26 | Python | 0.714 | suggestion | 81 | 51 | 51 | false | CBCPlayer | 7,484 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | trainman261 |
def get_entries(page_data):
for entry in page_data.get('data', []):
yield self.url_result(f'https://www.bilibili.com/audio/au{entry["id"]}', BilibiliAudioIE, entry['id'])
metadata, paged_list = self._extract_playlist(fetch_page, get_metadata, get_entries)
return self... | ```suggestion
_VALID_URL = r'https?://space\.bilibili\.com/(?P<mid>\d+)/channel/collectiondetail/?\?sid=(?P<sid>\d+)'
``` | raise
if response['code'] == -401:
raise ExtractorError(
'Request is blocked by server (401), please add cookies, wait and try later.', expected=True)
return response['data']
def get_metadata(page_data):
page_size = page_da... | @@ -633,13 +634,35 @@ def get_entries(page_data):
return self.playlist_result(paged_list, playlist_id)
-class BilibiliSpacePlaylistIE(BilibiliSpaceBaseIE):
- _VALID_URL = r'https?://space.bilibili\.com/(?P<mid>\d+)/channel/collectiondetail\?sid=(?P<sid>\d+)'
+class BilibiliSpaceListBaseIE(BilibiliSpaceB... | yt_dlp/extractor/bilibili.py | 26 | Python | 0.714 | suggestion | 127 | 51 | 51 | false | [extractor/bilibili] support mutiple playlists including series, favorites and watchlater | 7,518 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | c-basalt |
'thumbnail': "https://archive.biliimg.com/bfs/archive/e0e543ae35ad3df863ea7dea526bc32e70f4c091.jpg",
},
'playlist_mincount': 31,
}]
def _real_extract(self, url):
mid, sid = self._match_valid_url(url).group('mid', 'sid')
playlist_id = f'{mid}_{sid}'
def fetch... | It looks like `uploader_id` is the only value we'd want to transform with `str_or_none`; expecting the type is good enough for the first two
```suggestion
'title': ('meta', 'name', {str}),
'description': ('meta', 'description', {str}),
'uploader_id': ('met... | return self._download_json(
'https://api.bilibili.com/audio/music-service/web/song/upper', playlist_id,
note=f'Downloading page {page_idx}',
query={'uid': playlist_id, 'pn': page_idx + 1, 'ps': 30, 'order': 1, 'jsonp': 'jsonp'})['data']
def get_metada... | @@ -660,16 +683,248 @@ def get_metadata(page_data):
return {
'page_count': math.ceil(entry_count / page_size),
'page_size': page_size,
- 'title': traverse_obj(page_data, ('meta', 'name'))
+ 'uploader': self._get_uploader(mid, playlist_id),
+ ... | yt_dlp/extractor/bilibili.py | 26 | Python | 0.929 | suggestion | 351 | 51 | 51 | false | [extractor/bilibili] support mutiple playlists including series, favorites and watchlater | 7,518 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | c-basalt |
def get_metadata(page_data):
page_size = page_data['page']['page_size']
entry_count = page_data['page']['total']
return {
'page_count': math.ceil(entry_count / page_size),
'page_size': page_size,
'uploader': self._get_uploader(... | ```suggestion
_VALID_URL = r'https?://space\.bilibili\.com/(?P<mid>\d+)/channel/seriesdetail/?\?\bsid=(?P<sid>\d+)'
``` |
metadata, paged_list = self._extract_playlist(fetch_page, get_metadata, get_entries)
return self.playlist_result(paged_list, playlist_id)
class BilibiliSpaceListBaseIE(BilibiliSpaceBaseIE):
def _get_entries(self, page_data, bvid_keys, ending_key='bvid'):
for bvid in traverse_obj(page_data... | @@ -660,16 +683,248 @@ def get_metadata(page_data):
return {
'page_count': math.ceil(entry_count / page_size),
'page_size': page_size,
- 'title': traverse_obj(page_data, ('meta', 'name'))
+ 'uploader': self._get_uploader(mid, playlist_id),
+ ... | yt_dlp/extractor/bilibili.py | 26 | Python | 0.714 | suggestion | 125 | 51 | 51 | false | [extractor/bilibili] support mutiple playlists including series, favorites and watchlater | 7,518 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | c-basalt |
_VALID_URL = r'https?://space.bilibili\.com/(?P<mid>\d+)/channel/seriesdetail/?\?\bsid=(?P<sid>\d+)'
_TESTS = [{
'url': 'https://space.bilibili.com/1958703906/channel/seriesdetail?sid=547718&ctype=0',
'info_dict': {
'id': '1958703906_547718',
'title': '直播回放',
... | same as above comment
```suggestion
'title': ('data', 'meta', 'name', {str}),
'description': ('data', 'meta', 'description', {str}),
'uploader_id': ('data', 'meta', 'mid', {str_or_none}),
``` | 'info_dict': {
'id': '2142762_57445',
'title': '【完结】《底特律 变人》全结局流程解说',
'description': '',
'uploader': '老戴在此',
'uploader_id': '2142762',
'timestamp': int,
'upload_date': str,
'thumbnail': 'https://archive.biliimg.com/b... | @@ -660,16 +683,248 @@ def get_metadata(page_data):
return {
'page_count': math.ceil(entry_count / page_size),
'page_size': page_size,
- 'title': traverse_obj(page_data, ('meta', 'name'))
+ 'uploader': self._get_uploader(mid, playlist_id),
+ ... | yt_dlp/extractor/bilibili.py | 26 | Python | 0.786 | suggestion | 232 | 51 | 51 | false | [extractor/bilibili] support mutiple playlists including series, favorites and watchlater | 7,518 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | c-basalt |
def fetch_page(page_idx):
return self._download_json(
'https://api.bilibili.com/x/series/archives',
playlist_id, note=f'Downloading page {page_idx}',
query={'mid': mid, 'series_id': sid, 'pn': page_idx + 1, 'ps': 30})['data']
def get_metadata... | ```suggestion
_VALID_URL = r'https?://(?:space\.bilibili\.com/\d+/favlist/?\?fid=|(?:www\.)?bilibili\.com/medialist/detail/ml)(?P<id>\d+)'
```
or, the other `_VALID_URL` patterns do not match if there is no subdomain, so should we do this?
```suggestion
_VALID_URL = r'https?://(?:space\.bilibili\.c... | 'uploader': self._get_uploader(mid, playlist_id),
**traverse_obj(page_data, {
'title': ('meta', 'name', {str}),
'description': ('meta', 'description', {str}),
'uploader_id': ('meta', 'mid', {str_or_none}),
't... | @@ -660,16 +683,248 @@ def get_metadata(page_data):
return {
'page_count': math.ceil(entry_count / page_size),
'page_size': page_size,
- 'title': traverse_obj(page_data, ('meta', 'name'))
+ 'uploader': self._get_uploader(mid, playlist_id),
+ ... | yt_dlp/extractor/bilibili.py | 26 | Python | 0.857 | suggestion | 399 | 51 | 51 | false | [extractor/bilibili] support mutiple playlists including series, favorites and watchlater | 7,518 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | c-basalt |
}, {
'url': 'https://www.bilibili.com/medialist/detail/ml1103407912',
'only_matching': True,
}]
def _real_extract(self, url):
fid = self._match_id(url)
list_info = self._download_json(
f'https://api.bilibili.com/x/v3/fav/resource/list?media_id={fid}&pn=1&ps=20',... | ```suggestion
'title': ('title', {str}),
'description': ('intro', {str}),
'uploader': ('upper', 'name', {str}),
'uploader_id': ('upper', 'mid', {str_or_none}),
``` | 'uploader_id': ('data', 'meta', 'mid', {str_or_none}),
'timestamp': ('data', 'meta', 'ctime', {int_or_none}),
'modified_timestamp': ('data', 'meta', 'mtime', {int_or_none}),
})
def fetch_page(page_idx):
return self._download_json(
'https:/... | @@ -660,16 +683,248 @@ def get_metadata(page_data):
return {
'page_count': math.ceil(entry_count / page_size),
'page_size': page_size,
- 'title': traverse_obj(page_data, ('meta', 'name'))
+ 'uploader': self._get_uploader(mid, playlist_id),
+ ... | yt_dlp/extractor/bilibili.py | 26 | Python | 0.786 | suggestion | 216 | 51 | 51 | false | [extractor/bilibili] support mutiple playlists including series, favorites and watchlater | 7,518 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | c-basalt |
'view_count': ('cnt_info', 'play', {int_or_none}),
'like_count': ('cnt_info', 'thumb_up', {int_or_none}),
})))
class BilibiliWatchlaterIE(BilibiliSpaceListBaseIE):
_VALID_URL = r'https?://www\.bilibili\.com/watchlater/?(?:[?#]|$)'
_TESTS = [{
'url': 'https://www.bilibil... | ```suggestion
_VALID_URL = r'https?://www\.bilibili\.com/(?:medialist/play|list)/(?P<id>\w+)'
``` | _VALID_URL = r'https?://(?:space\.bilibili\.com/\d+/favlist/?\?fid=|(?:www\.)?bilibili\.com/medialist/detail/ml)(?P<id>\d+)'
_TESTS = [{
'url': 'https://space.bilibili.com/84912/favlist?fid=1103407912&ftype=create',
'info_dict': {
'id': '1103407912',
'title': '【V2】(旧)',
... | @@ -660,16 +683,248 @@ def get_metadata(page_data):
return {
'page_count': math.ceil(entry_count / page_size),
'page_size': page_size,
- 'title': traverse_obj(page_data, ('meta', 'name'))
+ 'uploader': self._get_uploader(mid, playlist_id),
+ ... | yt_dlp/extractor/bilibili.py | 26 | Python | 0.714 | suggestion | 103 | 51 | 51 | false | [extractor/bilibili] support mutiple playlists including series, favorites and watchlater | 7,518 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | c-basalt |
def _real_extract(self, url):
playlist_id = self._match_id(url)
def fetch_page(page_idx):
return self._download_json(
'https://api.bilibili.com/audio/music-service/web/song/upper', playlist_id,
note=f'Downloading page {page_idx}',
query={'... | I think it would be better to do it like this; reduces code duplication and chances of usage error:
```suggestion
def _get_entries(self, page_data, bvid_keys):
for bvid in traverse_obj(page_data, (*variadic(bvid_keys, (str, bytes, dict, set)), ..., 'bvid', {str})):
``` | 'pn': page_idx + 1,
'ps': 30,
'tid': 0,
'web_location': 1550101,
'wts': int(time.time()),
}
query['w_rid'] = hashlib.md5(f'{urllib.parse.urlencode(query)}{signature}'.encode()).hexdigest()
try:
... | @@ -633,13 +634,35 @@ def get_entries(page_data):
return self.playlist_result(paged_list, playlist_id)
-class BilibiliSpacePlaylistIE(BilibiliSpaceBaseIE):
- _VALID_URL = r'https?://space.bilibili\.com/(?P<mid>\d+)/channel/collectiondetail\?sid=(?P<sid>\d+)'
+class BilibiliSpaceListBaseIE(BilibiliSpaceB... | yt_dlp/extractor/bilibili.py | 26 | Python | 1 | suggestion | 285 | 51 | 51 | false | [extractor/bilibili] support mutiple playlists including series, favorites and watchlater | 7,518 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | c-basalt |
playlist_id = f'{mid}_{sid}'
def fetch_page(page_idx):
return self._download_json(
'https://api.bilibili.com/x/polymer/space/seasons_archives_list',
playlist_id, note=f'Downloading page {page_idx}',
query={'mid': mid, 'season_id': sid, 'page_n... | To go along with the suggestion for `BilibiliSpaceListBaseIE._get_entries()`:
```suggestion
def get_entries(page_data):
return self._get_entries(page_data, 'archives')
``` | 'page_count': page_data['pageCount'],
'page_size': page_data['pageSize'],
}
def get_entries(page_data):
for entry in page_data.get('data', []):
yield self.url_result(f'https://www.bilibili.com/audio/au{entry["id"]}', BilibiliAudioIE, entry... | @@ -660,16 +683,248 @@ def get_metadata(page_data):
return {
'page_count': math.ceil(entry_count / page_size),
'page_size': page_size,
- 'title': traverse_obj(page_data, ('meta', 'name'))
+ 'uploader': self._get_uploader(mid, playlist_id),
+ ... | yt_dlp/extractor/bilibili.py | 26 | Python | 0.714 | suggestion | 195 | 51 | 51 | false | [extractor/bilibili] support mutiple playlists including series, favorites and watchlater | 7,518 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | c-basalt |
), {
'title': ('data', 'meta', 'name', {str_or_none}),
'description': ('data', 'meta', 'description', {str_or_none}),
'uploader_id': ('data', 'meta', 'mid', {str_or_none}),
'timestamp': ('data', 'meta', 'ctime', {int_or_none}),
'modified_timestamp': ('... | To go along with the suggestion for `BilibiliSpaceListBaseIE._get_entries()`:
```suggestion
return self._get_entries(page_data, 'archives')
``` |
def get_metadata(page_data):
page_size = page_data['page']['page_size']
entry_count = page_data['page']['total']
return {
'page_count': math.ceil(entry_count / page_size),
'page_size': page_size,
'uploader': self._get_uploader(... | @@ -660,16 +683,248 @@ def get_metadata(page_data):
return {
'page_count': math.ceil(entry_count / page_size),
'page_size': page_size,
- 'title': traverse_obj(page_data, ('meta', 'name'))
+ 'uploader': self._get_uploader(mid, playlist_id),
+ ... | yt_dlp/extractor/bilibili.py | 26 | Python | 0.714 | suggestion | 158 | 51 | 51 | false | [extractor/bilibili] support mutiple playlists including series, favorites and watchlater | 7,518 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | c-basalt |
'modified_date': str,
'thumbnail': r"re:http://i\d\.hdslb\.com/bfs/archive/14b83c62aa8871b79083df1e9ab4fbc699ad16fe\.jpg",
'view_count': int,
'like_count': int,
},
'playlist_mincount': 22,
}, {
'url': 'https://www.bilibili.com/medialist/detail/... | To go along with the suggestion for `BilibiliSpaceListBaseIE._get_entries()`:
```suggestion
entries = self._get_entries(self._download_json(
f'https://api.bilibili.com/x/v3/fav/resource/ids?media_id={fid}',
fid, note='Download favlist entries'), 'data')
``` | playlist_id = f'{mid}_{sid}'
playlist_meta = traverse_obj(self._download_json(
f'https://api.bilibili.com/x/series/series?series_id={sid}', playlist_id, fatal=False
), {
'title': ('data', 'meta', 'name', {str}),
'description': ('data', 'meta', 'description', {... | @@ -660,16 +683,248 @@ def get_metadata(page_data):
return {
'page_count': math.ceil(entry_count / page_size),
'page_size': page_size,
- 'title': traverse_obj(page_data, ('meta', 'name'))
+ 'uploader': self._get_uploader(mid, playlist_id),
+ ... | yt_dlp/extractor/bilibili.py | 26 | Python | 0.786 | suggestion | 294 | 51 | 51 | false | [extractor/bilibili] support mutiple playlists including series, favorites and watchlater | 7,518 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | c-basalt |
'uploader': ('upper', 'name', {str_or_none}),
'uploader_id': ('upper', 'mid', {str_or_none}),
'timestamp': ('ctime', {int_or_none}),
'modified_timestamp': ('mtime', {int_or_none}),
'thumbnail': ('cover', {url_or_none}),
'view_count': ('cnt_info', '... | To go along with the suggestion for `BilibiliSpaceListBaseIE._get_entries()`:
```suggestion
entries = self._get_entries(watchlater_info, ('data', 'list'))
``` | metadata, paged_list = self._extract_playlist(fetch_page, get_metadata, get_entries)
return self.playlist_result(paged_list, playlist_id, **metadata)
class BilibiliFavoritesListIE(BilibiliSpaceListBaseIE):
_VALID_URL = r'https?://(?:space\.bilibili\.com/\d+/favlist/?\?fid=|(?:www\.)?bilibili\.com/... | @@ -660,16 +683,248 @@ def get_metadata(page_data):
return {
'page_count': math.ceil(entry_count / page_size),
'page_size': page_size,
- 'title': traverse_obj(page_data, ('meta', 'name'))
+ 'uploader': self._get_uploader(mid, playlist_id),
+ ... | yt_dlp/extractor/bilibili.py | 26 | Python | 0.714 | suggestion | 169 | 51 | 51 | false | [extractor/bilibili] support mutiple playlists including series, favorites and watchlater | 7,518 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | c-basalt |
}, {
'url': 'https://www.bilibili.com/medialist/play/ml1103407912',
'info_dict': {
'id': '3_1103407912',
},
'playlist_mincount': 22,
'skip': 'redirect url',
}, {
'url': 'https://www.bilibili.com/list/watchlater',
'info_dict': {'id': 'watchlater... | To go along with the suggestion for `BilibiliSpaceListBaseIE._get_entries()`:
```suggestion
yield from self._get_entries(page_data, 'media_list')
``` | }]
def _real_extract(self, url):
list_id = getattr(self._get_cookies(url).get('DedeUserID'), 'value', 'watchlater')
watchlater_info = self._download_json(
'https://api.bilibili.com/x/v2/history/toview/web?jsonp=jsonp', list_id)
if watchlater_info['code'] == -101:
... | @@ -660,16 +683,248 @@ def get_metadata(page_data):
return {
'page_count': math.ceil(entry_count / page_size),
'page_size': page_size,
- 'title': traverse_obj(page_data, ('meta', 'name'))
+ 'uploader': self._get_uploader(mid, playlist_id),
+ ... | yt_dlp/extractor/bilibili.py | 26 | Python | 0.714 | suggestion | 164 | 51 | 51 | false | [extractor/bilibili] support mutiple playlists including series, favorites and watchlater | 7,518 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | c-basalt |
break
def _real_extract(self, url):
list_id = self._match_id(url)
webpage = self._download_webpage(url, list_id)
initial_state = self._search_json(r'window\.__INITIAL_STATE__\s*=', webpage, 'initial state', list_id)
if traverse_obj(initial_state, ('error', 'code', {i... | Some sites do not like/recognize the capitalized `True`/`False` as a query value -- test this to see if it needs to be fixed
| 'id': '5_547718',
},
'playlist_mincount': 513,
'skip': 'redirect url',
}, {
'url': 'https://www.bilibili.com/list/ml1103407912',
'info_dict': {
'id': '3_1103407912',
'title': '【V2】(旧)',
'uploader': '晓月春日',
'uploader_... | @@ -660,16 +683,248 @@ def get_metadata(page_data):
return {
'page_count': math.ceil(entry_count / page_size),
'page_size': page_size,
- 'title': traverse_obj(page_data, ('meta', 'name'))
+ 'uploader': self._get_uploader(mid, playlist_id),
+ ... | yt_dlp/extractor/bilibili.py | 26 | Python | 0.5 | suggestion | 126 | 51 | 51 | false | [extractor/bilibili] support mutiple playlists including series, favorites and watchlater | 7,518 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | c-basalt |
'id': 'kichiku: mad',
'title': 'kichiku: mad'
},
'playlist_mincount': 45,
'params': {
'playlistend': 45
}
}]
def _fetch_page(self, api_url, num_pages, query, page_num):
parsed_json = self._download_json(
api_url, query, que... | We want this to be fatal, then, yeah? | webpage = self._download_webpage(url, list_id)
initial_state = self._search_json(r'window\.__INITIAL_STATE__\s*=', webpage, 'initial state', list_id)
if traverse_obj(initial_state, ('error', 'code', {int_or_none})) != 200:
error_code = traverse_obj(initial_state, ('error', 'trueCode'... | @@ -660,16 +683,248 @@ def get_metadata(page_data):
return {
'page_count': math.ceil(entry_count / page_size),
'page_size': page_size,
- 'title': traverse_obj(page_data, ('meta', 'name'))
+ 'uploader': self._get_uploader(mid, playlist_id),
+ ... | yt_dlp/extractor/bilibili.py | 26 | Python | 0.071 | question | 37 | 51 | 51 | false | [extractor/bilibili] support mutiple playlists including series, favorites and watchlater | 7,518 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | c-basalt |
error_message = traverse_obj(initial_state, ('error', 'message', {str_or_none}))
if error_code == -400 and list_id == 'watchlater':
self.raise_login_required('You need to login to access your watchlater playlist')
elif error_code == -403:
self.raise_lo... | ```suggestion
'title': ('title', {str}),
'uploader': ('upper', 'name', {str}),
'uploader_id': ('upper', 'mid', {str_or_none}),
``` | 'title': '【V2】(旧)',
'uploader': '晓月春日',
'uploader_id': '84912',
'timestamp': 1604905176,
'upload_date': '20201109',
'thumbnail': r"re:http://i\d\.hdslb\.com/bfs/archive/14b83c62aa8871b79083df1e9ab4fbc699ad16fe\.jpg",
},
'playlist_mi... | @@ -660,16 +683,248 @@ def get_metadata(page_data):
return {
'page_count': math.ceil(entry_count / page_size),
'page_size': page_size,
- 'title': traverse_obj(page_data, ('meta', 'name'))
+ 'uploader': self._get_uploader(mid, playlist_id),
+ ... | yt_dlp/extractor/bilibili.py | 26 | Python | 0.714 | suggestion | 182 | 51 | 51 | false | [extractor/bilibili] support mutiple playlists including series, favorites and watchlater | 7,518 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | c-basalt |
yield self.url_result(f'https://www.bilibili.com/video/{bvid}', BiliBiliIE, bvid)
def _get_uploader(self, uid, playlist_id):
webpage = self._download_webpage(f'https://space.bilibili.com/{uid}', playlist_id, fatal=False)
return self._search_regex(r'(?s)<title\b[^>]*>([^<]+)的个人空间-', webp... | ```suggestion
'thumbnail': 'https://archive.biliimg.com/bfs/archive/e0e543ae35ad3df863ea7dea526bc32e70f4c091.jpg',
``` | yield self.url_result(f'https://www.bilibili.com/video/{bvid}', BiliBiliIE, bvid)
def _get_uploader(self, uid, playlist_id):
webpage = self._download_webpage(f'https://space.bilibili.com/{uid}', playlist_id, fatal=False)
return self._search_regex(r'(?s)<title\b[^>]*>([^<]+)的个人空间-', webp... | @@ -679,13 +681,35 @@ def get_entries(page_data):
return self.playlist_result(paged_list, playlist_id)
-class BilibiliSpacePlaylistIE(BilibiliSpaceBaseIE):
- _VALID_URL = r'https?://space.bilibili\.com/(?P<mid>\d+)/channel/collectiondetail\?sid=(?P<sid>\d+)'
+class BilibiliSpaceListBaseIE(BilibiliSpaceB... | yt_dlp/extractor/bilibili.py | 26 | Python | 0.714 | suggestion | 132 | 51 | 51 | false | [extractor/bilibili] support mutiple playlists including series, favorites and watchlater | 7,518 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | c-basalt |
if not self.is_logged_in:
self.raise_login_required('Twitter Spaces require authentication')
space_data = self._call_graphql_api('HPEisOmj1epUNLCWTYhUWw/AudioSpaceById', space_id)['audioSpace']
if not space_data:
raise ExtractorError('Twitter Space not found', expected=Tr... | Add this anyway, since user can force native with `--downloader native`. Afair, fixup code will not run when ffmpeg is used | 'running': 'is_live',
'timedout': 'post_live',
}
def _build_graphql_query(self, space_id):
return {
'variables': {
'id': space_id,
'isMetatagsQuery': True,
'withDownvotePerspective': False,
'withReactionsMetadat... | @@ -1555,13 +1555,11 @@ def _real_extract(self, url):
source = traverse_obj(
self._call_api(f'live_video_stream/status/{metadata["media_key"]}', metadata['media_key']),
('source', ('noRedirectPlaybackUrl', 'location'), {url_or_none}), get_all=False)
- formats = ... | yt_dlp/extractor/twitter.py | 26 | Python | 0.571 | suggestion | 123 | 51 | 51 | false | [ie/twitter:spaces] Fix format protocol | 7,550 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | bashonly |
from .common import InfoExtractor
from ..utils import (
parse_duration,
traverse_obj,
)
class WimbledonIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?wimbledon\.com/en_GB/video/media/(?P<id>[0-9]+).html'
BRIGHTCOVE_URL_TEMPLATE = 'http://players.brightcove.net/%s/default_default/index.html?video... | Allow other languages/locales; seems many other work in browser.
You could also add an `'only_matching': True` test for an `en_US` URL etc
```suggestion
_VALID_URL = r'https?://(?:www\.)?wimbledon\.com/\w+/video/media/(?P<id>\d+)\.html'
``` | from .common import InfoExtractor
from ..utils import (
parse_duration,
traverse_obj,
)
class WimbledonIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?wimbledon\.com/\w+/video/media/(?P<id>\d+).html'
_TESTS = [{
'url': 'https://www.wimbledon.com/en_GB/video/media/6330247525112.html',
... | @@ -0,0 +1,60 @@
+from .common import InfoExtractor
+from ..utils import (
+ parse_duration,
+ traverse_obj,
+)
+
+
+class WimbledonIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?wimbledon\.com/en_GB/video/media/(?P<id>[0-9]+).html' | yt_dlp/extractor/wimbledon.py | 9 | Python | 0.857 | suggestion | 248 | 34 | 34 | false | [extractor/wimbledon] Add extractor | 7,551 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | nnoboa |
from .common import InfoExtractor
from ..utils import (
parse_duration,
traverse_obj,
)
class WimbledonIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?wimbledon\.com/en_GB/video/media/(?P<id>[0-9]+).html'
BRIGHTCOVE_URL_TEMPLATE = 'http://players.brightcove.net/%s/default_default/index.html?video... | since the extractor is fairly simple, it makes sense to just inline this
```suggestion
``` | from .common import InfoExtractor
from ..utils import (
parse_duration,
traverse_obj,
)
class WimbledonIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?wimbledon\.com/\w+/video/media/(?P<id>\d+).html'
_TESTS = [{
'url': 'https://www.wimbledon.com/en_GB/video/media/6330247525112.html',
... | @@ -0,0 +1,60 @@
+from .common import InfoExtractor
+from ..utils import (
+ parse_duration,
+ traverse_obj,
+)
+
+
+class WimbledonIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?wimbledon\.com/en_GB/video/media/(?P<id>[0-9]+).html'
+ BRIGHTCOVE_URL_TEMPLATE = 'http://players.brightcove.net/%s/defau... | yt_dlp/extractor/wimbledon.py | 10 | Python | 0.643 | refactor | 92 | 35 | 35 | false | [extractor/wimbledon] Add extractor | 7,551 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | nnoboa |
'duration': 163072.0,
},
}, {
'url': 'https://www.wimbledon.com/en_GB/video/media/6308703111112.html',
'info_dict': {
'id': '6308703111112',
'ext': 'mp4',
'thumbnail': 'https://cf-images.eu-west-1.prod.boltdns.net/v1/jit/3506358525001/3144a401-... | inline `account` too
```suggestion
metadata = self._download_json(
f'https://www.wimbledon.com/relatedcontent/rest/v2/wim_v1/en/content/wim_v1_{video_id}_en', video_id)
``` | }, {
'url': 'https://www.wimbledon.com/en_GB/video/media/6308703111112.html',
'info_dict': {
'id': '6308703111112',
'ext': 'mp4',
'thumbnail': r're:^https://[\w.-]+\.prod\.boltdns\.net/[^?#]+/image\.jpg',
'description': 'null',
'upload_date... | @@ -0,0 +1,60 @@
+from .common import InfoExtractor
+from ..utils import (
+ parse_duration,
+ traverse_obj,
+)
+
+
+class WimbledonIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?wimbledon\.com/en_GB/video/media/(?P<id>[0-9]+).html'
+ BRIGHTCOVE_URL_TEMPLATE = 'http://players.brightcove.net/%s/defau... | yt_dlp/extractor/wimbledon.py | 26 | Python | 0.714 | suggestion | 196 | 38 | 39 | false | [extractor/wimbledon] Add extractor | 7,551 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | nnoboa |
'info_dict': {
'id': '6308703111112',
'ext': 'mp4',
'thumbnail': 'https://cf-images.eu-west-1.prod.boltdns.net/v1/jit/3506358525001/3144a401-e6b3-4d49-9dfc-627866a2e2de/main/1920x1080/50s720ms/match/image.jpg',
'description': 'null',
'upload_date': '20... | ```suggestion
'url': 'https://players.brightcove.net/3506358525001/default_default/index.html?videoId={video_id}',
``` | 'ext': 'mp4',
'thumbnail': r're:^https://[\w.-]+\.prod\.boltdns\.net/[^?#]+/image\.jpg',
'description': 'null',
'upload_date': '20220629',
'uploader_id': '3506358525001',
'title': 'Roblox | WimbleWorld ',
'duration': 101440.0,
... | @@ -0,0 +1,60 @@
+from .common import InfoExtractor
+from ..utils import (
+ parse_duration,
+ traverse_obj,
+)
+
+
+class WimbledonIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?wimbledon\.com/en_GB/video/media/(?P<id>[0-9]+).html'
+ BRIGHTCOVE_URL_TEMPLATE = 'http://players.brightcove.net/%s/defau... | yt_dlp/extractor/wimbledon.py | 26 | Python | 0.714 | suggestion | 132 | 34 | 35 | false | [extractor/wimbledon] Add extractor | 7,551 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | nnoboa |
'uploader_id': '3506358525001',
'title': 'Roblox | WimbleWorld ',
'duration': 101440.0,
'tags': ['features', 'kids'],
'timestamp': 1656500867,
},
}]
def _real_extract(self, url):
video_id = self._match_id(url)
account = '350635... | `language` is a format field, so we can leave it out
```suggestion
**traverse_obj(metadata, {
'title': 'title',
'description': 'description',
'duration': ('metadata', 'duration', {parse_duration}),
}),
``` | 'duration': 101440.0,
'tags': ['features', 'kids'],
'timestamp': 1656500867,
},
}, {
'url': 'https://www.wimbledon.com/en_US/video/media/6309327106112.html',
'only_matching': True,
}, {
'url': 'https://www.wimbledon.com/es_Es/video/media/630837... | @@ -0,0 +1,60 @@
+from .common import InfoExtractor
+from ..utils import (
+ parse_duration,
+ traverse_obj,
+)
+
+
+class WimbledonIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?wimbledon\.com/en_GB/video/media/(?P<id>[0-9]+).html'
+ BRIGHTCOVE_URL_TEMPLATE = 'http://players.brightcove.net/%s/defau... | yt_dlp/extractor/wimbledon.py | 26 | Python | 0.786 | suggestion | 284 | 28 | 29 | false | [extractor/wimbledon] Add extractor | 7,551 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | nnoboa |
from .common import InfoExtractor
from ..utils import (
parse_duration,
traverse_obj,
)
class WimbledonIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?wimbledon\.com/en_GB/video/media/(?P<id>[0-9]+).html'
BRIGHTCOVE_URL_TEMPLATE = 'http://players.brightcove.net/%s/default_default/index.html?video... | You can use regex for thumbnail URLs if they are too long or if they may change
```suggestion
'thumbnail': r're:^https://[\w-]+\.prod\.boltdns\.net/[^?#]+/image\.jpg',
``` | from .common import InfoExtractor
from ..utils import (
parse_duration,
traverse_obj,
)
class WimbledonIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?wimbledon\.com/\w+/video/media/(?P<id>\d+).html'
_TESTS = [{
'url': 'https://www.wimbledon.com/en_GB/video/media/6330247525112.html',
... | @@ -0,0 +1,60 @@
+from .common import InfoExtractor
+from ..utils import (
+ parse_duration,
+ traverse_obj,
+)
+
+
+class WimbledonIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?wimbledon\.com/en_GB/video/media/(?P<id>[0-9]+).html'
+ BRIGHTCOVE_URL_TEMPLATE = 'http://players.brightcove.net/%s/defau... | yt_dlp/extractor/wimbledon.py | 19 | Python | 0.786 | refactor | 186 | 44 | 44 | false | [extractor/wimbledon] Add extractor | 7,551 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | nnoboa |
from .common import InfoExtractor
from ..utils import (
parse_duration,
traverse_obj,
)
class WimbledonIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?wimbledon\.com/\w+/video/media/(?P<id>\d+).html'
_TESTS = [{
'url': 'https://www.wimbledon.com/en_GB/video/media/6330247525112.html',
... | dots don't have to be escaped in character class
```suggestion
'thumbnail': r're:^https://[\w.-]+\.prod\.boltdns\.net/[^?#]+/image\.jpg',
``` | from .common import InfoExtractor
from ..utils import (
parse_duration,
traverse_obj,
)
class WimbledonIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?wimbledon\.com/\w+/video/media/(?P<id>\d+).html'
_TESTS = [{
'url': 'https://www.wimbledon.com/en_GB/video/media/6330247525112.html',
... | @@ -0,0 +1,64 @@
+from .common import InfoExtractor
+from ..utils import (
+ parse_duration,
+ traverse_obj,
+)
+
+
+class WimbledonIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?wimbledon\.com/\w+/video/media/(?P<id>\d+).html'
+ _TESTS = [{
+ 'url': 'https://www.wimbledon.com/en_GB/video/med... | yt_dlp/extractor/wimbledon.py | 17 | Python | 0.714 | security | 156 | 42 | 42 | false | [extractor/wimbledon] Add extractor | 7,551 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | nnoboa |
traverse_obj,
)
class WimbledonIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?wimbledon\.com/\w+/video/media/(?P<id>\d+).html'
_TESTS = [{
'url': 'https://www.wimbledon.com/en_GB/video/media/6330247525112.html',
'info_dict': {
'id': '6330247525112',
'ext': 'mp... | ```suggestion
'thumbnail': r're:^https://[\w.-]+\.prod\.boltdns\.net/[^?#]+/image\.jpg',
``` | traverse_obj,
)
class WimbledonIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?wimbledon\.com/\w+/video/media/(?P<id>\d+).html'
_TESTS = [{
'url': 'https://www.wimbledon.com/en_GB/video/media/6330247525112.html',
'info_dict': {
'id': '6330247525112',
'ext': 'mp... | @@ -0,0 +1,64 @@
+from .common import InfoExtractor
+from ..utils import (
+ parse_duration,
+ traverse_obj,
+)
+
+
+class WimbledonIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?wimbledon\.com/\w+/video/media/(?P<id>\d+).html'
+ _TESTS = [{
+ 'url': 'https://www.wimbledon.com/en_GB/video/med... | yt_dlp/extractor/wimbledon.py | 26 | Python | 0.714 | suggestion | 106 | 51 | 51 | false | [extractor/wimbledon] Add extractor | 7,551 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | nnoboa |
'id': '6308703111112',
'ext': 'mp4',
'thumbnail': r're:^https://[\.\w-]+\.prod\.boltdns\.net/[^?#]+/image\.jpg',
'description': 'null',
'upload_date': '20220629',
'uploader_id': '3506358525001',
'title': 'Roblox | WimbleWorld ',
... | ```suggestion
metadata = self._download_json(
f'https://www.wimbledon.com/relatedcontent/rest/v2/wim_v1/en/content/wim_v1_{video_id}_en', video_id)
``` | 'id': '6308703111112',
'ext': 'mp4',
'thumbnail': r're:^https://[\w.-]+\.prod\.boltdns\.net/[^?#]+/image\.jpg',
'description': 'null',
'upload_date': '20220629',
'uploader_id': '3506358525001',
'title': 'Roblox | WimbleWorld ',
... | @@ -0,0 +1,64 @@
+from .common import InfoExtractor
+from ..utils import (
+ parse_duration,
+ traverse_obj,
+)
+
+
+class WimbledonIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?wimbledon\.com/\w+/video/media/(?P<id>\d+).html'
+ _TESTS = [{
+ 'url': 'https://www.wimbledon.com/en_GB/video/med... | yt_dlp/extractor/wimbledon.py | 26 | Python | 0.714 | suggestion | 174 | 39 | 36 | false | [extractor/wimbledon] Add extractor | 7,551 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | nnoboa |
# Source for `safe` arguments: https://url.spec.whatwg.org/#percent-encoded-bytes.
def to_high_limit_path(path):
if sys.platform in ['win32', 'cygwin']:
# Work around MAX_PATH limitation on Windows. The maximum allowed length for the individual path segments may still be quite limited.
return ... | ```suggestion
mgln\.ai/e
``` | # Source for `safe` arguments: https://url.spec.whatwg.org/#percent-encoded-bytes.
def to_high_limit_path(path):
if sys.platform in ['win32', 'cygwin']:
# Work around MAX_PATH limitation on Windows. The maximum allowed length for the individual path segments may still be quite limited.
return ... | @@ -5121,16 +5121,21 @@ def clean_podcast_url(url):
url = re.sub(r'''(?x)
(?:
(?:
- chtbl\.com/track|
media\.blubrry\.com| # https://create.blubrry.com/resources/podcast-media-download-statistics/getting-started/
- play\.podtrac\.com
+ ... | yt_dlp/utils/_utils.py | 26 | Python | 0.429 | suggestion | 46 | 51 | 51 | false | Fixes for clean_podcast_url() | 7,556 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | mabdelfattah |
def to_high_limit_path(path):
if sys.platform in ['win32', 'cygwin']:
# Work around MAX_PATH limitation on Windows. The maximum allowed length for the individual path segments may still be quite limited.
return '\\\\?\\' + os.path.abspath(path)
return path
def format_field(obj, field=None, te... | ```suggestion
chtbl\.com/track(?:/[^/.]+)?|
```
or, maybe it'd be better to move `chtbl\.com/track` back to where it was and do this:
```diff
(?:
chtbl\.com/track|
media\.blubrry\.com| # https://create.blubrry.com/resources/podcast-media-download... | def to_high_limit_path(path):
if sys.platform in ['win32', 'cygwin']:
# Work around MAX_PATH limitation on Windows. The maximum allowed length for the individual path segments may still be quite limited.
return '\\\\?\\' + os.path.abspath(path)
return path
def format_field(obj, field=None, te... | @@ -5121,16 +5121,21 @@ def clean_podcast_url(url):
url = re.sub(r'''(?x)
(?:
(?:
- chtbl\.com/track|
media\.blubrry\.com| # https://create.blubrry.com/resources/podcast-media-download-statistics/getting-started/
- play\.podtrac\.com
+ ... | yt_dlp/utils/_utils.py | 26 | Python | 1 | suggestion | 506 | 51 | 51 | false | Fixes for clean_podcast_url() | 7,556 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | mabdelfattah |
def format_field(obj, field=None, template='%s', ignore=NO_DEFAULT, default='', func=IDENTITY):
val = traversal.traverse_obj(obj, *variadic(field))
if not val if ignore is NO_DEFAULT else val in variadic(ignore):
return default
return template % func(val)
def clean_podcast_url(url):
url = re.s... | ```suggestion
pscrb\.fm/rss/p
``` | def format_field(obj, field=None, template='%s', ignore=NO_DEFAULT, default='', func=IDENTITY):
val = traversal.traverse_obj(obj, *variadic(field))
if not val if ignore is NO_DEFAULT else val in variadic(ignore):
return default
return template % func(val)
def clean_podcast_url(url):
url = re.s... | @@ -5121,16 +5121,21 @@ def clean_podcast_url(url):
url = re.sub(r'''(?x)
(?:
(?:
- chtbl\.com/track|
media\.blubrry\.com| # https://create.blubrry.com/resources/podcast-media-download-statistics/getting-started/
- play\.podtrac\.com
+ ... | yt_dlp/utils/_utils.py | 26 | Python | 0.429 | suggestion | 47 | 51 | 51 | false | Fixes for clean_podcast_url() | 7,556 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | mabdelfattah |
urllib.parse.quote_plus(iri_parts.fragment, safe=r"!#$%&'()*+,/:;=?@{|}~")))
# Source for `safe` arguments: https://url.spec.whatwg.org/#percent-encoded-bytes.
def to_high_limit_path(path):
if sys.platform in ['win32', 'cygwin']:
# Work around MAX_PATH limitation on Windows. The maximum ... | ```suggestion
chtbl\.com/track|
``` |
urllib.parse.quote_plus(iri_parts.fragment, safe=r"!#$%&'()*+,/:;=?@{|}~")))
# Source for `safe` arguments: https://url.spec.whatwg.org/#percent-encoded-bytes.
def to_high_limit_path(path):
if sys.platform in ['win32', 'cygwin']:
# Work around MAX_PATH limitation on Windows. The maximum ... | @@ -5121,16 +5121,20 @@ def clean_podcast_url(url):
url = re.sub(r'''(?x)
(?:
(?:
- chtbl\.com/track|
+ chtbl\.com/track/| | yt_dlp/utils/_utils.py | 26 | Python | 0.571 | suggestion | 53 | 51 | 51 | false | Fixes for clean_podcast_url() | 7,556 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | mabdelfattah |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.