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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
media_json = video_json.get('media') or {}
if api_only and not media_json.get('url') and not video_json.get('url'):
raise ExtractorError('Failed to find video data for dashboard-only post')
provider = video_json.get('provider')
is_provi... | If applying the above suggestion about moving `_ambiguous_providers` into `_providers`, we can simplify like this:
```suggestion
elif provider and and provider not in self._providers:
unknown_providers.add(provider)
if video_json.get('url'):
... | video_url = self._og_search_video_url(webpage, default=None)
# for external video hosts
entries = []
ignored_providers = set()
unknown_providers = set()
for video_json in traverse_obj(content_json, lambda _, v: v['type'] in ('video', 'audio')):
media_json = v... | @@ -291,21 +440,70 @@ def _real_extract(self, url):
video_id, headers={'Authorization': f'Bearer {self._ACCESS_TOKEN}'}, fatal=False),
('response', 'timeline', 'elements', 0)) or {}
content_json = traverse_obj(post_json, ('trail', 0, 'content'), ('content')) or []
- ... | yt_dlp/extractor/tumblr.py | 26 | Python | 0.857 | refactor | 476 | 51 | 51 | false | [ie/Tumblr] Support more URLs | 6,057 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | selfisekai |
formats = [{
'url': video_url,
'format_id': format_id,
'height': int_or_none(self._search_regex(
r'_(\d+)\.\w+$', video_url, 'height', default=None)),
'quality': quality,
... | ```suggestion
self.report_warning(f'Skipped embeds from unsupported providers: {str(", ".join(ignored_providers))}', video_id)
``` | if sd_url:
sources.append((sd_url, 'sd'))
sources.append((hd_url, 'hd'))
formats = [{
'url': video_url,
'format_id': format_id,
'height': int_or_none(self._search_... | @@ -344,44 +542,35 @@ def _real_extract(self, url):
'quality': quality,
} for quality, (video_url, format_id) in enumerate(sources)]
- if not media_json.get('url') and not video_url and not iframe_url:
- # external video host (but we weren't able to figu... | yt_dlp/extractor/tumblr.py | 26 | Python | 0.714 | suggestion | 148 | 41 | 46 | false | [ie/Tumblr] Support more URLs | 6,057 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | selfisekai |
def _real_extract(self, url):
blog_1, blog_2, video_id = self._match_valid_url(url).groups()
blog = blog_2 or blog_1
url = f'http://{blog}.tumblr.com/post/{video_id}'
webpage, urlh = self._download_webpage_handle(
url, video_id, headers={'User-Agent': 'WhatsApp/2.0'}) #... | maybe these would be better?
if we want the content dicts from all branches:
```suggestion
content_json = traverse_obj(post_json, ((('trail', 0), None), 'content', ..., {dict}))
```
or if we want the exact same results as the original line of code (only the content dicts from the first succes... |
def _real_extract(self, url):
blog_1, blog_2, video_id = self._match_valid_url(url).groups()
blog = blog_2 or blog_1
url = f'http://{blog}.tumblr.com/post/{video_id}'
webpage, urlh = self._download_webpage_handle(
url, video_id, headers={'User-Agent': 'WhatsApp/2.0'}) ... | @@ -289,23 +444,68 @@ def _real_extract(self, url):
self._download_json(
f'https://www.tumblr.com/api/v2/blog/{blog}/posts/{video_id}/permalink',
video_id, headers={'Authorization': f'Bearer {self._ACCESS_TOKEN}'}, fatal=False),
- ('response', 't... | yt_dlp/extractor/tumblr.py | 26 | Python | 0.857 | suggestion | 454 | 51 | 51 | false | [ie/Tumblr] Support more URLs | 6,057 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | selfisekai |
video_id, headers={'Authorization': f'Bearer {self._ACCESS_TOKEN}'}, fatal=False),
('response', 'timeline', 'elements', 0, {dict})) or {}
content_json = traverse_obj(
post_json, ('trail', 0, 'content', ...), ('content', ...), expected_type=dict)
# the url... | ```suggestion
**traverse_obj(post_json, {
'like_count': ('like_count', {int_or_none}),
'repost_count': ('reblog_count', {int_or_none}),
'tags': ('tags', ..., {str}),
}),
'age_limit': {True: 18, False: 0}.get(post_json.get('is_nsfw... | f'https://www.tumblr.com/api/v2/blog/{blog}/posts/{video_id}/permalink',
video_id, headers={'Authorization': f'Bearer {self._ACCESS_TOKEN}'}, fatal=False),
('response', 'timeline', 'elements', 0, {dict})) or {}
content_json = traverse_obj(post_json, ((('tr... | @@ -289,23 +444,68 @@ def _real_extract(self, url):
self._download_json(
f'https://www.tumblr.com/api/v2/blog/{blog}/posts/{video_id}/permalink',
video_id, headers={'Authorization': f'Bearer {self._ACCESS_TOKEN}'}, fatal=False),
- ('response', 't... | yt_dlp/extractor/tumblr.py | 26 | Python | 0.786 | suggestion | 329 | 51 | 51 | false | [ie/Tumblr] Support more URLs | 6,057 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | selfisekai |
'formats': formats,
'duration': duration,
'thumbnail': traverse_obj(
video_json, ('poster', 0, 'url')) or self._og_search_thumbnail(
webpage, default=None)},
*entries]
if ignored_providers:
i... | Either we should add a `if not entries:` code path here or else invert the logic here e.g. `if len(entries) == 1: ` so that we return a 0-item playlist for posts w/o media | entries.insert(0, {
**info_dict,
'formats': formats,
'duration': duration,
'thumbnail': (traverse_obj(video_json, ('poster', 0, 'url', {url_or_none}))
or self._og_search_thumbnail(webpage, default=None)),
... | @@ -344,44 +544,36 @@ def _real_extract(self, url):
'quality': quality,
} for quality, (video_url, format_id) in enumerate(sources)]
- if not media_json.get('url') and not video_url and not iframe_url:
- # external video host (but we weren't able to figu... | yt_dlp/extractor/tumblr.py | 26 | Python | 0.571 | suggestion | 171 | 27 | 29 | false | [ie/Tumblr] Support more URLs | 6,057 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | selfisekai |
} for quality, (video_url, format_id) in enumerate(sources)]
if not formats and fallback_format:
formats.append(fallback_format)
if formats:
# tumblr's own video is always above embeds
entries = [{
**info_dict,
'fo... | since we do have metadata to return at this point, we could allow `--ignore-no-formats`
```suggestion
self.raise_no_formats('No video could be found in this post', expected=True, video_id=video_id)
``` | 'quality': quality,
} for quality, (video_url, format_id) in enumerate(sources)]
if not formats and fallback_format:
formats.append(fallback_format)
if formats:
# tumblr's own video is always above embeds
entries.insert(0,... | @@ -344,44 +545,37 @@ def _real_extract(self, url):
'quality': quality,
} for quality, (video_url, format_id) in enumerate(sources)]
- if not media_json.get('url') and not video_url and not iframe_url:
- # external video host (but we weren't able to figu... | yt_dlp/extractor/tumblr.py | 26 | Python | 0.857 | suggestion | 216 | 37 | 37 | false | [ie/Tumblr] Support more URLs | 6,057 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | selfisekai |
'sd video url', default=None, group='url')
if sd_url:
sources.append((sd_url, 'sd'))
sources.append((hd_url, 'hd'))
formats = [{
'url': video_url,
'format_id': for... | ```suggestion
entries.insert(0, {
**info_dict,
'formats': formats,
'duration': duration,
'thumbnail': (traverse_obj(video_json, ('poster', 0, 'url', {url_or_none}))
or self._og_search_thumbnail(webpage, defau... | r'<source[^>]+src=(["\'])(?P<url>.+?)\1', iframe,
'sd video url', default=None, group='url')
if sd_url:
sources.append((sd_url, 'sd'))
sources.append((hd_url, 'hd'))
formats = [{
... | @@ -344,44 +545,37 @@ def _real_extract(self, url):
'quality': quality,
} for quality, (video_url, format_id) in enumerate(sources)]
- if not media_json.get('url') and not video_url and not iframe_url:
- # external video host (but we weren't able to figu... | yt_dlp/extractor/tumblr.py | 26 | Python | 0.786 | suggestion | 351 | 48 | 48 | false | [ie/Tumblr] Support more URLs | 6,057 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | selfisekai |
import time
from hashlib import md5
import re
from .common import InfoExtractor
from ..utils import (
ExtractorError,
unescapeHTML,
unified_strdate,
urljoin,
)
class DouyuTVIE(InfoExtractor):
IE_DESC = '斗鱼'
_VALID_URL = r'https?://(?:www\.)?douyu(?:tv)?\.com/(topic/.*rid=|(?:[^/]+/))*(?P<id>[... | Don't use `.*`. The regex should not match any of these
```
https://www.douyu.com/topic/rid=6560603
https://www.douyu.com/topic/ydxc#rid=6560603
https://www.douyu.com/topic/ydxc?drid=6560603
``` | import time
import hashlib
import re
import urllib
from .common import InfoExtractor
from ..utils import (
ExtractorError,
unescapeHTML,
unified_strdate,
urljoin,
)
class DouyuTVIE(InfoExtractor):
IE_DESC = '斗鱼'
_VALID_URL = r'https?://(?:www\.)?douyu(?:tv)?\.com/(topic/\w+\?rid=|(?:[^/]+/))*... | @@ -13,7 +13,7 @@
class DouyuTVIE(InfoExtractor):
IE_DESC = '斗鱼'
- _VALID_URL = r'https?://(?:www\.)?douyu(?:tv)?\.com/(?:[^/]+/)*(?P<id>[A-Za-z0-9]+)'
+ _VALID_URL = r'https?://(?:www\.)?douyu(?:tv)?\.com/(topic/.*rid=|(?:[^/]+/))*(?P<id>[A-Za-z0-9]+)' | yt_dlp/extractor/douyutv.py | 16 | Python | 0.786 | suggestion | 199 | 41 | 41 | false | [extractor/DouyuTV]: Fix extractor and use new api | 6,074 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | hatienl0i2612 |
},
'params': {
'skip_download': True,
},
}, {
'url': 'http://www.douyu.com/xiaocang',
'only_matching': True,
}, {
# \"room_id\"
'url': 'http://www.douyu.com/t/lpl',
'only_matching': True,
}]
def _real_extract(self, url):
... | ```suggestion
auth = md5(f'room/{video_id}?aid=wp&client_sys=wp&time={tt}zNzMV1y4EMxOHS6I5WKm'.encode()).hexdigest()
``` | },
'params': {
'skip_download': True,
},
}, {
'url': 'http://www.douyu.com/xiaocang',
'only_matching': True,
}, {
# \"room_id\"
'url': 'http://www.douyu.com/t/lpl',
'only_matching': True,
}]
def _real_extract(self, url):
... | @@ -79,28 +95,25 @@ def _real_extract(self, url):
room_id = self._html_search_regex(
r'"room_id\\?"\s*:\s*(\d+),', page, 'room id')
- # Grab metadata from mobile API
+ # Grab metadata from API
+ tt = int(time.time())
+ auth = md5(f'room/{video_id}?aid=wp&clien... | yt_dlp/extractor/douyutv.py | 26 | Python | 0.714 | security | 130 | 51 | 51 | false | [extractor/DouyuTV]: Fix extractor and use new api | 6,074 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | hatienl0i2612 |
if video_id.isdigit():
room_id = video_id
else:
page = self._download_webpage(url, video_id)
room_id = self._html_search_regex(
r'"room_id\\?"\s*:\s*(\d+),', page, 'room id')
# Grab metadata from API
tt = int(time.time())
auth... | ```suggestion
video_url = url_join('https://hls3-akm.douyucdn.cn/',
self._search_regex(r'(live/.*)', room['hls_url'], 'URL')
``` |
if video_id.isdigit():
room_id = video_id
else:
page = self._download_webpage(url, video_id)
room_id = self._html_search_regex(
r'"room_id\\?"\s*:\s*(\d+),', page, 'room id')
# Grab metadata from API
params = {
'aid': 'wp'... | @@ -79,28 +95,25 @@ def _real_extract(self, url):
room_id = self._html_search_regex(
r'"room_id\\?"\s*:\s*(\d+),', page, 'room id')
- # Grab metadata from mobile API
+ # Grab metadata from API
+ tt = int(time.time())
+ auth = md5(f'room/{video_id}?aid=wp&clien... | yt_dlp/extractor/douyutv.py | 26 | Python | 0.714 | suggestion | 168 | 51 | 51 | false | [extractor/DouyuTV]: Fix extractor and use new api | 6,074 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | hatienl0i2612 |
'only_matching': True,
}, {
# \"room_id\"
'url': 'http://www.douyu.com/t/lpl',
'only_matching': True,
}]
def _real_extract(self, url):
video_id = self._match_id(url)
if video_id.isdigit():
room_id = video_id
else:
page = self.... | duplicate code. Why not construct the query object first and use it to generate auth. Like this:
https://github.com/yt-dlp/yt-dlp/blob/074b2fae9076221faaa8697381428131ad968dc9/yt_dlp/extractor/kankanews.py#L29-L38 | 'only_matching': True,
}, {
# \"room_id\"
'url': 'http://www.douyu.com/t/lpl',
'only_matching': True,
}]
def _real_extract(self, url):
video_id = self._match_id(url)
if video_id.isdigit():
room_id = video_id
else:
page = self.... | @@ -79,28 +95,25 @@ def _real_extract(self, url):
room_id = self._html_search_regex(
r'"room_id\\?"\s*:\s*(\d+),', page, 'room id')
- # Grab metadata from mobile API
+ # Grab metadata from API
+ tt = int(time.time())
+ auth = md5(f'room/{video_id}?aid=wp&clien... | yt_dlp/extractor/douyutv.py | 26 | Python | 0.5 | security | 214 | 51 | 51 | false | [extractor/DouyuTV]: Fix extractor and use new api | 6,074 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | hatienl0i2612 |
'only_matching': True,
}, {
# poll2choice_video card
'url': 'https://twitter.com/CAF_Online/status/1349365911120195585',
'only_matching': True,
}, {
# poll3choice_video card
'url': 'https://twitter.com/SamsungMobileSA/status/1348609186725289984',
'only_mat... | ```suggestion
'tweet_results', 'result', ('tweet', None)
), expected_type=dict, default={}, get_all=False)
```
Add the commented URL as a test | }, {
# onion route
'url': 'https://twitter3e4tixl4xyajtrzo62zg5vztmjuricljdp2c5kshju4avyoid.onion/TwitterBlue/status/1484226494708662273',
'only_matching': True,
}, {
# Twitch Clip Embed
'url': 'https://twitter.com/GunB1g/status/1163218564784017422',
'only_matchin... | @@ -814,6 +814,14 @@ def _graphql_to_legacy(self, data, twid):
'tweet_results', 'result'
), expected_type=dict, default={}, get_all=False)
+ # sometimes actual tweet might also be wrapped in "TweetWithVisibilityResults"
+ # https://twitter.com/TaylorLorenz/status/161631924584726528... | yt_dlp/extractor/twitter.py | 26 | Python | 0.857 | suggestion | 166 | 51 | 51 | false | [extractor/twitter] fix graphql extraction on some tweets | 6,075 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | selfisekai |
if season_id and not video_data:
# Non-Bstation layout, read through episode list
season_json = self._call_api(f'/web/v2/ogv/play/episodes?season_id={season_id}&platform=web', video_id)
video_data = traverse_obj(season_json, (
'sections', ..., 'episodes', lamb... | ```suggestion
for replies in traverse_obj(comment_api_raw_data, ('data', 'replies', ...)):
``` | 'url': 'https://www.bilibili.tv/en/play/1048837/11246489',
'info_dict': {
'id': '11246489',
'ext': 'mp4',
'title': 'E1 - Operation \'Strix\' <Owl>',
'description': 'md5:b4434eb1a9a97ad2bccb779514b89f17',
'timestamp': 1649516400,
'th... | @@ -1025,6 +1060,64 @@ def _extract_video_metadata(self, url, video_id, season_id):
'description': self._html_search_meta('og:description', webpage)
})
+ def _get_comments_reply(self, root_id, next_id=0, display_id=None):
+ comment_api_raw_data = self._download_json(
+ ... | yt_dlp/extractor/bilibili.py | 26 | Python | 0.714 | suggestion | 104 | 51 | 51 | false | [extractor/biliIntl] Add comment extraction | 6,079 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | HobbyistDev |
})
def _get_comments_reply(self, root_id, next_id=0, display_id=None):
comment_api_raw_data = self._download_json(
'https://api.bilibili.tv/reply/web/detail', display_id,
note=f'Downloading reply comment of {root_id}',
query={
'platform': 'web... | ```suggestion
if not traverse_obj(comment_api_raw_data, ('data', 'cursor', 'is_end')):
``` | }, {
'url': 'https://www.biliintl.com/en/play/34613/341736',
'only_matching': True,
}, {
# User-generated content (as opposed to a series licensed from a studio)
'url': 'https://bilibili.tv/en/video/2019955076',
'only_matching': True,
}, {
# No language in URL... | @@ -1025,6 +1060,64 @@ def _extract_video_metadata(self, url, video_id, season_id):
'description': self._html_search_meta('og:description', webpage)
})
+ def _get_comments_reply(self, root_id, next_id=0, display_id=None):
+ comment_api_raw_data = self._download_json(
+ ... | yt_dlp/extractor/bilibili.py | 26 | Python | 0.714 | suggestion | 104 | 51 | 51 | false | [extractor/biliIntl] Add comment extraction | 6,079 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | HobbyistDev |
def _get_comments_reply(self, root_id, next_id=0, display_id=None):
comment_api_raw_data = self._download_json(
'https://api.bilibili.tv/reply/web/detail', display_id,
note=f'Downloading reply comment of {root_id}',
query={
'platform': 'web',
... | ```suggestion
root_id, comment_api_raw_data['data']['cursor']['next'], display_id)
```
If it returns None, it may cause infinite loop | 'only_matching': True,
}, {
# User-generated content (as opposed to a series licensed from a studio)
'url': 'https://bilibili.tv/en/video/2019955076',
'only_matching': True,
}, {
# No language in URL
'url': 'https://www.bilibili.tv/video/2019955076',
'only... | @@ -1025,6 +1060,64 @@ def _extract_video_metadata(self, url, video_id, season_id):
'description': self._html_search_meta('og:description', webpage)
})
+ def _get_comments_reply(self, root_id, next_id=0, display_id=None):
+ comment_api_raw_data = self._download_json(
+ ... | yt_dlp/extractor/bilibili.py | 26 | Python | 0.786 | bug | 156 | 51 | 51 | false | [extractor/biliIntl] Add comment extraction | 6,079 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | HobbyistDev |
def _get_comments_reply(self, root_id, next_id=0, display_id=None):
comment_api_raw_data = self._download_json(
'https://api.bilibili.tv/reply/web/detail', display_id,
note=f'Downloading reply comment of {root_id}',
query={
'platform': 'web',
... | shouldn't this be `yield from`? | 'url': 'https://www.biliintl.com/en/play/34613/341736',
'only_matching': True,
}, {
# User-generated content (as opposed to a series licensed from a studio)
'url': 'https://bilibili.tv/en/video/2019955076',
'only_matching': True,
}, {
# No language in URL
... | @@ -1025,6 +1060,64 @@ def _extract_video_metadata(self, url, video_id, season_id):
'description': self._html_search_meta('og:description', webpage)
})
+ def _get_comments_reply(self, root_id, next_id=0, display_id=None):
+ comment_api_raw_data = self._download_json(
+ ... | yt_dlp/extractor/bilibili.py | 26 | Python | 0.286 | question | 31 | 51 | 51 | false | [extractor/biliIntl] Add comment extraction | 6,079 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | HobbyistDev |
'ps': 3, # comment's reply per page (default: 3)
'root': root_id,
'next': next_id,
})
for replies in traverse_obj(comment_api_raw_data, ('data', 'replies', ...)) or ():
yield {
'author': traverse_obj(replies, ('member', 'n... | ```suggestion
note=f'Downloading comment page {i + 1}',
``` | # No language in URL
'url': 'https://www.bilibili.tv/video/2019955076',
'only_matching': True,
}, {
# Uppercase language in URL
'url': 'https://www.bilibili.tv/EN/video/2019955076',
'only_matching': True,
}]
def _make_url(video_id, series_id=None):
if... | @@ -1025,6 +1060,64 @@ def _extract_video_metadata(self, url, video_id, season_id):
'description': self._html_search_meta('og:description', webpage)
})
+ def _get_comments_reply(self, root_id, next_id=0, display_id=None):
+ comment_api_raw_data = self._download_json(
+ ... | yt_dlp/extractor/bilibili.py | 26 | Python | 0.571 | suggestion | 77 | 51 | 51 | false | [extractor/biliIntl] Add comment extraction | 6,079 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | HobbyistDev |
'text': traverse_obj(replies, ('content', 'message')),
'id': replies.get('rpid'),
'like_count': int_or_none(replies.get('like_count')),
'parent': replies.get('parent'),
'timestamp': unified_timestamp(replies.get('ctime_text'))
}... | ```suggestion
for replies in traverse_obj(comment_api_raw_data, ('data', 'replies', ...)):
```
traverse_obj with ... always returns a list | if series_id:
return f'https://www.bilibili.tv/en/play/{series_id}/{video_id}'
return f'https://www.bilibili.tv/en/video/{video_id}'
def _extract_video_metadata(self, url, video_id, season_id):
url, smuggled_data = unsmuggle_url(url, {})
if smuggled_data.get('title'):
... | @@ -1025,6 +1060,64 @@ def _extract_video_metadata(self, url, video_id, season_id):
'description': self._html_search_meta('og:description', webpage)
})
+ def _get_comments_reply(self, root_id, next_id=0, display_id=None):
+ comment_api_raw_data = self._download_json(
+ ... | yt_dlp/extractor/bilibili.py | 26 | Python | 0.714 | suggestion | 153 | 51 | 51 | false | [extractor/biliIntl] Add comment extraction | 6,079 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | HobbyistDev |
def _get_comments(self, video_id, video_type):
for i in itertools.count(0):
comment_api_raw_data = self._download_json(
'https://api.bilibili.tv/reply/web/root', video_id,
note=f'Downloading comment page {i}',
query={
'platform'... | ```suggestion
if replies.get('count'):
```
None > 0 throws | initial_data = (
self._search_json(r'window\.__INITIAL_(?:DATA|STATE)__\s*=', webpage, 'preload state', video_id, default={})
or self._search_nuxt_data(webpage, video_id, '__initialState', fatal=False, traverse=None))
video_data = traverse_obj(
initial_data, ('OgvVide... | @@ -1025,6 +1060,64 @@ def _extract_video_metadata(self, url, video_id, season_id):
'description': self._html_search_meta('og:description', webpage)
})
+ def _get_comments_reply(self, root_id, next_id=0, display_id=None):
+ comment_api_raw_data = self._download_json(
+ ... | yt_dlp/extractor/bilibili.py | 26 | Python | 0.571 | suggestion | 77 | 51 | 51 | false | [extractor/biliIntl] Add comment extraction | 6,079 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | HobbyistDev |
yield {
'author': traverse_obj(replies, ('member', 'name')),
'author_id': traverse_obj(replies, ('member', 'mid')),
'author_thumbnail': traverse_obj(replies, ('member', 'face')),
'text': traverse_obj(replies, ('content', 'me... | ```suggestion
'__post_extractor': self.extract_comments(video_id, ep_id)
```
See next comment | self._parse_video_metadata(video_data), self._search_json_ld(webpage, video_id, fatal=False), {
'title': self._html_search_meta('og:title', webpage),
'description': self._html_search_meta('og:description', webpage)
})
def _get_comments_reply(self, root_id, ne... | @@ -1034,6 +1127,7 @@ def _real_extract(self, url):
**self._extract_video_metadata(url, video_id, season_id),
'formats': self._get_formats(ep_id=ep_id, aid=aid),
'subtitles': self.extract_subtitles(ep_id=ep_id, aid=aid),
+ '__post_extractor': self.extract_comments(video... | yt_dlp/extractor/bilibili.py | 26 | Python | 0.786 | refactor | 108 | 51 | 51 | false | [extractor/biliIntl] Add comment extraction | 6,079 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | HobbyistDev |
yield {
'author': traverse_obj(replies, ('member', 'name')),
'author_id': traverse_obj(replies, ('member', 'mid')),
'author_thumbnail': traverse_obj(replies, ('member', 'face')),
'text': traverse_obj(replies, ('content', 'message')),
... | ```suggestion
def _get_comments(self, video_id, ep_id):
for i in itertools.count(0):
comment_api_raw_data = self._download_json(
'https://api.bilibili.tv/reply/web/root', video_id,
note=f'Downloading comment page {i}',
query={
... | 'only_matching': True,
}]
def _make_url(video_id, series_id=None):
if series_id:
return f'https://www.bilibili.tv/en/play/{series_id}/{video_id}'
return f'https://www.bilibili.tv/en/video/{video_id}'
def _extract_video_metadata(self, url, video_id, season_id):
u... | @@ -1025,6 +1060,64 @@ def _extract_video_metadata(self, url, video_id, season_id):
'description': self._html_search_meta('og:description', webpage)
})
+ def _get_comments_reply(self, root_id, next_id=0, display_id=None):
+ comment_api_raw_data = self._download_json(
+ ... | yt_dlp/extractor/bilibili.py | 26 | Python | 1 | suggestion | 593 | 51 | 51 | false | [extractor/biliIntl] Add comment extraction | 6,079 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | HobbyistDev |
'height': height,
} for i in range(first, last + 1)]
def _real_extract(self, url):
mobj = self._match_valid_url(url)
video_id, host = mobj.group('id', 'host')
for display_id_key in ('display_id', 'display_id_2'):
if display_id_key in mobj.groupdict():
... | apparently now some pages have the config url as a hidden input value, add a check for that
```suggestion
inputs = self._hidden_inputs(webpage)
if not cfg_url:
cfg_url = inputs.get('config')
if not cfg_url and inputs.get('vkey') and inputs.get('nkey'):
```
and ... | 'height': height,
} for i in range(first, last + 1)]
def _real_extract(self, url):
mobj = self._match_valid_url(url)
video_id, host = mobj.group('id', 'host')
for display_id_key in ('display_id', 'display_id_2'):
if display_id_key in mobj.groupdict():
... | @@ -92,9 +92,8 @@ def _real_extract(self, url):
if not cfg_url:
inputs = self._hidden_inputs(webpage)
if inputs.get('vkey') and inputs.get('nkey'): | yt_dlp/extractor/tnaflix.py | 26 | Python | 0.786 | suggestion | 341 | 51 | 51 | false | Update tnaflix.com extractor url | 6,086 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | oxamun |
} for i in range(first, last + 1)]
def _real_extract(self, url):
mobj = self._match_valid_url(url)
video_id, host = mobj.group('id', 'host')
for display_id_key in ('display_id', 'display_id_2'):
if display_id_key in mobj.groupdict():
display_id = mobj.gro... | change `cfg_url` to `http` here to avoid cert problems
single-quotes for outer and double-quotes for inner
```suggestion
cfg_url = f'http://cdn-fck.{host}.com/{host}/{inputs["vkey"]}.fid'
``` | } for i in range(first, last + 1)]
def _real_extract(self, url):
mobj = self._match_valid_url(url)
video_id, host = mobj.group('id', 'host')
for display_id_key in ('display_id', 'display_id_2'):
if display_id_key in mobj.groupdict():
display_id = mobj.gro... | @@ -92,9 +92,8 @@ def _real_extract(self, url):
if not cfg_url:
inputs = self._hidden_inputs(webpage)
if inputs.get('vkey') and inputs.get('nkey'):
- cfg_url = f'https://www.{host}.com/cdn/cdn.php'
+ cfg_url = f"https://cdn-fck.{host}.com/{host}/{inputs['... | yt_dlp/extractor/tnaflix.py | 26 | Python | 0.857 | suggestion | 211 | 51 | 51 | false | Update tnaflix.com extractor url | 6,086 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | oxamun |
video_id = self._match_id(url).replace('_', '/')
item = self._download_json(
'http://api-live.dumpert.nl/mobile_api/json/info/' + video_id.replace('/', '_'),
video_id)['items'][0]
title = item['title']
media = next(m for m in item['media'] if m.get('mediatype') ==... | ```suggestion
preference = quality(version)
if determine_ext(uri) == 'm3u8':
formats.extend(self._extract_m3u8_formats(
uri, video_id, 'mp4', m3u8_id=version, quality=preference))
else:
formats.append({
'u... | 'only_matching': True,
}, {
'url': 'https://www.dumpert.nl/latest?selectedId=100031688_b317a185',
'only_matching': True,
}, {
'url': 'https://www.dumpert.nl/?selectedId=100031688_b317a185',
'only_matching': True,
}]
def _real_extract(self, url):
video_id ... | @@ -36,18 +56,25 @@ def _real_extract(self, url):
title = item['title']
media = next(m for m in item['media'] if m.get('mediatype') == 'VIDEO')
- quality = qualities(['flv', 'mobile', 'tablet', '720p'])
+ quality = qualities(['flv', 'mobile', 'tablet', '720p', '1080p'])
format... | yt_dlp/extractor/dumpert.py | 26 | Python | 0.857 | refactor | 441 | 51 | 51 | false | [extractor/Dumpert] Fix videos downloading as m3u8 files and added new-style valid URLs | 6,091 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | DataGhost |
from .common import InfoExtractor
from ..utils import (
determine_ext,
int_or_none,
qualities,
)
class DumpertIE(InfoExtractor):
_VALID_URL = r'(?P<protocol>https?)://(?:(?:www|legacy)\.)?dumpert\.nl(?:/(?:mediabase|embed|item)/|(?:/toppers|/latest|/?)\?selectedId=)(?P<id>[0-9]+[/_][0-9a-zA-Z]+)'
... | This's gotten complicated. Can you split it into multiple lines? | from .common import InfoExtractor
from ..utils import (
determine_ext,
int_or_none,
qualities,
)
class DumpertIE(InfoExtractor):
_VALID_URL = r'''(?x)
(?P<protocol>https?)://(?:(?:www|legacy)\.)?dumpert\.nl(?:
/(?:mediabase|embed|item)/|
(?:/toppers|/latest|/?)\?selecte... | @@ -1,12 +1,13 @@
from .common import InfoExtractor
from ..utils import (
+ determine_ext,
int_or_none,
qualities,
)
class DumpertIE(InfoExtractor):
- _VALID_URL = r'(?P<protocol>https?)://(?:(?:www|legacy)\.)?dumpert\.nl/(?:mediabase|embed|item)/(?P<id>[0-9]+[/_][0-9a-zA-Z]+)'
+ _VALID_URL =... | yt_dlp/extractor/dumpert.py | 10 | Python | 0.214 | question | 64 | 35 | 35 | false | [extractor/Dumpert] Fix videos downloading as m3u8 files and added new-style valid URLs | 6,091 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | DataGhost |
from .common import InfoExtractor
from ..utils import (
clean_html,
float_or_none,
int_or_none,
str_or_none,
traverse_obj,
unified_timestamp
)
class AnchorFMEpisodeIE(InfoExtractor):
_VALID_URL = r'https?://anchor\.fm/(?P<channel_name>\w+)/(?:embed/)?episodes/[\w-]+-(?P<episode_id>\w+)'
... | ```suggestion
_EMBED_REGEX = [rf'<iframe[^>]+\bsrc=[\'"](?P<url>{_VALID_URL})']
``` | from .common import InfoExtractor
from ..utils import (
clean_html,
float_or_none,
int_or_none,
str_or_none,
traverse_obj,
unified_timestamp
)
class AnchorFMEpisodeIE(InfoExtractor):
_VALID_URL = r'https?://anchor\.fm/(?P<channel_name>\w+)/(?:embed/)?episodes/[\w-]+-(?P<episode_id>\w+)'
... | @@ -0,0 +1,99 @@
+from .common import InfoExtractor
+from ..utils import (
+ clean_html,
+ float_or_none,
+ int_or_none,
+ str_or_none,
+ traverse_obj,
+ unified_timestamp
+)
+
+
+class AnchorFMEpisodeIE(InfoExtractor):
+ _VALID_URL = r'https?://anchor\.fm/(?P<channel_name>\w+)/(?:embed/)?episodes/... | yt_dlp/extractor/anchorfm.py | 16 | Python | 0.571 | suggestion | 89 | 41 | 41 | false | [extractor/anchor.fm] Add Episode Extractor | 6,092 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | HobbyistDev |
'id': 'e1shjqd',
'ext': 'mp3',
'release_date': '20221221',
'duration': 1042.008,
'season': 'Season 2',
'modified_timestamp': 1671590834,
'uploader_id': '2585461',
'modified_date': '20221221',
'description': 'md5:... | ```suggestion
'ext': 'mp3',
'vcodec': 'none',
``` | 'release_date': '20221221',
'duration': 1042.008,
'season': 'Season 2',
'modified_timestamp': 1671590834,
'uploader_id': '2585461',
'modified_date': '20221221',
'description': 'md5:9e95ad9293bf00178bf8d33e9cb92c41',
'season_... | @@ -0,0 +1,99 @@
+from .common import InfoExtractor
+from ..utils import (
+ clean_html,
+ float_or_none,
+ int_or_none,
+ str_or_none,
+ traverse_obj,
+ unified_timestamp
+)
+
+
+class AnchorFMEpisodeIE(InfoExtractor):
+ _VALID_URL = r'https?://anchor\.fm/(?P<channel_name>\w+)/(?:embed/)?episodes/... | yt_dlp/extractor/anchorfm.py | 26 | Python | 0.571 | suggestion | 76 | 40 | 39 | false | [extractor/anchor.fm] Add Episode Extractor | 6,092 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | HobbyistDev |
'description': 'md5:9e95ad9293bf00178bf8d33e9cb92c41',
'season_number': 2,
'title': 'S2E75 Perang Bintang di Balik Kasus Ferdy Sambo dan Ismail Bolong',
'release_timestamp': 1671595916,
'episode_id': 'e1shjqd',
'thumbnail': 'https://s3-us-west-2.am... | the url will always have the `episode_id`
```suggestion
'episode_id': episode_id,
``` | 'title': 'S2E75 Perang Bintang di Balik Kasus Ferdy Sambo dan Ismail Bolong',
'release_timestamp': 1671595916,
'episode_id': 'e1shjqd',
'thumbnail': 'https://s3-us-west-2.amazonaws.com/anchor-generated-image-bank/production/podcast_uploaded_episode400/2627805/2627805-1671... | @@ -0,0 +1,99 @@
+from .common import InfoExtractor
+from ..utils import (
+ clean_html,
+ float_or_none,
+ int_or_none,
+ str_or_none,
+ traverse_obj,
+ unified_timestamp
+)
+
+
+class AnchorFMEpisodeIE(InfoExtractor):
+ _VALID_URL = r'https?://anchor\.fm/(?P<channel_name>\w+)/(?:embed/)?episodes/... | yt_dlp/extractor/anchorfm.py | 26 | Python | 0.714 | suggestion | 100 | 32 | 31 | false | [extractor/anchor.fm] Add Episode Extractor | 6,092 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | HobbyistDev |
'release_timestamp': 1671595916,
'episode_id': 'e1shjqd',
'thumbnail': 'https://s3-us-west-2.amazonaws.com/anchor-generated-image-bank/production/podcast_uploaded_episode400/2627805/2627805-1671590688729-4db3882ac9e4b.jpg',
'uploader': 'Podcast Tempo',
'channe... | same for `channel_name`
```suggestion
'channel': channel_name,
``` | 'thumbnail': 'https://s3-us-west-2.amazonaws.com/anchor-generated-image-bank/production/podcast_uploaded_episode400/2627805/2627805-1671590688729-4db3882ac9e4b.jpg',
'uploader': 'Podcast Tempo',
'channel': 'apakatatempo',
}
}]
def _real_extract(self, url):
ch... | @@ -0,0 +1,99 @@
+from .common import InfoExtractor
+from ..utils import (
+ clean_html,
+ float_or_none,
+ int_or_none,
+ str_or_none,
+ traverse_obj,
+ unified_timestamp
+)
+
+
+class AnchorFMEpisodeIE(InfoExtractor):
+ _VALID_URL = r'https?://anchor\.fm/(?P<channel_name>\w+)/(?:embed/)?episodes/... | yt_dlp/extractor/anchorfm.py | 26 | Python | 0.571 | suggestion | 81 | 29 | 28 | false | [extractor/anchor.fm] Add Episode Extractor | 6,092 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | HobbyistDev |
'ext': 'mp3',
'release_date': '20221221',
'duration': 1042.008,
'season': 'Season 2',
'modified_timestamp': 1671590834,
'uploader_id': '2585461',
'modified_date': '20221221',
'description': 'md5:9e95ad9293bf00178bf8d33e9cb92... | ```suggestion
'url': traverse_obj(api_data, ('episode', 'episodeEnclosureUrl'), ('episodeAudios', 0, 'url')),
``` | 'ext': 'mp3',
'release_date': '20221221',
'duration': 1042.008,
'season': 'Season 2',
'modified_timestamp': 1671590834,
'uploader_id': '2585461',
'modified_date': '20221221',
'description': 'md5:9e95ad9293bf00178bf8d33e9cb92... | @@ -0,0 +1,98 @@
+from .common import InfoExtractor
+from ..utils import (
+ clean_html,
+ float_or_none,
+ int_or_none,
+ str_or_none,
+ traverse_obj,
+ unified_timestamp
+)
+
+
+class AnchorFMEpisodeIE(InfoExtractor):
+ _VALID_URL = r'https?://anchor\.fm/(?P<channel_name>\w+)/(?:embed/)?episodes/... | yt_dlp/extractor/anchorfm.py | 26 | Python | 0.714 | suggestion | 127 | 40 | 40 | false | [extractor/anchor.fm] Add Episode Extractor | 6,092 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | HobbyistDev |
from .common import InfoExtractor
from ..utils import traverse_obj
class MonsterSirenHypergryphMusicIE(InfoExtractor):
_VALID_URL = r'https?://monster-siren\.hypergryph\.com/music/(?P<id>\d+)'
_TESTS = [{
'url': 'https://monster-siren.hypergryph.com/music/514562',
'info_dict': {
'i... | `js_to_json` can make this simpler
```suggestion
json_data = self._search_json(
r'window\.g_initialProps\s*=', webpage, 'data', audio_id, transform_source=js_to_json)
``` | from .common import InfoExtractor
from ..utils import js_to_json, traverse_obj
class MonsterSirenHypergryphMusicIE(InfoExtractor):
_VALID_URL = r'https?://monster-siren\.hypergryph\.com/music/(?P<id>\d+)'
_TESTS = [{
'url': 'https://monster-siren.hypergryph.com/music/514562',
'info_dict': {
... | @@ -0,0 +1,34 @@
+from .common import InfoExtractor
+from ..utils import traverse_obj
+
+
+class MonsterSirenHypergryphMusicIE(InfoExtractor):
+ _VALID_URL = r'https?://monster-siren\.hypergryph\.com/music/(?P<id>\d+)'
+ _TESTS = [{
+ 'url': 'https://monster-siren.hypergryph.com/music/514562',
+ 'in... | yt_dlp/extractor/hypergryph.py | 26 | Python | 0.714 | suggestion | 196 | 35 | 33 | false | [extractor/hypergryph] Add MonsterSirenHypergryphMusic extractor | 6,094 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | HobbyistDev |
class MonsterSirenHypergryphMusicIE(InfoExtractor):
_VALID_URL = r'https?://monster-siren\.hypergryph\.com/music/(?P<id>\d+)'
_TESTS = [{
'url': 'https://monster-siren.hypergryph.com/music/514562',
'info_dict': {
'id': '514562',
'ext': 'wav',
'artist': ['塞壬唱... | `audio_id` can't be `None`
```suggestion
'id': audio_id,
``` |
class MonsterSirenHypergryphMusicIE(InfoExtractor):
_VALID_URL = r'https?://monster-siren\.hypergryph\.com/music/(?P<id>\d+)'
_TESTS = [{
'url': 'https://monster-siren.hypergryph.com/music/514562',
'info_dict': {
'id': '514562',
'ext': 'wav',
'artist': ['塞壬唱... | @@ -0,0 +1,34 @@
+from .common import InfoExtractor
+from ..utils import traverse_obj
+
+
+class MonsterSirenHypergryphMusicIE(InfoExtractor):
+ _VALID_URL = r'https?://monster-siren\.hypergryph\.com/music/(?P<id>\d+)'
+ _TESTS = [{
+ 'url': 'https://monster-siren.hypergryph.com/music/514562',
+ 'in... | yt_dlp/extractor/hypergryph.py | 26 | Python | 0.571 | suggestion | 75 | 33 | 31 | false | [extractor/hypergryph] Add MonsterSirenHypergryphMusic extractor | 6,094 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | HobbyistDev |
class MonsterSirenHypergryphMusicIE(InfoExtractor):
_VALID_URL = r'https?://monster-siren\.hypergryph\.com/music/(?P<id>\d+)'
_TESTS = [{
'url': 'https://monster-siren.hypergryph.com/music/514562',
'info_dict': {
'id': '514562',
'ext': 'wav',
'artist': ['塞壬唱... | ```suggestion
'ext': 'wav',
'vcodec': 'none',
``` |
class MonsterSirenHypergryphMusicIE(InfoExtractor):
_VALID_URL = r'https?://monster-siren\.hypergryph\.com/music/(?P<id>\d+)'
_TESTS = [{
'url': 'https://monster-siren.hypergryph.com/music/514562',
'info_dict': {
'id': '514562',
'ext': 'wav',
'artist': ['塞壬唱... | @@ -0,0 +1,34 @@
+from .common import InfoExtractor
+from ..utils import traverse_obj
+
+
+class MonsterSirenHypergryphMusicIE(InfoExtractor):
+ _VALID_URL = r'https?://monster-siren\.hypergryph\.com/music/(?P<id>\d+)'
+ _TESTS = [{
+ 'url': 'https://monster-siren.hypergryph.com/music/514562',
+ 'in... | yt_dlp/extractor/hypergryph.py | 26 | Python | 0.571 | suggestion | 76 | 33 | 31 | false | [extractor/hypergryph] Add MonsterSirenHypergryphMusic extractor | 6,094 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | HobbyistDev |
'description': 'Trailer \'Jujutsu Kaisen\' Ver.01',
'cast': ['Junya Enoki', ' Yûichi Nakamura', ' Yuma Uchida', 'Asami Seto'],
'age_limit': 13,
}
}, {
# json ld metadata type equal to Movie instead of TVEpisodes
'url': 'https://www.viu.com/ott/id/id/all/vi... | ```suggestion
episode_json = traverse_obj(
self._yield_json_ld(webpage, display_id),
lambda _, v: v['@type'] in ('TVEpisode', 'Movie')) or {}
```
Is this what you meant? | 'description': 'Trailer \'Jujutsu Kaisen\' Ver.01',
'cast': ['Junya Enoki', ' Yûichi Nakamura', ' Yuma Uchida', 'Asami Seto'],
'age_limit': 13,
}
}, {
# json ld metadata type equal to Movie instead of TVEpisodes
'url': 'https://www.viu.com/ott/id/id/all/vi... | @@ -394,3 +397,146 @@ def download_playback():
'formats': formats,
'subtitles': subtitles,
}
+
+
+class ViuOTTNewBaseIE(InfoExtractor):
+ _BASE_QUERY = {
+ 'ver': 1.0,
+ 'fmt': 'json',
+ 'aver': 5.0,
+ 'appver': 2.0,
+ 'appid': 'viu_desktop',
+ ... | yt_dlp/extractor/viu.py | 26 | Python | 0.929 | question | 206 | 51 | 51 | false | [extractor/viu] Add ViuOTTNew extractor | 6,099 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | HobbyistDev |
'age_limit': 13,
}
}, {
# json ld metadata type equal to Movie instead of TVEpisodes
'url': 'https://www.viu.com/ott/id/id/all/video-japanese-animation-movies-demon_slayer_kimetsu_no_yaiba_the_movie_mugen_train-1165892707?containerId=1675060691786',
'info_dict': {
... | ```suggestion
r'window\.__INITIAL_STATE__\s*=', webpage, 'initial state',
```
name is to be human readable | 'age_limit': 13,
}
}, {
# json ld metadata type equal to Movie instead of TVEpisodes
'url': 'https://www.viu.com/ott/id/id/all/video-japanese-animation-movies-demon_slayer_kimetsu_no_yaiba_the_movie_mugen_train-1165892707?containerId=1675060691786',
'info_dict': {
... | @@ -394,3 +397,146 @@ def download_playback():
'formats': formats,
'subtitles': subtitles,
}
+
+
+class ViuOTTNewBaseIE(InfoExtractor):
+ _BASE_QUERY = {
+ 'ver': 1.0,
+ 'fmt': 'json',
+ 'aver': 5.0,
+ 'appver': 2.0,
+ 'appid': 'viu_desktop',
+ ... | yt_dlp/extractor/viu.py | 26 | Python | 0.714 | suggestion | 121 | 51 | 51 | false | [extractor/viu] Add ViuOTTNew extractor | 6,099 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | HobbyistDev |
'id': '1165892707',
'ext': 'mp4',
'timestamp': 1577836800,
'upload_date': '20200101',
'title': 'Demon Slayer - Kimetsu no Yaiba - The Movie: Mugen Train',
'age_limit': 13,
'cast': 'count:9',
'thumbnail': 'https://vuclipi-a.a... | ```suggestion
formats, subtitles = self._extract_m3u8_formats_and_subtitles(video_data['playUrl'], display_id)
``` | 'id': '1165892707',
'ext': 'mp4',
'timestamp': 1577836800,
'upload_date': '20200101',
'title': 'Demon Slayer - Kimetsu no Yaiba - The Movie: Mugen Train',
'age_limit': 13,
'cast': 'count:9',
'thumbnail': 'https://vuclipi-a.a... | @@ -394,3 +397,146 @@ def download_playback():
'formats': formats,
'subtitles': subtitles,
}
+
+
+class ViuOTTNewBaseIE(InfoExtractor):
+ _BASE_QUERY = {
+ 'ver': 1.0,
+ 'fmt': 'json',
+ 'aver': 5.0,
+ 'appver': 2.0,
+ 'appid': 'viu_desktop',
+ ... | yt_dlp/extractor/viu.py | 26 | Python | 0.786 | refactor | 124 | 51 | 51 | false | [extractor/viu] Add ViuOTTNew extractor | 6,099 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | HobbyistDev |
'description': 'Trailer \'Jujutsu Kaisen\' Ver.01',
'cast': ['Junya Enoki', ' Yûichi Nakamura', ' Yuma Uchida', 'Asami Seto'],
'age_limit': 13,
}
}, {
# json ld metadata type equal to Movie instead of TVEpisodes
'url': 'https://www.viu.com/ott/id/id/all/vi... | move this down, close to where it's used | 'description': 'Trailer \'Jujutsu Kaisen\' Ver.01',
'cast': ['Junya Enoki', ' Yûichi Nakamura', ' Yuma Uchida', 'Asami Seto'],
'age_limit': 13,
}
}, {
# json ld metadata type equal to Movie instead of TVEpisodes
'url': 'https://www.viu.com/ott/id/id/all/vi... | @@ -394,3 +397,146 @@ def download_playback():
'formats': formats,
'subtitles': subtitles,
}
+
+
+class ViuOTTNewBaseIE(InfoExtractor):
+ _BASE_QUERY = {
+ 'ver': 1.0,
+ 'fmt': 'json',
+ 'aver': 5.0,
+ 'appver': 2.0,
+ 'appid': 'viu_desktop',
+ ... | yt_dlp/extractor/viu.py | 26 | Python | 0.143 | refactor | 40 | 51 | 51 | false | [extractor/viu] Add ViuOTTNew extractor | 6,099 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | HobbyistDev |
r'window\.__INITIAL_STATE__\s*=', webpage, 'window.__INITIAL_STATE__',
display_id)['content']['clipDetails']
video_data = self._download_json(
f'https://um.viuapi.io/drm/v1/content/{display_id}', display_id, data=b'',
headers={'Authorization': ViuOTTNewBaseIE._TOK... | ```suggestion
'title': (traverse_obj(initial_state_json, 'title', 'display_title')
or episode_json.get('name')),
```
same below | headers={'Authorization': ViuOTTIndonesiaBaseIE._TOKEN, **self._HEADERS, 'ccode': 'ID'})
formats, subtitles = self._extract_m3u8_formats_and_subtitles(video_data['playUrl'], display_id)
initial_state = self._search_json(
r'window\.__INITIAL_STATE__\s*=', webpage, 'initial state'... | @@ -394,3 +397,146 @@ def download_playback():
'formats': formats,
'subtitles': subtitles,
}
+
+
+class ViuOTTNewBaseIE(InfoExtractor):
+ _BASE_QUERY = {
+ 'ver': 1.0,
+ 'fmt': 'json',
+ 'aver': 5.0,
+ 'appver': 2.0,
+ 'appid': 'viu_desktop',
+ ... | yt_dlp/extractor/viu.py | 26 | Python | 0.714 | suggestion | 165 | 40 | 40 | false | [extractor/viu] Add ViuOTTNew extractor | 6,099 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | HobbyistDev |
if lang and ext:
subtitles.setdefault(lang, []).append({
'ext': ext,
'url': initial_state_json[key]
})
subtitles[lang].append({
'ext': 'srt',
'url': f'{remove_end(initial_state_jso... | ```suggestion
'age_limit': self._AGE_RATINGS_MAPPER.get(
initial_state_json.get('internal_age_rating'))
``` | 'ext': ext,
'url': url,
})
if ext == 'vtt':
subtitles[lang].append({
'ext': 'srt',
'url': f'{remove_end(initial_state[key], "vtt")}srt',
})
episode = ... | @@ -394,3 +397,146 @@ def download_playback():
'formats': formats,
'subtitles': subtitles,
}
+
+
+class ViuOTTNewBaseIE(InfoExtractor):
+ _BASE_QUERY = {
+ 'ver': 1.0,
+ 'fmt': 'json',
+ 'aver': 5.0,
+ 'appver': 2.0,
+ 'appid': 'viu_desktop',
+ ... | yt_dlp/extractor/viu.py | 26 | Python | 0.714 | suggestion | 138 | 28 | 28 | false | [extractor/viu] Add ViuOTTNew extractor | 6,099 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | HobbyistDev |
display_id = self._match_id(url)
webpage = self._download_webpage(url, display_id)
episode_json = traverse_obj(list(filter(
lambda x: x.get('@type') in ('TVEpisode', 'Movie'), self._yield_json_ld(webpage, display_id))), 0) or {}
initial_state_json = self._search_json(
... | ```suggestion
for key, url in initial_state_json.items():
lang, ext = self._search_regex(
r'^subtitle_(?P<lang>[\w-]+)_(?P<ext>\w+)$', key, 'subtitle metadata',
default=(None, None), group=('lang', 'ext'))
if lang and ext:
subtitles.s... | display_id = self._match_id(url)
webpage = self._download_webpage(url, display_id)
video_data = self._download_json(
f'https://um.viuapi.io/drm/v1/content/{display_id}', display_id, data=b'',
headers={'Authorization': ViuOTTIndonesiaBaseIE._TOKEN, **self._HEADERS, 'ccode... | @@ -394,3 +397,146 @@ def download_playback():
'formats': formats,
'subtitles': subtitles,
}
+
+
+class ViuOTTNewBaseIE(InfoExtractor):
+ _BASE_QUERY = {
+ 'ver': 1.0,
+ 'fmt': 'json',
+ 'aver': 5.0,
+ 'appver': 2.0,
+ 'appid': 'viu_desktop',
+ ... | yt_dlp/extractor/viu.py | 26 | Python | 0.857 | suggestion | 576 | 45 | 45 | false | [extractor/viu] Add ViuOTTNew extractor | 6,099 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | HobbyistDev |
lang, ext = self._search_regex(
r'^subtitle_(?P<lang>[\w-]+)_(?P<ext>\w+)$', key, 'subtitle metadata',
default=(None, None), group=('lang', 'ext'))
if lang and ext:
subtitles.setdefault(lang, []).append({
'ext': ext,
... | ```suggestion
'episode_number': (traverse_obj(initial_state_json, 'episode_no', 'episodeno', expected_type=int_or_none)
or episode_json.get('episodeNumber')),
``` | default=(None, None), group=('lang', 'ext'))
if lang and ext:
subtitles.setdefault(lang, []).append({
'ext': ext,
'url': url,
})
if ext == 'vtt':
subtitles[lang].append({
... | @@ -394,3 +397,146 @@ def download_playback():
'formats': formats,
'subtitles': subtitles,
}
+
+
+class ViuOTTNewBaseIE(InfoExtractor):
+ _BASE_QUERY = {
+ 'ver': 1.0,
+ 'fmt': 'json',
+ 'aver': 5.0,
+ 'appver': 2.0,
+ 'appid': 'viu_desktop',
+ ... | yt_dlp/extractor/viu.py | 26 | Python | 0.929 | suggestion | 208 | 31 | 31 | false | [extractor/viu] Add ViuOTTNew extractor | 6,099 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | HobbyistDev |
'age_limit': 13,
}
}, {
# json ld metadata type equal to Movie instead of TVEpisodes
'url': 'https://www.viu.com/ott/id/id/all/video-japanese-animation-movies-demon_slayer_kimetsu_no_yaiba_the_movie_mugen_train-1165892707?containerId=1675060691786',
'info_dict': {
... | ```suggestion
episode = traverse_obj(list(filter(
lambda x: x.get('@type') in ('TVEpisode', 'Movie'), self._yield_json_ld(webpage, display_id))), 0) or {}
initial_state = self._search_json(
r'window\.__INITIAL_STATE__\s*=', webpage, 'window.__INITIAL_STATE__',
```
These a... | 'age_limit': 13,
}
}, {
# json ld metadata type equal to Movie instead of TVEpisodes
'url': 'https://www.viu.com/ott/id/id/all/video-japanese-animation-movies-demon_slayer_kimetsu_no_yaiba_the_movie_mugen_train-1165892707?containerId=1675060691786',
'info_dict': {
... | @@ -394,3 +397,146 @@ def download_playback():
'formats': formats,
'subtitles': subtitles,
}
+
+
+class ViuOTTNewBaseIE(InfoExtractor):
+ _BASE_QUERY = {
+ 'ver': 1.0,
+ 'fmt': 'json',
+ 'aver': 5.0,
+ 'appver': 2.0,
+ 'appid': 'viu_desktop',
+ ... | yt_dlp/extractor/viu.py | 26 | Python | 0.929 | suggestion | 338 | 51 | 51 | false | [extractor/viu] Add ViuOTTNew extractor | 6,099 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | HobbyistDev |
}
_DEVICE_ID = str(uuid.uuid4())
_SESSION_ID = str(uuid.uuid4())
_TOKEN = None
_HEADERS = {
'x-session-id': _SESSION_ID,
'x-client': 'browser'
}
_AGE_RATINGS_MAPPER = {
'ADULTS': 18,
'teens': 13
}
def _real_initialize(self):
ViuOTTNewBaseIE... | If there is only one class, baseclass isnt needed | }
_DEVICE_ID = str(uuid.uuid4())
_SESSION_ID = str(uuid.uuid4())
_TOKEN = None
_HEADERS = {
'x-session-id': _SESSION_ID,
'x-client': 'browser'
}
_AGE_RATINGS_MAPPER = {
'ADULTS': 18,
'teens': 13
}
def _real_initialize(self):
ViuOTTIndonesia... | @@ -394,3 +397,146 @@ def download_playback():
'formats': formats,
'subtitles': subtitles,
}
+
+
+class ViuOTTNewBaseIE(InfoExtractor):
+ _BASE_QUERY = {
+ 'ver': 1.0,
+ 'fmt': 'json',
+ 'aver': 5.0,
+ 'appver': 2.0,
+ 'appid': 'viu_desktop',
+ ... | yt_dlp/extractor/viu.py | 26 | Python | 0.071 | suggestion | 49 | 51 | 51 | false | [extractor/viu] Add ViuOTTNew extractor | 6,099 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | HobbyistDev |
'url': url,
})
if ext == 'vtt':
subtitles[lang].append({
'ext': 'srt',
'url': f'{remove_end(initial_state[key], "vtt")}srt',
})
episode = traverse_obj(list(filter(
... | ```suggestion
'age_limit': self._AGE_RATINGS_MAPPER.get(initial_state.get('internal_age_rating'))
``` | 'url': url,
})
if ext == 'vtt':
subtitles[lang].append({
'ext': 'srt',
'url': f'{remove_end(initial_state[key], "vtt")}srt',
})
episode = traverse_obj(list(filter(
... | @@ -394,3 +397,147 @@ def download_playback():
'formats': formats,
'subtitles': subtitles,
}
+
+
+class ViuOTTIndonesiaBaseIE(InfoExtractor):
+ _BASE_QUERY = {
+ 'ver': 1.0,
+ 'fmt': 'json',
+ 'aver': 5.0,
+ 'appver': 2.0,
+ 'appid': 'viu_desktop'... | yt_dlp/extractor/viu.py | 26 | Python | 0.714 | suggestion | 115 | 28 | 27 | false | [extractor/viu] Add ViuOTTNew extractor | 6,099 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | HobbyistDev |
from .common import InfoExtractor
from ..utils import (
float_or_none,
parse_qs,
unified_timestamp,
)
class ClypIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?clyp\.it/(?P<id>[a-z0-9]+)'
_TESTS = [{
'url': 'https://clyp.it/ojz2wfah',
'md5': '1d4961036c41247ecfdcc439c0cddcbb',... | this test case is outdated, file was deleted | from .common import InfoExtractor
from ..utils import (
float_or_none,
parse_qs,
unified_timestamp,
)
class ClypIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?clyp\.it/(?P<id>[a-z0-9]+)'
_TESTS = [{
'url': 'https://clyp.it/iynkjk4b',
'md5': '4bc6371c65210e7b372097fce4d92441',... | @@ -9,16 +9,16 @@
class ClypIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?clyp\.it/(?P<id>[a-z0-9]+)'
_TESTS = [{
- 'url': 'https://clyp.it/ojz2wfah', | yt_dlp/extractor/clyp.py | 12 | Python | 0.071 | suggestion | 44 | 37 | 37 | false | [extractor/clyp] Added wav download support | 6,102 | yt-dlp/yt-dlp | 132,642 | Python | qulaz | qulaz |
from .common import InfoExtractor
from ..utils import (
float_or_none,
parse_qs,
unified_timestamp,
)
class ClypIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?clyp\.it/(?P<id>[a-z0-9]+)'
_TESTS = [{
'url': 'https://clyp.it/ojz2wfah',
'md5': '1d4961036c41247ecfdcc439c0cddcbb',... | * Doesn't need to be a function
* The https check can be part of the regex
* Relax the regex with `\s*`
* Change `\"` to `\'"`, `.+` to `[^\'"]+` | from .common import InfoExtractor
from ..utils import (
float_or_none,
parse_qs,
unified_timestamp,
)
class ClypIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?clyp\.it/(?P<id>[a-z0-9]+)'
_TESTS = [{
'url': 'https://clyp.it/iynkjk4b',
'md5': '4bc6371c65210e7b372097fce4d92441',... | @@ -74,3 +97,11 @@ def _real_extract(self, url):
'timestamp': timestamp,
'formats': formats,
}
+
+ def get_wav_format(self, url, audio_id):
+ page = self._download_webpage(url, video_id=audio_id)
+ wav_url = self._html_search_regex(
+ r'var wavStreamUrl = \... | yt_dlp/extractor/clyp.py | 26 | Python | 0.571 | suggestion | 148 | 77 | 100 | false | [extractor/clyp] Added wav download support | 6,102 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | qulaz |
'id': 'b04p1odi',
'ext': 'mp3',
'title': 'GJ! (Reward Edit)',
'description': 'Metal Resistance (THE ONE edition)',
'duration': 177.789,
'timestamp': 1528241278,
'upload_date': '20180605',
},
'params': {
'skip... | ```suggestion
```
Shouldn't be needed | 'id': 'b04p1odi',
'ext': 'ogg',
'title': 'GJ! (Reward Edit)',
'description': 'Metal Resistance (THE ONE edition)',
'duration': 177.789,
'timestamp': 1528241278,
'upload_date': '20180605',
},
'params': {
'skip... | @@ -34,6 +34,21 @@ class ClypIE(InfoExtractor):
'params': {
'skip_download': True,
},
+ }, {
+ 'url': 'https://clyp.it/v42214lc',
+ 'md5': '4aca4dfc3236fb6d6ddc4ea08314f33f',
+ 'info_dict': {
+ 'id': 'v42214lc',
+ 'ext': 'wav',
+ 't... | yt_dlp/extractor/clyp.py | 26 | Python | 0.5 | suggestion | 39 | 51 | 51 | false | [extractor/clyp] Added wav download support | 6,102 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | qulaz |
from .common import InfoExtractor
from ..utils import (
float_or_none,
parse_qs,
unified_timestamp,
)
class ClypIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?clyp\.it/(?P<id>[a-z0-9]+)'
_TESTS = [{
'url': 'https://clyp.it/ojz2wfah',
'md5': '1d4961036c41247ecfdcc439c0cddcbb',... | ```suggestion
```
Neither of the tests have description? Add one with it is possible | from .common import InfoExtractor
from ..utils import (
float_or_none,
parse_qs,
unified_timestamp,
)
class ClypIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?clyp\.it/(?P<id>[a-z0-9]+)'
_TESTS = [{
'url': 'https://clyp.it/iynkjk4b',
'md5': '4bc6371c65210e7b372097fce4d92441',... | @@ -9,16 +9,16 @@
class ClypIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?clyp\.it/(?P<id>[a-z0-9]+)'
_TESTS = [{
- 'url': 'https://clyp.it/ojz2wfah',
- 'md5': '1d4961036c41247ecfdcc439c0cddcbb',
+ 'url': 'https://clyp.it/2poken35',
+ 'md5': 'd0ec74cafbd1506fddc8ec4b6fe010b... | yt_dlp/extractor/clyp.py | 18 | Python | 0.571 | suggestion | 86 | 43 | 43 | false | [extractor/clyp] Added wav download support | 6,102 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | qulaz |
qs = parse_qs(url)
token = qs.get('token', [None])[0]
query = {}
if token:
query['token'] = token
metadata = self._download_json(
'https://api.clyp.it/%s' % audio_id, audio_id, query=query)
formats = []
for secure in ('', 'Secure'):
... | ```suggestion
r'var\s*wavStreamUrl\s*=\s*["\'](?P<url>https?://[^\'"]+)', page, 'url', default=None)
``` | query = {}
if token:
query['token'] = token
metadata = self._download_json(
'https://api.clyp.it/%s' % audio_id, audio_id, query=query)
formats = []
for secure in ('', 'Secure'):
for ext in ('Ogg', 'Mp3'):
format_id = '%s%s' %... | @@ -61,6 +76,16 @@ def _real_extract(self, url):
'vcodec': 'none',
})
+ page = self._download_webpage(url, video_id=audio_id)
+ wav_url = self._html_search_regex(
+ r'var\s*wavStreamUrl\s*=\s*["\'](?P<url>https?://[^\'"]+)', page, 'url', default='... | yt_dlp/extractor/clyp.py | 26 | Python | 0.714 | suggestion | 118 | 47 | 45 | false | [extractor/clyp] Added wav download support | 6,102 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | qulaz |
_LOGIN_ERRORS = {
1502: 'The username and password you entered did not match.', # LOGIN_FAILED
1503: 'Payment method is expired.', # LOGIN_FAILED_ACCOUNT_NOT_ACTIVE
1506: 'Your BrainPOP plan has expired.', # LOGIN_FAILED_ACCOUNT_EXPIRED
1507: 'Terms not accepted.', # LOGIN_FAILED... | ```suggestion
formats = self._extract_m3u8_formats(
f'{urljoin(self._VIDEO_URL, slug)}.m3u8?{token}',
display_id, 'mp4', m3u8_id=f'{format_id}-hls', fatal=False)
formats.append({
'format_id': format_id,
'url': f'{urljoin(self._VIDEO_URL, slug)}?{toke... | class BrainPOPBaseIE(InfoExtractor):
_NETRC_MACHINE = 'brainpop'
_ORIGIN = '' # So that _VALID_URL doesn't crash
_LOGIN_ERRORS = {
1502: 'The username and password you entered did not match.', # LOGIN_FAILED
1503: 'Payment method is expired.', # LOGIN_FAILED_ACCOUNT_NOT_ACTIVE
150... | @@ -0,0 +1,322 @@
+import json
+
+from .common import InfoExtractor
+from ..utils import (
+ int_or_none,
+ traverse_obj,
+ urljoin
+)
+
+
+class BrainPOPBaseIE(InfoExtractor):
+ _NETRC_MACHINE = 'brainpop'
+ _LOGIN_ERRORS = {
+ 1502: 'The username and password you entered did not match.', # LOGI... | yt_dlp/extractor/brainpop.py | 26 | Python | 0.857 | refactor | 428 | 51 | 51 | false | [BrainPOP] Add extractors | 6,106 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | MinePlayersPE |
formats = []
if data.get(key_format % 'high'):
formats.extend(self._assemble_formats(data[key_format % 'high'], 'high', display_id, token, {
'quality': -1,
**extra_fields
}))
if data.get(key_format % 'low'):
formats.extend(self.... | Can be significantly simplified by using traverse_obj and looking up the additional fields in a dict | formats.append({
'format_id': format_id,
'url': f'{urljoin(self._VIDEO_URL, slug)}?{token}',
})
for f in formats:
f.update(extra_fields)
return formats
def _extract_adaptive_formats(self, data, token, display_id, key_format='%s', extra_fields={}):... | @@ -0,0 +1,322 @@
+import json
+
+from .common import InfoExtractor
+from ..utils import (
+ int_or_none,
+ traverse_obj,
+ urljoin
+)
+
+
+class BrainPOPBaseIE(InfoExtractor):
+ _NETRC_MACHINE = 'brainpop'
+ _LOGIN_ERRORS = {
+ 1502: 'The username and password you entered did not match.', # LOGI... | yt_dlp/extractor/brainpop.py | 26 | Python | 0.357 | suggestion | 100 | 51 | 51 | false | [BrainPOP] Add extractors | 6,106 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | MinePlayersPE |
'format_id': format_id,
'url': '%s?%s' % (urljoin(self._VIDEO_URL, slug), token),
**extra_fields
})
formats.extend({**f, **extra_fields} for f in self._extract_m3u8_formats(
'%s.m3u8?%s' % (urljoin(self._HLS_URL, slug), token),
display_id, 'mp4... | ~~Maybe language_preference is more suitable?~~ | @classproperty
def _VALID_URL(cls):
root = re.escape(cls._ORIGIN).replace(r'https:', r'https?:').replace(r'www\.', r'(?:www\.)?')
return rf'{root}/(?P<slug>[^/]+/[^/]+/(?P<id>[^/?#&]+))'
def _assemble_formats(self, slug, format_id, display_id, token='', extra_fields={}):
formats = [... | @@ -0,0 +1,322 @@
+import json
+
+from .common import InfoExtractor
+from ..utils import (
+ int_or_none,
+ traverse_obj,
+ urljoin
+)
+
+
+class BrainPOPBaseIE(InfoExtractor):
+ _NETRC_MACHINE = 'brainpop'
+ _LOGIN_ERRORS = {
+ 1502: 'The username and password you entered did not match.', # LOGI... | yt_dlp/extractor/brainpop.py | 26 | Python | 0.143 | suggestion | 47 | 51 | 51 | false | [BrainPOP] Add extractors | 6,106 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | MinePlayersPE |
}))
if data.get(key_format % 'low'):
formats.extend(self._assemble_formats(data[key_format % 'high'], 'low', display_id, token, {
'quality': -2,
**extra_fields
}))
if data.get(key_format % 'ad_high'):
formats.extend(self._as... | ```suggestion
data=json.dumps({'username': username, 'password': password}).encode(),
``` | f.update(extra_fields)
return formats
def _extract_adaptive_formats(self, data, token, display_id, key_format='%s', extra_fields={}):
formats = []
additional_key_formats = {
'%s': {},
'ad_%s': {
'format_note': 'Audio description',
... | @@ -0,0 +1,322 @@
+import json
+
+from .common import InfoExtractor
+from ..utils import (
+ int_or_none,
+ traverse_obj,
+ urljoin
+)
+
+
+class BrainPOPBaseIE(InfoExtractor):
+ _NETRC_MACHINE = 'brainpop'
+ _LOGIN_ERRORS = {
+ 1502: 'The username and password you entered did not match.', # LOGI... | yt_dlp/extractor/brainpop.py | 26 | Python | 0.786 | suggestion | 103 | 51 | 51 | false | [BrainPOP] Add extractors | 6,106 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | MinePlayersPE |
'quality': -1,
'format_note': 'Audio description',
'source_preference': -2,
**extra_fields
}))
if data.get(key_format % 'ad_low'):
formats.extend(self._assemble_formats(data[key_format % 'ad_low'], 'ad_low', display_id, toke... | ```suggestion
self.report_warning(
f'Unable to login: {self._LOGIN_ERRORS.get(status_code) or login_res.get("message")}'
or f'Got status code {status_code}')
``` | 'format_note': 'Audio description',
'source_preference': -2
}
}
for additional_key_format, additional_key_fields in additional_key_formats.items():
for key_quality, key_index in enumerate(('high', 'low')):
full_key_index = additiona... | @@ -0,0 +1,322 @@
+import json
+
+from .common import InfoExtractor
+from ..utils import (
+ int_or_none,
+ traverse_obj,
+ urljoin
+)
+
+
+class BrainPOPBaseIE(InfoExtractor):
+ _NETRC_MACHINE = 'brainpop'
+ _LOGIN_ERRORS = {
+ 1502: 'The username and password you entered did not match.', # LOGI... | yt_dlp/extractor/brainpop.py | 26 | Python | 0.929 | suggestion | 209 | 51 | 51 | false | [BrainPOP] Add extractors | 6,106 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | MinePlayersPE |
'display_id': 'martinlutherkingjr',
'description': 'md5:f403dbb2bf3ccc7cf4c59d9e43e3c349',
},
}, {
'url': 'https://www.brainpop.com/science/space/bigbang/',
'md5': '9a1ff0e77444dd9e437354eb669c87ec',
'info_dict': {
'id': 'acae52cd48c99acf',
... | why not try movie_data['topic'] first? | 'title': 'Martin Luther King, Jr.',
'display_id': 'martinlutherkingjr',
'description': 'md5:f403dbb2bf3ccc7cf4c59d9e43e3c349',
},
}, {
'url': 'https://www.brainpop.com/science/space/bigbang/',
'md5': '9a1ff0e77444dd9e437354eb669c87ec',
'info_dict':... | @@ -0,0 +1,322 @@
+import json
+
+from .common import InfoExtractor
+from ..utils import (
+ int_or_none,
+ traverse_obj,
+ urljoin
+)
+
+
+class BrainPOPBaseIE(InfoExtractor):
+ _NETRC_MACHINE = 'brainpop'
+ _LOGIN_ERRORS = {
+ 1502: 'The username and password you entered did not match.', # LOGI... | yt_dlp/extractor/brainpop.py | 26 | Python | 0.071 | question | 38 | 51 | 51 | false | [BrainPOP] Add extractors | 6,106 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | MinePlayersPE |
'subtitles': subtitles,
}
class BrainPOPLegacyBaseIE(BrainPOPBaseIE):
def _parse_js_topic_data(self, topic_data, display_id, token):
movie_data = topic_data['movies']
# TODO: Are there non-burned subtitles?
formats = self._extract_adaptive_formats(movie_data, token, dis... | ```suggestion
token = self._search_regex(r'ec_token\s*:\s*[\'"]([^\'"]+)', webpage, 'video token')
``` | 'formats': formats,
'subtitles': subtitles,
}
class BrainPOPLegacyBaseIE(BrainPOPBaseIE):
def _parse_js_topic_data(self, topic_data, display_id, token):
movie_data = topic_data['movies']
# TODO: Are there non-burned subtitles?
formats = self._extract_adaptiv... | @@ -0,0 +1,322 @@
+import json
+
+from .common import InfoExtractor
+from ..utils import (
+ int_or_none,
+ traverse_obj,
+ urljoin
+)
+
+
+class BrainPOPBaseIE(InfoExtractor):
+ _NETRC_MACHINE = 'brainpop'
+ _LOGIN_ERRORS = {
+ 1502: 'The username and password you entered did not match.', # LOGI... | yt_dlp/extractor/brainpop.py | 26 | Python | 0.714 | suggestion | 112 | 51 | 51 | false | [BrainPOP] Add extractors | 6,106 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | MinePlayersPE |
}))
if data.get(key_format % 'ad_low'):
formats.extend(self._assemble_formats(data[key_format % 'ad_low'], 'ad_low', display_id, token, {
'quality': -2,
'format_note': 'Audio description',
'source_preference': -2,
**extra_fi... | ```suggestion
@classproperty
def _VALID_URL(cls):
root = re.escape(cls._ORIGIN).replace(r'https:', r'https?:').replace(r'www\.', r'(?:www\.)?')
return rf'{root}/(?P<slug>(?:[^/?#]+/){2}(?P<id>[^/?#]+))'
```
This can be used in baseclass. Not sure if it's worth it | for additional_key_format, additional_key_fields in additional_key_formats.items():
for key_quality, key_index in enumerate(('high', 'low')):
full_key_index = additional_key_format % (key_format % key_index)
if data.get(full_key_index):
formats.ext... | @@ -0,0 +1,322 @@
+import json
+
+from .common import InfoExtractor
+from ..utils import (
+ int_or_none,
+ traverse_obj,
+ urljoin
+)
+
+
+class BrainPOPBaseIE(InfoExtractor):
+ _NETRC_MACHINE = 'brainpop'
+ _LOGIN_ERRORS = {
+ 1502: 'The username and password you entered did not match.', # LOGI... | yt_dlp/extractor/brainpop.py | 26 | Python | 0.857 | security | 293 | 51 | 51 | false | [BrainPOP] Add extractors | 6,106 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | MinePlayersPE |
import json
import re
from .common import InfoExtractor
from ..utils import (
classproperty,
int_or_none,
traverse_obj,
urljoin
)
class BrainPOPBaseIE(InfoExtractor):
_NETRC_MACHINE = 'brainpop'
_LOGIN_ERRORS = {
1502: 'The username and password you entered did not match.', # LOGIN_F... | ```suggestion
_ORIGIN = '' # So that _VALID_URL doesn't crash
_LOGIN_ERRORS = {
``` | import json
import re
from .common import InfoExtractor
from ..utils import (
classproperty,
int_or_none,
traverse_obj,
urljoin
)
class BrainPOPBaseIE(InfoExtractor):
_NETRC_MACHINE = 'brainpop'
_ORIGIN = '' # So that _VALID_URL doesn't crash
_LOGIN_ERRORS = {
1502: 'The username... | @@ -0,0 +1,317 @@
+import json
+import re
+
+from .common import InfoExtractor
+from ..utils import (
+ classproperty,
+ int_or_none,
+ traverse_obj,
+ urljoin
+)
+
+
+class BrainPOPBaseIE(InfoExtractor):
+ _NETRC_MACHINE = 'brainpop'
+ _LOGIN_ERRORS = { | yt_dlp/extractor/brainpop.py | 16 | Python | 0.714 | bug | 95 | 41 | 41 | false | [BrainPOP] Add extractors | 6,106 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | MinePlayersPE |
'description': audio_description,
'categories': list(filter(None, [audio_info.get('category_name')])),
'duration': audio_info.get('duration'),
'view_count': audio_info.get('play_count'),
'like_count': audio_info.get('favorites_count'),
'formats': f... | for playlists it's good to test the number of entries too
```suggestion
},
'playlist_mincount': 41,
``` | 'description': audio_description,
'categories': list(filter(None, [audio_info.get('category_name')])),
'duration': audio_info.get('duration'),
'view_count': audio_info.get('play_count'),
'like_count': audio_info.get('favorites_count'),
'formats': f... | @@ -123,14 +123,20 @@ def _real_extract(self, url):
class XimalayaAlbumIE(XimalayaBaseIE):
IE_NAME = 'ximalaya:album'
IE_DESC = '喜马拉雅FM 专辑'
- _VALID_URL = r'https?://(?:www\.|m\.)?ximalaya\.com/\d+/album/(?P<id>[0-9]+)'
+ _VALID_URL = r'https?://(?:www\.|m\.)?ximalaya\.com/(?:\d+/)?album/(?P<id>[0-9]+)... | yt_dlp/extractor/ximalaya.py | 26 | Python | 0.714 | suggestion | 123 | 51 | 51 | false | [extractor/ximalaya] updated album URL regex, tests | 6,110 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | carusocr |
traverse_obj(
nextjs_data, ('props', 'pageProps', ('data', 'OpenGraphParameters')), get_all=False)
or self._download_json(f'https://yappy.media/api/video/{video_id}', video_id))
media_url = media_data['link']
has_watermark = str(media_url).endswith('wm.mp4')
... | ```suggestion
media_url = traverse_obj(media_data, ('link', {url_or_none})) or ''
has_watermark = media_url.endswith('-wm.mp4')
formats = [{
'url': media_url,
'ext': 'mp4',
'format_note': 'Watermarked' if has_watermark else None,
'preferen... | traverse_obj(
nextjs_data, ('props', 'pageProps', ('data', 'OpenGraphParameters')), get_all=False)
or self._download_json(f'https://yappy.media/api/video/{video_id}', video_id))
media_url = traverse_obj(media_data, ('link', {url_or_none})) or ''
has_watermark = m... | @@ -0,0 +1,97 @@
+from .common import InfoExtractor
+from ..utils import (
+ int_or_none,
+ traverse_obj,
+ unified_timestamp,
+ url_or_none
+)
+
+
+class YappyIE(InfoExtractor):
+ _VALID_URL = r'https?://yappy\.media/video/(?P<id>\w+)'
+ _TESTS = [{
+ 'url': 'https://yappy.media/video/47fea6d8... | yt_dlp/extractor/yappy.py | 26 | Python | 0.857 | suggestion | 833 | 45 | 47 | false | [extractor/yappy] Add extractor | 6,111 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | HobbyistDev |
from .common import InfoExtractor
from ..utils import (
int_or_none,
traverse_obj,
unified_timestamp,
url_or_none
)
class YappyIE(InfoExtractor):
_VALID_URL = r'https?://yappy\.media/video/(?P<id>\w+)'
_TESTS = [{
'url': 'https://yappy.media/video/47fea6d8586f48d1a0cf96a7342aabd2',
... | Instead of taking out specific keys, use `merge_dict` with `json_ld` | audio_link = traverse_obj(media_data, ('audio', 'link'))
if audio_link:
formats.append({
'url': audio_link,
'ext': 'mp3',
'acodec': 'mp3',
'vcodec': 'none'
})
return {
'id': video_id,
... | @@ -0,0 +1,97 @@
+from .common import InfoExtractor
+from ..utils import (
+ int_or_none,
+ traverse_obj,
+ unified_timestamp,
+ url_or_none
+)
+
+
+class YappyIE(InfoExtractor):
+ _VALID_URL = r'https?://yappy\.media/video/(?P<id>\w+)'
+ _TESTS = [{
+ 'url': 'https://yappy.media/video/47fea6d8... | yt_dlp/extractor/yappy.py | 26 | Python | 0.429 | suggestion | 68 | 98 | 27 | false | [extractor/yappy] Add extractor | 6,111 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | HobbyistDev |
__typename
}
fragment PeopleItem on People {
role
slug
nameEn
nameZhHans
nameZhHant
__typename
}
"""
def _get_video_info(self, episode_number, program_slu... | ```suggestion
"query": self._QUERY
}).encode())['data']['episode']
``` | import json
import urllib.error
from .common import InfoExtractor
from ..utils import (
ExtractorError,
GeoRestrictedError,
float_or_none,
traverse_obj,
try_call
)
class OnDemandChinaEpisodeIE(InfoExtractor):
_VALID_URL = r'https?://www\.ondemandchina\.com/\w+/watch/(?P<series>[\w-]+)/(?P<id>... | @@ -0,0 +1,177 @@
+import json
+
+from .common import InfoExtractor
+from ..utils import (
+ ExtractorError,
+ GeoRestrictedError,
+ float_or_none,
+ traverse_obj,
+ try_call
+)
+
+
+class OnDemandChinaEpisodeIE(InfoExtractor):
+ _VALID_URL = r'https?://www\.ondemandchina\.com/\w+/watch/(?P<series_nam... | yt_dlp/extractor/odkmedia.py | 26 | Python | 0.714 | suggestion | 101 | 51 | 106 | false | [extractor/odkmedia] Add OnDemandChinaEpisode extractor | 6,116 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | HobbyistDev |
video_info = self._download_json(
'https://odc-graphql.odkmedia.io/graphql', display_id,
headers={'Content-type': 'application/json'},
data=json.dumps({
"operationName": "Episode",
"variables": {
"programSlug": program_slug,... | `e` maynot have a `cause.read`. See https://github.com/yt-dlp/yt-dlp/blob/59d7de0da545944c48a82fc2937b996d7cd8cc9c/yt_dlp/extractor/filmon.py#L42-L46
(Use urllib.error.HTTPError) | import json
import urllib.error
from .common import InfoExtractor
from ..utils import (
ExtractorError,
GeoRestrictedError,
float_or_none,
traverse_obj,
try_call
)
class OnDemandChinaEpisodeIE(InfoExtractor):
_VALID_URL = r'https?://www\.ondemandchina\.com/\w+/watch/(?P<series>[\w-]+)/(?P<id>... | @@ -0,0 +1,177 @@
+import json
+
+from .common import InfoExtractor
+from ..utils import (
+ ExtractorError,
+ GeoRestrictedError,
+ float_or_none,
+ traverse_obj,
+ try_call
+)
+
+
+class OnDemandChinaEpisodeIE(InfoExtractor):
+ _VALID_URL = r'https?://www\.ondemandchina\.com/\w+/watch/(?P<series_nam... | yt_dlp/extractor/odkmedia.py | 26 | Python | 0.714 | refactor | 181 | 51 | 106 | false | [extractor/odkmedia] Add OnDemandChinaEpisode extractor | 6,116 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | HobbyistDev |
video_info = self._get_video_info(ep_number, program_slug, display_id)
try:
source_json = self._download_json(
f'https://odkmedia.io/odc/api/v2/playback/{video_info["id"]}/', display_id,
headers={'Authorization': '', 'service-name': 'odc'})
except Extr... | ```suggestion
'alt_title': traverse_obj(video_info, 'titleKo', 'titleZhHans', 'titleZhHant'),
``` | import json
import urllib.error
from .common import InfoExtractor
from ..utils import (
ExtractorError,
GeoRestrictedError,
float_or_none,
traverse_obj,
try_call
)
class OnDemandChinaEpisodeIE(InfoExtractor):
_VALID_URL = r'https?://www\.ondemandchina\.com/\w+/watch/(?P<series>[\w-]+)/(?P<id>... | @@ -0,0 +1,177 @@
+import json
+
+from .common import InfoExtractor
+from ..utils import (
+ ExtractorError,
+ GeoRestrictedError,
+ float_or_none,
+ traverse_obj,
+ try_call
+)
+
+
+class OnDemandChinaEpisodeIE(InfoExtractor):
+ _VALID_URL = r'https?://www\.ondemandchina\.com/\w+/watch/(?P<series_nam... | yt_dlp/extractor/odkmedia.py | 26 | Python | 0.714 | suggestion | 111 | 35 | 106 | false | [extractor/odkmedia] Add OnDemandChinaEpisode extractor | 6,116 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | HobbyistDev |
'variables': {
'programSlug': program_slug,
'episodeNumber': int(ep_number),
'kind': 'series',
'part': None
},
'query': self._QUERY}
).encode())['data']['episode']
try:
... | we could put the `type` value in the warning so that users' logs are more useful to us:
```suggestion
self.report_warning('Unsupported format {source.get("type")}', display_id)
``` | import json
import urllib.error
from .common import InfoExtractor
from ..utils import (
ExtractorError,
GeoRestrictedError,
float_or_none,
traverse_obj,
try_call
)
class OnDemandChinaEpisodeIE(InfoExtractor):
_VALID_URL = r'https?://www\.ondemandchina\.com/\w+/watch/(?P<series>[\w-]+)/(?P<id>... | @@ -0,0 +1,139 @@
+import json
+import urllib.error
+
+from .common import InfoExtractor
+from ..utils import (
+ ExtractorError,
+ GeoRestrictedError,
+ float_or_none,
+ traverse_obj,
+ try_call
+)
+
+
+class OnDemandChinaEpisodeIE(InfoExtractor):
+ _VALID_URL = r'https?://www\.ondemandchina\.com/\w+... | yt_dlp/extractor/odkmedia.py | 26 | Python | 0.929 | suggestion | 199 | 44 | 106 | false | [extractor/odkmedia] Add OnDemandChinaEpisode extractor | 6,116 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | HobbyistDev |
videoCcLanguages
videoDuration
releaseDate
people {
...PeopleItem
__typename
}
images {
thumbnail
__typename
}
ageRating {
isBlock
... | There's so much metadata here that you aren't using. If you can actually extract them, that would be best. If not, remove them from query | video_info = self._download_json(
'https://odc-graphql.odkmedia.io/graphql', display_id,
headers={'Content-type': 'application/json'},
data=json.dumps({
'operationName': 'Episode',
'query': self._QUERY,
'variables': {
... | @@ -0,0 +1,139 @@
+import json
+import urllib.error
+
+from .common import InfoExtractor
+from ..utils import (
+ ExtractorError,
+ GeoRestrictedError,
+ float_or_none,
+ traverse_obj,
+ try_call
+)
+
+
+class OnDemandChinaEpisodeIE(InfoExtractor):
+ _VALID_URL = r'https?://www\.ondemandchina\.com/\w+... | yt_dlp/extractor/odkmedia.py | 26 | Python | 0.429 | refactor | 137 | 51 | 47 | false | [extractor/odkmedia] Add OnDemandChinaEpisode extractor | 6,116 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | HobbyistDev |
from .common import InfoExtractor
class VocarooIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?(?:vocaroo\.com|voca\.ro)/(?:embed/)?(?P<id>[a-zA-Z0-9]{11,12})'
_TESTS = [
{
'url': 'https://vocaroo.com/1de8yA3LNe77',
'md5': 'c557841d5e50261777a6585648adf439',
'i... | ```suggestion
'ext': 'mp3',
'vcodec': 'none',
``` | 'md5': 'f322e529275dd8a47994919eeac404a5',
'info_dict': {
'id': '19cgWmKO6AmC',
'ext': 'mp3',
'title': 'Vocaroo video #19cgWmKO6AmC',
'timestamp': 1675093841.408,
'upload_date': '20230130',
},
},
... | @@ -0,0 +1,35 @@
+from .common import InfoExtractor
+
+
+class VocarooIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?(?:vocaroo\.com|voca\.ro)/(?:embed/)?(?P<id>[a-zA-Z0-9]{11,12})'
+ _TESTS = [
+ {
+ 'url': 'https://vocaroo.com/1de8yA3LNe77',
+ 'md5': 'c557841d5e50261777a6585... | yt_dlp/extractor/vocaroo.py | 26 | Python | 0.571 | suggestion | 76 | 36 | 31 | false | [extractor/vocaroo] Add Vocaroo extractor | 6,117 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | qbnu |
_TESTS = [
{
'url': 'https://vocaroo.com/1de8yA3LNe77',
'md5': 'c557841d5e50261777a6585648adf439',
'info_dict': {
'id': '1de8yA3LNe77',
'ext': 'mp3',
'title': 'Vocaroo 1de8yA3LNe77',
},
},
{
... | ```suggestion
'title': '',
``` |
class VocarooIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?(?:vocaroo\.com|voca\.ro)/(?:embed/)?(?P<id>\w+)'
_EMBED_REGEX = [r'<iframe[^>]+src=(["\'])(?P<url>(?:https?://)?(?:www\.)?vocaroo\.com/embed/.+?)\1']
_TESTS = [
{
'url': 'https://vocaroo.com/1de8yA3LNe77',
'... | @@ -0,0 +1,35 @@
+from .common import InfoExtractor
+
+
+class VocarooIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?(?:vocaroo\.com|voca\.ro)/(?:embed/)?(?P<id>[a-zA-Z0-9]{11,12})'
+ _TESTS = [
+ {
+ 'url': 'https://vocaroo.com/1de8yA3LNe77',
+ 'md5': 'c557841d5e50261777a6585... | yt_dlp/extractor/vocaroo.py | 26 | Python | 0.429 | suggestion | 44 | 31 | 51 | false | [extractor/vocaroo] Add Vocaroo extractor | 6,117 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | qbnu |
from .common import InfoExtractor
class VocarooIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?(?:vocaroo\.com|voca\.ro)/(?:embed/)?(?P<id>[a-zA-Z0-9]{11,12})'
_TESTS = [
{
'url': 'https://vocaroo.com/1de8yA3LNe77',
'md5': 'c557841d5e50261777a6585648adf439',
'i... | ```suggestion
_VALID_URL = r'https?://(?:www\.)?(?:vocaroo\.com|voca\.ro)/(?:embed/)?(?P<id>\w+)'
``` | from .common import InfoExtractor
from ..utils import (
HEADRequest,
float_or_none,
)
class VocarooIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?(?:vocaroo\.com|voca\.ro)/(?:embed/)?(?P<id>\w+)'
_EMBED_REGEX = [r'<iframe[^>]+src=(["\'])(?P<url>(?:https?://)?(?:www\.)?vocaroo\.com/embed/.+?)\1']... | @@ -0,0 +1,35 @@
+from .common import InfoExtractor
+
+
+class VocarooIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?(?:vocaroo\.com|voca\.ro)/(?:embed/)?(?P<id>[a-zA-Z0-9]{11,12})' | yt_dlp/extractor/vocaroo.py | 5 | Python | 0.714 | suggestion | 107 | 30 | 30 | false | [extractor/vocaroo] Add Vocaroo extractor | 6,117 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | qbnu |
_WEBPAGE_TESTS = [
{
'url': 'https://qbnu.github.io/cool.html',
'md5': 'f322e529275dd8a47994919eeac404a5',
'info_dict': {
'id': '19cgWmKO6AmC',
'ext': 'mp3',
'title': 'Vocaroo video #19cgWmKO6AmC',
'timestam... | ```suggestion
resp = self._request_webpage(HEADRequest(url), audio_id, headers=http_headers)
``` |
_WEBPAGE_TESTS = [
{
'url': 'https://qbnu.github.io/cool.html',
'md5': 'f322e529275dd8a47994919eeac404a5',
'info_dict': {
'id': '19cgWmKO6AmC',
'ext': 'mp3',
'title': 'Vocaroo video #19cgWmKO6AmC',
'timestam... | @@ -0,0 +1,68 @@
+from .common import InfoExtractor
+from ..utils import (
+ HEADRequest,
+ float_or_none,
+)
+
+
+class VocarooIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?(?:vocaroo\.com|voca\.ro)/(?:embed/)?(?P<id>\w+)'
+ _EMBED_REGEX = [r'<iframe[^>]+src=(["\'])(?P<url>(?:https?://)?(?:www\.)?... | yt_dlp/extractor/vocaroo.py | 26 | Python | 0.714 | suggestion | 106 | 38 | 35 | false | [extractor/vocaroo] Add Vocaroo extractor | 6,117 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | qbnu |
'upload_date': '20230130',
},
},
]
def _real_extract(self, url):
audio_id = self._match_id(url)
if len(audio_id) == 10 or (len(audio_id) == 12 and audio_id[0] == '1'):
media_subdomain = 'media1'
else:
media_subdomain = 'media'
... | ```suggestion
return {
'id': audio_id,
'title': '',
'url': url,
'ext': 'mp3',
'timestamp': float_or_none(resp.getheader('x-bz-upload-timestamp'), scale=1000),
'vcodec': 'none',
'http_headers': http_headers,
``` | from .common import InfoExtractor
from ..utils import (
HEADRequest,
float_or_none,
)
class VocarooIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?(?:vocaroo\.com|voca\.ro)/(?:embed/)?(?P<id>\w+)'
_EMBED_REGEX = [r'<iframe[^>]+src=(["\'])(?P<url>(?:https?://)?(?:www\.)?vocaroo\.com/embed/.+?)\1']... | @@ -0,0 +1,68 @@
+from .common import InfoExtractor
+from ..utils import (
+ HEADRequest,
+ float_or_none,
+)
+
+
+class VocarooIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?(?:vocaroo\.com|voca\.ro)/(?:embed/)?(?P<id>\w+)'
+ _EMBED_REGEX = [r'<iframe[^>]+src=(["\'])(?P<url>(?:https?://)?(?:www\.)?... | yt_dlp/extractor/vocaroo.py | 26 | Python | 0.786 | suggestion | 311 | 28 | 66 | false | [extractor/vocaroo] Add Vocaroo extractor | 6,117 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | qbnu |
while True:
for video in video_list:
v = self._VIDEO._make(video[:2])
video_id = '%d_%d' % (v.owner_id, v.id)
yield self.url_result(
'http://vk.com/video' + video_id, VKIE.ie_key(), video_id)
if count >= total:
... | ```suggestion
section = f'playlist_{section}'
``` | class VKWallPostIE(VKBaseIE):
IE_NAME = 'vk:wallpost'
_VALID_URL = r'https?://(?:(?:(?:(?:m|new)\.)?vk\.com/(?:[^?]+\?.*\bw=)?wall(?P<id>-?\d+_\d+)))'
_TESTS = [{
# public page URL, audio playlist
'url': 'https://vk.com/bs.official?w=wall-23538238_35',
'info_dict': {
'id'... | @@ -595,6 +595,7 @@ def _real_extract(self, url):
page_id = self._search_regex(r'data-owner-id\s?=\s?"([^"]+)"', webpage, 'page_id')
elif '_' in u_id:
page_id, section = u_id.split('_', 1)
+ section = 'playlist_' + section | yt_dlp/extractor/vk.py | 26 | Python | 0.571 | suggestion | 63 | 51 | 51 | false | [extractor/vk] playlist fix for new API requirements | 6,122 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | the-marenga |
ext\.php\?(?P<embed_query>.*?\boid=(?P<oid>-?\d+).*?\bid=(?P<id>\d+).*)|
(?:
(?:(?:m|new)\.)?vk\.com/(?:.+?\?.*?z=)?(?:video|clip)|
(?:www\.)?daxab.com/embed/
)
... | Can you explain this? The URL no longer has .jpg? If so, does yt-dlp still write the thumbnail correctly? | (?:www\.)?daxab.com/
)
ext\.php\?(?P<embed_query>.*?\boid=(?P<oid>-?\d+).*?\bid=(?P<id>\d+).*)|
(?:
(?:(?:m|new)\.)?vk\.com/(?:.+?\?.*?z=)?(?:video|clip)|
... | @@ -117,7 +117,7 @@ class VKIE(VKBaseIE):
'upload_date': '20120212',
'comment_count': int,
'like_count': int,
- 'thumbnail': r're:https?://.+\.jpg$',
+ 'thumbnail': r're:https?://.+(?:\.jpg|getVideoPreview.*)$', | yt_dlp/extractor/vk.py | 26 | Python | 0.357 | question | 105 | 51 | 51 | false | [extractor/vk] playlist fix for new API requirements | 6,122 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | the-marenga |
post_id = self._match_id(url)
webpage = self._download_payload('wkview', post_id, {
'act': 'show',
'w': 'wall' + post_id,
})[1]
description = clean_html(get_element_by_class('wall_post_text', webpage))
uploader = clean_html(get_element_by_class('author',... | ```suggestion
entries.append({
'id': f'{audio["owner_id"]}_{audio["id"]},
'url': audio['url'],
'title': join_nonempty(audio.get('artist'), audio.get('title'), delim=' - '),
'thumbnails': try_call(lambda: [{'url': u} for u in audio['coverUr... |
def _real_extract(self, url):
post_id = self._match_id(url)
webpage = self._download_payload('wkview', post_id, {
'act': 'show',
'w': 'wall' + post_id,
})[1]
uploader = clean_html(get_element_by_class('PostHeaderTitle__authorName', webpage))
entrie... | @@ -710,21 +672,20 @@ def _real_extract(self, url):
for audio in re.findall(r'data-audio="([^"]+)', webpage):
audio = self._parse_json(unescapeHTML(audio), post_id)
- a = self._AUDIO._make(audio[:16])
- if not a.url:
+ if not audio['url']:
contin... | yt_dlp/extractor/vk.py | 26 | Python | 0.786 | suggestion | 494 | 43 | 44 | false | [extractor/vk] playlist fix for new API requirements | 6,122 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | the-marenga |
mask_url[index] = c
mask_url = ''.join(mask_url)
return mask_url
def _real_extract(self, url):
post_id = self._match_id(url)
webpage = self._download_payload('wkview', post_id, {
'act': 'show',
'w': 'wall' + post_id,
})[1]
... | I think I found the issue. Try removing `url`, `ext`, `protocol` and add `'formats': self._extract_m3u8_formats(...)` instead | index = indexes[url_len - 1 - n]
mask_url[n] = mask_url[index]
mask_url[index] = c
mask_url = ''.join(mask_url)
return mask_url
def _real_extract(self, url):
post_id = self._match_id(url)
webpage = self._download_payload('wkview',... | @@ -710,21 +672,20 @@ def _real_extract(self, url):
for audio in re.findall(r'data-audio="([^"]+)', webpage):
audio = self._parse_json(unescapeHTML(audio), post_id)
- a = self._AUDIO._make(audio[:16])
- if not a.url:
+ if not audio['url']:
contin... | yt_dlp/extractor/vk.py | 26 | Python | 0.571 | refactor | 125 | 48 | 49 | false | [extractor/vk] playlist fix for new API requirements | 6,122 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | the-marenga |
_VALID_URL = r'(?:tvpstream:|https?://(?:tvpstream\.vod|stream)\.tvp\.pl/(?:\?(?:[^&]+[&;])*channel_id=)?)(?P<id>\d*)'
_TESTS = [{
'url': 'https://stream.tvp.pl/?channel_id=56969941',
'only_matching': True,
}, {
# untestable as "video" id changes many times across a day
'url'... | ```suggestion
r'window\.__channels\s*=', webpage, 'channel list', channel_id,
``` | _VALID_URL = r'(?:tvpstream:|https?://(?:tvpstream\.vod|stream)\.tvp\.pl/(?:\?(?:[^&]+[&;])*channel_id=)?)(?P<id>\d*)'
_TESTS = [{
'url': 'https://stream.tvp.pl/?channel_id=56969941',
'only_matching': True,
}, {
# untestable as "video" id changes many times across a day
'url'... | @@ -285,28 +288,21 @@ class TVPStreamIE(InfoExtractor):
'only_matching': True,
}]
- _PLAYER_BOX_RE = r'<div\s[^>]*id\s*=\s*["\']?tvp_player_box["\']?[^>]+data-%s-id\s*=\s*["\']?(\d+)'
- _BUTTON_RE = r'<div\s[^>]*data-channel-id=["\']?%s["\']?[^>]*\sdata-title=(?:"([^"]*)"|\'([^\']*)\')[^>]*\sdata-... | yt_dlp/extractor/tvp.py | 26 | Python | 0.571 | suggestion | 95 | 51 | 51 | false | [extractor/tvp] fix for new tvp stream | 6,139 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | selfisekai |
}, {
'url': 'tvpstream:39821455',
'only_matching': True,
}, {
# the default stream when you provide no channel_id, most probably TVP Info
'url': 'tvpstream:',
'only_matching': True,
}, {
'url': 'https://tvpstream.vod.tvp.pl/',
'only_matching': True,
... | ```suggestion
'title': audition.get('title'),
``` | }, {
'url': 'tvpstream:39821455',
'only_matching': True,
}, {
# the default stream when you provide no channel_id, most probably TVP Info
'url': 'tvpstream:',
'only_matching': True,
}, {
'url': 'https://tvpstream.vod.tvp.pl/',
'only_matching': True,
... | @@ -285,28 +288,21 @@ class TVPStreamIE(InfoExtractor):
'only_matching': True,
}]
- _PLAYER_BOX_RE = r'<div\s[^>]*id\s*=\s*["\']?tvp_player_box["\']?[^>]+data-%s-id\s*=\s*["\']?(\d+)'
- _BUTTON_RE = r'<div\s[^>]*data-channel-id=["\']?%s["\']?[^>]*\sdata-title=(?:"([^"]*)"|\'([^\']*)\')[^>]*\sdata-... | yt_dlp/extractor/tvp.py | 26 | Python | 0.571 | suggestion | 63 | 51 | 51 | false | [extractor/tvp] fix for new tvp stream | 6,139 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | selfisekai |
'only_matching': True,
}, {
'url': 'https://www.zdf.de/dokumentation/planet-e/planet-e-uebersichtsseite-weitere-dokumentationen-von-planet-e-100.html',
'only_matching': True,
}, {
'url': 'https://www.zdf.de/arte/todliche-flucht/page-video-artede-toedliche-flucht-16-100.html',
... | Do you know why these changed? If not, make sure to check on the site that the new data is correct | 'url': 'https://www.zdf.de/filme/taunuskrimi/die-lebenden-und-die-toten-1---ein-taunuskrimi-100.html',
'only_matching': True,
}, {
'url': 'https://www.zdf.de/dokumentation/planet-e/planet-e-uebersichtsseite-weitere-dokumentationen-von-planet-e-100.html',
'only_matching': True,
},... | @@ -241,10 +242,23 @@ class ZDFIE(ZDFBaseIE):
'title': 'Das Geld anderer Leute',
'description': 'md5:cb6f660850dc5eb7d1ab776ea094959d',
'duration': 2581.0,
- 'timestamp': 1654790700,
- 'upload_date': '20220609', | yt_dlp/extractor/zdf.py | 26 | Python | 0.286 | suggestion | 98 | 51 | 51 | false | [extractor/zdf] Use android API endpoint for UHD downloads | 6,150 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | seproDev |
}, {
# non asf in streams
'url': 'http://www.npo.nl/hoe-gaat-europa-verder-na-parijs/10-01-2015/WO_NOS_762771',
'info_dict': {
'id': 'WO_NOS_762771',
'ext': 'mp4',
'title': 'Hoe gaat Europa verder na Parijs?',
},
'params': {
'sk... | ```suggestion
},
```
What's the point of tests if you skip when it breaks? | 'skip_download': True,
},
}, {
# non asf in streams
'url': 'http://www.npo.nl/hoe-gaat-europa-verder-na-parijs/10-01-2015/WO_NOS_762771',
'info_dict': {
'id': 'WO_NOS_762771',
'ext': 'mp4',
'title': 'Hoe gaat Europa verder na Parijs?',
... | @@ -115,7 +113,8 @@ class NPOIE(NPOBaseIE):
},
'params': {
'skip_download': True,
- }
+ },
+ 'skip': 'Currently broken', | yt_dlp/extractor/npo.py | 26 | Python | 0.571 | question | 85 | 51 | 51 | false | [extractor/npo] Fix extractor and add HD support | 6,155 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | seproDev |
'thumbnail': 'https://images.npo.nl/tile/1280x720/1827650.jpg',
'episode_number': 8,
'upload_date': '20221121',
},
'params': {
'skip_download': True,
},
}]
@classmethod
def suitable(cls, url):
return (False if any(ie.suitable(u... | ```suggestion
xsrf_token = try_call(lambda: urllib.parse.unquote(
self._get_cookies('https://www.npostart.nl')['XSRF-TOKEN'].value)
``` | 'upload_date': '20221121',
},
'params': {
'skip_download': True,
},
}]
@classmethod
def suitable(cls, url):
return (False if any(ie.suitable(url)
for ie in (NPOLiveIE, NPORadioIE, NPORadioFragmentIE))
else super(NPOIE, ... | @@ -179,15 +206,15 @@ def suitable(cls, url):
def _real_extract(self, url):
video_id = self._match_id(url)
- return self._get_info(url, video_id) or self._get_old_info(video_id)
- def _get_info(self, url, video_id):
- token = self._download_json(
+ self._download_json(
... | yt_dlp/extractor/npo.py | 26 | Python | 0.714 | suggestion | 158 | 51 | 51 | false | [extractor/npo] Fix extractor and add HD support | 6,155 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | seproDev |
def suitable(cls, url):
return (False if any(ie.suitable(url)
for ie in (NPOLiveIE, NPORadioIE, NPORadioFragmentIE))
else super(NPOIE, cls).suitable(url))
def _real_extract(self, url):
video_id = self._match_id(url)
self._download_json(
'http... | the token extraction could just be inlined here too | for ie in (NPOLiveIE, NPORadioIE, NPORadioFragmentIE))
else super(NPOIE, cls).suitable(url))
def _real_extract(self, url):
video_id = self._match_id(url)
if urllib.parse.urlparse(url).netloc in ['www.ntr.nl', 'ntr.nl']:
player = self._download_json(
... | @@ -196,8 +223,9 @@ def _get_info(self, url, video_id):
'share': 1,
'pageUrl': url,
'hasAdConsent': 0,
- '_token': token,
- }))
+ }), headers={
+ 'x-xsrf-token': xsrf_token | yt_dlp/extractor/npo.py | 26 | Python | 0.286 | refactor | 51 | 51 | 51 | false | [extractor/npo] Fix extractor and add HD support | 6,155 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | seproDev |
else:
formats.append({
'url': stream_url,
})
if not formats:
if not self.get_param('allow_unplayable_formats') and drm:
self.report_drm(video_id)
info = {
'id': video_id,
'title': video_... | You are sure this is no longer used by any video? | entry_protocol='m3u8_native', m3u8_id='hls', fatal=False))
elif re.search(r'\.isml?/Manifest', stream_url):
formats.extend(self._extract_ism_formats(
stream_url, video_id, ism_id='mss', fatal=False))
else:
formats.append({
... | @@ -291,188 +319,8 @@ def _get_info(self, url, video_id):
return info
- def _get_old_info(self, video_id): | yt_dlp/extractor/npo.py | 26 | Python | 0.143 | question | 49 | 51 | 51 | false | [extractor/npo] Fix extractor and add HD support | 6,155 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | seproDev |
'series': 'The Genius',
'description': 'md5:db02f1456939ca63f7c408f858044e94',
'title': 'The Genius',
'timestamp': 1669062000,
'creator': 'NED3',
'episode': 'The Genius',
'thumbnail': 'https://images.npo.nl/tile/1280x720/1827650.jpg',
... | ```suggestion
self._request_webpage(
'https://www.npostart.nl/api/token', video_id,
```
There is no read to parse or even read the result if it's not gonna be used | 'url': 'https://www.npo3.nl/the-genius/21-11-2022/VPWON_1341105',
'info_dict': {
'id': 'VPWON_1341105',
'ext': 'mp4',
'duration': 2658,
'series': 'The Genius',
'description': 'md5:db02f1456939ca63f7c408f858044e94',
'title': 'The Gen... | @@ -179,15 +199,13 @@ def suitable(cls, url):
def _real_extract(self, url):
video_id = self._match_id(url)
- return self._get_info(url, video_id) or self._get_old_info(video_id)
- def _get_info(self, url, video_id):
- token = self._download_json(
+ self._download_json(
... | yt_dlp/extractor/npo.py | 26 | Python | 0.786 | suggestion | 187 | 51 | 51 | false | [extractor/npo] Fix extractor and add HD support | 6,155 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | seproDev |
if urllib.parse.urlparse(url).netloc in ['www.ntr.nl', 'ntr.nl']:
player = self._download_json(
'https://www.ntr.nl/ajax/player/embed/%s' % video_id, video_id,
'Downloading player JSON', query={
'parameters[elementId]': 'npo' + str(random.randint(0... | ```suggestion
player = self._download_json(
f'https://www.ntr.nl/ajax/player/embed/{video_id}', video_id,
'Downloading player JSON', query={
'parameters[elementId]': f'npo{random.randint(0, 999)}',
'parameters[sterReferralUrl]': ur... | if urllib.parse.urlparse(url).netloc in ['www.ntr.nl', 'ntr.nl']:
player = self._download_json(
f'https://www.ntr.nl/ajax/player/embed/{video_id}', video_id,
'Downloading player JSON', query={
'parameters[elementId]': f'npo{random.randint(0, 999)}'... | @@ -179,25 +204,32 @@ def suitable(cls, url):
def _real_extract(self, url):
video_id = self._match_id(url)
- return self._get_info(url, video_id) or self._get_old_info(video_id)
-
- def _get_info(self, url, video_id):
- token = self._download_json(
- 'https://www.npostart.nl/... | yt_dlp/extractor/npo.py | 26 | Python | 0.786 | suggestion | 1,225 | 51 | 51 | false | [extractor/npo] Fix extractor and add HD support | 6,155 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | seproDev |
import binascii
import json
import time
from .common import InfoExtractor
from ..utils import (
ExtractorError,
int_or_none,
jwt_decode_hs256,
traverse_obj,
url_or_none,
)
class WrestleUniverseBaseIE(InfoExtractor):
_VALID_URL_TMPL = r'https?://(?:www\.)?wrestle-universe\.com/(?:(?P<lang>\w{2... | ```suggestion
WrestleUniverseBaseIE._TOKEN = try_call(lambda: self._get_cookies(
'https://www.wrestle-universe.com/')['token'].value)
if not self._TOKEN:
self.raise_login_required()
``` | import binascii
import json
import time
from .common import InfoExtractor
from ..dependencies import Cryptodome
from ..utils import (
ExtractorError,
int_or_none,
jwt_decode_hs256,
traverse_obj,
try_call,
url_or_none,
)
class WrestleUniverseBaseIE(InfoExtractor):
_VALID_URL_TMPL = r'https... | @@ -0,0 +1,231 @@
+import base64
+import binascii
+import json
+import time
+
+from .common import InfoExtractor
+from ..utils import (
+ ExtractorError,
+ int_or_none,
+ jwt_decode_hs256,
+ traverse_obj,
+ url_or_none,
+)
+
+
+class WrestleUniverseBaseIE(InfoExtractor):
+ _VALID_URL_TMPL = r'https?:/... | yt_dlp/extractor/wrestleuniverse.py | 26 | Python | 0.786 | suggestion | 246 | 51 | 51 | false | [extractor/wrestleuniverse] Add extractors | 6,158 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | bashonly |
import base64
import binascii
import json
import time
from .common import InfoExtractor
from ..utils import (
ExtractorError,
int_or_none,
jwt_decode_hs256,
traverse_obj,
url_or_none,
)
class WrestleUniverseBaseIE(InfoExtractor):
_VALID_URL_TMPL = r'https?://(?:www\.)?wrestle-universe\.com/(?... | Isn't it simpler to put this in `_real_intitialize`? | import base64
import binascii
import json
import time
from .common import InfoExtractor
from ..dependencies import Cryptodome
from ..utils import (
ExtractorError,
int_or_none,
jwt_decode_hs256,
traverse_obj,
try_call,
url_or_none,
)
class WrestleUniverseBaseIE(InfoExtractor):
_VALID_URL_... | @@ -0,0 +1,231 @@
+import base64
+import binascii
+import json
+import time
+
+from .common import InfoExtractor
+from ..utils import (
+ ExtractorError,
+ int_or_none,
+ jwt_decode_hs256,
+ traverse_obj,
+ url_or_none,
+)
+
+
+class WrestleUniverseBaseIE(InfoExtractor):
+ _VALID_URL_TMPL = r'https?:/... | yt_dlp/extractor/wrestleuniverse.py | 24 | Python | 0.357 | question | 52 | 49 | 49 | false | [extractor/wrestleuniverse] Add extractors | 6,158 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | bashonly |
_API_PATH = None
_TOKEN = None
_TOKEN_EXPIRY = None
def _get_token_cookie(self):
if not self._TOKEN or not self._TOKEN_EXPIRY:
token_cookie = self._get_cookies('https://www.wrestle-universe.com/').get('token')
if not token_cookie or not token_cookie.value:
... | ```suggestion
data = json.dumps(data, separators=(',', ':')).encode()
```
is default in py3 | class WrestleUniverseBaseIE(InfoExtractor):
_VALID_URL_TMPL = r'https?://(?:www\.)?wrestle-universe\.com/(?:(?P<lang>\w{2})/)?%s/(?P<id>\w+)'
_API_PATH = None
_TOKEN = None
_TOKEN_EXPIRY = None
def _get_token_cookie(self):
if not self._TOKEN or not self._TOKEN_EXPIRY:
self._TOKE... | @@ -0,0 +1,231 @@
+import base64
+import binascii
+import json
+import time
+
+from .common import InfoExtractor
+from ..utils import (
+ ExtractorError,
+ int_or_none,
+ jwt_decode_hs256,
+ traverse_obj,
+ url_or_none,
+)
+
+
+class WrestleUniverseBaseIE(InfoExtractor):
+ _VALID_URL_TMPL = r'https?:/... | yt_dlp/extractor/wrestleuniverse.py | 26 | Python | 0.714 | suggestion | 106 | 51 | 51 | false | [extractor/wrestleuniverse] Add extractors | 6,158 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | bashonly |
'params': {
'skip_download': 'm3u8',
},
}]
_API_PATH = 'events'
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')
info = traverse_ob... | Imo, it makes sense for this function to return the decrypted key instead of a function | 'params': {
'skip_download': 'm3u8',
},
}]
_API_PATH = 'events'
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')
info = traverse_ob... | @@ -0,0 +1,231 @@
+import base64
+import binascii
+import json
+import time
+
+from .common import InfoExtractor
+from ..utils import (
+ ExtractorError,
+ int_or_none,
+ jwt_decode_hs256,
+ traverse_obj,
+ url_or_none,
+)
+
+
+class WrestleUniverseBaseIE(InfoExtractor):
+ _VALID_URL_TMPL = r'https?:/... | yt_dlp/extractor/wrestleuniverse.py | 26 | Python | 0.286 | suggestion | 87 | 45 | 47 | false | [extractor/wrestleuniverse] Add extractors | 6,158 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | bashonly |
'info_dict': {
'id': 'wUG8hP5iApC63jbtQzhVVx',
'ext': 'mp4',
'title': 'GRAND PRINCESS \'22',
'description': 'md5:e4f43d0d4262de3952ff34831bc99858',
'channel': 'tjpw',
'location': '東京・両国国技館',
'duration': 18044,
'times... | ```suggestion
'title': ('displayName', {str}),
```
Is 'title' expected to be absent? If so, you can add a
```diff
+ 'title': '',
**info
```
before L230 | 'info_dict': {
'id': 'wUG8hP5iApC63jbtQzhVVx',
'ext': 'mp4',
'title': 'GRAND PRINCESS \'22',
'description': 'md5:e4f43d0d4262de3952ff34831bc99858',
'channel': 'tjpw',
'location': '東京・両国国技館',
'duration': 18044,
'times... | @@ -0,0 +1,231 @@
+import base64
+import binascii
+import json
+import time
+
+from .common import InfoExtractor
+from ..utils import (
+ ExtractorError,
+ int_or_none,
+ jwt_decode_hs256,
+ traverse_obj,
+ url_or_none,
+)
+
+
+class WrestleUniverseBaseIE(InfoExtractor):
+ _VALID_URL_TMPL = r'https?:/... | yt_dlp/extractor/wrestleuniverse.py | 26 | Python | 0.714 | suggestion | 187 | 51 | 51 | false | [extractor/wrestleuniverse] Add extractors | 6,158 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | bashonly |
'channel': 'tjpw',
'location': '東京・両国国技館',
'duration': 18044,
'timestamp': 1647665400,
'upload_date': '20220319',
'thumbnail': 'https://image.asset.wrestle-universe.com/i8jxSTCHPfdAKD4zN41Psx/i8jxSTCHPfdAKD4zN41Psx',
'thumbnails': 'coun... | ```suggestion
# FIXME: Bug in traverse_obj
# 'thumbnails': (('keyVisualUrl', 'alterKeyVisualUrl', 'heroKeyVisualUrl'), {'url': {url_or_none}}),
'thumbnails': (('keyVisualUrl', 'alterKeyVisualUrl', 'heroKeyVisualUrl'), {url_or_none}, {'url': None}),
``` | 'channel': 'tjpw',
'location': '東京・両国国技館',
'duration': 18044,
'timestamp': 1647665400,
'upload_date': '20220319',
'thumbnail': 'https://image.asset.wrestle-universe.com/i8jxSTCHPfdAKD4zN41Psx/i8jxSTCHPfdAKD4zN41Psx',
'thumbnails': 'coun... | @@ -0,0 +1,231 @@
+import base64
+import binascii
+import json
+import time
+
+from .common import InfoExtractor
+from ..utils import (
+ ExtractorError,
+ int_or_none,
+ jwt_decode_hs256,
+ traverse_obj,
+ url_or_none,
+)
+
+
+class WrestleUniverseBaseIE(InfoExtractor):
+ _VALID_URL_TMPL = r'https?:/... | yt_dlp/extractor/wrestleuniverse.py | 26 | Python | 0.929 | bug | 292 | 51 | 51 | false | [extractor/wrestleuniverse] Add extractors | 6,158 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | bashonly |
from ..utils import (
ExtractorError,
int_or_none,
jwt_decode_hs256,
traverse_obj,
url_or_none,
)
class WrestleUniverseBaseIE(InfoExtractor):
_VALID_URL_TMPL = r'https?://(?:www\.)?wrestle-universe\.com/(?:(?P<lang>\w{2})/)?%s/(?P<id>\w+)'
_API_PATH = None
_TOKEN = None
_TOKEN_EXPI... | Why is this saved? It doesn't seem to be used elsewhere | from ..dependencies import Cryptodome
from ..utils import (
ExtractorError,
int_or_none,
jwt_decode_hs256,
traverse_obj,
try_call,
url_or_none,
)
class WrestleUniverseBaseIE(InfoExtractor):
_VALID_URL_TMPL = r'https?://(?:www\.)?wrestle-universe\.com/(?:(?P<lang>\w{2})/)?%s/(?P<id>\w+)'
... | @@ -0,0 +1,231 @@
+import base64
+import binascii
+import json
+import time
+
+from .common import InfoExtractor
+from ..utils import (
+ ExtractorError,
+ int_or_none,
+ jwt_decode_hs256,
+ traverse_obj,
+ url_or_none,
+)
+
+
+class WrestleUniverseBaseIE(InfoExtractor):
+ _VALID_URL_TMPL = r'https?:/... | yt_dlp/extractor/wrestleuniverse.py | 26 | Python | 0.286 | question | 55 | 51 | 51 | false | [extractor/wrestleuniverse] Add extractors | 6,158 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | bashonly |
the URL?
10 if it's what the URL is about,
-1 for default (don't know),
-10 otherwise, other values reserved for now.
* quality Order number of the video quality of ... | Could you also add extra_params... here? | the URL?
10 if it's what the URL is about,
-1 for default (don't know),
-10 otherwise, other values reserved for now.
* quality Order number of the video quality of ... | @@ -220,6 +220,12 @@ class InfoExtractor:
* no_resume The server does not support resuming the
(HTTP or RTMP) download. Boolean.
* has_drm The format has DRM and cannot be downloaded. Boolean
+ * hls_aes_key The key (as ... | yt_dlp/extractor/common.py | 26 | Python | 0.143 | question | 40 | 51 | 51 | false | [extractor/wrestleuniverse] Add extractors | 6,158 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | bashonly |
'channel': 'tjpw',
'duration': 7119,
'timestamp': 1674979200,
'upload_date': '20230129',
'thumbnail': 'https://image.asset.wrestle-universe.com/8FjD67P8rZc446RBQs5RBN/8FjD67P8rZc446RBQs5RBN',
'chapters': 'count:7',
'cast': 'count:18',
... | Do you have a test case for this? | 'timestamp': 1674979200,
'upload_date': '20230129',
'thumbnail': 'https://image.asset.wrestle-universe.com/8FjD67P8rZc446RBQs5RBN/8FjD67P8rZc446RBQs5RBN',
'chapters': 'count:7',
'cast': 'count:18',
},
'params': {
'skip_download': 'm... | @@ -126,10 +126,11 @@ def _real_extract(self, url):
return {
'id': video_id,
+ 'title': '', | yt_dlp/extractor/wrestleuniverse.py | 26 | Python | 0.071 | question | 33 | 51 | 51 | false | [extractor/wrestleuniverse] Add extractors | 6,158 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | bashonly |
'start': sub_range_start,
'end': sub_range_start + int(splitted_byte_range[0]),
}
fragments.append({
'frag_index': frag_index,
'url': frag_url,
'de... | ```suggestion
decrypt_info['URI'] = urljoin(man_url, decrypt_info['URI'])
```
The urljoin in utils should handle this | byte_range = {
'start': sub_range_start,
'end': sub_range_start + int(splitted_byte_range[0]),
}
fragments.append({
'frag_index': frag_index,
'url'... | @@ -218,15 +225,19 @@ def is_ad_fragment_end(s):
decrypt_url = decrypt_info.get('URI')
decrypt_info = parse_m3u8_attributes(line[11:])
if decrypt_info['METHOD'] == 'AES-128':
- if 'IV' in decrypt_info:
+ if exte... | yt_dlp/downloader/hls.py | 26 | Python | 0.929 | suggestion | 148 | 51 | 51 | false | [extractor/wrestleuniverse] Add extractors | 6,158 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | bashonly |
If True (default), HLS manifests and related
data will be downloaded and processed by extractor.
You can reduce network I/O by disabling it if you don't
care about HLS. (only for youtube)
"""
_NUMERIC_FIELDS = {
... | You can change `_decryption_key_url` | If True (default), HLS manifests and related
data will be downloaded and processed by extractor.
You can reduce network I/O by disabling it if you don't
care about HLS. (only for youtube)
"""
_NUMERIC_FIELDS = {
... | @@ -554,7 +554,8 @@ class YoutubeDL:
'vbr', 'fps', 'vcodec', 'container', 'filesize', 'filesize_approx', 'rows', 'columns',
'player_url', 'protocol', 'fragment_base_url', 'fragments', 'is_from_start',
'preference', 'language', 'language_preference', 'quality', 'source_preference',
- 'h... | yt_dlp/YoutubeDL.py | 26 | Python | 0.286 | suggestion | 36 | 51 | 51 | false | [extractor/wrestleuniverse] Add extractors | 6,158 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | bashonly |
-1 for default (order by other properties),
-2 or smaller for less than default.
* source_preference Order number for this video source
(quality takes higher priority)
... | maybe it makes sense to put these inside a dict? like `hls_aes: {key, url, iv}`
Then we can do this to prevent passing such formats to external downloaders
```diff
--- a/yt_dlp/downloader/external.py
+++ b/yt_dlp/downloader/external.py
@@ -104,6 +104,7 @@ def supports(cls, info_dict):
return all((
... | -1 for default (order by other properties),
-2 or smaller for less than default.
* source_preference Order number for this video source
(quality takes higher priority)
... | @@ -220,6 +220,18 @@ class InfoExtractor:
* no_resume The server does not support resuming the
(HTTP or RTMP) download. Boolean.
* has_drm The format has DRM and cannot be downloaded. Boolean
+ * extra_param_to_segment_ur... | yt_dlp/extractor/common.py | 26 | Python | 0.786 | suggestion | 725 | 51 | 51 | false | [extractor/wrestleuniverse] Add extractors | 6,158 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | bashonly |
ad_frags += 1
continue
media_frags += 1
ctx = {
'filename': filename,
'total_frags': media_frags,
'ad_frags': ad_frags,
}
if real_downloader:
self._prepare_external_frag_download(ctx)
else:
... | ```suggestion
external_aes_key = traverse_obj(info_dict, ('hls_aes', 'key'))
```
If the extractor sets non string value, it should error
Same below | ad_frags += 1
continue
media_frags += 1
ctx = {
'filename': filename,
'total_frags': media_frags,
'ad_frags': ad_frags,
}
if real_downloader:
self._prepare_external_frag_download(ctx)
else:
... | @@ -150,12 +157,12 @@ def is_ad_fragment_end(s):
i = 0
media_sequence = 0
decrypt_info = {'METHOD': 'NONE'}
- external_aes_key = info_dict.get('hls_aes_key')
- if isinstance(external_aes_key, str):
+ external_aes_key = traverse_obj(info_dict, ('hls_aes', 'key', {str})) | yt_dlp/downloader/hls.py | 26 | Python | 0.929 | refactor | 161 | 51 | 51 | false | [extractor/wrestleuniverse] Add extractors | 6,158 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | bashonly |
external_aes_key = traverse_obj(info_dict, ('hls_aes', 'key', {str}))
if external_aes_key:
external_aes_key = binascii.unhexlify(remove_start(external_aes_key, '0x'))
assert len(external_aes_key) in (16, 24, 32), 'Invalid length for HLS AES-128 key'
external_aes_iv = trav... | ```suggestion
frag_url = urljoin(man_url, line)
```
The point is that it already handles absolute URLs correctly | external_aes_key = traverse_obj(info_dict, ('hls_aes', 'key'))
if external_aes_key:
external_aes_key = binascii.unhexlify(remove_start(external_aes_key, '0x'))
assert len(external_aes_key) in (16, 24, 32), 'Invalid length for HLS AES-128 key'
external_aes_iv = traverse_ob... | @@ -175,7 +182,7 @@ def is_ad_fragment_end(s):
frag_url = (
line
if re.match(r'^https?://', line)
- else urllib.parse.urljoin(man_url, line))
+ else urljoin(man_url, line)) | yt_dlp/downloader/hls.py | 26 | Python | 0.857 | suggestion | 135 | 51 | 51 | false | [extractor/wrestleuniverse] Add extractors | 6,158 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | bashonly |
if 'audio' in source_url:
f.update({
'vcodec': 'none',
'ext': 'mp3',
})
else:
f.update({
'width': int_or_none(video_data.get('width')),
'height': int_or_none(video_data... | ```suggestion
f['hls_aes'] = {'uri': url_templ % ('goose', '') + qs}
``` | if 'audio' in source_url:
f.update({
'vcodec': 'none',
'ext': 'mp3',
})
else:
f.update({
'width': int_or_none(video_data.get('width')),
'height': int_or_none(video_data... | @@ -87,7 +87,7 @@ def _real_extract(self, url):
m3u8_id='hls', fatal=False)
if hls_aes:
for f in m3u8_formats:
- f['_decryption_key_url'] = url_templ % ('goose', '') + qs
+ f.update({'hls_aes': {'uri': url_templ % ('goose', '') + qs}}) | yt_dlp/extractor/vzaar.py | 26 | Python | 0.571 | suggestion | 94 | 37 | 37 | false | [extractor/wrestleuniverse] Add extractors | 6,158 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | bashonly |
ctx = {
'filename': filename,
'total_frags': media_frags,
'ad_frags': ad_frags,
}
if real_downloader:
self._prepare_external_frag_download(ctx)
else:
self._prepare_and_start_frag_download(ctx, info_dict)
extra_state = ... | ```suggestion
external_aes_iv = traverse_obj(info_dict, ('hls_aes', 'iv'))
``` | ctx = {
'filename': filename,
'total_frags': media_frags,
'ad_frags': ad_frags,
}
if real_downloader:
self._prepare_external_frag_download(ctx)
else:
self._prepare_and_start_frag_download(ctx, info_dict)
extra_state = ... | @@ -150,6 +157,13 @@ def is_ad_fragment_end(s):
i = 0
media_sequence = 0
decrypt_info = {'METHOD': 'NONE'}
+ external_aes_key = traverse_obj(info_dict, ('hls_aes', 'key', {str}))
+ if external_aes_key:
+ external_aes_key = binascii.unhexlify(remove_start(external_aes_... | yt_dlp/downloader/hls.py | 26 | Python | 0.571 | suggestion | 88 | 51 | 51 | false | [extractor/wrestleuniverse] Add extractors | 6,158 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | bashonly |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.