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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
entries = [{
'_type': 'url_transparent',
'url': smuggle_url(episode['webplay_url'], {'no_bangumi_tip': 1}),
'ie_key': BiliBiliIE.ie_key(),
'timestamp': parse_iso8601(episode.get('update_time'), delimiter=' '),
'episode': episode.get('index_title'),
... | Can you put back the Base class and put this there? 😶 |
entries = [{
'_type': 'url_transparent',
'url': smuggle_url(episode['webplay_url'], {'no_bangumi_tip': 1}),
'ie_key': BiliBiliIE.ie_key(),
'timestamp': parse_iso8601(episode.get('update_time'), delimiter=' '),
'episode': episode.get('index_title'),
... | @@ -502,39 +503,135 @@ def _real_extract(self, url):
season_info.get('bangumi_title'), season_info.get('evaluate'))
-class BilibiliChannelIE(InfoExtractor):
- _VALID_URL = r'https?://space.bilibili\.com/(?P<id>\d+)'
- _API_URL = "https://api.bilibili.com/x/space/arc/search?mid=%s&pn=%d&jsonp=json... | yt_dlp/extractor/bilibili.py | 26 | Python | 0.214 | suggestion | 54 | 51 | 51 | false | [extractor/bilibili] add BilibiliSpaceAudioIE, add BilibiliSpacePlaylistIE | 4,468 | yt-dlp/yt-dlp | 132,642 | Python | elyse0 | lockmatrix |
'ie_key': BiliBiliIE.ie_key(),
'timestamp': parse_iso8601(episode.get('update_time'), delimiter=' '),
'episode': episode.get('index_title'),
'episode_number': int_or_none(episode.get('index')),
} for episode in season_info['episodes']]
entries = sorted(en... | This is a Space Video extractor, right?
We could add another extractor specifically for the main page of a Space, e.g. https://space.bilibili.com/3985676 , extracting the links of the webpage
```suggestion
_VALID_URL = r'https?://space\.bilibili\.com/(?P<id>\d+)/video'
``` | 'ie_key': BiliBiliIE.ie_key(),
'timestamp': parse_iso8601(episode.get('update_time'), delimiter=' '),
'episode': episode.get('index_title'),
'episode_number': int_or_none(episode.get('index')),
} for episode in season_info['episodes']]
entries = sorted(en... | @@ -502,39 +503,135 @@ def _real_extract(self, url):
season_info.get('bangumi_title'), season_info.get('evaluate'))
-class BilibiliChannelIE(InfoExtractor):
- _VALID_URL = r'https?://space.bilibili\.com/(?P<id>\d+)'
- _API_URL = "https://api.bilibili.com/x/space/arc/search?mid=%s&pn=%d&jsonp=json... | yt_dlp/extractor/bilibili.py | 26 | Python | 0.857 | refactor | 285 | 51 | 51 | false | [extractor/bilibili] add BilibiliSpaceAudioIE, add BilibiliSpacePlaylistIE | 4,468 | yt-dlp/yt-dlp | 132,642 | Python | elyse0 | lockmatrix |
def bilibili_space_extract_playlist(fetch_page, get_metadata, get_entries):
first_page = fetch_page(1)
metadata = get_metadata(first_page)
paged_list = InAdvancePagedList(
lambda idx: get_entries(fetch_page(idx) if idx else first_page),
metadata['page_count'], metadata['page_size'])
re... | If we change the _valid_url, we won't need this | class BilibiliSpaceBaseIE(InfoExtractor):
def _extract_playlist(self, fetch_page, get_metadata, get_entries):
first_page = fetch_page(1)
metadata = get_metadata(first_page)
paged_list = InAdvancePagedList(
lambda idx: get_entries(fetch_page(idx) if idx > 1 else first_page),
... | @@ -502,39 +503,135 @@ def _real_extract(self, url):
season_info.get('bangumi_title'), season_info.get('evaluate'))
-class BilibiliChannelIE(InfoExtractor):
- _VALID_URL = r'https?://space.bilibili\.com/(?P<id>\d+)'
- _API_URL = "https://api.bilibili.com/x/space/arc/search?mid=%s&pn=%d&jsonp=json... | yt_dlp/extractor/bilibili.py | 26 | Python | 0.143 | suggestion | 47 | 51 | 51 | false | [extractor/bilibili] add BilibiliSpaceAudioIE, add BilibiliSpacePlaylistIE | 4,468 | yt-dlp/yt-dlp | 132,642 | Python | elyse0 | lockmatrix |
if not mobj.group('video'):
self.to_screen(f'{url} may have multiple media types. This run will only download videos.\n'
+ f'For example, use {url}/audio for audios.')
playlist_id = self._match_id(url)
def fetch_page(page_idx):
return self._do... | ie_key() isn't needed
```suggestion
yield self.url_result(f'https://www.bilibili.com/video/{entry["bvid"]}', BiliBiliIE, entry['bvid'])
``` | playlist_id, is_video_url = self._match_valid_url(url).group('id', 'video')
if not is_video_url:
self.to_screen('A channel URL was given. Only the channel\'s videos will be downloaded. '
'To download audios, add a "/audio" to the URL')
def fetch_page(page_... | @@ -502,39 +503,135 @@ def _real_extract(self, url):
season_info.get('bangumi_title'), season_info.get('evaluate'))
-class BilibiliChannelIE(InfoExtractor):
- _VALID_URL = r'https?://space.bilibili\.com/(?P<id>\d+)'
- _API_URL = "https://api.bilibili.com/x/space/arc/search?mid=%s&pn=%d&jsonp=json... | yt_dlp/extractor/bilibili.py | 26 | Python | 0.714 | suggestion | 160 | 51 | 51 | false | [extractor/bilibili] add BilibiliSpaceAudioIE, add BilibiliSpacePlaylistIE | 4,468 | yt-dlp/yt-dlp | 132,642 | Python | elyse0 | lockmatrix |
},
'playlist_mincount': 1,
}]
def _real_extract(self, url):
playlist_id = self._match_id(url)
def fetch_page(page_idx):
return self._download_json(
'https://api.bilibili.com/audio/music-service/web/song/upper', playlist_id,
note=f'Dow... | ie_key() isn't needed
```suggestion
yield self.url_result(f'https://www.bilibili.com/audio/au{entry["id"]}', BilibiliAudioIE, entry['id'])
``` | def _real_extract(self, url):
playlist_id = self._match_id(url)
def fetch_page(page_idx):
return self._download_json(
'https://api.bilibili.com/audio/music-service/web/song/upper', playlist_id,
note=f'Downloading page {page_idx}',
query={'... | @@ -502,39 +503,135 @@ def _real_extract(self, url):
season_info.get('bangumi_title'), season_info.get('evaluate'))
-class BilibiliChannelIE(InfoExtractor):
- _VALID_URL = r'https?://space.bilibili\.com/(?P<id>\d+)'
- _API_URL = "https://api.bilibili.com/x/space/arc/search?mid=%s&pn=%d&jsonp=json... | yt_dlp/extractor/bilibili.py | 26 | Python | 0.714 | suggestion | 163 | 51 | 51 | false | [extractor/bilibili] add BilibiliSpaceAudioIE, add BilibiliSpacePlaylistIE | 4,468 | yt-dlp/yt-dlp | 132,642 | Python | elyse0 | lockmatrix |
yield self.url_result(f'https://www.bilibili.com/video/{entry["bvid"]}',
BiliBiliIE.ie_key(), entry['bvid'])
metadata, paged_list = bilibili_space_extract_playlist(fetch_page, get_metadata, get_entries)
return self.playlist_result(paged_list, playli... | ```suggestion
def fetch_page(page_idx):
return self._download_json(
'https://api.bilibili.com/audio/music-service/web/song/upper', playlist_id,
note=f'Downloading page {page_idx}',
query={'uid': playlist_id, 'pn': page_idx, 'ps': 30, 'order': 1, '... | return self.playlist_result(paged_list, playlist_id)
class BilibiliSpaceAudioIE(BilibiliSpaceBaseIE):
_VALID_URL = r'https?://space\.bilibili\.com/(?P<id>\d+)/audio'
_TESTS = [{
'url': 'https://space.bilibili.com/3985676/audio',
'info_dict': {
'id': '3985676',
},
... | @@ -502,39 +503,135 @@ def _real_extract(self, url):
season_info.get('bangumi_title'), season_info.get('evaluate'))
-class BilibiliChannelIE(InfoExtractor):
- _VALID_URL = r'https?://space.bilibili\.com/(?P<id>\d+)'
- _API_URL = "https://api.bilibili.com/x/space/arc/search?mid=%s&pn=%d&jsonp=json... | yt_dlp/extractor/bilibili.py | 26 | Python | 0.786 | suggestion | 350 | 51 | 51 | false | [extractor/bilibili] add BilibiliSpaceAudioIE, add BilibiliSpacePlaylistIE | 4,468 | yt-dlp/yt-dlp | 132,642 | Python | elyse0 | lockmatrix |
'timestamp': parse_iso8601(episode.get('update_time'), delimiter=' '),
'episode': episode.get('index_title'),
'episode_number': int_or_none(episode.get('index')),
} for episode in season_info['episodes']]
entries = sorted(entries, key=lambda entry: entry.get('episode... | ```suggestion
_VALID_URL = r'https?://space\.bilibili\.com/(?P<id>\d+)(?P<video>/video)?/?(?:[?#]|$)'
``` | 'timestamp': parse_iso8601(episode.get('update_time'), delimiter=' '),
'episode': episode.get('index_title'),
'episode_number': int_or_none(episode.get('index')),
} for episode in season_info['episodes']]
entries = sorted(entries, key=lambda entry: entry.get('episode... | @@ -502,39 +503,133 @@ def _real_extract(self, url):
season_info.get('bangumi_title'), season_info.get('evaluate'))
-class BilibiliChannelIE(InfoExtractor):
- _VALID_URL = r'https?://space.bilibili\.com/(?P<id>\d+)'
- _API_URL = "https://api.bilibili.com/x/space/arc/search?mid=%s&pn=%d&jsonp=json... | yt_dlp/extractor/bilibili.py | 26 | Python | 0.714 | suggestion | 111 | 51 | 51 | false | [extractor/bilibili] add BilibiliSpaceAudioIE, add BilibiliSpacePlaylistIE | 4,468 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | lockmatrix |
metadata = get_metadata(first_page)
paged_list = InAdvancePagedList(
lambda idx: get_entries(fetch_page(idx) if idx else first_page),
metadata['page_count'], metadata['page_size'])
return metadata, paged_list
class BilibiliSpaceVideoIE(BilibiliSpaceBaseIE):
_VALID... | ```suggestion
playlist_id, is_video_url = self._match_valid_url(url).group('id', 'video')
if not is_video_url:
self.to_screen('A channel URL was given. Only the channel\'s videos will be downloaded. '
'To download audios, add a "/audio" to the URL')
``` | metadata = get_metadata(first_page)
paged_list = InAdvancePagedList(
lambda idx: get_entries(fetch_page(idx) if idx > 1 else first_page),
metadata['page_count'], metadata['page_size'])
return metadata, paged_list
class BilibiliSpaceVideoIE(BilibiliSpaceBaseIE):
_V... | @@ -502,39 +503,133 @@ def _real_extract(self, url):
season_info.get('bangumi_title'), season_info.get('evaluate'))
-class BilibiliChannelIE(InfoExtractor):
- _VALID_URL = r'https?://space.bilibili\.com/(?P<id>\d+)'
- _API_URL = "https://api.bilibili.com/x/space/arc/search?mid=%s&pn=%d&jsonp=json... | yt_dlp/extractor/bilibili.py | 26 | Python | 0.786 | suggestion | 313 | 51 | 51 | false | [extractor/bilibili] add BilibiliSpaceAudioIE, add BilibiliSpacePlaylistIE | 4,468 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | lockmatrix |
},
'playlist_mincount': 178,
}]
def _real_extract(self, url):
mobj = self._match_valid_url(url)
if not mobj.group('video'):
self.to_screen(f'{url} may have multiple media types. This run will only download videos.\n'
+ f'For example, use {u... | What's the point of these fields? | },
'playlist_mincount': 178,
}]
def _real_extract(self, url):
playlist_id, is_video_url = self._match_valid_url(url).group('id', 'video')
if not is_video_url:
self.to_screen('A channel URL was given. Only the channel\'s videos will be downloaded. '
... | @@ -502,39 +503,133 @@ def _real_extract(self, url):
season_info.get('bangumi_title'), season_info.get('evaluate'))
-class BilibiliChannelIE(InfoExtractor):
- _VALID_URL = r'https?://space.bilibili\.com/(?P<id>\d+)'
- _API_URL = "https://api.bilibili.com/x/space/arc/search?mid=%s&pn=%d&jsonp=json... | yt_dlp/extractor/bilibili.py | 26 | Python | 0.071 | question | 33 | 51 | 51 | false | [extractor/bilibili] add BilibiliSpaceAudioIE, add BilibiliSpacePlaylistIE | 4,468 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | lockmatrix |
}]
def _real_extract(self, url):
mid, sid = self._match_valid_url(url).group('mid', 'sid')
playlist_id = f'{mid}_{sid}'
def fetch_page(page_idx):
return self._download_json(
'https://api.bilibili.com/x/polymer/space/seasons_archives_list',
pl... | ```suggestion
BiliBiliIE, entry['bvid'])
``` | def fetch_page(page_idx):
return self._download_json(
'https://api.bilibili.com/x/polymer/space/seasons_archives_list',
playlist_id, note=f'Downloading page {page_idx}',
query={'mid': mid, 'season_id': sid, 'page_num': page_idx, 'page_size': 30})['data... | @@ -502,39 +503,133 @@ def _real_extract(self, url):
season_info.get('bangumi_title'), season_info.get('evaluate'))
-class BilibiliChannelIE(InfoExtractor):
- _VALID_URL = r'https?://space.bilibili\.com/(?P<id>\d+)'
- _API_URL = "https://api.bilibili.com/x/space/arc/search?mid=%s&pn=%d&jsonp=json... | yt_dlp/extractor/bilibili.py | 26 | Python | 0.571 | suggestion | 84 | 51 | 51 | false | [extractor/bilibili] add BilibiliSpaceAudioIE, add BilibiliSpacePlaylistIE | 4,468 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | lockmatrix |
('errorScreen', 'playerLegacyDesktopYpcTrailerRenderer', 'trailerVideoId'),
expected_type=str)
if trailer_video_id:
return self.url_result(
trailer_video_id, self.ie_key(), trailer_video_id)
search_meta = ((lambda x: self._html_search_meta(x, webpage,... | I'd write it like this:
```suggestion
translated_title = self._get_text(microformats, (..., 'title'))
video_title = (self._preferred_lang and translated_title
or get_first(video_details, 'title')
or translated_title
or search_met... | audio_track = fmt.get('audioTrack') or {}
stream_id = '%s.%s' % (itag or '', audio_track.get('id', ''))
if stream_id in stream_ids:
continue
quality = fmt.get('quality')
height = int_or_none(fmt.get('height'))
if quality == 'tiny' ... | @@ -3403,11 +3435,18 @@ def _real_extract(self, url):
microformats = traverse_obj(
player_responses, (..., 'microformat', 'playerMicroformatRenderer'),
expected_type=dict, default=[])
- video_title = (
- get_first(video_details, 'title')
- or self._get_tex... | yt_dlp/extractor/youtube.py | 26 | Python | 0.857 | suggestion | 714 | 51 | 51 | false | [extractor/youtube] Support changing extraction langauge | 4,470 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | coletdjnz |
ie=YoutubeIE.ie_key(), video_id=video_id)
self.to_screen(f'Downloading playlist {playlist_id}; add --no-playlist to just download video {video_id}')
data, ytcfg = self._extract_data(url, item_id)
# YouTube may provide a non-standard redirect to the re... | There are so many types of pages that it'll be difficult to fully test this 😒 | 'url': 'http://www.youtube.com/NASAgovVideo/videos',
'only_matching': True,
}, {
'url': 'https://www.youtube.com/TheYoungTurks/live',
'only_matching': True,
}, {
'url': 'https://www.youtube.com/hashtag/cctv9',
'info_dict': {
'id': 'cctv9',
... | @@ -5379,10 +5418,19 @@ def get_mobj(url):
tabs = traverse_obj(data, ('contents', 'twoColumnBrowseResultsRenderer', 'tabs'), expected_type=list)
if tabs:
selected_tab = self._extract_selected_tab(tabs)
+ selected_tab_url = urljoin(
+ url, traverse_obj(selected_ta... | yt_dlp/extractor/youtube.py | 26 | Python | 0.357 | suggestion | 78 | 51 | 51 | false | [extractor/youtube] Support changing extraction langauge | 4,470 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | coletdjnz |
return preferred_lang
def _initialize_consent(self):
cookies = self._get_cookies('https://www.youtube.com/')
if cookies.get('__Secure-3PSID'):
return
consent_id = None
consent = cookies.get('CONSENT')
if consent:
if 'YES' in consent.value:
... | ```suggestion
return preferred_lang or 'en'
```
Then you can remove all the `None` checks | _SUPPORTED_LANG_CODES = [
'af', 'az', 'id', 'ms', 'bs', 'ca', 'cs', 'da', 'de', 'et', 'en-IN', 'en-GB', 'en', 'es',
'es-419', 'es-US', 'eu', 'fil', 'fr', 'fr-CA', 'gl', 'hr', 'zu', 'is', 'it', 'sw', 'lv',
'lt', 'hu', 'nl', 'no', 'uz', 'pl', 'pt-PT', 'pt', 'ro', 'sq', 'sk', 'sl', 'sr-Latn', '... | @@ -354,6 +354,34 @@ class YoutubeBaseInfoExtractor(InfoExtractor):
r'(?:www\.)?piped\.privacy\.com\.de',
)
+ # extracted from account/account_menu ep
+ # XXX: These are the supported YouTube UI and API languages,
+ # which is slightly different from languages supported for translation in YouTu... | yt_dlp/extractor/youtube.py | 26 | Python | 0.786 | suggestion | 100 | 51 | 51 | false | [extractor/youtube] Support changing extraction langauge | 4,470 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | coletdjnz |
start = mobj.group('start')
if start:
return datetime_from_str(start)
try:
return datetime_from_str('now-%s%s' % (mobj.group('time'), mobj.group('unit')))
except ValueError:
return None
def _parse_time_text(self, text):... | ```suggestion
f'Cannot parse localized time text "{text}"', only_once=True)
``` | @staticmethod
def _get_text(data, *path_list, max_runs=None):
for path in path_list or [None]:
if path is None:
obj = [data]
else:
obj = traverse_obj(data, path, default=[])
if not any(key is ... or isinstance(key, (list, tuple)) fo... | @@ -756,9 +784,10 @@ def _extract_time_text(self, renderer, *path_list):
(r'([a-z]+\s*\d{1,2},?\s*20\d{2})', r'(?:.+|^)(?:live|premieres|ed|ing)(?:\s*(?:on|for))?\s*(.+\d)'),
text.lower(), 'time text', default=None)))
- if text and timestamp is None:
- ... | yt_dlp/extractor/youtube.py | 26 | Python | 0.571 | suggestion | 97 | 51 | 51 | false | [extractor/youtube] Support changing extraction langauge | 4,470 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | coletdjnz |
chapter_list = [{
'start_time': chapter_time(chapter),
'title': chapter_title(chapter),
} for chapter in chapter_list or []]
if not strict:
chapter_list.sort(key=lambda c: c['start_time'] or 0)
chapters = [{'start_time': 0}]
for idx, chapter i... | There is no way for us to extract a more accurate timestamp, correct? Then let's leave it enabled by default |
if func_code:
return jsi, player_id, func_code
func_name = self._extract_n_function_name(jscode)
# For redundancy
func_code = self._search_regex(
r'''(?xs)%s\s*=\s*function\s*\((?P<var>[\w$]+)\)\s*
# NB: The end of the regex is intentionall... | @@ -2790,8 +2874,11 @@ def _extract_comment(self, comment_renderer, parent=None):
text = self._get_text(comment_renderer, 'contentText')
- # note: timestamp is an estimate calculated from the current time and time_text
- timestamp, time_text = self._extract_time_text(comment_renderer, 'publis... | yt_dlp/extractor/youtube.py | 26 | Python | 0.429 | refactor | 108 | 51 | 51 | false | [extractor/youtube] Support changing extraction langauge | 4,470 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | coletdjnz |
# extracted from account/account_menu ep
# XXX: These are the supported YouTube UI and API languages,
# which is slightly different from languages supported for translation in YouTube studio
_SUPPORTED_LANG_CODES = [
'af', 'az', 'id', 'ms', 'bs', 'ca', 'cs', 'da', 'de', 'et', 'en-IN', 'en-GB', '... | ```suggestion
f'Preferring "{preferred_lang}" translated fields. Note that some metadata extraction may fail or be incorrect.')
``` | r'(?:www\.)?qklhadlycap4cnod\.onion',
r'(?:www\.)?axqzx4s6s54s32yentfqojs3x5i7faxza6xo3ehd4bzzsg2ii4fv2iid\.onion',
r'(?:www\.)?c7hqkpkpemu6e7emz5b4vyz7idjgdvgaaa3dyimmeojqbgpea3xqjoid\.onion',
r'(?:www\.)?fz253lmuao3strwbfbmx46yu7acac2jz27iwtorgmbqlkurlclmancad\.onion',
r'(?:www... | @@ -354,6 +354,34 @@ class YoutubeBaseInfoExtractor(InfoExtractor):
r'(?:www\.)?piped\.privacy\.com\.de',
)
+ # extracted from account/account_menu ep
+ # XXX: These are the supported YouTube UI and API languages,
+ # which is slightly different from languages supported for translation in YouTu... | yt_dlp/extractor/youtube.py | 26 | Python | 0.786 | bug | 149 | 51 | 51 | false | [extractor/youtube] Support changing extraction langauge | 4,470 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | coletdjnz |
label_map = {
'unlisted': 'unlisted',
'private': 'private',
'members only': 'members_only',
'live': 'is_live',
'premium': 'premium'
}
badge_types = set()
for badge in traverse_obj(renderer, ('badges', ..., 'metadataBadgeRender... | not really a fan of this but idk if there's a better way | self.report_warning(f'YouTube said: {alert_type} - {alert_message}', only_once=only_once)
if errors:
raise ExtractorError('YouTube said: %s' % errors[-1][1], expected=expected)
def _extract_and_report_alerts(self, data, *args, **kwargs):
return self._report_alerts(self._extr... | @@ -665,13 +693,49 @@ def _report_alerts(self, alerts, expected=True, fatal=True, only_once=False):
def _extract_and_report_alerts(self, data, *args, **kwargs):
return self._report_alerts(self._extract_alerts(data), *args, **kwargs)
+ _PRIVACY_ICON_MAP = {
+ 'PRIVACY_UNLISTED': 'unlisted',
+ ... | yt_dlp/extractor/youtube.py | 26 | Python | 0.286 | suggestion | 56 | 51 | 51 | false | [extractor/youtube] Support changing extraction langauge | 4,470 | yt-dlp/yt-dlp | 132,642 | Python | coletdjnz | coletdjnz |
trailer_video_id, self.ie_key(), trailer_video_id)
search_meta = ((lambda x: self._html_search_meta(x, webpage, default=None))
if webpage else (lambda x: None))
video_details = traverse_obj(
player_responses, (..., 'videoDetails'), expected_type=dict,... | If original_description is blank, wouldn't translated_description also be? If so, this an be simplified to `original_description or translated_description`.
Even if not, why the "or None"? | if trailer_video_id:
return self.url_result(
trailer_video_id, self.ie_key(), trailer_video_id)
search_meta = ((lambda x: self._html_search_meta(x, webpage, default=None))
if webpage else (lambda x: None))
video_details = traverse_obj(
... | @@ -3554,11 +3692,24 @@ def _real_extract(self, url):
microformats = traverse_obj(
player_responses, (..., 'microformat', 'playerMicroformatRenderer'),
expected_type=dict, default=[])
- video_title = (
- get_first(video_details, 'title')
- or self._get_tex... | yt_dlp/extractor/youtube.py | 26 | Python | 0.5 | question | 191 | 51 | 51 | false | [extractor/youtube] Support changing extraction langauge | 4,470 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | coletdjnz |
r'(?:www\.)?piped\.privacy\.com\.de',
)
# extracted from account/account_menu ep
# XXX: These are the supported YouTube UI and API languages,
# which is slightly different from languages supported for translation in YouTube studio
_SUPPORTED_LANG_CODES = [
'af', 'az', 'id', 'ms', 'b... | what do we think about also printing all the language codes here:
```suggestion
if preferred_lang not in self._SUPPORTED_LANG_CODES:
raise ExtractorError( f'Unsupported language code: {preferred_lang}. Supported language codes: {join_nonempty(*self._SUPPORTED_LANG_CODES, delim=", ")}', expected... | r'(?:www\.)?piped\.privacy\.com\.de',
)
# extracted from account/account_menu ep
# XXX: These are the supported YouTube UI and API languages,
# which is slightly different from languages supported for translation in YouTube studio
_SUPPORTED_LANG_CODES = [
'af', 'az', 'id', 'ms', 'b... | @@ -367,6 +377,34 @@ class YoutubeBaseInfoExtractor(InfoExtractor):
r'(?:www\.)?piped\.privacy\.com\.de',
)
+ # extracted from account/account_menu ep
+ # XXX: These are the supported YouTube UI and API languages,
+ # which is slightly different from languages supported for translation in YouTu... | yt_dlp/extractor/youtube.py | 26 | Python | 1 | refactor | 813 | 51 | 51 | false | [extractor/youtube] Support changing extraction langauge | 4,470 | yt-dlp/yt-dlp | 132,642 | Python | coletdjnz | coletdjnz |
(r'vup\.to', 'VUp'),
(r'wolfstream\.tv', 'WolfStream'),
(r'xvideosharing\.com', 'XVideoSharing'),
)
IE_DESC = 'XFileShare based sites: %s' % ', '.join(list(zip(*_SITES))[1])
_VALID_URL = (r'https?://(?:www\.)?(?P<host>%s)/(?:embed-)?(?P<id>[0-9a-zA-Z]+)'
% '|'.join... | 1. Use non-piracy link
2. Add md5
3. Use actual title
4. `http_headers` is not needed in test | (r'vup\.to', 'VUp'),
(r'wolfstream\.tv', 'WolfStream'),
(r'xvideosharing\.com', 'XVideoSharing'),
)
IE_DESC = 'XFileShare based sites: %s' % ', '.join(list(zip(*_SITES))[1])
_VALID_URL = (r'https?://(?:www\.)?(?P<host>%s)/(?:embed-)?(?P<id>[0-9a-zA-Z]+)'
% '|'.join... | @@ -68,6 +68,17 @@ class XFileShareIE(InfoExtractor):
)
_TESTS = [{
+ 'url': 'https://uqload.com/nn85ef9zmgzk',
+ 'info_dict': {
+ 'id': 'nn85ef9zmgzk',
+ 'ext': 'mp4',
+ 'title': r're:.*',
+ 'thumbnail': r're:https://.*\.jpg',
+ 'http_hea... | yt_dlp/extractor/xfileshare.py | 26 | Python | 0.429 | suggestion | 96 | 51 | 51 | false | [extractor/xfileshare] Add Referer in HTTP header | 4,494 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Galiley |
if not formats:
urls = []
for regex in (
r'(?:file|src)\s*:\s*(["\'])(?P<url>http(?:(?!\1).)+\.(?:m3u8|mp4|flv)(?:(?!\1).)*)\1',
r'file_link\s*=\s*(["\'])(?P<url>http(?:(?!\1).)+)\1',
r'addVariable\((\\?["\'])file\1\s*,\s*(\\?["... | ```suggestion
formats.append({
'url': video_url,
'format_id': 'sd',
})
``` | if not formats:
urls = []
for regex in (
r'(?:file|src)\s*:\s*(["\'])(?P<url>http(?:(?!\1).)+\.(?:m3u8|mp4|flv)(?:(?!\1).)*)\1',
r'file_link\s*=\s*(["\'])(?P<url>http(?:(?!\1).)+)\1',
r'addVariable\((\\?["\'])file\1\s*,\s*(\\?["... | @@ -177,10 +186,7 @@ def _real_extract(self, url):
entry_protocol='m3u8_native', m3u8_id='hls',
fatal=False))
else:
- formats.append({
- 'url': video_url,
- 'format_id': 'sd',
- ... | yt_dlp/extractor/xfileshare.py | 26 | Python | 0.714 | suggestion | 167 | 42 | 45 | false | [extractor/xfileshare] Add Referer in HTTP header | 4,494 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Galiley |
'uploader_id': self._search_regex(r'/(?:channel|user)/([^/?&#]+)', owner_profile_url, 'uploader id') if owner_profile_url else None,
'uploader_url': owner_profile_url,
'channel_id': channel_id,
'channel_url': format_field(channel_id, None, 'https://www.youtube.com/channel... | ```suggestion
if get_first(video_details, 'isPostLiveDvr'):
``` | 'uploader_id': self._search_regex(r'/(?:channel|user)/([^/?&#]+)', owner_profile_url, 'uploader id') if owner_profile_url else None,
'uploader_url': owner_profile_url,
'channel_id': channel_id,
'channel_url': format_field(channel_id, None, 'https://www.youtube.com/channel... | @@ -3599,6 +3592,13 @@ def feed_entry(name):
'live_status': 'is_upcoming' if is_upcoming else None, # rest will be set by YoutubeDL
'release_timestamp': live_start_time,
}
+ if get_first(video_details, 'isPostLiveDvr'): | yt_dlp/extractor/youtube.py | 26 | Python | 0.571 | suggestion | 75 | 51 | 51 | false | [extractor/youtube] Added is_post_live_dvr to returned info | 4,495 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | lazypete365 |
* "html" - Comment as HTML
* "text" - Plain text of the comment
* "timestamp" - UNIX timestamp of comment
* "parent" - ID of the comment this one is replying to.
Set to "root" to indicate... | ```suggestion
or 'post_live' (was live, but VOD is not yet processed)
``` | * "html" - Comment as HTML
* "text" - Plain text of the comment
* "timestamp" - UNIX timestamp of comment
* "parent" - ID of the comment this one is replying to.
Set to "root" to indicate... | @@ -312,7 +312,8 @@ class InfoExtractor:
live stream that goes on instead of a fixed-length video.
was_live: True, False, or None (=unknown). Whether this video was
originally a live stream.
- live_status: 'is_live', 'is_upcoming', 'was_live', 'not_live' or Non... | yt_dlp/extractor/common.py | 26 | Python | 0.571 | suggestion | 95 | 51 | 51 | false | [extractor/youtube] Added is_post_live_dvr to returned info | 4,495 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | lazypete365 |
_TESTS = [{
'url': 'https://www.espn.com/watch/player/_/id/dbbc6b1d-c084-4b47-9878-5f13c56ce309',
'info_dict': {
'id': 'dbbc6b1d-c084-4b47-9878-5f13c56ce309',
'ext': 'mp4',
'title': 'Huddersfield vs. Burnley',
'duration': 7500,
'thumbnail':... | this is supposed to test `espnplus/` URL | _TESTS = [{
'url': 'https://www.espn.com/watch/player/_/id/dbbc6b1d-c084-4b47-9878-5f13c56ce309',
'info_dict': {
'id': 'dbbc6b1d-c084-4b47-9878-5f13c56ce309',
'ext': 'mp4',
'title': 'Huddersfield vs. Burnley',
'duration': 7500,
'thumbnail':... | @@ -283,34 +284,37 @@ def _real_extract(self, url):
class WatchESPNIE(AdobePassIE):
_VALID_URL = r'https?://(?:www\.)?espn\.com/(?:watch|espnplus)/player/_/id/(?P<id>[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})'
_TESTS = [{
- 'url': 'https://www.espn.com/watch/player/_/id/ba7d17da-453... | yt_dlp/extractor/espn.py | 26 | Python | 0.214 | suggestion | 40 | 51 | 51 | false | [ESPN] Extract duration and update tests | 4,499 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | ischmidt20 |
'ext': 'mp4',
'title': 'Debatable',
'duration': 3600,
'thumbnail': 'https://artwork.api.espn.com/artwork/collections/media/47950544-b39f-4e47-a982-b2132d20c8d1/default?width=640&apikey=1ngjw23osgcis1i1vbj96lmfqs',
},
'params': {
'skip_download'... | duration extraction can be inlined in the return | 'ext': 'mp4',
'title': 'The Wheel - Episode 10',
'duration': 3352,
'thumbnail': 'https://s.secure.espncdn.com/stitcher/artwork/collections/media/317f5fd1-c78a-4ebe-824a-129e0d348421/16x9.jpg?timestamp=202205031523&showBadge=true&cb=12&package=ESPN_PLUS',
},
... | @@ -328,9 +332,12 @@ def _call_bamgrid_api(self, path, video_id, payload=None, headers={}):
def _real_extract(self, url):
video_id = self._match_id(url)
- video_data = self._download_json(
+ cdn_data = self._download_json(
f'https://watch-cdn.product.api.espn.com/api/product/v... | yt_dlp/extractor/espn.py | 26 | Python | 0.143 | refactor | 48 | 51 | 51 | false | [ESPN] Extract duration and update tests | 4,499 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | ischmidt20 |
_TESTS = [{
'url': 'https://raisudtirol.rai.it/de/index.php?media=Ttv1656281400',
'info_dict': {
'id': 'Ttv1656281400',
'ext': 'mp4',
'title': 'Tagesschau + Sport am Sonntag - 31-07-2022 20:00',
'date': '20220731',
'thumbnail': r're:https:/... | Do the date need to be part of title? | _TESTS = [{
'url': 'https://raisudtirol.rai.it/de/index.php?media=Ttv1656281400',
'info_dict': {
'id': 'Ttv1656281400',
'ext': 'mp4',
'title': 'Tagesschau + Sport am Sonntag - 31-07-2022 20:00',
'series': 'Tagesschau + Sport am Sonntag',
'u... | @@ -764,3 +764,38 @@ def _real_extract(self, url):
'uploader': strip_or_none(track_info.get('editor') or None),
**relinker_info
}
+
+
+class RaiSudtirolIE(RaiBaseIE):
+ _VALID_URL = r'https?://raisudtirol\.rai\.it/.+?media=(?P<id>[TP]tv\d+)'
+ _TESTS = [{
+ 'url': 'https:... | yt_dlp/extractor/rai.py | 26 | Python | 0.071 | question | 37 | 32 | 32 | false | [rai] added raisudtirol support (fix #4206) | 4,524 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | nixxo |
'id': 'Ttv1656281400',
'ext': 'mp4',
'title': 'Tagesschau + Sport am Sonntag - 31-07-2022 20:00',
'date': '20220731',
'thumbnail': r're:https://raisudtirol\.rai\.it/img/.+?\.jpg',
'uploader': 'raisudtirol',
}
}]
def _real_extract(s... | ```suggestion
return {
'id': video_id,
'title': join_nonempty(video_title, video_data, delim=' - '),
'date': unified_strdate(video_data),
'thumbnail': video_thumb,
'url': self._proto_relative_url(video_url),
``` | 'id': 'Ttv1656281400',
'ext': 'mp4',
'title': 'Tagesschau + Sport am Sonntag - 31-07-2022 20:00',
'series': 'Tagesschau + Sport am Sonntag',
'upload_date': '20220731',
'thumbnail': r're:https://raisudtirol\.rai\.it/img/.+?\.jpg',
'uploa... | @@ -764,3 +764,38 @@ def _real_extract(self, url):
'uploader': strip_or_none(track_info.get('editor') or None),
**relinker_info
}
+
+
+class RaiSudtirolIE(RaiBaseIE):
+ _VALID_URL = r'https?://raisudtirol\.rai\.it/.+?media=(?P<id>[TP]tv\d+)'
+ _TESTS = [{
+ 'url': 'https:... | yt_dlp/extractor/rai.py | 26 | Python | 0.786 | suggestion | 286 | 29 | 29 | false | [rai] added raisudtirol support (fix #4206) | 4,524 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | nixxo |
_TESTS = [{
'url': 'https://raisudtirol.rai.it/de/index.php?media=Ttv1656281400',
'info_dict': {
'id': 'Ttv1656281400',
'ext': 'mp4',
'title': 'Tagesschau + Sport am Sonntag - 31-07-2022 20:00',
'date': '20220731',
'thumbnail': r're:https:/... | ```suggestion
'title': 'Tagesschau + Sport am Sonntag - 31-07-2022 20:00',
'series': 'Tagesschau + Sport am Sonntag',
'upload_date': '20220731',
'thumbnail': r're:https://raisudtirol\.rai\.it/img/.+?\.jpg',
'uploader': 'raisudtirol',
}
}]
... | _TESTS = [{
'url': 'https://raisudtirol.rai.it/de/index.php?media=Ttv1656281400',
'info_dict': {
'id': 'Ttv1656281400',
'ext': 'mp4',
'title': 'Tagesschau + Sport am Sonntag - 31-07-2022 20:00',
'series': 'Tagesschau + Sport am Sonntag',
'u... | @@ -764,3 +764,36 @@ def _real_extract(self, url):
'uploader': strip_or_none(track_info.get('editor') or None),
**relinker_info
}
+
+
+class RaiSudtirolIE(RaiBaseIE):
+ _VALID_URL = r'https?://raisudtirol\.rai\.it/.+?media=(?P<id>[TP]tv\d+)'
+ _TESTS = [{
+ 'url': 'https:... | yt_dlp/extractor/rai.py | 26 | Python | 0.857 | refactor | 1,212 | 30 | 32 | false | [rai] added raisudtirol support (fix #4206) | 4,524 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | nixxo |
SAKTVIE,
VTXTVIE,
WalyTVIE,
ZattooIE,
ZattooLiveIE,
ZattooMoviesIE,
ZattooRecordingsIE,
)
from .zdf import ZDFIE, ZDFChannelIE
from .zee5 import (
Zee5IE,
Zee5SeriesIE,
)
from .zhihu import ZhihuIE
from .zingmp3 import (
ZingMp3IE,
ZingMp3AlbumIE,
ZingMp3ChartHomeIE,
... | the imports are sorted alphabetically | SaltTVIE,
SAKTVIE,
VTXTVIE,
WalyTVIE,
ZattooIE,
ZattooLiveIE,
ZattooMoviesIE,
ZattooRecordingsIE,
)
from .zdf import ZDFIE, ZDFChannelIE
from .zee5 import (
Zee5IE,
Zee5SeriesIE,
)
from .zhihu import ZhihuIE
from .zingmp3 import (
ZingMp3IE,
ZingMp3AlbumIE,
ZingMp3Cha... | @@ -2226,3 +2226,5 @@
)
from .zoom import ZoomIE
from .zype import ZypeIE
+
+from .harpodeon import HarpodeonIE | yt_dlp/extractor/_extractors.py | 26 | Python | 0.071 | style | 37 | 26 | 26 | false | [extractor/harpodeon] Add Extractor | 4,540 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | eren-kemer |
from .common import InfoExtractor
from ..utils import (
str_or_none,
unified_strdate
)
class HarpodeonIE(InfoExtractor):
_VALID_URL = r'https?:\/\/(?:www\.)?harpodeon\.com\/(?:video|preview)\/[a-zA-Z_]+\/(?P<id>[0-9]+)$'
_TESTS = [{
'url': 'https://www.harpodeon.com/video/The_Smoking_Out_of_Be... | ```suggestion
from ..utils import str_or_none, unified_strdate
``` | from .common import InfoExtractor
from ..utils import unified_strdate
class HarpodeonIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?harpodeon\.com/(?:video|preview)/\w+/(?P<id>\d+)'
_TESTS = [{
'url': 'https://www.harpodeon.com/video/The_Smoking_Out_of_Bella_Butts/268068288',
'md5': '727... | @@ -0,0 +1,69 @@
+from .common import InfoExtractor
+from ..utils import (
+ str_or_none,
+ unified_strdate
+) | yt_dlp/extractor/harpodeon.py | 5 | Python | 0.571 | suggestion | 68 | 30 | 30 | false | [extractor/harpodeon] Add Extractor | 4,540 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | eren-kemer |
from .common import InfoExtractor
from ..utils import (
str_or_none,
unified_strdate
)
class HarpodeonIE(InfoExtractor):
_VALID_URL = r'https?:\/\/(?:www\.)?harpodeon\.com\/(?:video|preview)\/[a-zA-Z_]+\/(?P<id>[0-9]+)$'
_TESTS = [{
'url': 'https://www.harpodeon.com/video/The_Smoking_Out_of_Be... | ```suggestion
_VALID_URL = r'https?://(?:www\.)?harpodeon\.com/(?:video|preview)/\w+/(?P<id>\d+)'
``` | from .common import InfoExtractor
from ..utils import unified_strdate
class HarpodeonIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?harpodeon\.com/(?:video|preview)/\w+/(?P<id>\d+)'
_TESTS = [{
'url': 'https://www.harpodeon.com/video/The_Smoking_Out_of_Bella_Butts/268068288',
'md5': '727... | @@ -0,0 +1,69 @@
+from .common import InfoExtractor
+from ..utils import (
+ str_or_none,
+ unified_strdate
+)
+
+
+class HarpodeonIE(InfoExtractor):
+ _VALID_URL = r'https?:\/\/(?:www\.)?harpodeon\.com\/(?:video|preview)\/[a-zA-Z_]+\/(?P<id>[0-9]+)$' | yt_dlp/extractor/harpodeon.py | 9 | Python | 0.714 | suggestion | 107 | 34 | 34 | false | [extractor/harpodeon] Add Extractor | 4,540 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | eren-kemer |
from .common import InfoExtractor
from ..utils import (
str_or_none,
unified_strdate
)
class HarpodeonIE(InfoExtractor):
_VALID_URL = r'https?:\/\/(?:www\.)?harpodeon\.com\/(?:video|preview)\/[a-zA-Z_]+\/(?P<id>[0-9]+)$'
_TESTS = [{
'url': 'https://www.harpodeon.com/video/The_Smoking_Out_of_Be... | Use md5. Like:
```suggestion
'description': 'md5:xxx',
```
| from .common import InfoExtractor
from ..utils import unified_strdate
class HarpodeonIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?harpodeon\.com/(?:video|preview)/\w+/(?P<id>\d+)'
_TESTS = [{
'url': 'https://www.harpodeon.com/video/The_Smoking_Out_of_Bella_Butts/268068288',
'md5': '727... | @@ -0,0 +1,69 @@
+from .common import InfoExtractor
+from ..utils import (
+ str_or_none,
+ unified_strdate
+)
+
+
+class HarpodeonIE(InfoExtractor):
+ _VALID_URL = r'https?:\/\/(?:www\.)?harpodeon\.com\/(?:video|preview)\/[a-zA-Z_]+\/(?P<id>[0-9]+)$'
+ _TESTS = [{
+ 'url': 'https://www.harpodeon.com... | yt_dlp/extractor/harpodeon.py | 18 | Python | 0.643 | suggestion | 75 | 43 | 43 | false | [extractor/harpodeon] Add Extractor | 4,540 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | eren-kemer |
'id': '268068288',
'ext': 'mp4',
'title': 'The Smoking Out of Bella Butts',
'description': 'Anti-smoking campaigner Bella Butts enlists the help of the mayor\'s wife to enact a ban on tobacco, much to the chagrin of the town\'s cigar-addicted menfolk.',
'creat... | * line too long
* Make non-fatal
```suggestion
r'''(?x)
<div[^>]+videoInfo[^<]*<h2[^>]*>(?P<title>[^>]+)</h2>
(?:\s*<p[^>]*>\((?P<creator>.+),\s*)?
(?P<release_year>\d{4})?''',
webpage, 'title', group=('title', 'creator', 'release_year'),
... | 'description': 'md5:47e16bdb41fc8a79c83ab83af11c8b77',
'creator': 'Vitagraph Company of America',
'release_date': '19150101'
}
}, {
'url': 'https://www.harpodeon.com/preview/Behind_the_Screen/421838710',
'md5': '7979df9ca04637282cb7d172ab3a9c3b',
'... | @@ -0,0 +1,69 @@
+from .common import InfoExtractor
+from ..utils import (
+ str_or_none,
+ unified_strdate
+)
+
+
+class HarpodeonIE(InfoExtractor):
+ _VALID_URL = r'https?:\/\/(?:www\.)?harpodeon\.com\/(?:video|preview)\/[a-zA-Z_]+\/(?P<id>[0-9]+)$'
+ _TESTS = [{
+ 'url': 'https://www.harpodeon.com... | yt_dlp/extractor/harpodeon.py | 26 | Python | 0.786 | refactor | 370 | 45 | 46 | false | [extractor/harpodeon] Add Extractor | 4,540 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | eren-kemer |
'description': 'Anti-smoking campaigner Bella Butts enlists the help of the mayor\'s wife to enact a ban on tobacco, much to the chagrin of the town\'s cigar-addicted menfolk.',
'creator': 'Vitagraph Company of America',
'release_date': '19150101'
}
}, {
'url': 'h... | ```suggestion
r'hpBase\(\s*["\'](^["\']+)', webpage, 'hp_base')
``` | }
}, {
'url': 'https://www.harpodeon.com/preview/Behind_the_Screen/421838710',
'md5': '7979df9ca04637282cb7d172ab3a9c3b',
'info_dict': {
'id': '421838710',
'ext': 'mp4',
'title': 'Behind the Screen',
'description': 'md5:008972a3dc51fba3... | @@ -0,0 +1,69 @@
+from .common import InfoExtractor
+from ..utils import (
+ str_or_none,
+ unified_strdate
+)
+
+
+class HarpodeonIE(InfoExtractor):
+ _VALID_URL = r'https?:\/\/(?:www\.)?harpodeon\.com\/(?:video|preview)\/[a-zA-Z_]+\/(?P<id>[0-9]+)$'
+ _TESTS = [{
+ 'url': 'https://www.harpodeon.com... | yt_dlp/extractor/harpodeon.py | 26 | Python | 0.571 | suggestion | 81 | 42 | 43 | false | [extractor/harpodeon] Add Extractor | 4,540 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | eren-kemer |
}
}, {
'url': 'https://www.harpodeon.com/preview/Behind_the_Screen/421838710',
'md5': '7979df9ca04637282cb7d172ab3a9c3b',
'info_dict': {
'id': '421838710',
'ext': 'mp4',
'title': 'Behind the Screen',
'description': 'A woman tries to bre... | clean this up similar to above suggestions | 'md5': '7979df9ca04637282cb7d172ab3a9c3b',
'info_dict': {
'id': '421838710',
'ext': 'mp4',
'title': 'Behind the Screen',
'description': 'md5:008972a3dc51fba3965ee517d2ba9155',
'creator': 'Lone Star Corporation',
'release_date': '191... | @@ -0,0 +1,69 @@
+from .common import InfoExtractor
+from ..utils import (
+ str_or_none,
+ unified_strdate
+)
+
+
+class HarpodeonIE(InfoExtractor):
+ _VALID_URL = r'https?:\/\/(?:www\.)?harpodeon\.com\/(?:video|preview)\/[a-zA-Z_]+\/(?P<id>[0-9]+)$'
+ _TESTS = [{
+ 'url': 'https://www.harpodeon.com... | yt_dlp/extractor/harpodeon.py | 26 | Python | 0.071 | suggestion | 42 | 39 | 40 | false | [extractor/harpodeon] Add Extractor | 4,540 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | eren-kemer |
'title': 'Behind the Screen',
'description': 'A woman tries to break into being a stage hand at Charlie\'s studio by disguising herself as a man. Meanwhile, hostile strikers plan to blow up the set.',
'creator': 'Lone Star Corporation',
'release_date': '19160101'
... | ```suggestion
return {
'id': video_id,
'title': title,
'url': f'{hp_base}{hp_inject_video}_{hp_resolution}.mp4',
``` | 'release_date': '19160101'
}
}]
def _real_extract(self, url):
video_id = self._match_id(url)
webpage = self._download_webpage(url, video_id)
title, creator, release_year = self._search_regex(
r'''(?x)
<div[^>]+videoInfo[^<]*<h2[^>]*>(?P<t... | @@ -0,0 +1,69 @@
+from .common import InfoExtractor
+from ..utils import (
+ str_or_none,
+ unified_strdate
+)
+
+
+class HarpodeonIE(InfoExtractor):
+ _VALID_URL = r'https?:\/\/(?:www\.)?harpodeon\.com\/(?:video|preview)\/[a-zA-Z_]+\/(?P<id>[0-9]+)$'
+ _TESTS = [{
+ 'url': 'https://www.harpodeon.com... | yt_dlp/extractor/harpodeon.py | 26 | Python | 0.857 | suggestion | 165 | 32 | 33 | false | [extractor/harpodeon] Add Extractor | 4,540 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | eren-kemer |
'release_date': '19160101'
}
}]
def _real_extract(self, url):
video_id = self._match_id(url)
webpage = self._download_webpage(url, video_id)
title, creator, release_year = self._search_regex(
r'<div[^>]+videoInfo[^<]*<h2[^>]*>(?P<title>.+)<\/h2>(?:\n<p[^... | since it is from regex, it can only be string or None
```suggestion
'creator': creator,
``` |
def _real_extract(self, url):
video_id = self._match_id(url)
webpage = self._download_webpage(url, video_id)
title, creator, release_year = self._search_regex(
r'''(?x)
<div[^>]+videoInfo[^<]*<h2[^>]*>(?P<title>[^>]+)</h2>
(?:\s*<p[^>]*>\((?P<cre... | @@ -0,0 +1,69 @@
+from .common import InfoExtractor
+from ..utils import (
+ str_or_none,
+ unified_strdate
+)
+
+
+class HarpodeonIE(InfoExtractor):
+ _VALID_URL = r'https?:\/\/(?:www\.)?harpodeon\.com\/(?:video|preview)\/[a-zA-Z_]+\/(?P<id>[0-9]+)$'
+ _TESTS = [{
+ 'url': 'https://www.harpodeon.com... | yt_dlp/extractor/harpodeon.py | 26 | Python | 0.714 | suggestion | 106 | 29 | 30 | false | [extractor/harpodeon] Add Extractor | 4,540 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | eren-kemer |
}
}]
def _real_extract(self, url):
video_id = self._match_id(url)
webpage = self._download_webpage(url, video_id)
title, creator, release_year = self._search_regex(
r'<div[^>]+videoInfo[^<]*<h2[^>]*>(?P<title>.+)<\/h2>(?:\n<p[^>]*>\((?P<creator>.+), )?(?P<release_ye... | ```suggestion
'release_date': unified_strdate(f'{release_year}0101')
``` | def _real_extract(self, url):
video_id = self._match_id(url)
webpage = self._download_webpage(url, video_id)
title, creator, release_year = self._search_regex(
r'''(?x)
<div[^>]+videoInfo[^<]*<h2[^>]*>(?P<title>[^>]+)</h2>
(?:\s*<p[^>]*>\((?P<crea... | @@ -0,0 +1,69 @@
+from .common import InfoExtractor
+from ..utils import (
+ str_or_none,
+ unified_strdate
+)
+
+
+class HarpodeonIE(InfoExtractor):
+ _VALID_URL = r'https?:\/\/(?:www\.)?harpodeon\.com\/(?:video|preview)\/[a-zA-Z_]+\/(?P<id>[0-9]+)$'
+ _TESTS = [{
+ 'url': 'https://www.harpodeon.com... | yt_dlp/extractor/harpodeon.py | 26 | Python | 0.571 | suggestion | 86 | 28 | 29 | false | [extractor/harpodeon] Add Extractor | 4,540 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | eren-kemer |
'description': 'Anti-smoking campaigner Bella Butts enlists the help of the mayor\'s wife to enact a ban on tobacco, much to the chagrin of the town\'s cigar-addicted menfolk.',
'creator': 'Vitagraph Company of America',
'release_date': '19150101'
}
}, {
'url': 'h... | ```suggestion
hp_base = self._html_search_regex(r'hpBase\(\s*["\']([^"\']+)', webpage, 'hp_base')
``` | 'description': 'md5:47e16bdb41fc8a79c83ab83af11c8b77',
'creator': 'Vitagraph Company of America',
'release_date': '19150101'
}
}, {
'url': 'https://www.harpodeon.com/preview/Behind_the_Screen/421838710',
'md5': '7979df9ca04637282cb7d172ab3a9c3b',
'... | @@ -0,0 +1,64 @@
+from .common import InfoExtractor
+from ..utils import str_or_none, unified_strdate
+
+
+class HarpodeonIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?harpodeon\.com/(?:video|preview)/\w+/(?P<id>\d+)'
+ _TESTS = [{
+ 'url': 'https://www.harpodeon.com/video/The_Smoking_Out_of_Bella... | yt_dlp/extractor/harpodeon.py | 26 | Python | 0.714 | suggestion | 111 | 40 | 46 | false | [extractor/harpodeon] Add Extractor | 4,540 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | eren-kemer |
QuantumTVIE,
SaltTVIE,
SAKTVIE,
VTXTVIE,
WalyTVIE,
ZattooIE,
ZattooLiveIE,
ZattooMoviesIE,
ZattooRecordingsIE,
)
from .zdf import ZDFIE, ZDFChannelIE
from .zee5 import (
Zee5IE,
Zee5SeriesIE,
)
from .zhihu import ZhihuIE
from .zingmp3 import (
ZingMp3IE,
ZingMp3AlbumI... | ```suggestion
from .zype import ZypeIE
``` | QuantumTVIE,
SaltTVIE,
SAKTVIE,
VTXTVIE,
WalyTVIE,
ZattooIE,
ZattooLiveIE,
ZattooMoviesIE,
ZattooRecordingsIE,
)
from .zdf import ZDFIE, ZDFChannelIE
from .zee5 import (
Zee5IE,
Zee5SeriesIE,
)
from .zhihu import ZhihuIE
from .zingmp3 import (
ZingMp3IE,
ZingMp3AlbumI... | @@ -2225,4 +2226,4 @@
ZingMp3UserIE,
)
from .zoom import ZoomIE
-from .zype import ZypeIE
+from .zype import ZypeIE | yt_dlp/extractor/_extractors.py | 26 | Python | 0.429 | suggestion | 46 | 26 | 27 | false | [extractor/harpodeon] Add Extractor | 4,540 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | eren-kemer |
for stream in json_data['streams']:
if stream.get('type') == 'HLS':
fmt, sub = self._extract_m3u8_formats_and_subtitles(stream.get('url'), display_id, ext='mp4')
formats.extend(fmt)
self._merge_subtitles(sub, target=subtitles)
else:
... | `has_drm` should be set inside the format | for stream in json_data['streams']:
if stream.get('type') == 'HLS':
fmt, sub = self._extract_m3u8_formats_and_subtitles(stream.get('url'), display_id, ext='mp4')
formats.extend(fmt)
self._merge_subtitles(sub, target=subtitles)
else:
... | @@ -0,0 +1,70 @@
+from .common import InfoExtractor
+from ..utils import (
+ clean_html,
+ float_or_none,
+ str_or_none,
+ traverse_obj,
+)
+
+# Video from www.kompas.tv and video.kompas.com seems use jixie player
+# see [1] https://jixie.atlassian.net/servicedesk/customer/portal/2/article/1339654214?src=-1... | yt_dlp/extractor/kompas.py | 26 | Python | 0.286 | suggestion | 41 | 31 | 29 | false | [extractor/kompas] Add extractor | 4,562 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | HobbyistDev |
fmt, sub = self._extract_m3u8_formats_and_subtitles(stream.get('url'), display_id, ext='mp4')
formats.extend(fmt)
self._merge_subtitles(sub, target=subtitles)
else:
formats.append({
'url': stream.get('url'),
... | `''.split(',') or None` doesn't work like you think. It makes sense to use `try_call` here instead
```suggestion
'tags': try_call(lambda: json_data['metadata']['keywords'].split(',')),
'categories': try_call(lambda: json_data['metadata']['categories'].split(',')),
``` | fmt, sub = self._extract_m3u8_formats_and_subtitles(stream.get('url'), display_id, ext='mp4')
formats.extend(fmt)
self._merge_subtitles(sub, target=subtitles)
else:
formats.append({
'url': stream.get('url'),
... | @@ -0,0 +1,70 @@
+from .common import InfoExtractor
+from ..utils import (
+ clean_html,
+ float_or_none,
+ str_or_none,
+ traverse_obj,
+)
+
+# Video from www.kompas.tv and video.kompas.com seems use jixie player
+# see [1] https://jixie.atlassian.net/servicedesk/customer/portal/2/article/1339654214?src=-1... | yt_dlp/extractor/kompas.py | 26 | Python | 0.857 | suggestion | 296 | 29 | 27 | false | [extractor/kompas] Add extractor | 4,562 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | HobbyistDev |
clean_html,
float_or_none,
traverse_obj,
try_call,
)
# Video from www.kompas.tv and video.kompas.com seems use jixie player
# see [1] https://jixie.atlassian.net/servicedesk/customer/portal/2/article/1339654214?src=-1456335525,
# [2] https://scripts.jixie.media/jxvideo.3.1.min.js for more info
class ... | ```suggestion
'tags': 'count:9',
``` | clean_html,
float_or_none,
traverse_obj,
try_call,
)
# Video from www.kompas.tv and video.kompas.com seems use jixie player
# see [1] https://jixie.atlassian.net/servicedesk/customer/portal/2/article/1339654214?src=-1456335525,
# [2] https://scripts.jixie.media/jxvideo.3.1.min.js for more info
class ... | @@ -0,0 +1,69 @@
+from .common import InfoExtractor
+from ..utils import (
+ clean_html,
+ float_or_none,
+ traverse_obj,
+ try_call,
+)
+
+# Video from www.kompas.tv and video.kompas.com seems use jixie player
+# see [1] https://jixie.atlassian.net/servicedesk/customer/portal/2/article/1339654214?src=-1456... | yt_dlp/extractor/kompas.py | 26 | Python | 0.571 | suggestion | 50 | 51 | 51 | false | [extractor/kompas] Add extractor | 4,562 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | HobbyistDev |
class MLBTVIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?mlb\.com/tv/g(?P<id>\d{6})/?.*'
_TESTS = [{
'url': 'https://www.mlb.com/tv/g661581/vee2eff5f-a7df-4c20-bdb4-7b926fa12638',
'info_dict': {
'id': '661581',
'ext': 'mp4',
'title': '2022-07-02 - St.... | I think `os=Android&appname=...` part can moved to `query` field | })['data']['mediaPlayback'][0]
class MLBTVIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?mlb\.com/tv/g(?P<id>\d{6})'
_NETRC_MACHINE = 'mlb'
_TESTS = [{
'url': 'https://www.mlb.com/tv/g661581/vee2eff5f-a7df-4c20-bdb4-7b926fa12638',
'info_dict': {
'id': '661581... | @@ -263,3 +265,68 @@ def _download_video_data(self, display_id):
}
}''' % display_id,
})['data']['mediaPlayback'][0]
+
+
+class MLBTVIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?mlb\.com/tv/g(?P<id>\d{6})/?.*'
+
+ _TESTS = [{
+ 'url': 'https://www.mlb.com/tv/g661581/vee2eff5f-a7d... | yt_dlp/extractor/mlb.py | 26 | Python | 0.429 | suggestion | 64 | 51 | 51 | false | [MLB.tv] New Extractor | 4,586 | yt-dlp/yt-dlp | 132,642 | Python | HobbyistDev | ischmidt20 |
description
feeds(types: CMS) {
closedCaptions
duration
image {
cuts {
width
height
src
}
}
playbacks {
name
url
}
}
id
timestamp
title
}
}''' % display_id,
})['data']['mediaPlayback']... | You forget to define `_NETRC_MATCHINE` variable
From test:
```
AssertionError: None is not true : Extractor MLBTV supports login, but is missing a _NETRC_MACHINE property
``` | 'query': '''{
mediaPlayback(ids: "%s") {
description
feeds(types: CMS) {
closedCaptions
duration
image {
cuts {
width
height
src
}
}
playbacks {
name
url
}
}
id
timestamp
title
}... | @@ -263,3 +265,68 @@ def _download_video_data(self, display_id):
}
}''' % display_id,
})['data']['mediaPlayback'][0]
+
+
+class MLBTVIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?mlb\.com/tv/g(?P<id>\d{6})/?.*' | yt_dlp/extractor/mlb.py | 26 | Python | 0.929 | refactor | 178 | 51 | 51 | false | [MLB.tv] New Extractor | 4,586 | yt-dlp/yt-dlp | 132,642 | Python | HobbyistDev | ischmidt20 |
_TESTS = [{
'url': 'https://www.mlb.com/tv/g661581/vee2eff5f-a7df-4c20-bdb4-7b926fa12638',
'info_dict': {
'id': '661581',
'ext': 'mp4',
'title': '2022-07-02 - St. Louis Cardinals @ Philadelphia Phillies',
},
'params': {
'skip_download'... | Assign to `self._access_token` here and remove `_real_initialize`. `self.get_param('username'), self.get_param('password')` may contain credentials for different site | class MLBTVIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?mlb\.com/tv/g(?P<id>\d{6})'
_NETRC_MACHINE = 'mlb'
_TESTS = [{
'url': 'https://www.mlb.com/tv/g661581/vee2eff5f-a7df-4c20-bdb4-7b926fa12638',
'info_dict': {
'id': '661581',
'ext': 'mp4',
'tit... | @@ -263,3 +265,68 @@ def _download_video_data(self, display_id):
}
}''' % display_id,
})['data']['mediaPlayback'][0]
+
+
+class MLBTVIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?mlb\.com/tv/g(?P<id>\d{6})/?.*'
+
+ _TESTS = [{
+ 'url': 'https://www.mlb.com/tv/g661581/vee2eff5f-a7d... | yt_dlp/extractor/mlb.py | 26 | Python | 0.571 | security | 166 | 51 | 51 | false | [MLB.tv] New Extractor | 4,586 | yt-dlp/yt-dlp | 132,642 | Python | Lesmiscore | ischmidt20 |
access_token = self._download_json('https://us.edge.bamgrid.com/token', None,
headers={'Accept': 'application/json',
'Authorization': 'Bearer bWxidHYmYW5kcm9pZCYxLjAuMA.6LZMbH2r--rbXcgEabaDdIslpo4RyZrlVfWZhsAgXIk',
... | `self._merge_subtitles(s, subtitles)` | access_token = self._download_json(
'https://ids.mlb.com/oauth2/aus1m088yK07noBfh356/v1/token', None,
headers={
'User-Agent': 'okhttp/3.12.1',
'Content-Type': 'application/x-www-form-urlencoded'
}, data=data.encode())['access_token']
e... | @@ -263,3 +265,68 @@ def _download_video_data(self, display_id):
}
}''' % display_id,
})['data']['mediaPlayback'][0]
+
+
+class MLBTVIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?mlb\.com/tv/g(?P<id>\d{6})/?.*'
+
+ _TESTS = [{
+ 'url': 'https://www.mlb.com/tv/g661581/vee2eff5f-a7d... | yt_dlp/extractor/mlb.py | 26 | Python | 0.214 | suggestion | 37 | 38 | 51 | false | [MLB.tv] New Extractor | 4,586 | yt-dlp/yt-dlp | 132,642 | Python | Lesmiscore | ischmidt20 |
description
feeds(types: CMS) {
closedCaptions
duration
image {
cuts {
width
height
src
}
}
playbacks {
name
url
}
}
id
timestamp
title
}
}''' % display_id,
})['data']['mediaPlayback']... | ```suggestion
_VALID_URL = r'https?://(?:www\.)?mlb\.com/tv/g(?P<id>\d{6})'
``` | 'query': '''{
mediaPlayback(ids: "%s") {
description
feeds(types: CMS) {
closedCaptions
duration
image {
cuts {
width
height
src
}
}
playbacks {
name
url
}
}
id
timestamp
title
}... | @@ -263,3 +265,68 @@ def _download_video_data(self, display_id):
}
}''' % display_id,
})['data']['mediaPlayback'][0]
+
+
+class MLBTVIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?mlb\.com/tv/g(?P<id>\d{6})/?.*' | yt_dlp/extractor/mlb.py | 26 | Python | 0.571 | suggestion | 85 | 51 | 51 | false | [MLB.tv] New Extractor | 4,586 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | ischmidt20 |
access_token = self._download_json('https://us.edge.bamgrid.com/token', None,
headers={'Accept': 'application/json',
'Authorization': 'Bearer bWxidHYmYW5kcm9pZCYxLjAuMA.6LZMbH2r--rbXcgEabaDdIslpo4RyZrlVfWZhsAgXIk',
... | make non-fatal (use `traverse_obj`) | 'https://ids.mlb.com/oauth2/aus1m088yK07noBfh356/v1/token', None,
headers={
'User-Agent': 'okhttp/3.12.1',
'Content-Type': 'application/x-www-form-urlencoded'
}, data=data.encode())['access_token']
entitlement = self._download_webpage(
... | @@ -263,3 +265,68 @@ def _download_video_data(self, display_id):
}
}''' % display_id,
})['data']['mediaPlayback'][0]
+
+
+class MLBTVIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?mlb\.com/tv/g(?P<id>\d{6})/?.*'
+
+ _TESTS = [{
+ 'url': 'https://www.mlb.com/tv/g661581/vee2eff5f-a7d... | yt_dlp/extractor/mlb.py | 26 | Python | 0.286 | suggestion | 35 | 37 | 50 | false | [MLB.tv] New Extractor | 4,586 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | ischmidt20 |
.encode())['access_token']
entitlement = self._download_webpage('https://media-entitlement.mlb.com/api/v3/jwt?os=Android&appname=AtBat&did=' + str(uuid.uuid4()), None,
headers={'User-Agent': 'okhttp/3.12.1', 'Authorization'... | Have you read the style guide? similar changes elsewhere
```suggestion
playback = self._download_json(
airing['playbackUrls'][0]['href'].format(scenario='browser~csai'),
video_id, headers={
'Authorization': self._access_token,
... | 'All videos are only available to registered users', method='password')
def _perform_login(self, username, password):
data = f'grant_type=password&username={urllib.parse.quote(username)}&password={urllib.parse.quote(password)}&scope=openid offline_access&client_id=0oa3e1nutA1HLzAKG356'
... | @@ -263,3 +265,68 @@ def _download_video_data(self, display_id):
}
}''' % display_id,
})['data']['mediaPlayback'][0]
+
+
+class MLBTVIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?mlb\.com/tv/g(?P<id>\d{6})/?.*'
+
+ _TESTS = [{
+ 'url': 'https://www.mlb.com/tv/g661581/vee2eff5f-a7d... | yt_dlp/extractor/mlb.py | 26 | Python | 0.857 | security | 403 | 42 | 51 | false | [MLB.tv] New Extractor | 4,586 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | ischmidt20 |
class MLBTVIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?mlb\.com/tv/g(?P<id>\d{6})'
_NETRC_MACHINE = 'mlb'
_TESTS = [{
'url': 'https://www.mlb.com/tv/g661581/vee2eff5f-a7df-4c20-bdb4-7b926fa12638',
'info_dict': {
'id': '661581',
'ext': 'mp4',
'tit... | ```suggestion
data = f'grant_type=password&username={urllib.parse.quote(username)}&password={urllib.parse.quote(password)}&scope=openid offline_access&client_id=0oa3e1nutA1HLzAKG356'
access_token = self._download_json(
'https://ids.mlb.com/oauth2/aus1m088yK07noBfh356/v1/token', None,
... |
class MLBTVIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?mlb\.com/tv/g(?P<id>\d{6})'
_NETRC_MACHINE = 'mlb'
_TESTS = [{
'url': 'https://www.mlb.com/tv/g661581/vee2eff5f-a7df-4c20-bdb4-7b926fa12638',
'info_dict': {
'id': '661581',
'ext': 'mp4',
'ti... | @@ -263,3 +266,81 @@ def _download_video_data(self, display_id):
}
}''' % display_id,
})['data']['mediaPlayback'][0]
+
+
+class MLBTVIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?mlb\.com/tv/g(?P<id>\d{6})'
+ _NETRC_MACHINE = 'mlb'
+
+ _TESTS = [{
+ 'url': 'https://www.mlb.com/... | yt_dlp/extractor/mlb.py | 26 | Python | 1 | security | 512 | 51 | 51 | false | [MLB.tv] New Extractor | 4,586 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | ischmidt20 |
'Accept': 'application/json',
'Authorization': 'Bearer bWxidHYmYW5kcm9pZCYxLjAuMA.6LZMbH2r--rbXcgEabaDdIslpo4RyZrlVfWZhsAgXIk',
'Content-Type': 'application/x-www-form-urlencoded'
},
data=(
('grant_type=urn:ietf:params:oauth:grant-... | ```suggestion
f, s = self._extract_m3u8_formats_and_subtitles(
m3u8_url, video_id, 'mp4', m3u8_id=join_nonempty(airing.get('feedType'), airing.get('feedLanguage'))
``` | })
data = f'grant_type=urn:ietf:params:oauth:grant-type:token-exchange&subject_token={entitlement}&subject_token_type=urn:ietf:params:oauth:token-type:jwt&platform=android-tv'
self._access_token = self._download_json(
'https://us.edge.bamgrid.com/token', None,
header... | @@ -263,3 +266,81 @@ def _download_video_data(self, display_id):
}
}''' % display_id,
})['data']['mediaPlayback'][0]
+
+
+class MLBTVIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?mlb\.com/tv/g(?P<id>\d{6})'
+ _NETRC_MACHINE = 'mlb'
+
+ _TESTS = [{
+ 'url': 'https://www.mlb.com/... | yt_dlp/extractor/mlb.py | 26 | Python | 0.929 | refactor | 198 | 40 | 39 | false | [MLB.tv] New Extractor | 4,586 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | ischmidt20 |
self._access_token = access_token
def _real_extract(self, url):
video_id = self._match_id(url)
formats, subtitles = [], {}
airings = self._download_json(
f'https://search-api-mlbtv.mlb.com/svc/search/v2/graphql/persisted/query/core/Airings?variables=%7B%22partnerProgram... | ```suggestion
self._sort_formats(formats)
return {
'title': traverse_obj(airings, (..., 'titles', 0, 'episodeName'), get_all=False),
``` | 'Content-Type': 'application/x-www-form-urlencoded'
}, data=data.encode())['access_token']
def _real_extract(self, url):
video_id = self._match_id(url)
airings = self._download_json(
f'https://search-api-mlbtv.mlb.com/svc/search/v2/graphql/persisted/query/cor... | @@ -263,3 +266,81 @@ def _download_video_data(self, display_id):
}
}''' % display_id,
})['data']['mediaPlayback'][0]
+
+
+class MLBTVIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?mlb\.com/tv/g(?P<id>\d{6})'
+ _NETRC_MACHINE = 'mlb'
+
+ _TESTS = [{
+ 'url': 'https://www.mlb.com/... | yt_dlp/extractor/mlb.py | 26 | Python | 0.714 | suggestion | 170 | 32 | 31 | false | [MLB.tv] New Extractor | 4,586 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | ischmidt20 |
def _perform_login(self, username, password):
data = f'grant_type=password&username={urllib.parse.quote(username)}&password={urllib.parse.quote(password)}&scope=openid offline_access&client_id=0oa3e1nutA1HLzAKG356'
access_token = self._download_json(
'https://ids.mlb.com/oauth2/aus1m088y... | ```suggestion
self._access_token = self._download_json(
'https://us.edge.bamgrid.com/token', None,
headers={
'Accept': 'application/json',
'Authorization': 'Bearer bWxidHYmYW5kcm9pZCYxLjAuMA.6LZMbH2r--rbXcgEabaDdIslpo4RyZrlVfWZhsAgXIk',
... |
def _real_initialize(self):
if not self._access_token:
self.raise_login_required(
'All videos are only available to registered users', method='password')
def _perform_login(self, username, password):
data = f'grant_type=password&username={urllib.parse.quote(username... | @@ -263,3 +267,75 @@ def _download_video_data(self, display_id):
}
}''' % display_id,
})['data']['mediaPlayback'][0]
+
+
+class MLBTVIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?mlb\.com/tv/g(?P<id>\d{6})'
+ _NETRC_MACHINE = 'mlb'
+
+ _TESTS = [{
+ 'url': 'https://www.mlb.com/... | yt_dlp/extractor/mlb.py | 26 | Python | 0.929 | security | 431 | 51 | 51 | false | [MLB.tv] New Extractor | 4,586 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | ischmidt20 |
}''' % display_id,
})['data']['mediaPlayback'][0]
class MLBTVIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?mlb\.com/tv/g(?P<id>\d{6})'
_NETRC_MACHINE = 'mlb'
_TESTS = [{
'url': 'https://www.mlb.com/tv/g661581/vee2eff5f-a7df-4c20-bdb4-7b926fa12638',
'info_dict': {
... | All video on the site needs account, correct? Do this to give users a proper error message if try try without `-u`.
```suggestion
_access_token = None
def _real_initialize(self):
if not self._access_token:
self.raise_login_required(
'All videos are only available ... | }''' % display_id,
})['data']['mediaPlayback'][0]
class MLBTVIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?mlb\.com/tv/g(?P<id>\d{6})'
_NETRC_MACHINE = 'mlb'
_TESTS = [{
'url': 'https://www.mlb.com/tv/g661581/vee2eff5f-a7df-4c20-bdb4-7b926fa12638',
'info_dict': {
... | @@ -263,3 +267,73 @@ def _download_video_data(self, display_id):
}
}''' % display_id,
})['data']['mediaPlayback'][0]
+
+
+class MLBTVIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?mlb\.com/tv/g(?P<id>\d{6})'
+ _NETRC_MACHINE = 'mlb'
+
+ _TESTS = [{
+ 'url': 'https://www.mlb.com/... | yt_dlp/extractor/mlb.py | 26 | Python | 1 | suggestion | 365 | 51 | 51 | false | [MLB.tv] New Extractor | 4,586 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | ischmidt20 |
'User-Agent': 'okhttp/3.12.1',
'Content-Type': 'application/x-www-form-urlencoded'
}, data=data.encode())['access_token']
entitlement = self._download_webpage(
f'https://media-entitlement.mlb.com/api/v3/jwt?os=Android&appname=AtBat&did={str(uuid.uuid4())}... | ```suggestion
airings = self._download_json(
f'https://search-api-mlbtv.mlb.com/svc/search/v2/graphql/persisted/query/core/Airings?variables=%7B%22partnerProgramIds%22%3A%5B%22{video_id}%22%5D%2C%22applyEsniMediaRightsLabels%22%3Atrue%7D',
video_id)['data']['Airings']
f... | 'User-Agent': 'okhttp/3.12.1',
'Content-Type': 'application/x-www-form-urlencoded'
}, data=data.encode())['access_token']
entitlement = self._download_webpage(
f'https://media-entitlement.mlb.com/api/v3/jwt?os=Android&appname=AtBat&did={str(uuid.uuid4())}... | @@ -263,3 +267,79 @@ def _download_video_data(self, display_id):
}
}''' % display_id,
})['data']['mediaPlayback'][0]
+
+
+class MLBTVIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?mlb\.com/tv/g(?P<id>\d{6})'
+ _NETRC_MACHINE = 'mlb'
+
+ _TESTS = [{
+ 'url': 'https://www.mlb.com/... | yt_dlp/extractor/mlb.py | 26 | Python | 0.786 | suggestion | 351 | 48 | 48 | false | [MLB.tv] New Extractor | 4,586 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | ischmidt20 |
})
data = f'grant_type=urn:ietf:params:oauth:grant-type:token-exchange&subject_token={entitlement}&subject_token_type=urn:ietf:params:oauth:token-type:jwt&platform=android-tv'
self._access_token = self._download_json(
'https://us.edge.bamgrid.com/token', None,
header... | ```suggestion
m3u8_url = self._download_json(
airing['playbackUrls'][0]['href'].format(scenario='browser~csai'), video_id,
headers={
'Authorization': self._access_token,
'Accept': 'application/vnd.media-service+json; version=2'
... | })
data = f'grant_type=urn:ietf:params:oauth:grant-type:token-exchange&subject_token={entitlement}&subject_token_type=urn:ietf:params:oauth:token-type:jwt&platform=android-tv'
self._access_token = self._download_json(
'https://us.edge.bamgrid.com/token', None,
header... | @@ -263,3 +267,79 @@ def _download_video_data(self, display_id):
}
}''' % display_id,
})['data']['mediaPlayback'][0]
+
+
+class MLBTVIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?mlb\.com/tv/g(?P<id>\d{6})'
+ _NETRC_MACHINE = 'mlb'
+
+ _TESTS = [{
+ 'url': 'https://www.mlb.com/... | yt_dlp/extractor/mlb.py | 26 | Python | 0.857 | security | 425 | 39 | 39 | false | [MLB.tv] New Extractor | 4,586 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | ischmidt20 |
def _real_extract(self, url):
video_id = self._match_id(url)
formats, subtitles = [], {}
airings = self._download_json(
f'https://search-api-mlbtv.mlb.com/svc/search/v2/graphql/persisted/query/core/Airings?variables=%7B%22partnerProgramIds%22%3A%5B%22{video_id}%22%5D%2C%22applyEs... | ```suggestion
'id': video_id,
'title': traverse_obj(airings, (..., 'titles', 0, 'episodeName'), get_all=False),
'formats': formats,
'subtitles': subtitles,
'http_headers': {'Authorization': f'Bearer {self._access_token}'},
``` | def _real_extract(self, url):
video_id = self._match_id(url)
airings = self._download_json(
f'https://search-api-mlbtv.mlb.com/svc/search/v2/graphql/persisted/query/core/Airings?variables=%7B%22partnerProgramIds%22%3A%5B%22{video_id}%22%5D%2C%22applyEsniMediaRightsLabels%22%3Atrue%7D',
... | @@ -263,3 +267,79 @@ def _download_video_data(self, display_id):
}
}''' % display_id,
})['data']['mediaPlayback'][0]
+
+
+class MLBTVIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?mlb\.com/tv/g(?P<id>\d{6})'
+ _NETRC_MACHINE = 'mlb'
+
+ _TESTS = [{
+ 'url': 'https://www.mlb.com/... | yt_dlp/extractor/mlb.py | 26 | Python | 0.786 | security | 292 | 28 | 28 | false | [MLB.tv] New Extractor | 4,586 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | ischmidt20 |
self._access_token = self._download_json(
'https://us.edge.bamgrid.com/token', None,
headers={
'Accept': 'application/json',
'Authorization': 'Bearer bWxidHYmYW5kcm9pZCYxLjAuMA.6LZMbH2r--rbXcgEabaDdIslpo4RyZrlVfWZhsAgXIk',
'Content-Type': '... | ```suggestion
self._merge_subtitles(s, target=subtitles)
``` | self._access_token = self._download_json(
'https://us.edge.bamgrid.com/token', None,
headers={
'Accept': 'application/json',
'Authorization': 'Bearer bWxidHYmYW5kcm9pZCYxLjAuMA.6LZMbH2r--rbXcgEabaDdIslpo4RyZrlVfWZhsAgXIk',
'Content-Type': '... | @@ -263,3 +267,79 @@ def _download_video_data(self, display_id):
}
}''' % display_id,
})['data']['mediaPlayback'][0]
+
+
+class MLBTVIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?mlb\.com/tv/g(?P<id>\d{6})'
+ _NETRC_MACHINE = 'mlb'
+
+ _TESTS = [{
+ 'url': 'https://www.mlb.com/... | yt_dlp/extractor/mlb.py | 26 | Python | 0.571 | suggestion | 74 | 36 | 36 | false | [MLB.tv] New Extractor | 4,586 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | ischmidt20 |
'url': 'https://9gag.com/gag/ajgp66G',
'info_dict': {
'id': 'ajgp66G',
'ext': 'webm',
'title': 'Master Shifu! Or Splinter! You decide:',
'upload_date': '20220806',
'timestamp': 1659803411,
'thumbnail': 'https://img-9gag-fun.9cache.c... | Revert this. It didn't use traverse_obj/try_get because the entire extraction will fail anyway if this fails. | 'url': 'https://9gag.com/gag/ajgp66G',
'info_dict': {
'id': 'ajgp66G',
'ext': 'webm',
'title': 'Master Shifu! Or Splinter! You decide:',
'upload_date': '20220806',
'timestamp': 1659803411,
'thumbnail': 'https://img-9gag-fun.9cache.c... | @@ -32,22 +34,40 @@ class NineGagIE(InfoExtractor):
# HTML escaped title
'url': 'https://9gag.com/gag/av5nvyb',
'only_matching': True,
+ }, {
+ # Non Anonymous Uploader
+ 'url': 'https://9gag.com/gag/ajgp66G',
+ 'info_dict': {
+ 'id': 'ajgp66G',
+ ... | yt_dlp/extractor/ninegag.py | 26 | Python | 0.429 | bug | 109 | 51 | 51 | false | [extractor/ninegag] Update to 9GAG extractor | 4,597 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | DjesonPV |
class RaiBaseIE(InfoExtractor):
_UUID_RE = r'[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}'
_GEO_COUNTRIES = ['IT']
_GEO_BYPASS = False
def _extract_relinker_info(self, relinker_url, video_id, audio_only=False):
if not re.match(r'https?://', relinker_url):
return {'format... | Error should be raised only if ALL formats have DRM, correct? |
class RaiBaseIE(InfoExtractor):
_UUID_RE = r'[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}'
_GEO_COUNTRIES = ['IT']
_GEO_BYPASS = False
def _extract_relinker_info(self, relinker_url, video_id, audio_only=False):
if not re.match(r'https?://', relinker_url):
return {'format... | @@ -51,6 +51,10 @@ def _extract_relinker_info(self, relinker_url, video_id, audio_only=False):
query={'output': 45, 'pl': platform},
headers=self.geo_verification_headers())
+ if xpath_text(relinker, './license_url', default='{}') != '{}':
+ self.report_drm(... | yt_dlp/extractor/rai.py | 26 | Python | 0.429 | question | 61 | 51 | 51 | false | [extractor/rai] various fixes and improvements | 4,600 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | nixxo |
(?P<url>
(?:https?:)?
//mediapolis(?:vod)?\.rai\.it/relinker/relinkerServlet\.htm\?
(?:(?!\1).)*\bcont=(?:(?!\1).)+)\1
''',
webpage, 'relinker URL', group='url'))
relinker_info = self._extract_relinker_info(
... | this'll have to test too many iframes. Add the domain to the regex | (?:https?:)?
//mediapolis(?:vod)?\.rai\.it/relinker/relinkerServlet\.htm\?
(?:(?!\1).)*\bcont=(?:(?!\1).)+)\1
''',
webpage, 'relinker URL', group='url'))
relinker_info = self._extract_relinker_info(
urljoin(url, rel... | @@ -707,7 +719,8 @@ def _real_extract(self, url):
class RaiNewsIE(RaiIE):
- _VALID_URL = rf'https?://(www\.)?rainews\.it/[^?#]+-(?P<id>{RaiBaseIE._UUID_RE})(?:-[^/?#]+)?\.html'
+ _VALID_URL = rf'https?://(www\.)?rainews\.it/(?!articoli)[^?#]+-(?P<id>{RaiBaseIE._UUID_RE})(?:-[^/?#]+)?\.html'
+ _EMBED_REGEX... | yt_dlp/extractor/rai.py | 26 | Python | 0.214 | suggestion | 66 | 51 | 51 | false | [extractor/rai] various fixes and improvements | 4,600 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | nixxo |
'episode': 'Om vetenskap, kritiskt tänkande och motstånd',
'age_limit': 15,
},
}, {
'url': 'https://urplay.se/program/222967-en-foralders-dagbok-mitt-barn-skadar-sig-sjalv',
'info_dict': {
'id': '222967',
'ext': 'mp4',
'title': 'En ... | ```suggestion
'categories': 'count:2',
'tags': 'count:7',
``` | 'episode': 'Om vetenskap, kritiskt tänkande och motstånd',
'age_limit': 15,
},
}, {
'url': 'https://urplay.se/program/222967-en-foralders-dagbok-mitt-barn-skadar-sig-sjalv',
'info_dict': {
'id': '222967',
'ext': 'mp4',
'title': 'En ... | @@ -29,19 +30,49 @@ class URPlayIE(InfoExtractor):
'episode': 'Om vetenskap, kritiskt tänkande och motstånd',
'age_limit': 15,
},
+ }, {
+ 'url': 'https://urplay.se/program/222967-en-foralders-dagbok-mitt-barn-skadar-sig-sjalv',
+ 'info_dict': {
+ 'id': '22... | yt_dlp/extractor/urplay.py | 26 | Python | 0.571 | suggestion | 88 | 51 | 51 | false | [urplay] Add support for audio-only formats | 4,606 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | barsnick |
'categories': [],
'tags': ['Sova'],
'episode': 'Sovkudde',
'season': 'Säsong 1',
},
}, {
'url': 'http://urskola.se/Produkter/155794-Smasagor-meankieli-Grodan-i-vida-varlden',
'only_matching': True,
}]
def _real_extract(self, url):
... | Do we even need this check? Are there known keys that fails here? | 'only_matching': True,
}]
def _real_extract(self, url):
video_id = self._match_id(url)
url = url.replace('skola.se/Produkter', 'play.se/program')
webpage = self._download_webpage(url, video_id)
urplayer_data = self._search_nextjs_data(webpage, video_id, fatal=False) or {... | @@ -69,7 +100,7 @@ def _real_extract(self, url):
urplayer_streams = urplayer_data.get('streamingInfo', {})
for k, v in urplayer_streams.get('raw', {}).items():
- if not (k in ('sd', 'hd') and isinstance(v, dict)):
+ if not (k in ('sd', 'hd', 'mp3', 'm4a') and isinstance(v, dict... | yt_dlp/extractor/urplay.py | 26 | Python | 0.214 | bug | 65 | 51 | 51 | false | [urplay] Add support for audio-only formats | 4,606 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | barsnick |
'thumbnail': 'https://video.jixie.media/1003/28210/28210_1280x720.jpg',
'description': 'md5:2a5e18d98eef9b39d7895029cac96c63',
'title': 'Paris Van Java Episode 16',
}
}
]
def _real_extract(self, url):
display_id = self._match_id(url)
... | ```suggestion
fmt, sub = self._extract_m3u8_formats_and_subtitles(stream.get('url'), display_id, ext='mp4')
if json_data.get('drm'):
for f in fmt:
f['has_drm'] = True
``` | from .jixie import JixieBaseIE
class MoviewPlayIE(JixieBaseIE):
_VALID_URL = r'https?://www\.moview\.id/play/\d+/(?P<id>[\w-]+)'
_TESTS = [
{
# drm hls, only use direct link
'url': 'https://www.moview.id/play/174/Candy-Monster',
'info_dict': {
'id': ... | @@ -0,0 +1,89 @@
+from .common import InfoExtractor
+from ..utils import (
+ clean_html,
+ float_or_none,
+ traverse_obj,
+ try_call,
+)
+
+
+class MoviewPlayIE(InfoExtractor):
+ _VALID_URL = r'https?://www\.moview\.id/play/\d+/(?P<id>[\w-]+)'
+ _TESTS = [
+ {
+ # drm hls, only use d... | yt_dlp/extractor/moview.py | 26 | Python | 0.857 | refactor | 251 | 51 | 44 | false | [extractor/moview] Add extractor | 4,607 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | HobbyistDev |
self.write_debug('Found drm content, trying to use non-drm link')
else:
fmt, sub = self._extract_m3u8_formats_and_subtitles(stream.get('url'), display_id, ext='mp4')
formats.extend(fmt)
self._merge_subtitles(sub, target=subt... | ```suggestion
'tags': try_call(lambda: (json_data['metadata']['keywords'] or None).split(',')),
'categories': try_call(lambda: (json_data['metadata']['categories'] or None).split(',')),
```
should fix the `['']`
But why is this empty for both tests? | from .jixie import JixieBaseIE
class MoviewPlayIE(JixieBaseIE):
_VALID_URL = r'https?://www\.moview\.id/play/\d+/(?P<id>[\w-]+)'
_TESTS = [
{
# drm hls, only use direct link
'url': 'https://www.moview.id/play/174/Candy-Monster',
'info_dict': {
'id': ... | @@ -0,0 +1,89 @@
+from .common import InfoExtractor
+from ..utils import (
+ clean_html,
+ float_or_none,
+ traverse_obj,
+ try_call,
+)
+
+
+class MoviewPlayIE(InfoExtractor):
+ _VALID_URL = r'https?://www\.moview\.id/play/\d+/(?P<id>[\w-]+)'
+ _TESTS = [
+ {
+ # drm hls, only use d... | yt_dlp/extractor/moview.py | 26 | Python | 0.857 | question | 280 | 29 | 44 | false | [extractor/moview] Add extractor | 4,607 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | HobbyistDev |
from .common import InfoExtractor
from ..utils import (
clean_html,
float_or_none,
traverse_obj,
try_call,
)
# Video from www.kompas.tv and video.kompas.com seems use jixie player
# see [1] https://jixie.atlassian.net/servicedesk/customer/portal/2/article/1339654214?src=-1456335525,
# [2] https://scrip... | Actually, i think this class can be defined in a new extractor(jixie). Is it acceptable to define a file that just contain this base class ? | from .jixie import JixieBaseIE
# Video from video.kompas.com seems use jixie player
class KompasVideoIE(JixieBaseIE):
_VALID_URL = r'https?://video\.kompas\.com/\w+/(?P<id>\d+)/(?P<slug>[\w-]+)'
_TESTS = [{
'url': 'https://video.kompas.com/watch/164474/kim-jong-un-siap-kirim-nuklir-lawan-as-dan-korse... | @@ -11,28 +11,8 @@
# [2] https://scripts.jixie.media/jxvideo.3.1.min.js for more info
-class KompasVideoIE(InfoExtractor):
- _VALID_URL = r'https?://video\.kompas\.com/\w+/(?P<id>\d+)/(?P<slug>[\w-]+)'
- _TESTS = [{
- 'url': 'https://video.kompas.com/watch/164474/kim-jong-un-siap-kirim-nuklir-lawan-as... | yt_dlp/extractor/kompas.py | 15 | Python | 0.429 | refactor | 140 | 40 | 29 | false | [extractor/moview] Add extractor | 4,607 | yt-dlp/yt-dlp | 132,642 | Python | HobbyistDev | HobbyistDev |
'uploader_id': 'ProjectVeritasAction',
'uploader_url': 'https://truthsocial.com/@ProjectVeritasAction',
'repost_count': int,
'comment_count': int,
'like_count': int,
},
},
]
_GEO_COUNTRIES = ['US'] # The site is... | I think account variable not needed, you can write uploader with `traverse_obj` from utils | 'uploader_url': 'https://truthsocial.com/@ProjectVeritasAction',
'repost_count': int,
'comment_count': int,
'like_count': int,
},
},
]
def _real_extract(self, url):
video_id = self._match_id(url)
status = self._... | @@ -0,0 +1,94 @@
+from .common import InfoExtractor
+
+from ..utils import (
+ clean_html,
+ int_or_none,
+ unified_timestamp,
+ strip_or_none
+)
+
+
+class TruthIE(InfoExtractor):
+ """Extract videos from posts on Donald Trump's truthsocial.com."""
+
+ _VALID_URL = r'https://truthsocial\.com/@[^/]+/p... | yt_dlp/extractor/truth.py | 26 | Python | 0.357 | suggestion | 90 | 51 | 26 | false | [truth] added new extractor | 4,609 | yt-dlp/yt-dlp | 132,642 | Python | HobbyistDev | palewire |
def _real_extract(self, url):
# Get data from API
video_id = self._match_id(url)
status = self._download_json(
'https://truthsocial.com/api/v1/statuses/' + video_id,
video_id
)
# Pull out video
url = status['media_attachments'][0]['url']
... | I think it's better to keep title as is. We can add uploader at title in output_template
```suggestion
``` | from .common import InfoExtractor
from ..utils import (
clean_html,
format_field,
int_or_none,
strip_or_none,
traverse_obj,
unified_timestamp,
)
class TruthIE(InfoExtractor):
_VALID_URL = r'https?://truthsocial\.com/@[^/]+/posts/(?P<id>\d+)'
_TESTS = [
{
'url': 'htt... | @@ -0,0 +1,94 @@
+from .common import InfoExtractor
+
+from ..utils import (
+ clean_html,
+ int_or_none,
+ unified_timestamp,
+ strip_or_none
+)
+
+
+class TruthIE(InfoExtractor):
+ """Extract videos from posts on Donald Trump's truthsocial.com."""
+
+ _VALID_URL = r'https://truthsocial\.com/@[^/]+/p... | yt_dlp/extractor/truth.py | 26 | Python | 0.786 | suggestion | 108 | 41 | 70 | false | [truth] added new extractor | 4,609 | yt-dlp/yt-dlp | 132,642 | Python | HobbyistDev | palewire |
from .common import InfoExtractor
from ..utils import (
clean_html,
int_or_none,
unified_timestamp,
strip_or_none,
traverse_obj
)
class TruthIE(InfoExtractor):
"""Extract videos from posts on Donald Trump's truthsocial.com."""
_VALID_URL = r'https://truthsocial\.com/@[^/]+/posts/(?P<id>[... | sort imports. You can either use `isort` or just manually sort it | from .common import InfoExtractor
from ..utils import (
clean_html,
format_field,
int_or_none,
strip_or_none,
traverse_obj,
unified_timestamp,
)
class TruthIE(InfoExtractor):
_VALID_URL = r'https?://truthsocial\.com/@[^/]+/posts/(?P<id>\d+)'
_TESTS = [
{
'url': 'htt... | @@ -0,0 +1,91 @@
+from .common import InfoExtractor
+
+from ..utils import (
+ clean_html,
+ int_or_none,
+ unified_timestamp,
+ strip_or_none,
+ traverse_obj
+) | yt_dlp/extractor/truth.py | 9 | Python | 0.429 | suggestion | 65 | 34 | 34 | false | [truth] added new extractor | 4,609 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | palewire |
from .common import InfoExtractor
from ..utils import (
clean_html,
int_or_none,
unified_timestamp,
strip_or_none,
traverse_obj
)
class TruthIE(InfoExtractor):
"""Extract videos from posts on Donald Trump's truthsocial.com."""
_VALID_URL = r'https://truthsocial\.com/@[^/]+/posts/(?P<id>[... | ```suggestion
_VALID_URL = r'https?://truthsocial\.com/@[^/]+/posts/(?P<id>\d+)'
``` | from .common import InfoExtractor
from ..utils import (
clean_html,
format_field,
int_or_none,
strip_or_none,
traverse_obj,
unified_timestamp,
)
class TruthIE(InfoExtractor):
_VALID_URL = r'https?://truthsocial\.com/@[^/]+/posts/(?P<id>\d+)'
_TESTS = [
{
'url': 'htt... | @@ -0,0 +1,91 @@
+from .common import InfoExtractor
+
+from ..utils import (
+ clean_html,
+ int_or_none,
+ unified_timestamp,
+ strip_or_none,
+ traverse_obj
+)
+
+
+class TruthIE(InfoExtractor):
+ """Extract videos from posts on Donald Trump's truthsocial.com."""
+
+ _VALID_URL = r'https://truths... | yt_dlp/extractor/truth.py | 15 | Python | 0.571 | suggestion | 90 | 40 | 40 | false | [truth] added new extractor | 4,609 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | palewire |
from .common import InfoExtractor
from ..utils import (
clean_html,
int_or_none,
unified_timestamp,
strip_or_none,
traverse_obj
)
class TruthIE(InfoExtractor):
"""Extract videos from posts on Donald Trump's truthsocial.com."""
_VALID_URL = r'https://truthsocial\.com/@[^/]+/posts/(?P<id>[... | You sure the description is literally an empty string? Lack of description should be denoted by `None` | from .common import InfoExtractor
from ..utils import (
clean_html,
format_field,
int_or_none,
strip_or_none,
traverse_obj,
unified_timestamp,
)
class TruthIE(InfoExtractor):
_VALID_URL = r'https?://truthsocial\.com/@[^/]+/posts/(?P<id>\d+)'
_TESTS = [
{
'url': 'htt... | @@ -0,0 +1,91 @@
+from .common import InfoExtractor
+
+from ..utils import (
+ clean_html,
+ int_or_none,
+ unified_timestamp,
+ strip_or_none,
+ traverse_obj
+)
+
+
+class TruthIE(InfoExtractor):
+ """Extract videos from posts on Donald Trump's truthsocial.com."""
+
+ _VALID_URL = r'https://truths... | yt_dlp/extractor/truth.py | 24 | Python | 0.571 | suggestion | 102 | 49 | 49 | false | [truth] added new extractor | 4,609 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | palewire |
'uploader_url': 'https://truthsocial.com/@realDonaldTrump',
'repost_count': int,
'comment_count': int,
'like_count': int,
},
},
{
'url': 'https://truthsocial.com/@ProjectVeritasAction/posts/108618228543962049',
... | Only set this if XFR works for this site | 'comment_count': int,
'like_count': int,
},
},
{
'url': 'https://truthsocial.com/@ProjectVeritasAction/posts/108618228543962049',
'md5': 'fd47ba68933f9dce27accc52275be9c3',
'info_dict': {
'id': '1086182285439... | @@ -0,0 +1,91 @@
+from .common import InfoExtractor
+
+from ..utils import (
+ clean_html,
+ int_or_none,
+ unified_timestamp,
+ strip_or_none,
+ traverse_obj
+)
+
+
+class TruthIE(InfoExtractor):
+ """Extract videos from posts on Donald Trump's truthsocial.com."""
+
+ _VALID_URL = r'https://truths... | yt_dlp/extractor/truth.py | 26 | Python | 0.071 | suggestion | 40 | 51 | 42 | false | [truth] added new extractor | 4,609 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | palewire |
'md5': 'fd47ba68933f9dce27accc52275be9c3',
'info_dict': {
'id': '108618228543962049',
'ext': 'mp4',
'title': 'md5:d313e7659709bf212e3c719d12e2763e',
'description': 'md5:de2fc49045bf92bb8dc97e56503b150f',
'timestamp':... | read coding conventions
```suggestion
video_id = self._match_id(url)
status = self._download_json(
f'https://truthsocial.com/api/v1/statuses/{video_id}', video_id)
``` | 'id': '108618228543962049',
'ext': 'mp4',
'title': 'md5:debde7186cf83f60ff7b44dbb9444e35',
'description': 'md5:de2fc49045bf92bb8dc97e56503b150f',
'timestamp': 1657382637,
'upload_date': '20220709',
'uploader'... | @@ -0,0 +1,91 @@
+from .common import InfoExtractor
+
+from ..utils import (
+ clean_html,
+ int_or_none,
+ unified_timestamp,
+ strip_or_none,
+ traverse_obj
+)
+
+
+class TruthIE(InfoExtractor):
+ """Extract videos from posts on Donald Trump's truthsocial.com."""
+
+ _VALID_URL = r'https://truths... | yt_dlp/extractor/truth.py | 26 | Python | 0.857 | suggestion | 200 | 51 | 34 | false | [truth] added new extractor | 4,609 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | palewire |
'uploader_id': 'ProjectVeritasAction',
'uploader_url': 'https://truthsocial.com/@ProjectVeritasAction',
'repost_count': int,
'comment_count': int,
'like_count': int,
},
},
]
_GEO_COUNTRIES = ['US'] # The site is... | These comments are unnecessary | from .common import InfoExtractor
from ..utils import (
clean_html,
format_field,
int_or_none,
strip_or_none,
traverse_obj,
unified_timestamp,
)
class TruthIE(InfoExtractor):
_VALID_URL = r'https?://truthsocial\.com/@[^/]+/posts/(?P<id>\d+)'
_TESTS = [
{
'url': 'htt... | @@ -0,0 +1,91 @@
+from .common import InfoExtractor
+
+from ..utils import (
+ clean_html,
+ int_or_none,
+ unified_timestamp,
+ strip_or_none,
+ traverse_obj
+)
+
+
+class TruthIE(InfoExtractor):
+ """Extract videos from posts on Donald Trump's truthsocial.com."""
+
+ _VALID_URL = r'https://truths... | yt_dlp/extractor/truth.py | 26 | Python | 0.071 | suggestion | 30 | 47 | 70 | false | [truth] added new extractor | 4,609 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | palewire |
from .common import InfoExtractor
from ..utils import (
clean_html,
int_or_none,
unified_timestamp,
strip_or_none,
traverse_obj
)
class TruthIE(InfoExtractor):
"""Extract videos from posts on Donald Trump's truthsocial.com."""
_VALID_URL = r'https://truthsocial\.com/@[^/]+/posts/(?P<id>[... | ```suggestion
```
Set an IE_DESC if you want instead | from .common import InfoExtractor
from ..utils import (
clean_html,
format_field,
int_or_none,
strip_or_none,
traverse_obj,
unified_timestamp,
)
class TruthIE(InfoExtractor):
_VALID_URL = r'https?://truthsocial\.com/@[^/]+/posts/(?P<id>\d+)'
_TESTS = [
{
'url': 'htt... | @@ -0,0 +1,91 @@
+from .common import InfoExtractor
+
+from ..utils import (
+ clean_html,
+ int_or_none,
+ unified_timestamp,
+ strip_or_none,
+ traverse_obj
+)
+
+
+class TruthIE(InfoExtractor):
+ """Extract videos from posts on Donald Trump's truthsocial.com."""
+ | yt_dlp/extractor/truth.py | 14 | Python | 0.643 | suggestion | 54 | 39 | 39 | false | [truth] added new extractor | 4,609 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | palewire |
# Get data from API
video_id = self._match_id(url)
status = self._download_json(
'https://truthsocial.com/api/v1/statuses/' + video_id,
video_id
)
# Pull out video
url = status['media_attachments'][0]['url']
# Return the stuff
upl... | ```suggestion
return {
'id': video_id,
'url': url,
'title': '',
```
Let core code build title. neither description nor generic_title makes sense here. | from .common import InfoExtractor
from ..utils import (
clean_html,
format_field,
int_or_none,
strip_or_none,
traverse_obj,
unified_timestamp,
)
class TruthIE(InfoExtractor):
_VALID_URL = r'https?://truthsocial\.com/@[^/]+/posts/(?P<id>\d+)'
_TESTS = [
{
'url': 'htt... | @@ -0,0 +1,91 @@
+from .common import InfoExtractor
+
+from ..utils import (
+ clean_html,
+ int_or_none,
+ unified_timestamp,
+ strip_or_none,
+ traverse_obj
+)
+
+
+class TruthIE(InfoExtractor):
+ """Extract videos from posts on Donald Trump's truthsocial.com."""
+
+ _VALID_URL = r'https://truths... | yt_dlp/extractor/truth.py | 26 | Python | 0.786 | suggestion | 200 | 36 | 70 | false | [truth] added new extractor | 4,609 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | palewire |
)
# Pull out video
url = status['media_attachments'][0]['url']
# Return the stuff
uploader_id = strip_or_none(traverse_obj(status, ('account', 'username')))
post = strip_or_none(clean_html(status.get('content')))
# Set the title, handling case where its too lon... | ```suggestion
'uploader_url': format_field(uploader_id, None, 'https://truthsocial.com/@%s'),
``` | from .common import InfoExtractor
from ..utils import (
clean_html,
format_field,
int_or_none,
strip_or_none,
traverse_obj,
unified_timestamp,
)
class TruthIE(InfoExtractor):
_VALID_URL = r'https?://truthsocial\.com/@[^/]+/posts/(?P<id>\d+)'
_TESTS = [
{
'url': 'htt... | @@ -0,0 +1,91 @@
+from .common import InfoExtractor
+
+from ..utils import (
+ clean_html,
+ int_or_none,
+ unified_timestamp,
+ strip_or_none,
+ traverse_obj
+)
+
+
+class TruthIE(InfoExtractor):
+ """Extract videos from posts on Donald Trump's truthsocial.com."""
+
+ _VALID_URL = r'https://truths... | yt_dlp/extractor/truth.py | 26 | Python | 0.714 | suggestion | 111 | 31 | 70 | false | [truth] added new extractor | 4,609 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | palewire |
video_id = self._match_id(url)
status = self._download_json(
'https://truthsocial.com/api/v1/statuses/' + video_id,
video_id
)
# Pull out video
url = status['media_attachments'][0]['url']
# Return the stuff
uploader_id = strip_or_none(tra... | If it's only used once, it probably shouldn't be a var
```suggestion
uploader_id = strip_or_none(traverse_obj(status, ('account', 'username')))
return {
'id': video_id,
'url': status['media_attachments'][0]['url'],
'title': '',
'descriptio... | from .common import InfoExtractor
from ..utils import (
clean_html,
format_field,
int_or_none,
strip_or_none,
traverse_obj,
unified_timestamp,
)
class TruthIE(InfoExtractor):
_VALID_URL = r'https?://truthsocial\.com/@[^/]+/posts/(?P<id>\d+)'
_TESTS = [
{
'url': 'htt... | @@ -0,0 +1,91 @@
+from .common import InfoExtractor
+
+from ..utils import (
+ clean_html,
+ int_or_none,
+ unified_timestamp,
+ strip_or_none,
+ traverse_obj
+)
+
+
+class TruthIE(InfoExtractor):
+ """Extract videos from posts on Donald Trump's truthsocial.com."""
+
+ _VALID_URL = r'https://truths... | yt_dlp/extractor/truth.py | 26 | Python | 0.857 | suggestion | 378 | 35 | 70 | false | [truth] added new extractor | 4,609 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | palewire |
'title': 'Benny Johnson - This man should run for office',
'description': 'This man should run for office',
'timestamp': 1659657600,
'upload_date': '20220805',
'uploader': 'Benny Johnson',
'uploader_id': 'BennyJohnson',
... | Any reason why this can't be:
```suggestion
data = status['data'][0]['primary']
url = data['video_data']['videoSrc']
```
either way `url` will error when `primary` isn't a dict | },
},
{
'url': 'https://parler.com/feed/a7406eb4-91e5-4793-b5e3-ade57a24e287',
'md5': '11687e2f5bb353682cee338d181422ed',
'info_dict': {
'id': 'a7406eb4-91e5-4793-b5e3-ade57a24e287',
'ext': 'mp4',
'thumbnail'... | @@ -0,0 +1,89 @@
+from .common import InfoExtractor
+
+from ..utils import (
+ clean_html,
+ strip_or_none,
+ unified_timestamp,
+ urlencode_postdata,
+)
+
+
+class ParlerIE(InfoExtractor):
+ """Extract videos from posts on parler.com."""
+
+ _UUID_RE = r'[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4... | yt_dlp/extractor/parler.py | 26 | Python | 0.857 | suggestion | 197 | 51 | 51 | false | [parler] Add new extractor | 4,616 | yt-dlp/yt-dlp | 132,642 | Python | MinePlayersPE | palewire |
from .common import InfoExtractor
from ..utils import (
clean_html,
format_field,
unified_timestamp,
urlencode_postdata,
strip_or_none,
)
class ParlerIE(InfoExtractor):
"""Extract videos from posts on parler.com."""
_UUID_RE = r'[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12... | set this to `IE_DESC` to set extractor description | import json
from .common import InfoExtractor
from .youtube import YoutubeIE
from ..utils import (
clean_html,
format_field,
int_or_none,
strip_or_none,
traverse_obj,
unified_timestamp,
urlencode_postdata,
)
class ParlerIE(InfoExtractor):
IE_DESC = 'Posts on parler.com'
_VALID_UR... | @@ -0,0 +1,69 @@
+from .common import InfoExtractor
+
+from ..utils import (
+ clean_html,
+ format_field,
+ unified_timestamp,
+ urlencode_postdata,
+ strip_or_none,
+)
+
+
+class ParlerIE(InfoExtractor):
+ """Extract videos from posts on parler.com.""" | yt_dlp/extractor/parler.py | 13 | Python | 0.429 | refactor | 50 | 38 | 38 | false | [parler] Add new extractor | 4,616 | yt-dlp/yt-dlp | 132,642 | Python | HobbyistDev | palewire |
{
'url': 'https://parler.com/feed/a7406eb4-91e5-4793-b5e3-ade57a24e287',
'md5': '11687e2f5bb353682cee338d181422ed',
'info_dict': {
'id': 'a7406eb4-91e5-4793-b5e3-ade57a24e287',
'ext': 'mp4',
'title': 'Parler video #a7406eb4-91e5... | I think these lines written like this:
```suggestion
data = self._download_json(
'https://parler.com/open-api/ParleyDetailEndpoint.php', video_id,
data=urlencode_postdata({'uuid': video_id}))['data'][0]['primary']
url = data['video_data']['videoSrc']
``` | 'uploader_id': 'TulsiGabbard',
'uploader_url': 'https://parler.com/TulsiGabbard',
'view_count': int,
'comment_count': int,
'repost_count': int,
},
},
{
'url': 'https://parler.com/feed/a7406eb4-91e5-47... | @@ -0,0 +1,69 @@
+from .common import InfoExtractor
+
+from ..utils import (
+ clean_html,
+ format_field,
+ unified_timestamp,
+ urlencode_postdata,
+ strip_or_none,
+)
+
+
+class ParlerIE(InfoExtractor):
+ """Extract videos from posts on parler.com."""
+
+ _UUID_RE = r'[0-9a-f]{8}-[0-9a-f]{4}-[0-... | yt_dlp/extractor/parler.py | 26 | Python | 0.786 | suggestion | 300 | 38 | 51 | false | [parler] Add new extractor | 4,616 | yt-dlp/yt-dlp | 132,642 | Python | HobbyistDev | palewire |
from .common import InfoExtractor
from ..utils import (
clean_html,
format_field,
int_or_none,
strip_or_none,
unified_timestamp,
urlencode_postdata,
)
class ParlerIE(InfoExtractor):
IE_DESC = "Extract videos from posts on parler.com"
_UUID_RE = r'[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0... | ```suggestion
IE_DESC = 'Posts on parler.com'
``` | import json
from .common import InfoExtractor
from .youtube import YoutubeIE
from ..utils import (
clean_html,
format_field,
int_or_none,
strip_or_none,
traverse_obj,
unified_timestamp,
urlencode_postdata,
)
class ParlerIE(InfoExtractor):
IE_DESC = 'Posts on parler.com'
_VALID_UR... | @@ -0,0 +1,78 @@
+from .common import InfoExtractor
+
+from ..utils import (
+ clean_html,
+ format_field,
+ int_or_none,
+ strip_or_none,
+ unified_timestamp,
+ urlencode_postdata,
+)
+
+
+class ParlerIE(InfoExtractor):
+ IE_DESC = "Extract videos from posts on parler.com" | yt_dlp/extractor/parler.py | 14 | Python | 0.571 | suggestion | 55 | 39 | 39 | false | [parler] Add new extractor | 4,616 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | palewire |
from .common import InfoExtractor
from ..utils import (
clean_html,
format_field,
int_or_none,
strip_or_none,
unified_timestamp,
urlencode_postdata,
)
class ParlerIE(InfoExtractor):
IE_DESC = "Extract videos from posts on parler.com"
_UUID_RE = r'[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0... | ```suggestion
_VALID_URL = r'https://parler\.com/feed/(?P<id>[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12})'
``` | import json
from .common import InfoExtractor
from .youtube import YoutubeIE
from ..utils import (
clean_html,
format_field,
int_or_none,
strip_or_none,
traverse_obj,
unified_timestamp,
urlencode_postdata,
)
class ParlerIE(InfoExtractor):
IE_DESC = 'Posts on parler.com'
_VALID_UR... | @@ -0,0 +1,78 @@
+from .common import InfoExtractor
+
+from ..utils import (
+ clean_html,
+ format_field,
+ int_or_none,
+ strip_or_none,
+ unified_timestamp,
+ urlencode_postdata,
+)
+
+
+class ParlerIE(InfoExtractor):
+ IE_DESC = "Extract videos from posts on parler.com"
+ _UUID_RE = r'[0-9a-... | yt_dlp/extractor/parler.py | 16 | Python | 0.714 | suggestion | 116 | 41 | 41 | false | [parler] Add new extractor | 4,616 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | palewire |
'uploader_url': 'https://parler.com/BennyJohnson',
'view_count': int,
'comment_count': int,
'repost_count': int,
},
},
]
def _real_extract(self, url):
video_id = self._match_id(url)
data = self._download_json(
... | it makes sense to put `data['primary']` in a var | 'upload_date': '20220805',
'uploader': 'Benny Johnson',
'uploader_id': 'BennyJohnson',
'uploader_url': 'https://parler.com/BennyJohnson',
'view_count': int,
'comment_count': int,
'repost_count': int,
... | @@ -0,0 +1,78 @@
+from .common import InfoExtractor
+
+from ..utils import (
+ clean_html,
+ format_field,
+ int_or_none,
+ strip_or_none,
+ unified_timestamp,
+ urlencode_postdata,
+)
+
+
+class ParlerIE(InfoExtractor):
+ IE_DESC = "Extract videos from posts on parler.com"
+ _UUID_RE = r'[0-9a-... | yt_dlp/extractor/parler.py | 26 | Python | 0.214 | suggestion | 48 | 30 | 51 | false | [parler] Add new extractor | 4,616 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | palewire |
'title': 'Parler video #a7406eb4-91e5-4793-b5e3-ade57a24e287',
'description': 'This man should run for office',
'timestamp': 1659657600,
'upload_date': '20220805',
'uploader': 'Benny Johnson',
'uploader_id': 'BennyJohnson',
... | ```suggestion
'title': '',
```
Only use `'` | 'id': 'a7406eb4-91e5-4793-b5e3-ade57a24e287',
'ext': 'mp4',
'thumbnail': 'https://bl-images.parler.com/videos/317827a8-1e48-4cbc-981f-7dd17d4c1183/thumbnail.jpeg',
'title': 'Parler video #a7406eb4-91e5-4793-b5e3-ade57a24e287',
'description'... | @@ -0,0 +1,78 @@
+from .common import InfoExtractor
+
+from ..utils import (
+ clean_html,
+ format_field,
+ int_or_none,
+ strip_or_none,
+ unified_timestamp,
+ urlencode_postdata,
+)
+
+
+class ParlerIE(InfoExtractor):
+ IE_DESC = "Extract videos from posts on parler.com"
+ _UUID_RE = r'[0-9a-... | yt_dlp/extractor/parler.py | 26 | Python | 0.643 | suggestion | 58 | 36 | 51 | false | [parler] Add new extractor | 4,616 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | palewire |
'tags': list,
'availability': 'public',
'live_status': 'not_live',
'view_count': int,
'comment_count': int,
'like_count': int,
'channel_follower_count': int,
'age_limit': 0,
'p... | ```suggestion
video_id = self._match_id(url)
data = self._download_json(
'https://parler.com/open-api/ParleyDetailEndpoint.php', video_id,
data=urlencode_postdata({'uuid': video_id}))['data'][0]
primary = data['primary']
embed = self._parse_json(primary.ge... | 'tags': list,
'availability': 'public',
'live_status': 'not_live',
'view_count': int,
'comment_count': int,
'like_count': int,
'channel_follower_count': int,
'age_limit': 0,
'p... | @@ -0,0 +1,116 @@
+import json
+
+from .common import InfoExtractor
+from .youtube import YoutubeIE
+
+from ..utils import (
+ clean_html,
+ format_field,
+ int_or_none,
+ strip_or_none,
+ traverse_obj,
+ unified_timestamp,
+ urlencode_postdata,
+)
+
+
+class ParlerIE(InfoExtractor):
+ IE_DESC =... | yt_dlp/extractor/parler.py | 26 | Python | 0.786 | suggestion | 448 | 41 | 39 | false | [parler] Add new extractor | 4,616 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | palewire |
]
def _real_extract(self, url):
# Get the crucial data from the API
video_id = self._match_id(url)
data = self._download_json(
'https://parler.com/open-api/ParleyDetailEndpoint.php', video_id,
data=urlencode_postdata({'uuid': video_id}))['data'][0]
primar... | ```suggestion
'view_count': int_or_none(primary.get('view_count')),
``` | ]
def _real_extract(self, url):
video_id = self._match_id(url)
data = self._download_json(
'https://parler.com/open-api/ParleyDetailEndpoint.php', video_id,
data=urlencode_postdata({'uuid': video_id}))['data'][0]
primary = data['primary']
embed = self._p... | @@ -0,0 +1,116 @@
+import json
+
+from .common import InfoExtractor
+from .youtube import YoutubeIE
+
+from ..utils import (
+ clean_html,
+ format_field,
+ int_or_none,
+ strip_or_none,
+ traverse_obj,
+ unified_timestamp,
+ urlencode_postdata,
+)
+
+
+class ParlerIE(InfoExtractor):
+ IE_DESC =... | yt_dlp/extractor/parler.py | 26 | Python | 0.571 | suggestion | 85 | 30 | 28 | false | [parler] Add new extractor | 4,616 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | palewire |
def _perform_login(self, username, password):
self.report_login()
form_data = {
'username': username,
'password': password,
}
payload = urlencode_postdata(form_data)
request = sanitized_Request(self._LOGIN_URL, payload)
request.add_header('Con... | ```suggestion
if resource['type'] in ('dash', ):
``` |
def _perform_login(self, username, password):
self.report_login()
form_data = {
'username': username,
'password': password,
}
payload = urlencode_postdata(form_data)
request = sanitized_Request(self._LOGIN_URL, payload)
request.add_header('Con... | @@ -70,16 +70,17 @@ def _perform_login(self, username, password):
def _real_extract(self, url):
video_id = self._match_id(url)
video_data = self._download_json(
- 'http://tubitv.com/oz/videos/%s/content' % video_id, video_id)
+ 'https://tubitv.com/oz/videos/%s/content?video_... | yt_dlp/extractor/tubitv.py | 26 | Python | 0.714 | suggestion | 66 | 51 | 51 | false | [tubitv] Extract additional formats | 4,646 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | shirt-dev |
class FacebookReelIE(InfoExtractor):
_VALID_URL = r'https?://(?:[\w-]+\.)?facebook\.com/reel/(?P<id>\d+)'
IE_NAME = 'facebook:reel'
_TESTS = [{
'url': 'https://www.facebook.com/reel/1195289147628387',
'md5': 'c4ff9a7182ff9ff7d6f7a83603bae831',
'info_dict': {
'id': '1195... | ```suggestion
return self.url_result(
f'https://m.facebook.com/watch/?v={video_id}&_rdr', FaceBookIE, video_id)
``` |
class FacebookReelIE(InfoExtractor):
_VALID_URL = r'https?://(?:[\w-]+\.)?facebook\.com/reel/(?P<id>\d+)'
IE_NAME = 'facebook:reel'
_TESTS = [{
'url': 'https://www.facebook.com/reel/1195289147628387',
'md5': 'c4ff9a7182ff9ff7d6f7a83603bae831',
'info_dict': {
'id': '1195... | @@ -772,3 +772,30 @@ def _real_extract(self, url):
if not redirect_url:
raise ExtractorError('Invalid facebook redirect URL', expected=True)
return self.url_result(redirect_url)
+
+
+class FacebookReelIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:[\w-]+\.)?facebook\.com/reel/(?P<id>\... | yt_dlp/extractor/facebook.py | 26 | Python | 0.714 | suggestion | 138 | 27 | 27 | false | [facebook] add reel support | 4,660 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | bashonly |
.replace('<', '<')
.replace('>', '>')
.replace('"', '"')
.replace("'", ''')
)
def process_communicate_or_kill(p, *args, **kwargs):
write_string('DeprecationWarning: yt_dlp.utils.process_communicate_or_kill is deprecated '
'and may be removed in a... | `sys.platform != 'win32'` will be true for cygwin. I'm not sure if that's the intended behaviour | .replace('<', '<')
.replace('>', '>')
.replace('"', '"')
.replace("'", ''')
)
def process_communicate_or_kill(p, *args, **kwargs):
deprecation_warning(f'"{__name__}.process_communicate_or_kill" is deprecated and may be removed '
f'in a fut... | @@ -840,11 +840,17 @@ class Popen(subprocess.Popen):
else:
_startupinfo = None
- def __init__(self, *args, text=False, **kwargs):
+ def __init__(self, *args, env=None, text=False, **kwargs):
if text is True:
kwargs['universal_newlines'] = True # For 3.6 compatibility
... | yt_dlp/utils.py | 26 | Python | 0.357 | suggestion | 96 | 51 | 51 | false | Unset LD_LIBRARY_PATH for child processes on non-Windows systems | 4,666 | yt-dlp/yt-dlp | 132,642 | Python | gamer191 | Lesmiscore |
.replace('<', '<')
.replace('>', '>')
.replace('"', '"')
.replace("'", ''')
)
def process_communicate_or_kill(p, *args, **kwargs):
write_string('DeprecationWarning: yt_dlp.utils.process_communicate_or_kill is deprecated '
'and may be removed in a... | Isn't this better to do at initialization? similar to `windows_enable_vt_mode`
Also, since we only want this to happen for pyinstaller exes, better to check `compat_os_name != 'nt' && hasattr(sys, '_MEIPASS')` | .replace('<', '<')
.replace('>', '>')
.replace('"', '"')
.replace("'", ''')
)
def process_communicate_or_kill(p, *args, **kwargs):
deprecation_warning(f'"{__name__}.process_communicate_or_kill" is deprecated and may be removed '
f'in a fut... | @@ -840,11 +840,17 @@ class Popen(subprocess.Popen):
else:
_startupinfo = None
- def __init__(self, *args, text=False, **kwargs):
+ def __init__(self, *args, env=None, text=False, **kwargs):
if text is True:
kwargs['universal_newlines'] = True # For 3.6 compatibility
... | yt_dlp/utils.py | 26 | Python | 0.643 | question | 212 | 51 | 51 | false | Unset LD_LIBRARY_PATH for child processes on non-Windows systems | 4,666 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Lesmiscore |
bearer_token = self._get_bearer_token(asset_id, **kwargs)
api_response = self._download_json(
f'{self._API_URL}/entitlement/{asset_id}/play',
asset_id, headers={
'Authorization': f'Bearer {bearer_token}',
'Accept': 'application/json, text/plain, */... | _extract_m3u8_formats_and_subtitles etc has it's own drm detection. Don't override it
```suggestion
if format.get('drm'):
for f in fmts:
f['has_drm'] = True
``` | bearer_token = self._get_bearer_token(asset_id, **kwargs)
api_response = self._download_json(
f'{self._API_URL}/entitlement/{asset_id}/play',
asset_id, headers={
'Authorization': f'Bearer {bearer_token}',
'Accept': 'application/json, text/plain, */... | @@ -69,6 +69,9 @@ def _get_formats_and_subtitles(self, asset_id, **kwargs):
fmts, subs = self._extract_m3u8_formats_and_subtitles(
format['mediaLocator'], asset_id, fatal=False)
+ for index in range(len(fmts)):
+ fmts[index]['has_drm'] = format.get('drm'... | yt_dlp/extractor/redbee.py | 26 | Python | 0.857 | refactor | 215 | 51 | 51 | false | [extractor/rtbf] Update stream extractor | 4,671 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | elyse0 |
session_jwt = self._download_json(
'https://login.rtbf.be/accounts.getJWT', media_id, query={
'login_token': login_token.value,
'APIKey': self._GIGYA_API_KEY,
'sdk': 'js_latest',
'authMode': 'cookie',
'pageURL': url,
... | ```suggestion
if re.search(r'<div[^>]+id="[^"]*\bjs-error-expired\b', embed_page):
raise ExtractorError('Livestream has ended', expected=True)
if re.search(r'<div[^>]+id="[^"]*\bs-sso-connect\b', embed_page):
self.raise_login_required()
```
is this insuffici... | self.raise_login_required()
session_jwt = self._download_json(
'https://login.rtbf.be/accounts.getJWT', media_id, query={
'login_token': login_token.value,
'APIKey': self._GIGYA_API_KEY,
'sdk': 'js_latest',
'authMode': 'coo... | @@ -269,8 +272,17 @@ def _real_extract(self, url):
embed_page = self._download_webpage(
'https://www.rtbf.be/auvio/embed/' + ('direct' if live else 'media'),
media_id, query={'id': media_id})
- data = self._parse_json(self._html_search_regex(
- r'data-media="([^"]+)"... | yt_dlp/extractor/redbee.py | 26 | Python | 1 | refactor | 324 | 51 | 51 | false | [extractor/rtbf] Update stream extractor | 4,671 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | elyse0 |
'https://www.rtbf.be/auvio/embed/' + ('direct' if live else 'media'),
media_id, query={'id': media_id})
media_data = self._html_search_regex(r'data-media="([^"]+)"', embed_page, 'media data', fatal=False)
if not media_data:
if re.findall(r'<div[^>]+id="[^"]*js-error-... | ```suggestion
title = traverse_obj(data, 'subtitle', 'title')
``` | embed_page = self._download_webpage(
'https://www.rtbf.be/auvio/embed/' + ('direct' if live else 'media'),
media_id, query={'id': media_id})
media_data = self._html_search_regex(r'data-media="([^"]+)"', embed_page, 'media data', fatal=False)
if not media_data:
... | @@ -280,69 +292,79 @@ def _real_extract(self, url):
if provider in self._PROVIDERS:
return self.url_result(data['url'], self._PROVIDERS[provider])
- title = data['subtitle']
+ # In general, we prefer the 'subtitle' because it's a lot more specific than the 'title',
+ # but w... | yt_dlp/extractor/redbee.py | 26 | Python | 0.571 | suggestion | 75 | 51 | 51 | false | [extractor/rtbf] Update stream extractor | 4,671 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | elyse0 |
if re.findall(r'<div[^>]+id="[^"]*js-error-expired[^"]*"[^>]+class="(?![^"]*hidden)', embed_page):
raise ExtractorError('Livestream has ended.', expected=True)
if re.findall(r'<div[^>]+id="[^"]*js-sso-connect[^"]*"[^>]+class="(?![^"]*hidden)', embed_page):
self.ra... | Do
```py
m3u8_url = None if data.get('isLive') else traverse_obj(data, 'urlHlsAes128', 'urlHls')
```
This allows you to de-indent this whole large block to it's previous state | if not media_data:
if re.search(r'<div[^>]+id="js-error-expired"[^>]+class="(?![^"]*hidden)', embed_page):
raise ExtractorError('Livestream has ended.', expected=True)
if re.search(r'<div[^>]+id="js-sso-connect"[^>]+class="(?![^"]*hidden)', embed_page):
se... | @@ -280,69 +292,79 @@ def _real_extract(self, url):
if provider in self._PROVIDERS:
return self.url_result(data['url'], self._PROVIDERS[provider])
- title = data['subtitle']
+ # In general, we prefer the 'subtitle' because it's a lot more specific than the 'title',
+ # but w... | yt_dlp/extractor/redbee.py | 26 | Python | 0.714 | style | 181 | 51 | 51 | false | [extractor/rtbf] Update stream extractor | 4,671 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | elyse0 |
return res
mobj = re.search(r'<a[^>]+href=([\'"])(?P<link>[^\'"]+)\1',
get_element_by_attribute('class', 'instagram-media', webpage) or '')
if mobj:
return [mobj.group('link')]
def _real_extract(self, url):
video_id, url = self._match_valid_... | isn't this enough?
```suggestion
if self._get_cookies(url).get('sessionid'):
``` |
@classmethod
def _extract_embed_urls(cls, url, webpage):
res = tuple(super()._extract_embed_urls(url, webpage))
if res:
return res
mobj = re.search(r'<a[^>]+href=([\'"])(?P<link>[^\'"]+)\1',
get_element_by_attribute('class', 'instagram-media', webpa... | @@ -360,49 +360,83 @@ def _extract_embed_urls(cls, url, webpage):
def _real_extract(self, url):
video_id, url = self._match_valid_url(url).group('id', 'url')
- general_info = self._download_json(
- f'https://www.instagram.com/graphql/query/?query_hash=9f8827793ef34641b2fb195d4d41151c'
... | yt_dlp/extractor/instagram.py | 26 | Python | 0.571 | question | 95 | 51 | 51 | false | [extractor/instagram] Fix graphql, API, webpage extraction | 4,696 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | bashonly |
entries, current_season = [], None
for ep_id, ep, season in paths:
if season:
current_season = season
continue
entries.append(self.url_result(
f'http://www.crunchyroll.com{ep}', CrunchyrollIE.ie_key(), ep_id, season=current_season)... | ```suggestion
if self._get_cookies(f'https://beta.crunchyroll.com/{lang}').get('etp_rt'):
grant_type, key = 'etp_rt_cookie', 'accountAuthClientId'
else:
grant_type, key = 'client_id', 'anonClientId'
```
should make it much simpler (see comment below) |
entries, current_season = [], None
for ep_id, ep, season in paths:
if season:
current_season = season
continue
entries.append(self.url_result(
f'http://www.crunchyroll.com{ep}', CrunchyrollIE.ie_key(), ep_id, season=current_season)... | @@ -720,15 +720,27 @@ class CrunchyrollBetaBaseIE(CrunchyrollBaseIE):
def _get_params(self, lang):
if not CrunchyrollBetaBaseIE.params:
+ if self._get_cookies(f'https://beta.crunchyroll.com/{lang}').get('etp_rt'):
+ auth = 'cookie'
+ else:
+ auth = 'cl... | yt_dlp/extractor/crunchyroll.py | 26 | Python | 1 | security | 313 | 51 | 51 | false | [crunchyroll:beta] Use anonymous access instead of redirecting | 4,704 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | tejing1 |
'id': show_id,
'title': title,
'entries': reversed(entries),
}
class CrunchyrollBetaBaseIE(CrunchyrollBaseIE):
params = None
def _get_params(self, lang):
if not CrunchyrollBetaBaseIE.params:
if self._get_cookies(f'https://beta.crunchyroll.com/{l... | ```suggestion
client_id = app_config['cxApiParams'][key]
``` | 'id': show_id,
'title': title,
'entries': reversed(entries),
}
class CrunchyrollBetaBaseIE(CrunchyrollBaseIE):
params = None
def _get_params(self, lang):
if not CrunchyrollBetaBaseIE.params:
if self._get_cookies(f'https://beta.crunchyroll.com/{l... | @@ -720,15 +720,27 @@ class CrunchyrollBetaBaseIE(CrunchyrollBaseIE):
def _get_params(self, lang):
if not CrunchyrollBetaBaseIE.params:
+ if self._get_cookies(f'https://beta.crunchyroll.com/{lang}').get('etp_rt'):
+ auth = 'cookie'
+ else:
+ auth = 'cl... | yt_dlp/extractor/crunchyroll.py | 26 | Python | 0.571 | suggestion | 74 | 51 | 51 | false | [crunchyroll:beta] Use anonymous access instead of redirecting | 4,704 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | tejing1 |
else:
csrf_token_value = csrf_token.value
info = traverse_obj(self._download_json(
f'{self._API_BASE_URL}/media/{_id_to_pk(video_id)}/info/', video_id,
fatal=False, errnote=False, note='Downloading video info', headers={
**self._API_HEADERS,
... | why remove this? this is how we determine if the user is logged-in or not
i thought there was agreement that there should be two different extraction flows... one for logged-in users and one for logged-out users | 'only_matching': True,
}]
@classmethod
def _extract_embed_urls(cls, url, webpage):
res = tuple(super()._extract_embed_urls(url, webpage))
if res:
return res
mobj = re.search(r'<a[^>]+href=([\'"])(?P<link>[^\'"]+)\1',
get_element_by_attri... | @@ -403,17 +420,6 @@ def _real_extract(self, url):
self.report_warning('General metadata extraction failed (some metadata might be missing).', video_id)
media.update(traverse_obj(general_info, ('data', 'shortcode_media')) or {})
- if self._get_cookies(url).get('sessionid'): | yt_dlp/extractor/instagram.py | 26 | Python | 0.5 | refactor | 214 | 51 | 51 | false | [extractor/instagram] Fix missing metadata in post extractor | 4,708 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | pritam20ps05 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.