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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
# DRM premier-exclusive livestream
'url': 'https://www.vidio.com/live/6299-bein-1',
'only_matching': True,
}]
def _real_extract(self, url):
video_id, display_id = re.match(self._VALID_URL, url).groups()
stream_data = self._call_api(
'https://www.vidio.com/api... | If the only purpose of this code is to extract DRM formats, it shouldn't be here | }, {
# DRM premier-exclusive livestream
'url': 'https://www.vidio.com/live/6299-bein-1',
'only_matching': True,
}]
def _real_extract(self, url):
video_id, display_id = re.match(self._VALID_URL, url).groups()
stream_data = self._call_api(
'https://www.vidi... | @@ -150,3 +158,134 @@ def _real_extract(self, url):
'comment_count': get_count('comments'),
'tags': video.get('tag_list'),
}
+
+
+class VidioPremierIE(VidioBaseIE):
+ _VALID_URL = r'https?://(?:www\.)?vidio\.com/premier/(?P<id>\d+)/(?P<display_id>[^/?#&]+)'
+ _TESTS = [{
+ ... | yt_dlp/extractor/vidio.py | 26 | Python | 0.357 | refactor | 80 | 51 | 51 | false | [vidio] Add VidioPremierIE and VidioLiveIE | 371 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | MinePlayersPE |
# DRM premier-exclusive livestream
'url': 'https://www.vidio.com/live/6299-bein-1',
'only_matching': True,
}]
def _real_extract(self, url):
video_id, display_id = re.match(self._VALID_URL, url).groups()
stream_data = self._call_api(
'https://www.vidio.com/api... | ```suggestion
drm_hls_url, display_id, 'mp4', 'm3u8_native'))
``` | }, {
# DRM premier-exclusive livestream
'url': 'https://www.vidio.com/live/6299-bein-1',
'only_matching': True,
}]
def _real_extract(self, url):
video_id, display_id = re.match(self._VALID_URL, url).groups()
stream_data = self._call_api(
'https://www.vidi... | @@ -150,3 +158,134 @@ def _real_extract(self, url):
'comment_count': get_count('comments'),
'tags': video.get('tag_list'),
}
+
+
+class VidioPremierIE(VidioBaseIE):
+ _VALID_URL = r'https?://(?:www\.)?vidio\.com/premier/(?P<id>\d+)/(?P<display_id>[^/?#&]+)'
+ _TESTS = [{
+ ... | yt_dlp/extractor/vidio.py | 26 | Python | 0.857 | suggestion | 87 | 51 | 51 | false | [vidio] Add VidioPremierIE and VidioLiveIE | 371 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | MinePlayersPE |
if drm_hls_url:
formats.extend(self._extract_m3u8_formats(
drm_hls_url, display_id, 'mp4', 'm3u8-native'))
elif stream_meta.get('is_premium'):
sources = self._download_json(
'https://www.vidio.com/interactions_stream.json?video_id=%s&ty... | ```suggestion
if sources.get('source'):
token_json = self._download_json(
'https://www.vidio.com/live/%s/tokens' % video_id,
display_id, note='Downloading HLS token JSON', data=b'')
formats.extend(self._extract_m3u8_formats(
... | 'https://www.vidio.com/interactions_stream.json?video_id=%s&type=livestreamings' % video_id,
display_id, note='Downloading premier API JSON')
if not (sources.get('source') or sources.get('source_dash')):
self.raise_login_required('This video is only available ... | @@ -150,3 +158,134 @@ def _real_extract(self, url):
'comment_count': get_count('comments'),
'tags': video.get('tag_list'),
}
+
+
+class VidioPremierIE(VidioBaseIE):
+ _VALID_URL = r'https?://(?:www\.)?vidio\.com/premier/(?P<id>\d+)/(?P<display_id>[^/?#&]+)'
+ _TESTS = [{
+ ... | yt_dlp/extractor/vidio.py | 26 | Python | 1 | refactor | 1,332 | 48 | 44 | false | [vidio] Add VidioPremierIE and VidioLiveIE | 371 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | MinePlayersPE |
if stream_meta.get('is_drm'):
# skip non-drm formats if drm is detected
if not self.get_param('allow_unplayable_formats'):
self.raise_no_formats(
'This video is DRM protected.', expected=True)
if stream_meta.get('drm_stream_hls_url'):
... | explain "prioritize token urls"
Do you mean that `stream_token_url` and `stream_url` could exist at the same time? If so, both should be extracted. | formats = []
if stream_meta.get('is_drm'):
if not self.get_param('allow_unplayable_formats'):
self.raise_no_formats(
'This video is DRM protected.', expected=True)
if stream_meta.get('is_premium'):
sources = self._download_json(
... | @@ -150,3 +158,135 @@ def _real_extract(self, url):
'comment_count': get_count('comments'),
'tags': video.get('tag_list'),
}
+
+
+class VidioPremierIE(VidioBaseIE):
+ _VALID_URL = r'https?://(?:www\.)?vidio\.com/premier/(?P<id>\d+)/(?P<display_id>[^/?#&]+)'
+ _TESTS = [{
+ ... | yt_dlp/extractor/vidio.py | 26 | Python | 0.714 | refactor | 151 | 51 | 51 | false | [vidio] Add VidioPremierIE and VidioLiveIE | 371 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | MinePlayersPE |
'This video is DRM protected.', expected=True)
if stream_meta.get('is_premium'):
sources = self._download_json(
'https://www.vidio.com/interactions_stream.json?video_id=%s&type=livestreamings' % video_id,
display_id, note='Downloading premier API J... | ```suggestion
if stream_meta.get('stream_token_url'):
token_json = self._download_json(
'https://www.vidio.com/live/%s/tokens' % video_id,
display_id, note='Downloading HLS token JSON', data=b'')
formats.extend(self._extract_m3u8_f... | 'This video is DRM protected.', expected=True)
if stream_meta.get('is_premium'):
sources = self._download_json(
'https://www.vidio.com/interactions_stream.json?video_id=%s&type=livestreamings' % video_id,
display_id, note='Downloading premier API J... | @@ -150,3 +159,129 @@ def _real_extract(self, url):
'comment_count': get_count('comments'),
'tags': video.get('tag_list'),
}
+
+
+class VidioPremierIE(VidioBaseIE):
+ _VALID_URL = r'https?://(?:www\.)?vidio\.com/premier/(?P<id>\d+)/(?P<display_id>[^/?#&]+)'
+ _TESTS = [{
+ ... | yt_dlp/extractor/vidio.py | 26 | Python | 1 | refactor | 552 | 47 | 47 | false | [vidio] Add VidioPremierIE and VidioLiveIE | 371 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | MinePlayersPE |
)
if item is None:
return None
renderer = (
# text
try_get(item, lambda x: x['liveChatTextMessageRenderer'], dict)
or try_get(item, lambda x: x['liveChatPaidMessageRenderer'], dict)
or try_get(item, lambd... | Is it necessary to make 2 protocols? Can't you find this information from the `is_live` key? | live_offset = timestamp - start_time
# compatibility with replay format
pseudo_action = {
'replayChatItemAction': {'actions': [action]},
'videoOffsetTimeMsec': str(live_offset),
'isLive': True,
... | @@ -31,13 +32,116 @@ def real_download(self, filename, info_dict):
ie = YT_BaseIE(self.ydl)
+ start_time = int(time.time() * 1000)
+
def dl_fragment(url, data=None, headers=None):
http_headers = info_dict.get('http_headers', {})
if headers:
http_he... | yt_dlp/downloader/youtube_live_chat.py | 26 | Python | 0.357 | question | 92 | 51 | 51 | false | [youtube] Real time live chat | 422 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | siikamiika |
or try_get(item, lambda x: x['liveChatTickerSponsorItemRenderer'], dict)
# banner
or try_get(item, lambda x: x['liveChatBannerRenderer'], dict)
)
if renderer is None:
return None
parent_item = (
try_get(
... | We no longer support py2. So this workaround is not needed | lambda x: x['continuations'][0]['timedContinuationData'],
]
continuation_data = try_get(live_chat_continuation, continuation_data_getters, dict)
if continuation_data:
continuation_id = continuation_data.get('continuation')
timeout_ms = ... | @@ -31,13 +32,116 @@ def real_download(self, filename, info_dict):
ie = YT_BaseIE(self.ydl)
+ start_time = int(time.time() * 1000)
+
def dl_fragment(url, data=None, headers=None):
http_headers = info_dict.get('http_headers', {})
if headers:
http_he... | yt_dlp/downloader/youtube_live_chat.py | 26 | Python | 0.143 | suggestion | 58 | 51 | 51 | false | [youtube] Real time live chat | 422 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | siikamiika |
item = (
try_get(action_content, lambda x: x['item'], dict)
or try_get(action_content, lambda x: x['bannerRenderer'], dict)
)
if item is None:
return None
renderer = (
# text
try_get(item, lam... | `try_get` accepts multiple getters | for action in live_chat_continuation.get('actions', []):
timestamp = self.parse_live_timestamp(action)
if timestamp is not None:
live_offset = timestamp - start_time
# compatibility with replay format
pseudo_action = {
... | @@ -31,13 +32,116 @@ def real_download(self, filename, info_dict):
ie = YT_BaseIE(self.ydl)
+ start_time = int(time.time() * 1000)
+
def dl_fragment(url, data=None, headers=None):
http_headers = info_dict.get('http_headers', {})
if headers:
http_he... | yt_dlp/downloader/youtube_live_chat.py | 26 | Python | 0.5 | suggestion | 34 | 51 | 51 | false | [youtube] Real time live chat | 422 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | siikamiika |
or try_get(item, lambda x: x['liveChatPaidStickerRenderer'], dict)
# ticker
or try_get(item, lambda x: x['liveChatTickerPaidMessageItemRenderer'], dict)
or try_get(item, lambda x: x['liveChatTickerSponsorItemRenderer'], dict)
# banner
... | ```suggestion
timestamp_usec = int_or_none(try_get(renderer, lambda x: x['timestampUsec'], str), 1000)
``` | json.dumps(pseudo_action, ensure_ascii=False).encode('utf-8') + b'\n')
continuation_data_getters = [
lambda x: x['continuations'][0]['invalidationContinuationData'],
lambda x: x['continuations'][0]['timedContinuationData'],
]
contin... | @@ -31,13 +32,116 @@ def real_download(self, filename, info_dict):
ie = YT_BaseIE(self.ydl)
+ start_time = int(time.time() * 1000)
+
def dl_fragment(url, data=None, headers=None):
http_headers = info_dict.get('http_headers', {})
if headers:
http_he... | yt_dlp/downloader/youtube_live_chat.py | 26 | Python | 1 | suggestion | 124 | 51 | 51 | false | [youtube] Real time live chat | 422 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | siikamiika |
start_time = int(time.time() * 1000)
def dl_fragment(url, data=None, headers=None):
http_headers = info_dict.get('http_headers', {})
if headers:
http_headers = http_headers.copy()
http_headers.update(headers)
return self._download_frag... | Try to put the functions outside `real_download` where possible (ie, when it doesn't actually make use of the scope). This one especially sticks out since it should really be a static function of the class imo | ie = YT_BaseIE(self.ydl)
start_time = int(time.time() * 1000)
def dl_fragment(url, data=None, headers=None):
http_headers = info_dict.get('http_headers', {})
if headers:
http_headers = http_headers.copy()
http_headers.update(headers)
... | @@ -31,13 +32,116 @@ def real_download(self, filename, info_dict):
ie = YT_BaseIE(self.ydl)
+ start_time = int(time.time() * 1000)
+
def dl_fragment(url, data=None, headers=None):
http_headers = info_dict.get('http_headers', {})
if headers:
http_he... | yt_dlp/downloader/youtube_live_chat.py | 26 | Python | 0.786 | suggestion | 209 | 51 | 51 | false | [youtube] Real time live chat | 422 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | siikamiika |
def parse_actions_live(live_chat_continuation):
continuation_id = None
processed_fragment = bytearray()
for action in live_chat_continuation.get('actions', []):
timestamp = parse_live_timestamp(action)
if timestamp is not None:
... | For single keys, `.get` is better | continuation_id, offset = parse_actions(live_chat_continuation)
return True, continuation_id, offset
except compat_urllib_error.HTTPError as err:
count += 1
if count <= fragment_retries:
self.report_r... | @@ -31,13 +32,116 @@ def real_download(self, filename, info_dict):
ie = YT_BaseIE(self.ydl)
+ start_time = int(time.time() * 1000)
+
def dl_fragment(url, data=None, headers=None):
http_headers = info_dict.get('http_headers', {})
if headers:
http_he... | yt_dlp/downloader/youtube_live_chat.py | 26 | Python | 0.5 | suggestion | 33 | 51 | 51 | false | [youtube] Real time live chat | 422 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | siikamiika |
live_offset = [0] # Python 2 doesnot support nonlocal
def parse_actions_live(live_chat_continuation):
continuation_id = None
processed_fragment = bytearray()
for action in live_chat_continuation.get('actions', []):
timestamp = parse_live_timestamp(a... | Either use a single `try_get`, or something like:
``` py
continuation_data = dict_get(
try_get(live_chat_continuation, lambda x: x['continuations'][0], dict),
('invalidationContinuationData', 'timedContinuationData'))
``` | live_chat_continuation = try_get(
data,
lambda x: x['continuationContents']['liveChatContinuation'], dict) or {}
continuation_id, offset = parse_actions(live_chat_continuation)
return True, continuation_id, offse... | @@ -31,13 +32,116 @@ def real_download(self, filename, info_dict):
ie = YT_BaseIE(self.ydl)
+ start_time = int(time.time() * 1000)
+
def dl_fragment(url, data=None, headers=None):
http_headers = info_dict.get('http_headers', {})
if headers:
http_he... | yt_dlp/downloader/youtube_live_chat.py | 26 | Python | 1 | suggestion | 267 | 51 | 51 | false | [youtube] Real time live chat | 422 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | siikamiika |
'season_number': int_or_none(title_data.get('seasonNum') or _search_kane('season')),
'episode_number': int_or_none(title_data.get('episodeNum')),
'episode': episode,
'subtitles': subtitles,
'season_id': title_data.get('seriesId'),
'formats': format... | ```suggestion
subtitles.setdefault(language, []).append(url_element)
``` | # coding: utf-8
from __future__ import unicode_literals
import random
import string
from .common import InfoExtractor
from ..compat import compat_HTTPError
from ..utils import (
determine_ext,
int_or_none,
js_to_json,
urlencode_postdata,
urljoin,
ExtractorError,
)
class FunimationIE(InfoExtr... | @@ -153,6 +155,27 @@ def _search_kane(name):
'season_number': int_or_none(title_data.get('seasonNum') or _search_kane('season')),
'episode_number': int_or_none(title_data.get('episodeNum')),
'episode': episode,
+ 'subtitles': subtitles,
'season_id': title_d... | yt_dlp/extractor/funimation.py | 26 | Python | 0.857 | suggestion | 86 | 28 | 179 | false | [funimation] subtitles | 434 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Mevious |
'title': title,
'description': description,
'thumbnail': self._og_search_thumbnail(webpage),
'series': series,
'season_number': int_or_none(title_data.get('seasonNum') or _search_kane('season')),
'episode_number': int_or_none(title_data.get('episod... | ```suggestion
language += '_CC'
``` | 'title': title,
'description': description,
'thumbnail': self._og_search_thumbnail(webpage),
'series': series,
'season_number': int_or_none(title_data.get('seasonNum') or _search_kane('season')),
'episode_number': int_or_none(title_data.get('episod... | @@ -153,6 +155,27 @@ def _search_kane(name):
'season_number': int_or_none(title_data.get('seasonNum') or _search_kane('season')),
'episode_number': int_or_none(title_data.get('episodeNum')),
'episode': episode,
+ 'subtitles': subtitles,
'season_id': title_d... | yt_dlp/extractor/funimation.py | 26 | Python | 0.857 | suggestion | 53 | 32 | 29 | false | [funimation] subtitles | 434 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Mevious |
# coding: utf-8
from __future__ import unicode_literals
import random
import string
from .common import InfoExtractor
from ..compat import compat_HTTPError
from ..utils import (
determine_ext,
int_or_none,
js_to_json,
ExtractorError,
urlencode_postdata,
urljoin
)
class FunimationIE(InfoExtra... | ```py
urlencode_postdata,
urljoin,
ExtractorError,
``` | # coding: utf-8
from __future__ import unicode_literals
import random
import string
from .common import InfoExtractor
from ..compat import compat_HTTPError
from ..utils import (
determine_ext,
int_or_none,
js_to_json,
urlencode_postdata,
urljoin,
ExtractorError,
)
class FunimationIE(InfoExtr... | @@ -11,7 +11,8 @@
int_or_none,
js_to_json,
ExtractorError,
- urlencode_postdata
+ urlencode_postdata,
+ urljoin | yt_dlp/extractor/funimation.py | 15 | Python | 1 | refactor | 70 | 40 | 40 | false | [funimation] subtitles | 434 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Mevious |
'duration': 288,
'timestamp': 1571652600,
'upload_date': '20191021',
'series': 'Cahaya Terindah',
'channel': 'RCTI',
},
'params': {
'fixup': 'never',
},
}, { # Extra
'url': 'https://www.rctiplus.com/programs/616... | ```suggestion
'format': 'bestvideo',
``` | 'ext': 'mp4',
'duration': 288,
'timestamp': 1571652600,
'upload_date': '20191021',
'series': 'Cahaya Terindah',
'channel': 'RCTI',
},
'params': {
'fixup': 'never',
},
}, { # Extra
'url': 'https://www... | @@ -0,0 +1,243 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+import re
+
+from .openload import PhantomJSwrapper
+
+from .common import InfoExtractor
+from ..utils import (
+ ExtractorError,
+ RegexNotFoundError,
+ strip_or_none,
+ try_get
+)
+
+
+class RCTIPlusBaseIE(InfoExtractor):
+ ... | yt_dlp/extractor/rcti.py | 26 | Python | 0.857 | suggestion | 54 | 51 | 51 | false | [RCTIPlus] Add extractor | 443 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | MinePlayersPE |
video_type, video_id, display_id = re.match(self._VALID_URL, url).groups()
webpage = self._download_webpage(url, display_id)
self._search_auth_key(webpage)
video_json = self._call_api(
'https://api.rctiplus.com/api/v1/%s/%s/url?appierid=.1' % (video_type, video_id), display_... | ```suggestion
'url': '%s%d%s' % (image_path, 2000, video_meta['portrait_image'])
``` | def _real_extract(self, url):
video_type, video_id, display_id = re.match(self._VALID_URL, url).groups()
webpage = self._download_webpage(url, display_id)
self._search_auth_key(webpage)
video_json = self._call_api(
'https://api.rctiplus.com/api/v1/%s/%s/url?appierid=.1' ... | @@ -0,0 +1,243 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+import re
+
+from .openload import PhantomJSwrapper
+
+from .common import InfoExtractor
+from ..utils import (
+ ExtractorError,
+ RegexNotFoundError,
+ strip_or_none,
+ try_get
+)
+
+
+class RCTIPlusBaseIE(InfoExtractor):
+ ... | yt_dlp/extractor/rcti.py | 26 | Python | 1 | suggestion | 102 | 51 | 51 | false | [RCTIPlus] Add extractor | 443 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | MinePlayersPE |
'https://api.rctiplus.com/api/v1/%s/%s/url?appierid=.1' % (video_type, video_id), display_id, 'Downloading video URL JSON')[0]
video_url = video_json['url']
if 'akamaized' in video_url:
# Akamai's CDN requires a session to at least be made via Conviva's API
# TODO: Re... | ```suggestion
'url': '%s%d%s' % (image_path, 2000, video_meta['portrait_image'])
``` | video_json = self._call_api(
'https://api.rctiplus.com/api/v1/%s/%s/url?appierid=.1' % (video_type, video_id), display_id, 'Downloading video URL JSON')[0]
video_url = video_json['url']
if 'akamaized' in video_url:
# Akamai's CDN requires a session to at least be made via... | @@ -0,0 +1,243 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+import re
+
+from .openload import PhantomJSwrapper
+
+from .common import InfoExtractor
+from ..utils import (
+ ExtractorError,
+ RegexNotFoundError,
+ strip_or_none,
+ try_get
+)
+
+
+class RCTIPlusBaseIE(InfoExtractor):
+ ... | yt_dlp/extractor/rcti.py | 26 | Python | 1 | suggestion | 102 | 51 | 51 | false | [RCTIPlus] Add extractor | 443 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | MinePlayersPE |
except ExtractorError:
self.report_warning('PhantomJS is highly recommended for this video, as it might load incredibly slowly otherwise.'
'You can also try opening the page in this device\'s browser first')
video_meta, meta_paths = self._call_api... | ```suggestion
for f in formats:
if 'akamaized' in f['url']:
f.setdefault('http_headers', {})['Referer'] = 'https://www.rctiplus.com/'
self._sort_formats(formats)
```
Don't edit `formats` after sorting | phantom.get(url, webpage, display_id, note2='Initiating video session')
except ExtractorError:
self.report_warning('PhantomJS is highly recommended for this video, as it might load incredibly slowly otherwise.'
'You can also try opening the... | @@ -0,0 +1,243 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+import re
+
+from .openload import PhantomJSwrapper
+
+from .common import InfoExtractor
+from ..utils import (
+ ExtractorError,
+ RegexNotFoundError,
+ strip_or_none,
+ try_get
+)
+
+
+class RCTIPlusBaseIE(InfoExtractor):
+ ... | yt_dlp/extractor/rcti.py | 26 | Python | 1 | suggestion | 254 | 51 | 51 | false | [RCTIPlus] Add extractor | 443 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | MinePlayersPE |
for star in series_meta.get('starring', []):
cast.append(strip_or_none(star.get('name')))
for star in series_meta.get('creator', []):
cast.append(strip_or_none(star.get('name')))
for star in series_meta.get('writer', []):
cast.append(strip_or_none(star.get('na... | `entries` must be a generator so that only just enough API pages are downloaded when using `--playlist-end` | cast.append(strip_or_none(star.get('name')))
for star in series_meta.get('creator', []):
cast.append(strip_or_none(star.get('name')))
for star in series_meta.get('writer', []):
cast.append(strip_or_none(star.get('name')))
metadata['cast'] = cast
tags ... | @@ -0,0 +1,243 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+import re
+
+from .openload import PhantomJSwrapper
+
+from .common import InfoExtractor
+from ..utils import (
+ ExtractorError,
+ RegexNotFoundError,
+ strip_or_none,
+ try_get
+)
+
+
+class RCTIPlusBaseIE(InfoExtractor):
+ ... | yt_dlp/extractor/rcti.py | 26 | Python | 0.5 | suggestion | 107 | 27 | 26 | false | [RCTIPlus] Add extractor | 443 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | MinePlayersPE |
yield url_res
def _real_extract(self, url):
series_id, display_id = re.match(self._VALID_URL, url).groups()
series_meta, meta_paths = self._call_api(
'https://api.rctiplus.com/api/v1/program/%s/detail' % series_id, display_id, 'Downloading series metadata')
meta... | ```suggestion
entries = []
```
Don't make tuple if you are going to `+` anyway | yield url_res
def _real_extract(self, url):
series_id, display_id = re.match(self._VALID_URL, url).groups()
series_meta, meta_paths = self._call_api(
'https://api.rctiplus.com/api/v1/program/%s/detail' % series_id, display_id, 'Downloading series metadata')
meta... | @@ -0,0 +1,242 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+import itertools
+import re
+
+from .openload import PhantomJSwrapper
+
+from .common import InfoExtractor
+from ..utils import (
+ ExtractorError,
+ RegexNotFoundError,
+ strip_or_none,
+ try_get
+)
+
+
+class RCTIPlusBaseIE(Inf... | yt_dlp/extractor/rcti.py | 26 | Python | 0.857 | suggestion | 89 | 39 | 39 | false | [RCTIPlus] Add extractor | 443 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | MinePlayersPE |
cast = []
for star in series_meta.get('starring', []):
cast.append(strip_or_none(star.get('name')))
for star in series_meta.get('creator', []):
cast.append(strip_or_none(star.get('name')))
for star in series_meta.get('writer', []):
cast.append(strip_o... | ```suggestion
entries.append(self._entries('https://api.rctiplus.com/api/v2/program/%s/episode?season=%s' % (series_id, season['season']),
display_id, 'Downloading season %s episode entries' % season['season'], metadata))
entries.append(self._entries('https... |
cast = []
for star in series_meta.get('starring', []):
cast.append(strip_or_none(star.get('name')))
for star in series_meta.get('creator', []):
cast.append(strip_or_none(star.get('name')))
for star in series_meta.get('writer', []):
cast.append(strip_o... | @@ -0,0 +1,242 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+import itertools
+import re
+
+from .openload import PhantomJSwrapper
+
+from .common import InfoExtractor
+from ..utils import (
+ ExtractorError,
+ RegexNotFoundError,
+ strip_or_none,
+ try_get
+)
+
+
+class RCTIPlusBaseIE(Inf... | yt_dlp/extractor/rcti.py | 26 | Python | 1 | suggestion | 682 | 29 | 29 | false | [RCTIPlus] Add extractor | 443 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | MinePlayersPE |
for star in series_meta.get('starring', []):
cast.append(strip_or_none(star.get('name')))
for star in series_meta.get('creator', []):
cast.append(strip_or_none(star.get('name')))
for star in series_meta.get('writer', []):
cast.append(strip_or_none(star.get('na... | ```suggestion
return self.playlist_result(itertools.chain(*entries), series_id, series_meta.get('title'), series_meta.get('summary'), **metadata)
```
since the metadata applies for all videos in playlist, it would be nice to have in the playlist infojson as well | for star in series_meta.get('starring', []):
cast.append(strip_or_none(star.get('name')))
for star in series_meta.get('creator', []):
cast.append(strip_or_none(star.get('name')))
for star in series_meta.get('writer', []):
cast.append(strip_or_none(star.get('na... | @@ -0,0 +1,242 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+import itertools
+import re
+
+from .openload import PhantomJSwrapper
+
+from .common import InfoExtractor
+from ..utils import (
+ ExtractorError,
+ RegexNotFoundError,
+ strip_or_none,
+ try_get
+)
+
+
+class RCTIPlusBaseIE(Inf... | yt_dlp/extractor/rcti.py | 26 | Python | 1 | suggestion | 275 | 27 | 27 | false | [RCTIPlus] Add extractor | 443 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | MinePlayersPE |
for f in current_formats:
# TODO: Convert language to code
f.update({'language': fmt['lang'], 'format_note': fmt['uncut']})
formats.extend(current_formats)
self._remove_duplicate_formats(formats)
self._sort_formats(formats)
... | Github won't let me leave a comment on line 222 (one below this), so leaving it here.
Line 222 gave me an error due to `video_id `being an int
`ERROR: can only concatenate str (not "int") to str` | subtitles, experience_id, display_id=display_id, format_name=format_name,
episode=episode if experience_id == initial_experience_id else episode_id)
headers = {}
if self._TOKEN:
headers['Authorization'] = 'Token %s' % self._TOKEN
page ... | @@ -81,85 +126,96 @@ def _login(self):
def _real_initialize(self):
self._login()
- def _real_extract(self, url):
- display_id = self._match_id(url)
- webpage = self._download_webpage(url, display_id)
+ def _get_episode(self, webpage, experience_id):
+ show = self._parse_json(
... | yt_dlp/extractor/funimation.py | 26 | Python | 0.786 | suggestion | 197 | 51 | 51 | false | [Funimation] rewrite | 444 | yt-dlp/yt-dlp | 132,642 | Python | Mevious | pukkandan |
# coding: utf-8
from __future__ import unicode_literals
import random
import re
import string
from .common import InfoExtractor
from ..compat import compat_HTTPError, compat_str
from ..utils import (
determine_ext,
dict_get,
int_or_none,
js_to_json,
try_get,
urlencode_postdata,
urljoin,
... | Now that the project is Python 3 only, isn’t `str` enough? | # coding: utf-8
from __future__ import unicode_literals
import random
import re
import string
from .common import InfoExtractor
from ..compat import compat_HTTPError
from ..utils import (
determine_ext,
dict_get,
int_or_none,
js_to_json,
str_or_none,
try_get,
urlencode_postdata,
Extrac... | @@ -6,24 +6,24 @@
import string
from .common import InfoExtractor
-from ..compat import compat_HTTPError
+from ..compat import compat_HTTPError, compat_str | yt_dlp/extractor/funimation.py | 9 | Python | 0.357 | question | 58 | 34 | 34 | false | [Funimation] rewrite | 444 | yt-dlp/yt-dlp | 132,642 | Python | fstirlitz | pukkandan |
'id': '8d384cde33b89f3a43ce5329de42903ed5099887',
'ext': 'mp4',
'title': 'Monster',
'description': 'Get a first look at the theatrical trailer for TNT’s highly anticipated new psychological thriller The Alienist, which premieres January 22 on TNT.',
'timestamp... | ```suggestion
isLive = 'watchtnt' in path
``` | 'id': '8d384cde33b89f3a43ce5329de42903ed5099887',
'ext': 'mp4',
'title': 'Monster',
'description': 'Get a first look at the theatrical trailer for TNT’s highly anticipated new psychological thriller The Alienist, which premieres January 22 on TNT.',
'timestamp... | @@ -45,7 +45,8 @@ def _real_extract(self, url):
drupal_settings = self._parse_json(self._search_regex(
r'<script[^>]+?data-drupal-selector="drupal-settings-json"[^>]*?>({.+?})</script>',
webpage, 'drupal setting'), display_id)
- video_data = next(v for v in drupal_settings['tur... | yt_dlp/extractor/tbs.py | 26 | Python | 0.857 | suggestion | 55 | 51 | 51 | false | Implemented TNT live streams | 448 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | liamengland1 |
'is_favorited': is_liked,
'author': author,
'author_id': author_id,
'author_thumbnail': author_thumbnail,
'author_is_uploader': author_is_uploader,
'parent': parent or 'root'
}
def _comment_entries(self, root_continuation_data, identit... | oh, I forgot. Make sure to document this | 'like_count': votes,
'is_favorited': is_liked,
'author': author,
'author_id': author_id,
'author_thumbnail': author_thumbnail,
'author_is_uploader': author_is_uploader,
'parent': parent or 'root'
}
def _comment_entries(self... | @@ -1941,10 +2017,43 @@ def _extract_comment(self, comment_renderer, parent=None):
}
def _comment_entries(self, root_continuation_data, identity_token, account_syncid,
- ytcfg, session_token_list, parent=None, comment_counts=None):
+ ytcfg, parent=None, co... | yt_dlp/extractor/youtube.py | 26 | Python | 0.071 | suggestion | 40 | 51 | 51 | false | [youtube:comments] Move comment extraction to new API | 466 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | coletdjnz |
video_id, fatal=False, note='Downloading remix client config')
ytm_cfg = self._extract_ytcfg(video_id, ytm_webpage) or {}
ytm_client = 'WEB_REMIX'
if not sts or force_mobile_client:
# Android client already has signature descrambled
... | I hadn't thought about `ytm_player_response` not being a dict. In that case, you can just revert my changes and go back to:
```suggestion
# ytm_player_response need not be a dict
ytm_streaming_data = try_get(ytm_player_response, lambda x: x['streamingData']) or {}
```
but
```py
... | return text
runs = x.get('runs')
if not isinstance(runs, list):
return
return ''.join([r['text'] for r in runs if isinstance(r.get('text'), compat_str)])
ytm_streaming_data = {}
if is_music_url:
ytm_webpage = None
... | @@ -2255,7 +2310,8 @@ def get_text(x):
default_client=ytm_client,
note='Downloading %sremix player API JSON' % ('mobile ' if force_mobile_client else ''))
- ytm_streaming_data = try_get(ytm_player_response, lambda x: x['streamingData']) or {}
+ if isinstance(ytm... | yt_dlp/extractor/youtube.py | 26 | Python | 1 | refactor | 483 | 51 | 51 | false | [youtube:comments] Move comment extraction to new API | 466 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | coletdjnz |
query['client_id'] = self._CLIENT_ID
kwargs['query'] = query
try:
return super(SoundcloudIE, self)._download_json(*args, **compat_kwargs(kwargs))
except ExtractorError as e:
if isinstance(e.cause, compat_HTTPError) and e.cause.code == 401:
... | no need for so many names. Just one of them (say, `oauth`) would be sufficient | query['client_id'] = self._CLIENT_ID
kwargs['query'] = query
try:
return super(SoundcloudIE, self)._download_json(*args, **compat_kwargs(kwargs))
except ExtractorError as e:
if isinstance(e.cause, compat_HTTPError) and e.cause.code == 401:
... | @@ -317,21 +305,39 @@ def _download_json(self, *args, **kwargs):
raise
def _real_initialize(self):
- self._CLIENT_ID = self._downloader.cache.load('soundcloud', 'client_id') or "T5R4kgWS2PRf6lzLyIravUMnKlbIxQag" # 'EXLwg5lHTO2dslU5EePe3xkw0m1h86Cd' # 'YUKXoArFcqrlQn9tfNHvvyfnDISj04zk'
+ ... | yt_dlp/extractor/soundcloud.py | 26 | Python | 0.357 | security | 78 | 51 | 51 | false | [soundcloud] disable login, require oauth token instead | 469 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | blackjack4494 |
self._update_client_id()
continue
elif non_fatal:
self.report_warning(error_to_compat_str(e))
return False
raise
def _real_initialize(self):
self._CLIENT_ID = self._downloader.cache.load('soundcl... | If username is not in `oauth`, explain to the user that login is broken and only `-u oauth -p <TOKEN>` can be used | self._update_client_id()
continue
elif non_fatal:
self.report_warning(error_to_compat_str(e))
return False
raise
def _real_initialize(self):
self._CLIENT_ID = self._downloader.cache.load('soundcl... | @@ -317,21 +305,39 @@ def _download_json(self, *args, **kwargs):
raise
def _real_initialize(self):
- self._CLIENT_ID = self._downloader.cache.load('soundcloud', 'client_id') or "T5R4kgWS2PRf6lzLyIravUMnKlbIxQag" # 'EXLwg5lHTO2dslU5EePe3xkw0m1h86Cd' # 'YUKXoArFcqrlQn9tfNHvvyfnDISj04zk'
+ ... | yt_dlp/extractor/soundcloud.py | 26 | Python | 0.714 | bug | 114 | 51 | 51 | false | [soundcloud] disable login, require oauth token instead | 469 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | blackjack4494 |
'''
def genDevId():
def genNumBlock():
return ''.join([str(random.randrange(10)) for i in range(6)])
return '-'.join([genNumBlock() for i in range(4)])
payload = {
'client_id': self._CLIENT_ID,
'recaptcha_pubkey': 'null',
... | why? This code is being commented out, no? | r'''
def genDevId():
def genNumBlock():
return ''.join([str(random.randrange(10)) for i in range(6)])
return '-'.join([genNumBlock() for i in range(4)])
payload = {
'client_id': self._CLIENT_ID,
'recaptcha_pubkey': 'null',
... | @@ -352,12 +358,14 @@ def genNumBlock():
query = self._API_AUTH_QUERY_TEMPLATE % self._CLIENT_ID
login = sanitized_Request(self._API_AUTH_URL_PW % query, json.dumps(payload).encode('utf-8'))
- response = self._download_json(login, None)
- self._access_token = response.get('session').ge... | yt_dlp/extractor/soundcloud.py | 26 | Python | 0.071 | question | 42 | 51 | 51 | false | [soundcloud] disable login, require oauth token instead | 469 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | blackjack4494 |
self._store_client_id(client_id)
return
raise ExtractorError('Unable to extract client id')
def _download_json(self, *args, **kwargs):
non_fatal = kwargs.get('fatal') is False
if non_fatal:
del kwargs['fatal']
query = kwargs.get('q... | ```suggestion
self._CLIENT_ID = self._downloader.cache.load('soundcloud', 'client_id') or 'fXuVKzsVXlc6tzniWWS31etd7VHWFUuN' # persistent `client_id`
```
for consistency | self._store_client_id(client_id)
return
raise ExtractorError('Unable to extract client id')
def _download_json(self, *args, **kwargs):
non_fatal = kwargs.get('fatal') is False
if non_fatal:
del kwargs['fatal']
query = kwargs.get('q... | @@ -317,21 +305,39 @@ def _download_json(self, *args, **kwargs):
raise
def _real_initialize(self):
- self._CLIENT_ID = self._downloader.cache.load('soundcloud', 'client_id') or "T5R4kgWS2PRf6lzLyIravUMnKlbIxQag" # 'EXLwg5lHTO2dslU5EePe3xkw0m1h86Cd' # 'YUKXoArFcqrlQn9tfNHvvyfnDISj04zk'
+ ... | yt_dlp/extractor/soundcloud.py | 26 | Python | 1 | performance | 183 | 51 | 51 | false | [soundcloud] disable login, require oauth token instead | 469 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | blackjack4494 |
'origin': 'https://fancode.com',
'referer': 'https://fancode.com',
}
def _login(self):
# Access tokens are shortlived, so get them using the refresh token.
username, password = self._get_login_info()
if username == 'refresh' and password is not None:
self.rep... | If some other username was given, warn the user about how to actually use the option | 'content-type': 'application/json',
'origin': 'https://fancode.com',
'referer': 'https://fancode.com',
}
def _login(self):
# Access tokens are shortlived, so get them using the refresh token.
username, password = self._get_login_info()
if username == 'refresh' an... | @@ -38,16 +39,54 @@ class FancodeVodIE(InfoExtractor):
'only_matching': True,
}]
+ _ACCESS_TOKEN = None
+ _REFRESH_TOKEN = None
+ _NETRC_MACHINE = 'fancode'
+
+ headers = {
+ 'content-type': 'application/json',
+ 'origin': 'https://fancode.com',
+ 'referer': 'https://fan... | yt_dlp/extractor/fancode.py | 26 | Python | 0.357 | suggestion | 85 | 51 | 51 | false | [fancode] support fancodeLive and fixes | 471 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | zenerdi0de |
'title': 'Match Preview: PBKS vs MI',
'thumbnail': r're:^https?://.*\.jpg$',
"timestamp": 1619081590,
'view_count': int,
'like_count': int,
'upload_date': '20210422',
'uploader_id': '6008340455001'
}
}, {
'url': 'htt... | If user provides cookies, cant refresh token be extracted from there? | 'title': 'Match Preview: PBKS vs MI',
'thumbnail': r're:^https?://.*\.jpg$',
"timestamp": 1619081590,
'view_count': int,
'like_count': int,
'upload_date': '20210422',
'uploader_id': '6008340455001'
}
}, {
'url': 'htt... | @@ -38,16 +39,54 @@ class FancodeVodIE(InfoExtractor):
'only_matching': True,
}]
+ _ACCESS_TOKEN = None
+ _REFRESH_TOKEN = None
+ _NETRC_MACHINE = 'fancode'
+
+ headers = {
+ 'content-type': 'application/json',
+ 'origin': 'https://fancode.com',
+ 'referer': 'https://fan... | yt_dlp/extractor/fancode.py | 26 | Python | 0.357 | refactor | 69 | 51 | 51 | false | [fancode] support fancodeLive and fixes | 471 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | zenerdi0de |
brightcove_user_id = '6008340455001'
data = '''{
"query":"query Video($id: Int\\u0021, $filter: SegmentFilter) { media(id: $id, filter: $filter) { id contentId title contentId publishedTime totalViews totalUpvotes provider thumbnail { src } mediaSource {brightcove } duration isPremium isUse... | ~~Do cookies work for login? If not, use:~~
```suggestion
self.raise_login_required(method='password')
```
Same everywhere else | return self._download_json(
'https://www.fancode.com/graphql', variable,
data=data.encode(), note=note,
headers=headers, fatal=fatal)
def _real_extract(self, url):
BRIGHTCOVE_URL_TEMPLATE = 'https://players.brightcove.net/%s/default_default/index.html?videoId=%s... | @@ -74,8 +107,12 @@ def _real_extract(self, url):
raise ExtractorError('Unable to extract brightcove Video ID')
is_premium = media.get('isPremium')
- if is_premium:
- self.report_warning('this video requires a premium account', video_id)
+ is_available = media.get('isUse... | yt_dlp/extractor/fancode.py | 26 | Python | 1 | suggestion | 143 | 51 | 51 | false | [fancode] support fancodeLive and fixes | 471 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | zenerdi0de |
'title': metadata['title'],
'description': metadata.get('description'),
'season_number': int_or_none(metadata.get('season_num')),
'episode_number': int_or_none(metadata.get('episode_num')),
})
query['switch'] = 'progressive'
... | ```suggestion
dict_get(tp_metadata, ('pl1$show', 'nbcu$show')),
```
OR (with the latest master)
```suggestion
traverse_obj(tp_metadata, ('pl1$show',), ('nbcu$show',)),
```
Same for `episode`, `season_number` and `episode_number` | info.update({
'title': metadata['title'],
'description': metadata.get('description'),
'season_number': int_or_none(metadata.get('season_num')),
'episode_number': int_or_none(metadata.get('episode_num')),
})
query['switch... | @@ -79,12 +86,38 @@ def _real_extract(self, url):
'episode_number': int_or_none(metadata.get('episode_num')),
})
query['switch'] = 'progressive'
+
+ tp_url = 'http://link.theplatform.com/s/%s/%s' % (account_pid, tp_path)
+
+ tp_metadata = self._download_json(
+ ... | yt_dlp/extractor/bravotv.py | 26 | Python | 1 | suggestion | 277 | 42 | 39 | false | [BravoTV] Improve metadata extraction | 483 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | kevinoconnor7 |
class RTPIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?rtp\.pt/play/p(?P<program_id>[0-9]+)/(?P<id>[^/?#]+)/?'
_TESTS = [{
'url': 'http://www.rtp.pt/play/p405/e174042/paixoes-cruzadas',
'md5': 'e736ce0c665e459ddb818546220b4ef8',
'info_dict': {
'id': 'e174042',
... | since there aren't many fields and all are mandatory, I don't really see the need for `*`. I'm not bothered by it enough to ask it to be removed, but I'm curious as to your reason for using it |
class RTPIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?rtp\.pt/play/p(?P<program_id>[0-9]+)/(?P<id>[^/?#]+)/?'
_TESTS = [{
'url': 'http://www.rtp.pt/play/p405/e174042/paixoes-cruzadas',
'md5': 'e736ce0c665e459ddb818546220b4ef8',
'info_dict': {
'id': 'e174042',
... | @@ -25,42 +26,87 @@ class RTPIE(InfoExtractor):
'only_matching': True,
}]
+ _RX_OBFUSCATION = re.compile(r'''(?xs)
+ atob\s*\(\s*decodeURIComponent\s*\(\s*
+ (\[[0-9A-Za-z%,'"]*\])
+ \s*\.\s*join\(\s*(?:""|'')\s*\)\s*\)\s*\)
+ ''')
+
+ def __unobfuscate(self, data, *, v... | yt_dlp/extractor/rtp.py | 26 | Python | 0.714 | suggestion | 192 | 51 | 51 | false | RTP: fix extraction | 497 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | fstirlitz |
elif mrr_title == 'Song':
info['track'] = mrr_contents_text
fallbacks = {
'channel': 'uploader',
'channel_id': 'uploader_id',
'channel_url': 'uploader_url',
}
for to, frm in fallbacks.items():
... | Took me way too long to realize what `badge_lbls` means. might wanna consider `badge_labels` | elif mrr_title == 'Song':
info['track'] = mrr_contents_text
fallbacks = {
'channel': 'uploader',
'channel_id': 'uploader_id',
'channel_url': 'uploader_url',
}
for to, frm in fallbacks.items():
... | @@ -2957,21 +2965,20 @@ def chapter_time(mmlir):
if initial_data and is_private is not None:
is_membersonly = False
is_premium = False
- contents = try_get(initial_data, lambda x: x['contents']['twoColumnWatchNextResults']['results']['results']['contents'], list)
- ... | yt_dlp/extractor/youtube.py | 26 | Python | 0.571 | refactor | 92 | 51 | 51 | false | [youtube:tab] Add availability metadata for playlists | 504 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | coletdjnz |
content, (lambda x: x['continuationItemRenderer']['continuationEndpoint'],
lambda x: x['continuationItemRenderer']['button']['buttonRenderer']['command']),
dict)
continuation = cls._extract_continuation_ep_data(continuation_ep)
if continu... | potential future bug: if we fail to extract a message this will not return a two item tuple. it is assumed it will in other functions | for key in ('contents', 'items'):
contents.extend(try_get(renderer, lambda x: x[key], list) or [])
for content in contents:
if not isinstance(content, dict):
continue
continuation_ep = try_get(
content, (lambda x: x['continuationItemRe... | @@ -611,20 +603,16 @@ def _extract_continuation(cls, renderer):
if continuation:
return continuation
- @staticmethod
- def _extract_alerts(data):
+ @classmethod
+ def _extract_alerts(cls, data):
for alert_dict in try_get(data, lambda x: x['alerts'], list) or []:
... | yt_dlp/extractor/youtube.py | 26 | Python | 0.786 | bug | 133 | 51 | 51 | false | [youtube] misc cleanup and bug fixes | 505 | yt-dlp/yt-dlp | 132,642 | Python | coletdjnz | coletdjnz |
for alert_type, alert_message in alerts:
if alert_type.lower() == 'error':
errors.append([alert_type, alert_message])
else:
warnings.append([alert_type, alert_message])
for alert_type, alert_message in (warnings + errors[:-1]):
self.re... | ```suggestion
d = try_get(data, get) if get is not None else data
```
right? since it shouldn't fallback to data if try_get returns None | message = cls._get_text(alert.get('text'))
if message:
yield alert_type, message
def _report_alerts(self, alerts, expected=True):
errors = []
warnings = []
for alert_type, alert_message in alerts:
if alert_type.lower() == 'erro... | @@ -654,18 +642,23 @@ def _extract_badges(self, renderer: dict):
return badges
@staticmethod
- def _join_text_entries(runs):
- text = None
- for run in runs:
- if not isinstance(run, dict):
- continue
- sub_text = try_get(run, lambda x: x['text'], co... | yt_dlp/extractor/youtube.py | 26 | Python | 1 | suggestion | 151 | 51 | 51 | false | [youtube] misc cleanup and bug fixes | 505 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | coletdjnz |
def _extract_and_report_alerts(self, data, *args, **kwargs):
return self._report_alerts(self._extract_alerts(data), *args, **kwargs)
def _extract_badges(self, renderer: dict):
badges = set()
for badge in try_get(renderer, lambda x: x['badges'], list) or []:
label = try_get(... | why not
```suggestion
for run in runs[:max_runs]:
yield try_get(run, lambda x: x['text'], compat_str) or ''
```
| else:
warnings.append([alert_type, alert_message])
for alert_type, alert_message in (warnings + errors[:-1]):
self.report_warning('YouTube said: %s - %s' % (alert_type, alert_message))
if errors:
raise ExtractorError('YouTube said: %s' % errors[-1][1]... | @@ -654,18 +642,23 @@ def _extract_badges(self, renderer: dict):
return badges
@staticmethod
- def _join_text_entries(runs):
- text = None
- for run in runs:
- if not isinstance(run, dict):
- continue
- sub_text = try_get(run, lambda x: x['text'], co... | yt_dlp/extractor/youtube.py | 26 | Python | 1 | suggestion | 153 | 51 | 51 | false | [youtube] misc cleanup and bug fixes | 505 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | coletdjnz |
},
},
{
'url': 'https://www.pornflip.com/v/IrJEC40i21L',
'only_matching': True,
},
{
'url': 'https://www.pornflip.com/Z3jzbChC5-P/sexintaxi-e-sereyna-gomez-czech-naked-couple',
'only_matching': True,
},
{
... | `parse_duration` can handle `None` | 'skip_download': True,
},
},
{
'url': 'https://www.pornflip.com/v/IrJEC40i21L',
'only_matching': True,
},
{
'url': 'https://www.pornflip.com/Z3jzbChC5-P/sexintaxi-e-sereyna-gomez-czech-naked-couple',
'only_matchi... | @@ -0,0 +1,88 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+from ..utils import (
+ int_or_none,
+ parse_duration,
+ parse_iso8601
+)
+
+
+class PornFlipIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?pornflip\.com/(?:(embed|sv|v)/)?(?P<id>[^/]+)'
... | yt_dlp/extractor/pornflip.py | 26 | Python | 0.571 | suggestion | 34 | 51 | 51 | false | [pornflip] Add new extractor | 523 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | mezbaul-h |
'url': 'https://www.pornflip.com/embed/bLcDFxnrZnU',
'only_matching': True,
},
]
_HOST = 'www.pornflip.com'
def _real_extract(self, url):
video_id = self._match_id(url)
webpage = self._download_webpage(
'https://{}/sv/{}'.format(self._HOST, video_... | `age_limit` must be set of NSFW websites | {
'url': 'https://www.pornflip.com/embed/bLcDFxnrZnU',
'only_matching': True,
},
]
_HOST = 'www.pornflip.com'
def _real_extract(self, url):
video_id = self._match_id(url)
webpage = self._download_webpage(
'https://{}/sv/{}'.format(self._HO... | @@ -0,0 +1,88 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+from ..utils import (
+ int_or_none,
+ parse_duration,
+ parse_iso8601
+)
+
+
+class PornFlipIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?pornflip\.com/(?:(embed|sv|v)/)?(?P<id>[^/]+)'
... | yt_dlp/extractor/pornflip.py | 26 | Python | 0.286 | suggestion | 40 | 46 | 40 | false | [pornflip] Add new extractor | 523 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | mezbaul-h |
# coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
int_or_none,
parse_duration,
parse_iso8601
)
class PornFlipIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?pornflip\.com/(?:(embed|sv|v)/)?(?P<id>[^/]+)'
_TESTS = [
{
... | sorry, I should have been clearer. I meant that you should use md5 for description. The download test can be skipped | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
int_or_none,
parse_duration,
parse_iso8601
)
class PornFlipIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?pornflip\.com/(?:(embed|sv|v)/)?(?P<id>[^/]+)'
_TESTS = [
{
... | @@ -0,0 +1,85 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+from ..utils import (
+ int_or_none,
+ parse_duration,
+ parse_iso8601
+)
+
+
+class PornFlipIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?pornflip\.com/(?:(embed|sv|v)/)?(?P<id>[^/]+)'
... | yt_dlp/extractor/pornflip.py | 17 | Python | 0.5 | suggestion | 116 | 42 | 42 | false | [pornflip] Add new extractor | 523 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | mezbaul-h |
import struct
import subprocess
import sys
import tempfile
from datetime import datetime, timedelta, timezone
from hashlib import pbkdf2_hmac
from yt_dlp.aes import aes_cbc_decrypt
from yt_dlp.compat import (
compat_b64decode,
compat_cookiejar_Cookie,
)
from yt_dlp.utils import (
bytes_to_intlist,
expa... | ```suggestion
# sqlite support. See: https://github.com/yt-dlp/yt-dlp/issues/544
``` | import struct
import subprocess
import sys
import tempfile
from datetime import datetime, timedelta, timezone
from hashlib import pbkdf2_hmac
from yt_dlp.aes import aes_cbc_decrypt
from yt_dlp.compat import (
compat_b64decode,
compat_cookiejar_Cookie,
)
from yt_dlp.utils import (
bytes_to_intlist,
expa... | @@ -23,6 +22,15 @@
YoutubeDLCookieJar,
)
+try:
+ import sqlite3
+ SQLITE_AVAILABLE = True
+except ImportError:
+ # although sqlite3 is part of the standard library, it is possible to compile python without
+ # sqlite support, in which case importing fails | yt_dlp/cookies.py | 26 | Python | 0.857 | suggestion | 90 | 51 | 51 | false | add support for python interpreters compiled without sqlite3 support. fixes #544 | 554 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | mbway |
'description': 'md5:fb5a6c2e506f013cc76f133f673bc5c8',
'uploader': 'Nomad Capitalist',
'thumbnail': 'https://data-1.utreon.com/v/ZD/k1/Mj/C4ZxXhYBBmE/C4ZxXhYBBmE_628342076198c9c06dd6b2c665978584_cover.jpg',
'release_date': '20210723',
}
}, {
'url': 'ht... | why not directly parse it from the string. That way, if they add new resolutions, it will automatically work | 'title': 'Biden’s Capital Gains Tax Rate to Test World’s Highest',
'description': 'md5:fb5a6c2e506f013cc76f133f673bc5c8',
'uploader': 'Nomad Capitalist',
'thumbnail': 'https://data-1.utreon.com/v/ZD/k1/Mj/C4ZxXhYBBmE/C4ZxXhYBBmE_628342076198c9c06dd6b2c665978584_cover.jpg'... | @@ -0,0 +1,96 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+from ..utils import (
+ int_or_none,
+ str_or_none,
+ try_get,
+ unified_strdate,
+ url_or_none,
+)
+
+
+class UtreonIE(InfoExtractor):
+ _VALID_URL = r'(?:https?://)(?:www\.)?utreon.com/v/... | yt_dlp/extractor/utreon.py | 26 | Python | 0.5 | suggestion | 108 | 51 | 43 | false | Add UtreonIE. | 562 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Ashish0804 |
]
_formats = {
'video_144p_url': 144,
'video_240p_url': 240,
'video_360p_url': 360,
'video_480p_url': 480,
'video_720p_url': 720,
'video_1080p_url': 1080,
}
def _real_extract(self, url):
video_id = self._match_id(url)
json_data = self._do... | ```suggestion
thumbnail = url_or_none(dict_get(json_data, ('cover_image_url', 'preview_image_url'))
``` | }},
]
def _real_extract(self, url):
video_id = self._match_id(url)
json_data = self._download_json(
'https://api.utreon.com/v1/videos/' + video_id,
video_id)
videos_json = json_data['videos']
formats = [{
'url': format_url,
... | @@ -0,0 +1,96 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+from ..utils import (
+ int_or_none,
+ str_or_none,
+ try_get,
+ unified_strdate,
+ url_or_none,
+)
+
+
+class UtreonIE(InfoExtractor):
+ _VALID_URL = r'(?:https?://)(?:www\.)?utreon.com/v/... | yt_dlp/extractor/utreon.py | 26 | Python | 1 | suggestion | 113 | 38 | 27 | false | Add UtreonIE. | 562 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Ashish0804 |
'uploader': 'Merryweather Comics',
'thumbnail': 'https://data-1.utreon.com/v/MT/E4/Zj/Y-stEH-FBm8/Y-stEH-FBm8_5290676a41a4a1096db133b09f54f77b_cover.jpg',
'release_date': '20210718',
}},
]
_formats = {
'video_144p_url': 144,
'video_240p_url': 240,
... | ```suggestion
formats = [{
'url': url_or_none(url),
'format_id': '%dp' % self._formats[format_key],
'height': self._formats[format_key],
} for format_key, url in videos_json.items() if url_or_none(url)]
``` | 'description': 'md5:7a48450b0d761b96dec194be0c5ecb5f',
'uploader': 'Merryweather Comics',
'thumbnail': 'https://data-1.utreon.com/v/MT/E4/Zj/Y-stEH-FBm8/Y-stEH-FBm8_5290676a41a4a1096db133b09f54f77b_cover.jpg',
'release_date': '20210718',
}},
]
def _real_e... | @@ -0,0 +1,96 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+from ..utils import (
+ int_or_none,
+ str_or_none,
+ try_get,
+ unified_strdate,
+ url_or_none,
+)
+
+
+class UtreonIE(InfoExtractor):
+ _VALID_URL = r'(?:https?://)(?:www\.)?utreon.com/v/... | yt_dlp/extractor/utreon.py | 26 | Python | 1 | suggestion | 264 | 42 | 31 | false | Add UtreonIE. | 562 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Ashish0804 |
'ie_key': 'Vimeo',
})
if not info.get('url'):
embed_url = try_get(attributes, lambda x: x['embed']['url'])
if embed_url:
info.update({
'_type': 'url',
'url': embed_url,
})... | You have to make sure the regex doesnt match single patron posts | 'ie_key': 'Vimeo',
})
if not info.get('url'):
embed_url = try_get(attributes, lambda x: x['embed']['url'])
if embed_url:
info.update({
'_type': 'url',
'url': embed_url,
})... | @@ -185,3 +187,65 @@ def _real_extract(self, url):
})
return info
+
+
+class PatreonUserIE(InfoExtractor):
+
+ _VALID_URL = r'https?://(?:www\.)?patreon\.com/(?P<id>[-_\w\d]+)/?(?:posts/?)?' | yt_dlp/extractor/patreon.py | 26 | Python | 0.143 | suggestion | 64 | 51 | 51 | false | [Patreon] Add PatreonUserIE | 573 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | zenerdi0de |
if not info.get('url'):
embed_url = try_get(attributes, lambda x: x['embed']['url'])
if embed_url:
info.update({
'_type': 'url',
'url': embed_url,
})
if not info.get('url'):
post_file = attribut... | Add one proper test (not `only_matching`) |
if not info.get('url'):
embed_url = try_get(attributes, lambda x: x['embed']['url'])
if embed_url:
info.update({
'_type': 'url',
'url': embed_url,
})
if not info.get('url'):
post_file = attribut... | @@ -185,3 +187,65 @@ def _real_extract(self, url):
})
return info
+
+
+class PatreonUserIE(InfoExtractor):
+
+ _VALID_URL = r'https?://(?:www\.)?patreon\.com/(?P<id>[-_\w\d]+)/?(?:posts/?)?'
+
+ _TESTS = [{ | yt_dlp/extractor/patreon.py | 26 | Python | 0.286 | suggestion | 41 | 51 | 51 | false | [Patreon] Add PatreonUserIE | 573 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | zenerdi0de |
_VALID_URL = r'https?://(?:www\.)?patreon\.com/(?P<id>[-_\w\d]+)/?(?:posts/?)?'
_TESTS = [{
'url': 'https://www.patreon.com/dissonancepod/',
'only_matching': True
}, {
'url': 'https://www.patreon.com/dissonancepod/posts',
'only_matching': True
}]
def get_entries(sel... | ```suggestion
posts_json = self._download_json('https://www.patreon.com/api/posts', user_id, note='Downloading posts page %d' % page, query=params)
``` | _VALID_URL = r'https?://(?:www\.)?patreon\.com/(?P<id>[-_\w\d]+)/?(?:posts/?)?'
_TESTS = [{
'url': 'https://www.patreon.com/dissonancepod/',
'info_dict': {
'title': 'dissonancepod',
},
'playlist_mincount': 68,
'expected_warnings': 'Post not viewable by curren... | @@ -185,3 +187,65 @@ def _real_extract(self, url):
})
return info
+
+
+class PatreonUserIE(InfoExtractor):
+
+ _VALID_URL = r'https?://(?:www\.)?patreon\.com/(?P<id>[-_\w\d]+)/?(?:posts/?)?'
+
+ _TESTS = [{
+ 'url': 'https://www.patreon.com/dissonancepod/',
+ 'only_matchi... | yt_dlp/extractor/patreon.py | 26 | Python | 1 | suggestion | 165 | 51 | 50 | false | [Patreon] Add PatreonUserIE | 573 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | zenerdi0de |
'url': 'https://www.patreon.com/dissonancepod/',
'only_matching': True
}, {
'url': 'https://www.patreon.com/dissonancepod/posts',
'only_matching': True
}]
def get_entries(self, campaign_id, user_id):
cursor = None
params = {
'fields[campaign]': 's... | ```suggestion
data = posts_json.get('data') or []
``` | 'url': 'https://www.patreon.com/dissonancepod/',
'info_dict': {
'title': 'dissonancepod',
},
'playlist_mincount': 68,
'expected_warnings': 'Post not viewable by current user! Skipping!',
}, {
'url': 'https://www.patreon.com/dissonancepod/posts',
'o... | @@ -185,3 +187,65 @@ def _real_extract(self, url):
})
return info
+
+
+class PatreonUserIE(InfoExtractor):
+
+ _VALID_URL = r'https?://(?:www\.)?patreon\.com/(?P<id>[-_\w\d]+)/?(?:posts/?)?'
+
+ _TESTS = [{
+ 'url': 'https://www.patreon.com/dissonancepod/',
+ 'only_matchi... | yt_dlp/extractor/patreon.py | 26 | Python | 0.857 | suggestion | 67 | 51 | 47 | false | [Patreon] Add PatreonUserIE | 573 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | zenerdi0de |
'url': 'https://www.patreon.com/dissonancepod/posts',
'only_matching': True
}]
def get_entries(self, campaign_id, user_id):
cursor = None
params = {
'fields[campaign]': 'show_audio_post_download_links,name,url',
'fields[post]': 'current_user_can_view,embe... | ```suggestion
for post in posts_json.get('data') or []:
``` | },
'playlist_mincount': 68,
'expected_warnings': 'Post not viewable by current user! Skipping!',
}, {
'url': 'https://www.patreon.com/dissonancepod/posts',
'only_matching': True
}, ]
@classmethod
def suitable(cls, url):
return False if PatreonIE.suitable(... | @@ -185,3 +187,65 @@ def _real_extract(self, url):
})
return info
+
+
+class PatreonUserIE(InfoExtractor):
+
+ _VALID_URL = r'https?://(?:www\.)?patreon\.com/(?P<id>[-_\w\d]+)/?(?:posts/?)?'
+
+ _TESTS = [{
+ 'url': 'https://www.patreon.com/dissonancepod/',
+ 'only_matchi... | yt_dlp/extractor/patreon.py | 26 | Python | 0.857 | suggestion | 73 | 51 | 44 | false | [Patreon] Add PatreonUserIE | 573 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | zenerdi0de |
def get_entries(self, campaign_id, user_id):
cursor = None
params = {
'fields[campaign]': 'show_audio_post_download_links,name,url',
'fields[post]': 'current_user_can_view,embed,image,is_paid,post_file,published_at,patreon_url,url,post_type,thumbnail_url,title',
'... | can we atleast get the post id here? | 'url': 'https://www.patreon.com/dissonancepod/posts',
'only_matching': True
}, ]
@classmethod
def suitable(cls, url):
return False if PatreonIE.suitable(url) else super(PatreonUserIE, cls).suitable(url)
def _entries(self, campaign_id, user_id):
cursor = None
par... | @@ -185,3 +187,65 @@ def _real_extract(self, url):
})
return info
+
+
+class PatreonUserIE(InfoExtractor):
+
+ _VALID_URL = r'https?://(?:www\.)?patreon\.com/(?P<id>[-_\w\d]+)/?(?:posts/?)?'
+
+ _TESTS = [{
+ 'url': 'https://www.patreon.com/dissonancepod/',
+ 'only_matchi... | yt_dlp/extractor/patreon.py | 26 | Python | 0.071 | question | 36 | 49 | 40 | false | [Patreon] Add PatreonUserIE | 573 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | zenerdi0de |
if not info.get('url'):
post_file = attributes['post_file']
ext = determine_ext(post_file.get('name'))
if ext in KNOWN_EXTENSIONS:
info.update({
'ext': ext,
'url': post_file['url'],
})
return in... | Generally `_entries` is used as the name |
if not info.get('url'):
post_file = attributes['post_file']
ext = determine_ext(post_file.get('name'))
if ext in KNOWN_EXTENSIONS:
info.update({
'ext': ext,
'url': post_file['url'],
})
return in... | @@ -185,3 +187,65 @@ def _real_extract(self, url):
})
return info
+
+
+class PatreonUserIE(InfoExtractor):
+
+ _VALID_URL = r'https?://(?:www\.)?patreon\.com/(?P<id>[-_\w\d]+)/?(?:posts/?)?'
+
+ _TESTS = [{
+ 'url': 'https://www.patreon.com/dissonancepod/',
+ 'only_matchi... | yt_dlp/extractor/patreon.py | 26 | Python | 0.5 | suggestion | 40 | 51 | 51 | false | [Patreon] Add PatreonUserIE | 573 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | zenerdi0de |
def _extract_video_info(self, content_id, site='cbs', mpx_acc=2198311517):
items_data = self._download_xml(
'https://can.cbs.com/thunder/player/videoPlayerService.php',
content_id, query={'partner': site, 'contentId': content_id})
video_data = xpath_element(items_data, './/it... | remove comments and add these as tests | 'skip_download': 'm3u8',
},
'_skip': 'Blocked outside the US',
}, {
'url': 'https://www.paramountplus.com/shows/tooning-out-the-news/video/6hSWYWRrR9EUTz7IEe5fJKBhYvSUfexd/7-23-21-week-in-review-rep-jahana-hayes-howard-fineman-sen-michael-bennet-sheera-frenkel-cecilia-kang-/',
... | @@ -78,16 +78,29 @@ def _extract_video_info(self, content_id, site='cbs', mpx_acc=2198311517):
asset_types = []
subtitles = {}
formats = []
+ useXMLmetadata = True
last_e = None
for item in items_data.findall('.//item'):
asset_type = xpath_text(item, 'ass... | yt_dlp/extractor/cbs.py | 26 | Python | 0.286 | suggestion | 38 | 51 | 51 | false | Add fallback to CBS extractor | 579 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | liamengland1 |
tp_release_url = 'https://link.theplatform.com/s/' + tp_path
asset_types = []
subtitles = {}
formats = []
useXMLmetadata = True
last_e = None
for item in items_data.findall('.//item'):
asset_type = xpath_text(item, 'assetType')
query = {
... | ```suggestion
elif asset_type in asset_types or 'HLS_FPS' in asset_type or 'DASH_CENC' in asset_type:
``` | 'ext': 'mp4',
'title': '7/23/21 WEEK IN REVIEW (Rep. Jahana Hayes/Howard Fineman/Sen. Michael Bennet/Sheera Frenkel & Cecilia Kang)',
'description': 'md5:f4adcea3e8b106192022e121f1565bae',
'duration': 2506,
'timestamp': 1627063200,
'upload_date': '... | @@ -78,16 +78,29 @@ def _extract_video_info(self, content_id, site='cbs', mpx_acc=2198311517):
asset_types = []
subtitles = {}
formats = []
+ useXMLmetadata = True
last_e = None
for item in items_data.findall('.//item'):
asset_type = xpath_text(item, 'ass... | yt_dlp/extractor/cbs.py | 26 | Python | 1 | suggestion | 119 | 51 | 51 | false | Add fallback to CBS extractor | 579 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | liamengland1 |
}
if not asset_type:
# fallback for content_ids that videoPlayerService doesn't return anything for
# Examples:
# https://www.paramountplus.com/shows/catdog/video/Oe44g5_NrlgiZE3aQVONleD6vXc8kP0k/catdog-climb-every-catdog-the-canine-mutiny/
... | ```suggestion
if not useXMLmetadata and currentIndex + 1 < len(formatList):
``` | }, {
'url': 'https://www.cbs.com/shows/the-late-show-with-stephen-colbert/video/60icOhMb9NcjbcWnF_gub9XXHdeBcNk2/the-late-show-6-23-21-christine-baranski-joy-oladokun-',
'info_dict': {
'id': '60icOhMb9NcjbcWnF_gub9XXHdeBcNk2',
'title': 'The Late Show - 6/23/21 (Christine Bara... | @@ -97,6 +110,11 @@ def _extract_video_info(self, content_id, site='cbs', mpx_acc=2198311517):
update_url_query(tp_release_url, query), content_id,
'Downloading %s SMIL data' % asset_type)
except ExtractorError as e:
+ if not useXMLmetadata and curre... | yt_dlp/extractor/cbs.py | 26 | Python | 0.857 | suggestion | 97 | 51 | 51 | false | Add fallback to CBS extractor | 579 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | liamengland1 |
video_data = xpath_element(items_data, './/item')
title = xpath_text(video_data, 'videoTitle', 'title') or xpath_text(video_data, 'videotitle', 'title')
tp_path = 'dJ5BDC/media/guid/%d/%s' % (mpx_acc, content_id)
tp_release_url = 'https://link.theplatform.com/s/' + tp_path
asset... | currentIndex is never changed? | 'url': 'https://www.paramountplus.com/shows/tooning-out-the-news/video/6hSWYWRrR9EUTz7IEe5fJKBhYvSUfexd/7-23-21-week-in-review-rep-jahana-hayes-howard-fineman-sen-michael-bennet-sheera-frenkel-cecilia-kang-/',
'info_dict': {
'id': '6hSWYWRrR9EUTz7IEe5fJKBhYvSUfexd',
'ext': 'mp4',... | @@ -78,16 +78,29 @@ def _extract_video_info(self, content_id, site='cbs', mpx_acc=2198311517):
asset_types = []
subtitles = {}
formats = []
+ useXMLmetadata = True
last_e = None
for item in items_data.findall('.//item'):
asset_type = xpath_text(item, 'ass... | yt_dlp/extractor/cbs.py | 26 | Python | 0.286 | question | 30 | 51 | 51 | false | Add fallback to CBS extractor | 579 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | liamengland1 |
from __future__ import unicode_literals
from .common import InfoExtractor
from .theplatform import ThePlatformFeedIE
from ..utils import (
ExtractorError,
int_or_none,
find_xpath_attr,
xpath_element,
xpath_text,
update_url_query,
)
class CBSBaseIE(ThePlatformFeedIE):
def _parse_smil_subti... | Is this correct, or should these formats be ignored? | continue
elif any(excluded in asset_type for excluded in ('HLS_FPS', 'DASH_CENC', 'OnceURL')):
continue
asset_types.append(asset_type)
if asset_type.startswith('HLS') or 'StreamPack' in asset_type:
query['formats'] = 'MPEG4,M3U'
... | @@ -99,25 +156,37 @@ def _extract_video_info(self, content_id, site='cbs', mpx_acc=2198311517):
'Downloading %s SMIL data' % asset_type)
except ExtractorError as e:
last_e = e
- continue
+ if useXMLmetadata:
+ continue
+... | yt_dlp/extractor/cbs.py | 26 | Python | 0.357 | question | 52 | 162 | 51 | false | Add fallback to CBS extractor | 579 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | liamengland1 |
'expected_warnings': ['Unable to download asset JSON', 'is not a supported codec', 'Unknown MIME type'],
}]
_NETRC_MACHINE = 'vrtnu'
_APIKEY = '3_qhEcPa5JGFROVwu5SWKqJ4mVOIkwlFNMSKwzPDAh8QZOtHqu6L4nD5Q7lk0eXOOG'
_CONTEXT_ID = 'R3595707040'
def _real_initialize(self):
self._login()
... | ```suggestion
try:
auth_info = self._download_json(
'https://accounts.vrt.be/accounts.login', None,
note='Downloading Login data', errnote='Could not get Login data',
headers={}, data=urlencode_postdata({
'loginID': username,
... | 'expected_warnings': ['Unable to download asset JSON', 'is not a supported codec', 'Unknown MIME type'],
}]
_NETRC_MACHINE = 'vrtnu'
_APIKEY = '3_qhEcPa5JGFROVwu5SWKqJ4mVOIkwlFNMSKwzPDAh8QZOtHqu6L4nD5Q7lk0eXOOG'
_CONTEXT_ID = 'R3595707040'
def _real_initialize(self):
self._login()
... | @@ -276,35 +276,49 @@ def _login(self):
if username is None:
return
- auth_data = {
- 'APIKey': self._APIKEY,
- 'targetEnv': 'jssdk',
- 'loginID': username,
- 'password': password,
- 'authMode': 'cookie',
- }
-
- auth_in... | yt_dlp/extractor/canvas.py | 26 | Python | 1 | security | 524 | 51 | 51 | false | [VrtNU] Fix XSRF token | 588 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | SamDecrock |
def _login(self):
username, password = self._get_login_info()
if username is None:
return
# 1. Get Login Data
try:
auth_info = self._download_json(
'https://accounts.vrt.be/accounts.login', None,
note='Login data', errnote='Cou... | ```suggestion
```
Remove unnecessary comments. The code's `note` is self documenting | def _login(self):
username, password = self._get_login_info()
if username is None:
return
auth_info = self._download_json(
'https://accounts.vrt.be/accounts.login', None,
note='Login data', errnote='Could not get Login data',
headers={}, data=... | @@ -276,35 +276,49 @@ def _login(self):
if username is None:
return
- auth_data = {
- 'APIKey': self._APIKEY,
- 'targetEnv': 'jssdk',
- 'loginID': username,
- 'password': password,
- 'authMode': 'cookie',
- }
-
- auth_in... | yt_dlp/extractor/canvas.py | 26 | Python | 0.857 | suggestion | 88 | 51 | 51 | false | [VrtNU] Fix XSRF token | 588 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | SamDecrock |
# Sometimes authentication fails for no good reason, retry
login_attempt = 1
while login_attempt <= 3:
try:
# get XSRF Token
self._request_webpage('https://token.vrt.be/vrtnuinitlogin',
None, note='Requesting XSRF ... | ```suggestion
headers={}, data=urlencode_postdata(post_data))
``` | None, note='Requesting XSRF Token', errnote='Could not get XSRF Token',
query={'provider': 'site', 'destination': 'https://www.vrt.be/vrtnu/'})
post_data = {
'UID': auth_info['UID'],
'UID... | @@ -276,35 +276,49 @@ def _login(self):
if username is None:
return
- auth_data = {
- 'APIKey': self._APIKEY,
- 'targetEnv': 'jssdk',
- 'loginID': username,
- 'password': password,
- 'authMode': 'cookie',
- }
-
- auth_in... | yt_dlp/extractor/canvas.py | 26 | Python | 0.857 | suggestion | 87 | 51 | 51 | false | [VrtNU] Fix XSRF token | 588 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | SamDecrock |
auth_info = self._download_json(
'https://accounts.vrt.be/accounts.login', None,
note='Login data', errnote='Could not get Login data',
headers={}, data=urlencode_postdata({
'loginID': username,
'password': password,
'sessionEx... | ```suggestion
'_csrf': self._get_cookies('https://login.vrt.be').get('OIDCXSRF').value,
``` |
auth_info = self._download_json(
'https://accounts.vrt.be/accounts.login', None,
note='Login data', errnote='Could not get Login data',
headers={}, data=urlencode_postdata({
'loginID': username,
'password': password,
'sessionEx... | @@ -276,35 +276,38 @@ def _login(self):
if username is None:
return
- auth_data = {
- 'APIKey': self._APIKEY,
- 'targetEnv': 'jssdk',
- 'loginID': username,
- 'password': password,
- 'authMode': 'cookie',
- }
-
- auth_in... | yt_dlp/extractor/canvas.py | 26 | Python | 1 | security | 113 | 51 | 51 | false | [VrtNU] Fix XSRF token | 588 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | SamDecrock |
# the browser has been on a page. To stop back buttons?
# After resubmitting, we are redirected to the login form
#
# after the login form, there is a meta-refresh (bypassing some JS)
# that redirects to another bookend ... | ```suggestion
provider_association_redirect, urlh = post_form(provider_login_page_res, 'Logging in', {
mso_info['username_field']: username,
mso_info['password_field': password,
})
``` |
hidden_data = self._hidden_inputs(first_bookend_page)
hidden_data['history'] = 1
provider_login_page_res = self._download_webpage_handle(
urlh.geturl(), video_id, 'Sending first bookend.',
query=hidden_data)
... | @@ -1565,6 +1570,60 @@ def extract_redirect_url(html, url=None, fatal=False):
}), headers={
'Content-Type': 'application/x-www-form-urlencoded'
})
+ elif mso_id == 'slingtv':
+ # sling authentication require... | yt_dlp/extractor/adobepass.py | 26 | Python | 1 | suggestion | 277 | 51 | 51 | false | [adobepass] Add support for Sling TV (mso slingtv) (closes yt-dlp/yt-dlp#300 | 596 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | wesnm |
# extract the form data from the first bookend and re-send via GET
hidden_data = self._hidden_inputs(first_bookend_page)
hidden_data['history'] = 1
provider_login_page_res = self._download_webpage_handle(
urlh.getur... | ```suggestion
last_bookend_page, urlh = self._download_webpage_handle(
provider_refresh_redirect_url, video_id,
'Downloading Auth Association Redirect Page')
``` | })
provider_refresh_redirect_url = extract_redirect_url(
provider_association_redirect, url=urlh.geturl())
last_bookend_page, urlh = self._download_webpage_handle(
provider_refresh_redirect_url, video_id,
... | @@ -1565,6 +1570,60 @@ def extract_redirect_url(html, url=None, fatal=False):
}), headers={
'Content-Type': 'application/x-www-form-urlencoded'
})
+ elif mso_id == 'slingtv':
+ # sling authentication require... | yt_dlp/extractor/adobepass.py | 26 | Python | 1 | security | 233 | 51 | 51 | false | [adobepass] Add support for Sling TV (mso slingtv) (closes yt-dlp/yt-dlp#300 | 596 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | wesnm |
'Content-Type': 'application/json',
'Accept': 'application/json',
})
self._download_webpage(
saml_response_json['SAMLRedirectUri'], video_id,
'Confirming Login', data=urlen... | ```suggestion
# SlingTV has a meta-refresh based authentication, but also
# looks at the tab history to count the number of times the
# browser has been on a page
```
Also, remove the other comments. Comments in general should explain "why" and the cod... | 'Content-Type': 'application/json',
'Accept': 'application/json',
})
self._download_webpage(
saml_response_json['SAMLRedirectUri'], video_id,
'Confirming Login', data=urlen... | @@ -1565,6 +1570,60 @@ def extract_redirect_url(html, url=None, fatal=False):
}), headers={
'Content-Type': 'application/x-www-form-urlencoded'
})
+ elif mso_id == 'slingtv':
+ # sling authentication require... | yt_dlp/extractor/adobepass.py | 26 | Python | 1 | security | 347 | 51 | 51 | false | [adobepass] Add support for Sling TV (mso slingtv) (closes yt-dlp/yt-dlp#300 | 596 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | wesnm |
saml_response_json['SAMLRedirectUri'], video_id,
'Confirming Login', data=urlencode_postdata({
'SAMLResponse': saml_response_json['SAMLResponse'],
'RelayState': relay_state,
}), headers={
... | ```suggestion
provider_association_redirect, urlh = post_form(
provider_login_page_res, 'Logging in', {
mso_info['username_field']: username,
mso_info['password_field']: password
})
``` | saml_response_json['SAMLRedirectUri'], video_id,
'Confirming Login', data=urlencode_postdata({
'SAMLResponse': saml_response_json['SAMLResponse'],
'RelayState': relay_state,
}), headers={
... | @@ -1565,6 +1570,40 @@ def extract_redirect_url(html, url=None, fatal=False):
}), headers={
'Content-Type': 'application/x-www-form-urlencoded'
})
+ elif mso_id == 'slingtv':
+ # SlingTV has a meta-refresh ... | yt_dlp/extractor/adobepass.py | 26 | Python | 1 | suggestion | 316 | 51 | 51 | false | [adobepass] Add support for Sling TV (mso slingtv) (closes yt-dlp/yt-dlp#300 | 596 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | wesnm |
r'SAMLRequest\s*=\s*"(?P<saml_request>.+?)";',
saml_login_page, 'SAMLRequest', group='saml_request')
login_json = {
mso_info['username_field']: username,
mso_info['password_field']: password,
... | ```suggestion
# SlingTV has a meta-refresh based authentication, but also
``` | r'SAMLRequest\s*=\s*"(?P<saml_request>.+?)";',
saml_login_page, 'SAMLRequest', group='saml_request')
login_json = {
mso_info['username_field']: username,
mso_info['password_field']: password,
... | @@ -1565,6 +1570,40 @@ def extract_redirect_url(html, url=None, fatal=False):
}), headers={
'Content-Type': 'application/x-www-form-urlencoded'
})
+ elif mso_id == 'slingtv':
+ # SlingTV has a meta-refresh ... | yt_dlp/extractor/adobepass.py | 26 | Python | 0.857 | security | 99 | 51 | 51 | false | [adobepass] Add support for Sling TV (mso slingtv) (closes yt-dlp/yt-dlp#300 | 596 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | wesnm |
'Accept': 'application/json',
})
self._download_webpage(
saml_response_json['SAMLRedirectUri'], video_id,
'Confirming Login', data=urlencode_postdata({
'SAMLResponse': saml... | ```suggestion
provider_login_page_res, 'Logging in', {
``` | 'Accept': 'application/json',
})
self._download_webpage(
saml_response_json['SAMLRedirectUri'], video_id,
'Confirming Login', data=urlencode_postdata({
'SAMLResponse': saml... | @@ -1565,6 +1570,40 @@ def extract_redirect_url(html, url=None, fatal=False):
}), headers={
'Content-Type': 'application/x-www-form-urlencoded'
})
+ elif mso_id == 'slingtv':
+ # SlingTV has a meta-refresh ... | yt_dlp/extractor/adobepass.py | 26 | Python | 0.857 | suggestion | 84 | 51 | 51 | false | [adobepass] Add support for Sling TV (mso slingtv) (closes yt-dlp/yt-dlp#300 | 596 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | wesnm |
query['unlisted_hash'] = unlisted_hash
download_data = self._download_json(
url, video_id, fatal=False, query=query,
headers={'X-Requested-With': 'XMLHttpRequest'})
if download_data:
source_file = download_data.get('source_file')
if isinstance(... | Name could be better tbh
So open to suggestions. | query['unlisted_hash'] = unlisted_hash
download_data = self._download_json(
url, video_id, fatal=False, query=query,
headers={'X-Requested-With': 'XMLHttpRequest'})
if download_data:
source_file = download_data.get('source_file')
if isinstance(... | @@ -253,6 +253,23 @@ def _extract_original_format(self, url, video_id, unlisted_hash=None):
'quality': 1,
}
+ def _extract_original_format_2(self, video_id): | yt_dlp/extractor/vimeo.py | 26 | Python | 0.286 | suggestion | 49 | 51 | 51 | false | [VimeoIE]Add support to download original file. | 599 | yt-dlp/yt-dlp | 132,642 | Python | Ashish0804 | Ashish0804 |
headers={'X-Requested-With': 'XMLHttpRequest'})
if download_data:
source_file = download_data.get('source_file')
if isinstance(source_file, dict):
download_url = source_file.get('download_url')
if download_url and not source_file.get('is_cold')... | What's supposed to be the guidelines for quotes in an f string?
should it be `"` inside of `'` or other way round? | headers={'X-Requested-With': 'XMLHttpRequest'})
if download_data:
source_file = download_data.get('source_file')
if isinstance(source_file, dict):
download_url = source_file.get('download_url')
if download_url and not source_file.get('is_cold')... | @@ -253,6 +253,23 @@ def _extract_original_format(self, url, video_id, unlisted_hash=None):
'quality': 1,
}
+ def _extract_original_format_2(self, video_id):
+ jwt_response = self._download_json('https://vimeo.com/_rv/viewer', video_id)
+ if jwt_r... | yt_dlp/extractor/vimeo.py | 26 | Python | 0.714 | question | 115 | 51 | 51 | false | [VimeoIE]Add support to download original file. | 599 | yt-dlp/yt-dlp | 132,642 | Python | Ashish0804 | Ashish0804 |
source_name = source_file.get('public_name', 'Original')
if self._is_valid_url(download_url, video_id, '%s video' % source_name):
ext = (try_get(
source_file, lambda x: x['extension'],
compat_str) or ... | idk of any 4 letter extension for a video file.
Lemme know how this should be handled
`determine_ext` this wasn't working | source_name = source_file.get('public_name', 'Original')
if self._is_valid_url(download_url, video_id, '%s video' % source_name):
ext = (try_get(
source_file, lambda x: x['extension'],
compat_str) or ... | @@ -253,6 +253,23 @@ def _extract_original_format(self, url, video_id, unlisted_hash=None):
'quality': 1,
}
+ def _extract_original_format_2(self, video_id):
+ jwt_response = self._download_json('https://vimeo.com/_rv/viewer', video_id)
+ if jwt_r... | yt_dlp/extractor/vimeo.py | 26 | Python | 1 | suggestion | 124 | 51 | 51 | false | [VimeoIE]Add support to download original file. | 599 | yt-dlp/yt-dlp | 132,642 | Python | Ashish0804 | Ashish0804 |
'INNERTUBE_CONTEXT_CLIENT_NAME': 1
},
'web_embedded': {
'INNERTUBE_API_KEY': 'AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8',
'INNERTUBE_CONTEXT': {
'client': {
'clientName': 'WEB_EMBEDDED_PLAYER',
'clientVersion': '1.20210620.0.1',
},
... | `INNERTUBE_HOST` probably not needed since this key isn't restricted to a domain | 'INNERTUBE_CONTEXT_CLIENT_NAME': 1
},
'web_embedded': {
'INNERTUBE_API_KEY': 'AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8',
'INNERTUBE_CONTEXT': {
'client': {
'clientName': 'WEB_EMBEDDED_PLAYER',
'clientVersion': '1.20210620.0.1',
},
... | @@ -100,6 +100,17 @@ def parse_qs(url):
},
'INNERTUBE_CONTEXT_CLIENT_NAME': 67,
},
+ 'web_studio': {
+ 'INNERTUBE_API_KEY': 'AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8',
+ 'INNERTUBE_HOST': 'studio.youtube.com', | yt_dlp/extractor/youtube.py | 26 | Python | 0.357 | suggestion | 80 | 51 | 51 | false | [youtube] Add age-unverified account age-gate bypass (EU) | 600 | yt-dlp/yt-dlp | 132,642 | Python | coletdjnz | zerodytrash |
yt_query.update(self._generate_player_context(sts))
return self._extract_response(
item_id=video_id, ep='player', query=yt_query,
ytcfg=player_ytcfg, headers=headers, fatal=False,
default_client=client,
note='Downloading %s player API JSON' % client.replac... | Probably put this in `_extract_player_responses` where it checks for age_gate:
https://github.com/yt-dlp/yt-dlp/blob/d24734daeaf7a13c304fbdf285622a5a6477f3ef/yt_dlp/extractor/youtube.py#L2485-L2488
Maybe something like: If we detect the response is age gated, check if the previous client was an agegate client & tha... | def _is_unplayable(player_response):
return traverse_obj(player_response, ('playabilityStatus', 'status')) == 'UNPLAYABLE'
def _extract_player_response(self, client, video_id, master_ytcfg, player_ytcfg, identity_token, player_url, initial_pr):
session_index = self._extract_session_index(playe... | @@ -2441,9 +2452,14 @@ def _get_requested_clients(self, url, smuggled_data):
requested_clients.extend(allowed_clients)
else:
self.report_warning(f'Skipping unsupported client {client}')
+
if not requested_clients:
requested_clients = ['android', 'web'... | yt_dlp/extractor/youtube.py | 26 | Python | 0.857 | refactor | 534 | 51 | 51 | false | [youtube] Add age-unverified account age-gate bypass (EU) | 600 | yt-dlp/yt-dlp | 132,642 | Python | coletdjnz | zerodytrash |
'INNERTUBE_API_KEY': 'AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8',
'INNERTUBE_CONTEXT': {
'client': {
'clientName': 'WEB_EMBEDDED_PLAYER',
'clientVersion': '1.20210620.0.1',
},
},
'INNERTUBE_CONTEXT_CLIENT_NAME': 56
},
'web_mus... | this should be a string, "WEB_CREATOR" | 'INNERTUBE_API_KEY': 'AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8',
'INNERTUBE_CONTEXT': {
'client': {
'clientName': 'WEB_EMBEDDED_PLAYER',
'clientVersion': '1.20210620.0.1',
},
},
'INNERTUBE_CONTEXT_CLIENT_NAME': 56
},
'web_mus... | @@ -100,6 +100,17 @@ def parse_qs(url):
},
'INNERTUBE_CONTEXT_CLIENT_NAME': 67,
},
+ 'web_studio': {
+ 'INNERTUBE_API_KEY': 'AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8',
+ 'INNERTUBE_HOST': 'studio.youtube.com',
+ 'INNERTUBE_CONTEXT': {
+ 'client': {
+ ... | yt_dlp/extractor/youtube.py | 26 | Python | 0.286 | suggestion | 38 | 51 | 51 | false | [youtube] Add age-unverified account age-gate bypass (EU) | 600 | yt-dlp/yt-dlp | 132,642 | Python | coletdjnz | zerodytrash |
original_clients = clients
clients = clients[::-1]
creator_client_appended = False
while clients:
client = clients.pop()
player_ytcfg = master_ytcfg if client == 'web' else {}
if 'configs' not in self._configuration_arg('player_skip'):
... | github wont let me comment on the above line. The suggestion is meant to replace lines 2499-2506
```py
client = f'{client}_creator' if self._generate_sapisidhash_header() else f'{client}_agegate'
if client in INNERTUBE_CLIENTS and client not in original_clients:
... | }.get(client)
if not url:
return {}
webpage = self._download_webpage(url, video_id, fatal=False, note=f'Downloading {client} config')
return self.extract_ytcfg(video_id, webpage) or {}
def _extract_player_responses(self, clients, video_id, webpage, master_ytcfg, player_u... | @@ -2487,6 +2500,11 @@ def _extract_player_responses(self, clients, video_id, webpage, master_ytcfg, pl
if client in INNERTUBE_CLIENTS and client not in original_clients:
clients.append(client)
+ # Try web creator (studio) client if session cookies provided (bypass... | yt_dlp/extractor/youtube.py | 26 | Python | 1 | suggestion | 638 | 51 | 51 | false | [youtube] Add age-unverified account age-gate bypass (EU) | 600 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | zerodytrash |
def _extract_player_responses(self, clients, video_id, webpage, master_ytcfg, player_url, identity_token):
initial_pr = None
if webpage:
initial_pr = self._extract_yt_initial_variable(
webpage, self._YT_INITIAL_PLAYER_RESPONSE_RE,
video_id, 'initial player... | The condition `is_agegated` AND `client.endswith('_agegate')` never seems to apply. Because if an agegate client fails, the status is `UNPLAYABLE` and `desktopLegacyAgeGateReason` does not exist in the response. This is not covered by the `_is_agegated()` function. In my case, the creator client is never tried.
Resp... | video_id, 'initial player response')
original_clients = clients
clients = clients[::-1]
def append_client(client_name):
if client_name in INNERTUBE_CLIENTS and client_name not in original_clients:
clients.append(client_name)
while clients:
... | @@ -2514,15 +2514,16 @@ def _extract_player_responses(self, clients, video_id, webpage, master_ytcfg, pl
yield pr
if self._is_agegated(pr):
- client = f'{client}_agegate'
- if client in INNERTUBE_CLIENTS and client not in original_clients:
+ i... | yt_dlp/extractor/youtube.py | 26 | Python | 1 | bug | 1,476 | 51 | 51 | false | [youtube] Add age-unverified account age-gate bypass (EU) | 600 | yt-dlp/yt-dlp | 132,642 | Python | zerodytrash | zerodytrash |
webpage = self._download_webpage(url, video_id, fatal=False, note=f'Downloading {client} config')
return self.extract_ytcfg(video_id, webpage) or {}
def _extract_player_responses(self, clients, video_id, webpage, master_ytcfg, player_url, identity_token):
initial_pr = None
if webpag... | That's how it works for me. Just a suggestion. Try creator client if age-gate bypass fails with `UNPLAYABLE` and cookies are given. (3.)
Non embeddable video without Cookies
```
[youtube] Cr381pDsSsA: Downloading webpage
[youtube] Cr381pDsSsA: Downloading android player API JSON
[youtube] Cr381pDsSsA: Downloadin... | webpage = self._download_webpage(url, video_id, fatal=False, note=f'Downloading {client} config')
return self.extract_ytcfg(video_id, webpage) or {}
def _extract_player_responses(self, clients, video_id, webpage, master_ytcfg, player_url, identity_token):
initial_pr = None
if webpag... | @@ -2503,16 +2506,15 @@ def _extract_player_responses(self, clients, video_id, webpage, master_ytcfg, pl
if pr:
yield pr
- if self._is_agegated(pr):
- if client.endswith('_agegate'):
- # _creator clients can bypass AGE_VERIFICATION_REQUIRED if... | yt_dlp/extractor/youtube.py | 26 | Python | 1 | bug | 1,288 | 51 | 51 | false | [youtube] Add age-unverified account age-gate bypass (EU) | 600 | yt-dlp/yt-dlp | 132,642 | Python | zerodytrash | zerodytrash |
subtitles = self._merge_subtitles(subtitles, tp_subtitles)
if last_e and not formats:
raise last_e
self._sort_formats(formats)
info = self._extract_theplatform_metadata(tp_path, content_id)
info.update({
'id': content_id,
'title': title,
... | ```suggestion
_VALID_URL = r'https?://(?:www\.)?paramountplus\.com/shows/(?P<id>[a-zA-Z0-9-_]+)/?(?:[#?]|$)'
``` | raise last_e
self._sort_formats(formats)
info = self._extract_theplatform_metadata(tp_path, content_id)
info.update({
'id': content_id,
'title': title,
'series': xpath_text(video_data, 'seriesTitle'),
'season_number': int_or_none(xpath... | @@ -122,3 +125,39 @@ def _extract_video_info(self, content_id, site='cbs', mpx_acc=2198311517):
def _real_extract(self, url):
content_id = self._match_id(url)
return self._extract_video_info(content_id)
+
+
+class ParamountPlusSeriesIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?paramo... | yt_dlp/extractor/cbs.py | 26 | Python | 1 | suggestion | 118 | 51 | 51 | false | Add ParamountPlusSeriesIE. | 603 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Ashish0804 |
_TESTS = [{
'url': 'https://www.paramountplus.com/shows/drake-josh',
'playlist_mincount': 50,
'info_dict': {
'id': 'drake-josh',
}
}, {
'url': 'https://www.paramountplus.com/shows/hawaii_five_0/',
'playlist_mincount': 240,
'info_dict': {
... | Since there is only one API call, there is no advantage to yielding the results. ofc, no harm in it either | 'playlist_mincount': 50,
'info_dict': {
'id': 'drake-josh',
}
}, {
'url': 'https://www.paramountplus.com/shows/hawaii_five_0/',
'playlist_mincount': 240,
'info_dict': {
'id': 'hawaii_five_0',
}
}, {
'url': 'https://www.param... | @@ -122,3 +125,39 @@ def _extract_video_info(self, content_id, site='cbs', mpx_acc=2198311517):
def _real_extract(self, url):
content_id = self._match_id(url)
return self._extract_video_info(content_id)
+
+
+class ParamountPlusSeriesIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?paramo... | yt_dlp/extractor/cbs.py | 26 | Python | 0.286 | suggestion | 106 | 33 | 31 | false | Add ParamountPlusSeriesIE. | 603 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Ashish0804 |
}
}, {
'url': 'https://www.paramountplus.com/shows/hawaii_five_0/',
'playlist_mincount': 240,
'info_dict': {
'id': 'hawaii_five_0',
}
}, {
'url': 'https://www.paramountplus.com/shows/spongebob-squarepants/',
'playlist_mincount': 248,
'i... | ```suggestion
show_name = self._match_id(url)
``` | 'url': 'https://www.paramountplus.com/shows/hawaii_five_0/',
'playlist_mincount': 240,
'info_dict': {
'id': 'hawaii_five_0',
}
}, {
'url': 'https://www.paramountplus.com/shows/spongebob-squarepants/',
'playlist_mincount': 248,
'info_dict': {
... | @@ -122,3 +125,39 @@ def _extract_video_info(self, content_id, site='cbs', mpx_acc=2198311517):
def _real_extract(self, url):
content_id = self._match_id(url)
return self._extract_video_info(content_id)
+
+
+class ParamountPlusSeriesIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?paramo... | yt_dlp/extractor/cbs.py | 26 | Python | 0.857 | suggestion | 59 | 28 | 26 | false | Add ParamountPlusSeriesIE. | 603 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Ashish0804 |
}]
def _real_extract(self, url):
video_id = self._match_id(url)
webpage = self._download_webpage('https://www.openrec.tv/live/%s' % video_id, video_id)
window_stores = self._parse_json(
self._search_regex(r'(?m)window\.pageStore\s*=\s*(\{.+?\});$', webpage, 'window.pageStor... | Why so complicated?
Isnt this the same as L106-108? | 'url': 'https://www.openrec.tv/live/wez93eqvjzl',
'only_matching': True,
}]
def _real_extract(self, url):
video_id = self._match_id(url)
webpage = self._download_webpage('https://www.openrec.tv/live/%s' % video_id, video_id)
window_stores = self._parse_json(
... | @@ -0,0 +1,127 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+from ..utils import ExtractorError, try_get, unified_strdate
+
+
+class OpenRecBaseIE(InfoExtractor):
+ pass
+
+
+class OpenRecIE(OpenRecBaseIE):
+ IE_NAME = 'openrec'
+ _VALID_URL = r'https?://(?:... | yt_dlp/extractor/openrec.py | 26 | Python | 0.143 | question | 52 | 51 | 51 | false | [openrec] add support for openrec.tv | 624 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Lesmiscore |
from .common import InfoExtractor
from ..compat import compat_HTTPError
from ..utils import (
ExtractorError,
RegexNotFoundError,
strip_or_none,
try_get
)
class RCTIPlusBaseIE(InfoExtractor):
def _real_initialize(self):
self._AUTH_KEY = self._download_json(
'https://api.rctiplu... | ```suggestion
_VALID_URL = r'https://www\.rctiplus\.com/(?:programs/\d+?/.*?/)?(?P<type>episode|clip|extra|live-event|missed-event)/(?P<id>\d+)/(?P<display_id>[^/?#&]+)'
``` | from .common import InfoExtractor
from ..compat import compat_HTTPError
from ..utils import (
dict_get,
ExtractorError,
strip_or_none,
try_get
)
class RCTIPlusBaseIE(InfoExtractor):
def _real_initialize(self):
self._AUTH_KEY = self._download_json(
'https://api.rctiplus.com/api/... | @@ -30,7 +32,7 @@ def _call_api(self, url, video_id, note=None):
class RCTIPlusIE(RCTIPlusBaseIE):
- _VALID_URL = r'https://www\.rctiplus\.com/programs/\d+?/.*?/(?P<type>episode|clip|extra)/(?P<id>\d+)/(?P<display_id>[^/?#&]+)'
+ _VALID_URL = r'https://www\.rctiplus\.com/(programs/\d+?/.*?/)?(?P<type>episode... | yt_dlp/extractor/rcti.py | 26 | Python | 1 | suggestion | 179 | 51 | 51 | false | [RCTIPlus] Support events and TV | 625 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | MinePlayersPE |
'https://ff84ae928c3b33064b76dec08f12500465e59a6f.cws.conviva.com/0/wsg', display_id,
'Creating Conviva session', 'Failed to create Conviva session',
fatal=False, data=json.dumps(conviva_json_data).encode('utf-8'))
if conviva_json_res and conviva_json_res.get(... | ```suggestion
else:
raise e
``` | 'https://ff84ae928c3b33064b76dec08f12500465e59a6f.cws.conviva.com/0/wsg', display_id,
'Creating Conviva session', 'Failed to create Conviva session',
fatal=False, data=json.dumps(conviva_json_data).encode('utf-8'))
if conviva_json_res and conviva_json_res.get(... | @@ -142,35 +191,44 @@ def _real_extract(self, url):
'id': 'landscape_image',
'url': '%s%d%s' % (image_path, 2000, video_meta['landscape_image'])
})
-
- formats = self._extract_m3u8_formats(video_url, display_id, 'mp4', headers={'Referer': 'https://www.rctiplus.com/'... | yt_dlp/extractor/rcti.py | 26 | Python | 0.857 | suggestion | 62 | 51 | 51 | false | [RCTIPlus] Support events and TV | 625 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | MinePlayersPE |
if video_meta.get('portrait_image'):
thumbnails.append({
'id': 'portrait_image',
'url': '%s%d%s' % (image_path, 2000, video_meta['portrait_image']) # 2000px seems to be the highest resolution that can be given
})
if video_meta.get('landscape_image... | ```suggestion
'title': dict_get(video_meta, ('title', 'name')) or dict_get(video_json, ('content_name', 'assets_name')),
``` | if video_meta.get('portrait_image'):
thumbnails.append({
'id': 'portrait_image',
'url': '%s%d%s' % (image_path, 2000, video_meta['portrait_image']) # 2000px seems to be the highest resolution that can be given
})
if video_meta.get('landscape_image... | @@ -142,35 +191,44 @@ def _real_extract(self, url):
'id': 'landscape_image',
'url': '%s%d%s' % (image_path, 2000, video_meta['landscape_image'])
})
-
- formats = self._extract_m3u8_formats(video_url, display_id, 'mp4', headers={'Referer': 'https://www.rctiplus.com/'... | yt_dlp/extractor/rcti.py | 26 | Python | 1 | suggestion | 138 | 51 | 51 | false | [RCTIPlus] Support events and TV | 625 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | MinePlayersPE |
for f in formats:
if 'akamaized' in f['url'] or 'cloudfront' in f['url']:
f.setdefault('http_headers', {})['Referer'] = 'https://www.rctiplus.com/' # Referer header is required for akamai/cloudfront CDNs
self._sort_formats(formats)
return {
'id': video_... | You can also just set `live_status` and the other two will be automatically set | raise e
for f in formats:
if 'akamaized' in f['url'] or 'cloudfront' in f['url']:
f.setdefault('http_headers', {})['Referer'] = 'https://www.rctiplus.com/' # Referer header is required for akamai/cloudfront CDNs
self._sort_formats(formats)
return {
... | @@ -142,35 +191,44 @@ def _real_extract(self, url):
'id': 'landscape_image',
'url': '%s%d%s' % (image_path, 2000, video_meta['landscape_image'])
})
-
- formats = self._extract_m3u8_formats(video_url, display_id, 'mp4', headers={'Referer': 'https://www.rctiplus.com/'... | yt_dlp/extractor/rcti.py | 26 | Python | 0.357 | suggestion | 79 | 51 | 51 | false | [RCTIPlus] Support events and TV | 625 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | MinePlayersPE |
'format': 'bestvideo',
}
}, {
# Returned video will always change
'url': 'https://www.rctiplus.com/live-event',
'only_matching': True,
}, {
# Returned video will also always change
'url': 'https://www.rctiplus.com/missed-event',
'only_matching'... | btw, u can use fstrings to simplify this and the api callls if u want | # coding: utf-8
from __future__ import unicode_literals
import itertools
import json
import random
import re
import time
from .common import InfoExtractor
from ..compat import compat_HTTPError
from ..utils import (
dict_get,
ExtractorError,
strip_or_none,
try_get
)
class RCTIPlusBaseIE(InfoExtractor... | @@ -253,3 +316,44 @@ def _real_extract(self, url):
display_id, 'Downloading extra entries', metadata))
return self.playlist_result(itertools.chain(*entries), series_id, series_meta.get('title'), series_meta.get('summary'), **metadata)
+
+
+class RCTIPlusTVIE(RCTIPlusBase... | yt_dlp/extractor/rcti.py | 26 | Python | 0.357 | refactor | 69 | 27 | 356 | false | [RCTIPlus] Support events and TV | 625 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | MinePlayersPE |
'upload_date': '20190101',
},
'params': {
'skip_download': True,
'format': 'bestvideo',
}
}, {
# Returned video will always change
'url': 'https://www.rctiplus.com/live-event',
'only_matching': True,
}, {
# Returned vide... | ```suggestion
r'url\s*:\s*["\']https://api\.rctiplus\.com/api/v./(?P<type>[^/]+)/(?P<id>\d+)/url', webpage, 'video link', group=('type', 'id'))
```
a bit more robust | 'upload_date': '20190101',
},
'params': {
'skip_download': True,
'format': 'bestvideo',
}
}, {
# Returned video will always change
'url': 'https://www.rctiplus.com/live-event',
'only_matching': True,
}, {
# Returned vide... | @@ -351,9 +350,6 @@ def _real_extract(self, url):
match = re.match(self._VALID_URL, url).groupdict()
tv_id = match.get('tvname') or match.get('eventname')
webpage = self._download_webpage(url, tv_id)
- event_re = re.search(
- r'url ?: ?"https://api\.rctiplus\.com/api/v./(?P<... | yt_dlp/extractor/rcti.py | 26 | Python | 1 | suggestion | 182 | 28 | 28 | false | [RCTIPlus] Support events and TV | 625 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | MinePlayersPE |
uploader = json_video.get('author')
media_formats = json_video.get('sources', [])
for media_format in media_formats:
media_sources = media_formats[media_format]
for source in media_sources:
formats.append({
... | will be automatically set from timestamp | media_sources = media_formats[media_format]
for source in media_sources:
formats.append({
'format_id': media_format,
'quality': int_or_none(media_format[:-1]),
'url': source.get('src')
... | @@ -124,14 +131,19 @@ def _real_extract(self, url):
r'(?:Author|Writer)\s*<a[^>]+>([^<]+)'), webpage, 'uploader',
fatal=False)
- timestamp = unified_timestamp(self._html_search_regex(
+ timestamp = self._html_search_regex(
(r'<dt>\s*Uploaded\s*</dt>\s*<dd>... | yt_dlp/extractor/newgrounds.py | 26 | Python | 0.071 | suggestion | 40 | 51 | 51 | false | [Newgrounds] Improve extractor and fix broken playlist extractor | 627 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | u-spec-png |
def _real_extract(self, url):
media_id = self._match_id(url)
formats = []
uploader = None
webpage = self._download_webpage(url, media_id)
title = self._html_search_regex(
r'<title>([^>]+)</title>', webpage, 'title')
media_url_string = self._search_regex(... | This is not a suggestion or comment but a question
Why not use `fatal=True`?
```py
if fatal:
raise ExtractorError(errmsg, sys.exc_info()[2], cause=err)
```
this how the `fatal` argument is used. | formats = []
uploader = None
webpage = self._download_webpage(url, media_id)
title = self._html_search_regex(
r'<title>([^>]+)</title>', webpage, 'title')
media_url_string = self._search_regex(
r'"url"\s*:\s*("[^"]+"),', webpage, 'media url', default=Non... | @@ -73,38 +102,16 @@ def _real_extract(self, url):
'format_id': 'source',
'quality': 1,
}]
-
- max_resolution = int_or_none(self._search_regex(
- r'max_resolution["\']\s*:\s*(\d+)', webpage, 'max resolution',
- default=None))
- ... | yt_dlp/extractor/newgrounds.py | 26 | Python | 1 | refactor | 230 | 51 | 51 | false | [Newgrounds] Improve extractor and fix broken playlist extractor | 627 | yt-dlp/yt-dlp | 132,642 | Python | Ashish0804 | u-spec-png |
from .common import InfoExtractor
from ..utils import (
extract_attributes,
int_or_none,
parse_duration,
parse_filesize,
parse_count,
unified_timestamp,
)
class NewgroundsIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?newgrounds\.com/(?:audio/listen|portal/view)/(?P<id>\d+)(?:/forma... | nothing wrong with using `\'` but you can also use md5.
paste the text here `https://www.md5hashgenerator.com/` and then add it as
`'description': 'md5:<md5hash>',` |
from .common import InfoExtractor
from ..utils import (
extract_attributes,
int_or_none,
parse_count,
parse_duration,
parse_filesize,
unified_timestamp,
)
class NewgroundsIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?newgrounds\.com/(?:audio/listen|portal/view)/(?P<id>\d+)(?:/forma... | @@ -4,54 +4,81 @@
from .common import InfoExtractor
from ..utils import (
- ExtractorError,
extract_attributes,
int_or_none,
parse_duration,
parse_filesize,
+ parse_count,
unified_timestamp,
)
class NewgroundsIE(InfoExtractor):
- _VALID_URL = r'https?://(?:www\.)?newgrounds\.... | yt_dlp/extractor/newgrounds.py | 26 | Python | 0.714 | bug | 167 | 51 | 51 | false | [Newgrounds] Improve extractor and fix broken playlist extractor | 627 | yt-dlp/yt-dlp | 132,642 | Python | Ashish0804 | u-spec-png |
'status': 'finished',
'elapsed': elapsed,
}, info_dict)
def _prepare_external_frag_download(self, ctx):
if 'live' not in ctx:
ctx['live'] = False
if not ctx['live']:
total_frags_str = '%d' % ctx['total_frags']
ad_frags = ctx.get('a... | ```suggestion
def download_and_append_fragments(self, ctx, fragments, info_dict, *, pack_func=None, finish_func=None):
```
might as well do this, then
PS: needs related changes below | 'status': 'finished',
'elapsed': elapsed,
}, info_dict)
def _prepare_external_frag_download(self, ctx):
if 'live' not in ctx:
ctx['live'] = False
if not ctx['live']:
total_frags_str = '%d' % ctx['total_frags']
ad_frags = ctx.get('a... | @@ -327,7 +327,7 @@ def _prepare_external_frag_download(self, ctx):
'fragment_index': 0,
})
- def download_and_append_fragments(self, ctx, fragments, info_dict, pack_func=None):
+ def download_and_append_fragments(self, ctx, fragments, info_dict, pack_func=None, *, fin_func=None): | yt_dlp/downloader/fragment.py | 26 | Python | 1 | suggestion | 194 | 51 | 51 | false | Merge daisy-chained duplicate cues in segmented WebVTT streams | 638 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | fstirlitz |
(?P<id>\d{10})
'''
_TESTS = [{
# contentData
'url': 'https://www.hotstar.com/can-you-not-spread-rumours/1000076273',
'info_dict': {
'id': '1000076273',
'ext': 'mp4',
'title': 'Can You Not Spread Rumours?',
... | No need to repeat same test. Make this `only_matching` | (?P<id>\d{10})
'''
_TESTS = [{
'url': 'https://www.hotstar.com/can-you-not-spread-rumours/1000076273',
'info_dict': {
'id': '1000076273',
'ext': 'mp4',
'title': 'Can You Not Spread Rumours?',
'description': 'm... | @@ -96,56 +110,125 @@ class HotStarIE(HotStarBaseIE):
'upload_date': '20151111',
'duration': 381,
},
- 'params': {
- # m3u8 download
- 'skip_download': True,
- }
}, {
- # contentDetail
+ # contentData
+ 'url': 'hotstar:1000... | yt_dlp/extractor/hotstar.py | 26 | Python | 0.357 | suggestion | 54 | 51 | 51 | false | [HotStar]Rewrite HotStarIE to use API. | 640 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Ashish0804 |
'duration': 1219,
'channel': 'StarPlus',
'channel_id': 3,
'series': 'Ek Bhram - Sarvagun Sampanna',
'season': 'Chapter 1',
'season_number': 1,
'season_id': 6771,
'episode': 'Janhvi Targets Suman',
'episode_number... | DRY
```py
ep = {'tv': 'episode', None: 'content', 'movies': 'movie', 'sports': 'match'} #maybe make this a class property?
video_type = ep.get(video_type, video_type)
video_data = self._call_api(f'o/v1/{video_type}/detail', video_id)['body']['results']['item']
``` | for playback_set in playback_sets:
if not isinstance(playback_set, dict):
continue
format_url = url_or_none(playback_set.get('playbackUrl'))
if not format_url:
continue
format_url = re.sub(
r'(?<=//staragvod)(\d)', r... | @@ -96,56 +110,125 @@ class HotStarIE(HotStarBaseIE):
'upload_date': '20151111',
'duration': 381,
},
- 'params': {
- # m3u8 download
- 'skip_download': True,
- }
}, {
- # contentDetail
+ # contentData
+ 'url': 'hotstar:1000... | yt_dlp/extractor/hotstar.py | 26 | Python | 1 | refactor | 296 | 51 | 51 | false | [HotStar]Rewrite HotStarIE to use API. | 640 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Ashish0804 |
_GEO_BYPASS = False
def _real_extract(self, url):
mobj = re.match(self._VALID_URL, url)
video_id = mobj.group('id')
video_type = mobj.group('type')
cookies = self._get_cookies(url)
if video_type == 'movies':
video_data = self._call_api('o/v1/movie/detail', vi... | Doesn't this re-introduce #396? | ext = determine_ext(format_url)
try:
if 'package:hls' in tags or ext == 'm3u8':
hls_formats, hls_subs = self._extract_m3u8_formats_and_subtitles(
format_url, video_id, 'mp4',
entry_protocol='m3u8_native',
... | @@ -96,56 +110,125 @@ class HotStarIE(HotStarBaseIE):
'upload_date': '20151111',
'duration': 381,
},
- 'params': {
- # m3u8 download
- 'skip_download': True,
- }
}, {
- # contentDetail
+ # contentData
+ 'url': 'hotstar:1000... | yt_dlp/extractor/hotstar.py | 26 | Python | 0.071 | question | 31 | 51 | 51 | false | [HotStar]Rewrite HotStarIE to use API. | 640 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Ashish0804 |
_TYPE = {
'movies': 'movie',
'sports': 'match',
'episode': 'episode',
'tv': 'episode',
None: 'content',
}
def _real_extract(self, url):
mobj = re.match(self._VALID_URL, url)
video_id = mobj.group('id')
video_type = mobj.group('type')
c... | ```suggestion
# Required to fix https://github.com/yt-dlp/yt-dlp/issues/396
st = urlh.headers.get('x-origin-date')
``` | _TYPE = {
'movies': 'movie',
'sports': 'match',
'episode': 'episode',
'tv': 'episode',
None: 'content',
}
def _real_extract(self, url):
mobj = re.match(self._VALID_URL, url)
video_id = mobj.group('id')
video_type = mobj.group('type')
c... | @@ -96,54 +109,86 @@ class HotStarIE(HotStarBaseIE):
'upload_date': '20151111',
'duration': 381,
},
- 'params': {
- # m3u8 download
- 'skip_download': True,
- }
}, {
- # contentDetail
+ 'url': 'hotstar:1000076273',
+ 'only_... | yt_dlp/extractor/hotstar.py | 26 | Python | 1 | suggestion | 137 | 51 | 51 | false | [HotStar]Rewrite HotStarIE to use API. | 640 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Ashish0804 |
def _extract_response(self, item_id, query, note='Downloading API JSON', headers=None,
ytcfg=None, check_get_keys=None, ep='browse', fatal=True, api_hostname=None,
default_client='web'):
response = None
last_error = None
count = -1
... | Sometimes the API errors may return a HTML page (e.g. dead endpoint).
`_parse_json` has no way of silently reporting the error, so this is another way I thought of. |
def _extract_response(self, item_id, query, note='Downloading API JSON', headers=None,
ytcfg=None, check_get_keys=None, ep='browse', fatal=True, api_hostname=None,
default_client='web'):
response = None
last_error = None
count = -1
... | @@ -793,7 +794,8 @@ def _extract_response(self, item_id, query, note='Downloading API JSON', headers
note='%s%s' % (note, ' (retry #%d)' % count if count else ''))
except ExtractorError as e:
if isinstance(e.cause, network_exceptions):
- if isinstanc... | yt_dlp/extractor/youtube.py | 26 | Python | 0.643 | suggestion | 165 | 51 | 51 | false | [youtube:api] Extract error messages from HTTPError response | 644 | yt-dlp/yt-dlp | 132,642 | Python | coletdjnz | coletdjnz |
# coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import parse_iso8601
class BlackboardCollaborateIE(InfoExtractor):
_VALID_URL = r'https?://(?P<zone>[a-z-]+)\.bbcollab\.com/(?:[a-z-]+/)+(?P<id>[^/]+)'
_TESTS = [
{
'url': 'ht... | Looks a bit broad, doesn’t it? The testcases only cover cases where the path before the video ID is `/collab/ui/session/playback/load/` and `/recording/`. Are there any others? | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import parse_iso8601
class BlackboardCollaborateIE(InfoExtractor):
_VALID_URL = r'''(?x)
https?://
(?P<region>[a-z-]+)\.bbcollab\.com/
... | @@ -0,0 +1,67 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+import re
+
+from .common import InfoExtractor
+from ..utils import parse_iso8601
+
+
+class BlackboardCollaborateIE(InfoExtractor):
+ _VALID_URL = r'https?://(?P<zone>[a-z-]+)\.bbcollab\.com/(?:[a-z-]+/)+(?P<id>[^/]+)' | yt_dlp/extractor/blackboardcollaborate.py | 11 | Python | 0.5 | question | 176 | 36 | 36 | false | [blackboardcollaborate] Add new extractor | 646 | yt-dlp/yt-dlp | 132,642 | Python | fstirlitz | mezbaul-h |
'url': 'https://eu.bbcollab.com/recording/51ed7b50810c4444a106e48cefb3e6b5',
'only_matching': True,
},
{
'url': 'https://au.bbcollab.com/collab/ui/session/playback/load/2bccf7165d7c419ab87afc1ec3f3bb15',
'only_matching': True,
},
]
def _re... | ```suggestion
formats = [{'format_id': k, 'url': url} for k, url in streams.items()]
``` | 'only_matching': True,
},
{
'url': 'https://ca.bbcollab.com/collab/ui/session/playback/load/b6399dcb44df4f21b29ebe581e22479d',
'only_matching': True,
},
{
'url': 'https://eu.bbcollab.com/recording/51ed7b50810c4444a106e48cefb3e6b5',
... | @@ -0,0 +1,67 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+import re
+
+from .common import InfoExtractor
+from ..utils import parse_iso8601
+
+
+class BlackboardCollaborateIE(InfoExtractor):
+ _VALID_URL = r'https?://(?P<zone>[a-z-]+)\.bbcollab\.com/(?:[a-z-]+/)+(?P<id>[^/]+)'
+ _TESTS = [
+ ... | yt_dlp/extractor/blackboardcollaborate.py | 26 | Python | 0.857 | suggestion | 98 | 35 | 36 | false | [blackboardcollaborate] Add new extractor | 646 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | mezbaul-h |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.