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
'description': 'md5:35074f6190cef52b05dd133bb2ef460e', 'upload_date': '20220525', 'timestamp': 1653460637, 'release_date': '20220525', 'thumbnail': 'https://images.noiceid.cc/catalog/content-1653460337625', 'title': 'Eps 1: Dijodohin Sama Anak Pak ...
```suggestion for url in variadic(media_url): ```
'release_timestamp': 1653488220, 'description': 'md5:35074f6190cef52b05dd133bb2ef460e', 'upload_date': '20220525', 'timestamp': 1653460637, 'release_date': '20220525', 'thumbnail': 'https://images.noiceid.cc/catalog/content-1653460337625', ...
@@ -0,0 +1,115 @@ +from .common import InfoExtractor +from ..utils import ( + clean_html, + determine_ext, + int_or_none, + parse_iso8601, + traverse_obj, +) + + +class NoicePodcastIE(InfoExtractor): + _VALID_URL = r'https?://open\.noice\.id/content/(?P<id>[a-fA-F0-9-]+)' + _TESTS = [{ + 'ur...
yt_dlp/extractor/noice.py
26
Python
0.571
suggestion
59
51
51
false
[extractor/noice] Add NoicePodcast extractor
5,621
yt-dlp/yt-dlp
132,642
Python
pukkandan
HobbyistDev
'modified_date': '20221121', 'categories': ['Cerita dan Drama'], 'duration': 1830, 'season': 'Season 1', 'channel_id': '60193f6b-d24d-4b23-913b-ceed5a731e74', 'dislike_count': int, 'like_count': int, 'comment_count': int, ...
```suggestion 'url': url, 'ext': 'mp3', 'vcodec': 'none', 'acodec': 'mp3', ``` The vcodec is especially important so that yt-dlp can tell it's an audio-only format
'season_number': 1, 'modified_date': '20221121', 'categories': ['Cerita dan Drama'], 'duration': 1830, 'season': 'Season 1', 'channel_id': '60193f6b-d24d-4b23-913b-ceed5a731e74', 'dislike_count': int, 'like_count': int, ...
@@ -0,0 +1,115 @@ +from .common import InfoExtractor +from ..utils import ( + clean_html, + determine_ext, + int_or_none, + parse_iso8601, + traverse_obj, +) + + +class NoicePodcastIE(InfoExtractor): + _VALID_URL = r'https?://open\.noice\.id/content/(?P<id>[a-fA-F0-9-]+)' + _TESTS = [{ + 'ur...
yt_dlp/extractor/noice.py
26
Python
0.786
suggestion
249
51
51
false
[extractor/noice] Add NoicePodcast extractor
5,621
yt-dlp/yt-dlp
132,642
Python
pukkandan
HobbyistDev
from ..utils import ( OnDemandPagedList, traverse_obj, unified_strdate, ) class GronkhIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?gronkh\.tv/(?:watch/)?streams?/(?P<id>\d+)' _TESTS = [{ 'url': 'https://gronkh.tv/streams/657', 'info_dict': { 'id': '657', ...
this `only_matching` test case is redundant ```suggestion ```
from ..utils import ( OnDemandPagedList, traverse_obj, unified_strdate, ) class GronkhIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?gronkh\.tv/(?:watch/)?streams?/(?P<id>\d+)' _TESTS = [{ 'url': 'https://gronkh.tv/streams/657', 'info_dict': { 'id': '657', ...
@@ -9,23 +9,39 @@ class GronkhIE(InfoExtractor): - _VALID_URL = r'https?://(?:www\.)?gronkh\.tv/(?:watch/)?stream/(?P<id>\d+)' + _VALID_URL = r'https?://(?:www\.)?gronkh\.tv/(?:watch/)?streams?/(?P<id>\d+)' _TESTS = [{ + 'url': 'https://gronkh.tv/streams/657', + 'info_dict': { + ...
yt_dlp/extractor/gronkh.py
26
Python
0.571
suggestion
63
51
51
false
added the new url format for Gronkh and tests [Issue #5531]
5,628
yt-dlp/yt-dlp
132,642
Python
bashonly
muddi900
'thumbnail': r're:https://.+\.webp.*', 'like_count': int, 'view_count': int, 'comment_count': int, 'repost_count': int, 'uploader_url': 'https://www.tiktok.com/@MS4wLjABAAAAXcNoOEOxVyBzuII_E--T0MeCrLP0ay1Sm6x_n3dluiWEoWZD0VlQOytwad4W0i0n', ...
IMO we should try to keep the metadata fields consistent with the other TikTok IEs, in which case the `@username`/`unique_id`/`uniqueId` would instead be `uploader` ```suggestion uploader = self._match_id(url) ```
_UPLOADER_URL_FORMAT = 'https://www.douyin.com/user/%s' _WEBPAGE_HOST = 'https://www.douyin.com/' def _real_extract(self, url): video_id = self._match_id(url) try: return self._extract_aweme_app(video_id) except ExtractorError as e: e.expected = True ...
@@ -911,3 +911,47 @@ def _real_extract(self, url): if self.suitable(new_url): # Prevent infinite loop in case redirect fails raise UnsupportedError(new_url) return self.url_result(new_url) + + +class TikTokLiveIE(InfoExtractor): + _VALID_URL = r'https?://(?:www\.)?tiktok\.com/@(?P<id>...
yt_dlp/extractor/tiktok.py
26
Python
0.857
suggestion
224
51
51
false
[extractor/TikTok] Add `TikTokLiveIE` to download Live Stream
5,637
yt-dlp/yt-dlp
132,642
Python
bashonly
JC-Chung
'like_count': int, 'view_count': int, 'comment_count': int, 'repost_count': int, 'uploader_url': 'https://www.tiktok.com/@MS4wLjABAAAAXcNoOEOxVyBzuII_E--T0MeCrLP0ay1Sm6x_n3dluiWEoWZD0VlQOytwad4W0i0n', } }, { 'url': 'https://vt.tiktok.com/ZS...
This `User-Agent` workaround may not work for all users (possibly a fingerprinting or regional thing). It's fine for now, but looking ahead, do you know of any other source for the `room_id` value besides the webpage?
_WEBPAGE_HOST = 'https://www.douyin.com/' def _real_extract(self, url): video_id = self._match_id(url) try: return self._extract_aweme_app(video_id) except ExtractorError as e: e.expected = True self.to_screen(f'{e}; trying with webpage') we...
@@ -911,3 +911,47 @@ def _real_extract(self, url): if self.suitable(new_url): # Prevent infinite loop in case redirect fails raise UnsupportedError(new_url) return self.url_result(new_url) + + +class TikTokLiveIE(InfoExtractor): + _VALID_URL = r'https?://(?:www\.)?tiktok\.com/@(?P<id>...
yt_dlp/extractor/tiktok.py
26
Python
0.643
question
219
51
51
false
[extractor/TikTok] Add `TikTokLiveIE` to download Live Stream
5,637
yt-dlp/yt-dlp
132,642
Python
bashonly
JC-Chung
} }, { 'url': 'https://vt.tiktok.com/ZSe4FqkKd', 'only_matching': True, }] def _real_extract(self, url): new_url = self._request_webpage( HEADRequest(url), self._match_id(url), headers={'User-Agent': 'facebookexternalhit/1.1'}).geturl() if self.suitable(n...
```suggestion video_js_data = self._download_json( f'https://www.tiktok.com/api/live/detail/?aid=1988&roomID={room_id}', room_id) ```
try: return self._extract_aweme_app(video_id) except ExtractorError as e: e.expected = True self.to_screen(f'{e}; trying with webpage') webpage = self._download_webpage(url, video_id) render_data_json = self._search_regex( r'<script [^>]*\...
@@ -911,3 +911,47 @@ def _real_extract(self, url): if self.suitable(new_url): # Prevent infinite loop in case redirect fails raise UnsupportedError(new_url) return self.url_result(new_url) + + +class TikTokLiveIE(InfoExtractor): + _VALID_URL = r'https?://(?:www\.)?tiktok\.com/@(?P<id>...
yt_dlp/extractor/tiktok.py
26
Python
0.714
suggestion
164
51
51
false
[extractor/TikTok] Add `TikTokLiveIE` to download Live Stream
5,637
yt-dlp/yt-dlp
132,642
Python
bashonly
JC-Chung
'only_matching': True, }] def _real_extract(self, url): new_url = self._request_webpage( HEADRequest(url), self._match_id(url), headers={'User-Agent': 'facebookexternalhit/1.1'}).geturl() if self.suitable(new_url): # Prevent infinite loop in case redirect fails ...
you can inline these in the return (do include `thumbnail`) IMO title shouldn't be fatal, you could change `fatal=True` to `default=''`
e.expected = True self.to_screen(f'{e}; trying with webpage') webpage = self._download_webpage(url, video_id) render_data_json = self._search_regex( r'<script [^>]*\bid=[\'"]RENDER_DATA[\'"][^>]*>(%7B.+%7D)</script>', webpage, 'render data', default=None)...
@@ -911,3 +911,47 @@ def _real_extract(self, url): if self.suitable(new_url): # Prevent infinite loop in case redirect fails raise UnsupportedError(new_url) return self.url_result(new_url) + + +class TikTokLiveIE(InfoExtractor): + _VALID_URL = r'https?://(?:www\.)?tiktok\.com/@(?P<id>...
yt_dlp/extractor/tiktok.py
26
Python
0.571
suggestion
138
51
51
false
[extractor/TikTok] Add `TikTokLiveIE` to download Live Stream
5,637
yt-dlp/yt-dlp
132,642
Python
bashonly
JC-Chung
def _real_extract(self, url): new_url = self._request_webpage( HEADRequest(url), self._match_id(url), headers={'User-Agent': 'facebookexternalhit/1.1'}).geturl() if self.suitable(new_url): # Prevent infinite loop in case redirect fails raise UnsupportedError(new_url) ...
```suggestion # status = 2 if live else 4 is_live = traverse_obj(video_js_data, ('LiveRoomInfo', 'status'), expected_type=int, default=4) == 2 ```
webpage = self._download_webpage(url, video_id) render_data_json = self._search_regex( r'<script [^>]*\bid=[\'"]RENDER_DATA[\'"][^>]*>(%7B.+%7D)</script>', webpage, 'render data', default=None) if not render_data_json: # TODO: Run verification challenge code ...
@@ -911,3 +911,47 @@ def _real_extract(self, url): if self.suitable(new_url): # Prevent infinite loop in case redirect fails raise UnsupportedError(new_url) return self.url_result(new_url) + + +class TikTokLiveIE(InfoExtractor): + _VALID_URL = r'https?://(?:www\.)?tiktok\.com/@(?P<id>...
yt_dlp/extractor/tiktok.py
26
Python
0.857
suggestion
173
51
51
false
[extractor/TikTok] Add `TikTokLiveIE` to download Live Stream
5,637
yt-dlp/yt-dlp
132,642
Python
bashonly
JC-Chung
class TikTokLiveIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?tiktok\.com/@(?P<id>[\w\.-]+)/live' IE_NAME = 'tiktok:live' def _real_extract(self, url): uploader_id = self._match_id(url) webpage = self._download_webpage(url, uploader_id, headers={'User-Agent': 'User-Agent:Mozilla/5.0...
move these into return ```suggestion if is_live: ```
expected = not cookies.get('s_v_web_id') or not cookies.get('ttwid') raise ExtractorError( 'Fresh cookies (not necessarily logged in) are needed', expected=expected) render_data = self._parse_json( render_data_json, video_id, transform_source=compat_urllib_pa...
@@ -911,3 +911,47 @@ def _real_extract(self, url): if self.suitable(new_url): # Prevent infinite loop in case redirect fails raise UnsupportedError(new_url) return self.url_result(new_url) + + +class TikTokLiveIE(InfoExtractor): + _VALID_URL = r'https?://(?:www\.)?tiktok\.com/@(?P<id>...
yt_dlp/extractor/tiktok.py
26
Python
0.643
suggestion
67
44
51
false
[extractor/TikTok] Add `TikTokLiveIE` to download Live Stream
5,637
yt-dlp/yt-dlp
132,642
Python
bashonly
JC-Chung
class TikTokLiveIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?tiktok\.com/@(?P<id>[\w\.-]+)/live' IE_NAME = 'tiktok:live' def _real_extract(self, url): uploader_id = self._match_id(url) webpage = self._download_webpage(url, uploader_id, headers={'User-Agent': 'User-Agent:Mozilla/5.0'...
`snake_case` for var names ```suggestion live_url = traverse_obj(video_js_data, ('LiveRoomInfo', 'liveUrl'), expected_type=url_or_none) if not live_url: raise ExtractorError('No stream URL found') ```
raise ExtractorError( 'Fresh cookies (not necessarily logged in) are needed', expected=expected) render_data = self._parse_json( render_data_json, video_id, transform_source=compat_urllib_parse_unquote) return self._parse_aweme_video_web(get_first(render_data, ('...
@@ -911,3 +911,47 @@ def _real_extract(self, url): if self.suitable(new_url): # Prevent infinite loop in case redirect fails raise UnsupportedError(new_url) return self.url_result(new_url) + + +class TikTokLiveIE(InfoExtractor): + _VALID_URL = r'https?://(?:www\.)?tiktok\.com/@(?P<id>...
yt_dlp/extractor/tiktok.py
26
Python
1
refactor
257
43
51
false
[extractor/TikTok] Add `TikTokLiveIE` to download Live Stream
5,637
yt-dlp/yt-dlp
132,642
Python
bashonly
JC-Chung
IE_NAME = 'tiktok:live' def _real_extract(self, url): uploader_id = self._match_id(url) webpage = self._download_webpage(url, uploader_id, headers={'User-Agent': 'User-Agent:Mozilla/5.0'}) room_id = self._html_search_regex(r'snssdk\d*://live\?room_id=(\d+)', webpage, 'room ID', default=...
not necessary ```suggestion ```
render_data = self._parse_json( render_data_json, video_id, transform_source=compat_urllib_parse_unquote) return self._parse_aweme_video_web(get_first(render_data, ('aweme', 'detail')), url) class TikTokVMIE(InfoExtractor): _VALID_URL = r'https?://(?:(?:vm|vt)\.tiktok\.com|(?:www\.)ti...
@@ -911,3 +911,47 @@ def _real_extract(self, url): if self.suitable(new_url): # Prevent infinite loop in case redirect fails raise UnsupportedError(new_url) return self.url_result(new_url) + + +class TikTokLiveIE(InfoExtractor): + _VALID_URL = r'https?://(?:www\.)?tiktok\.com/@(?P<id>...
yt_dlp/extractor/tiktok.py
26
Python
0.429
suggestion
33
41
51
false
[extractor/TikTok] Add `TikTokLiveIE` to download Live Stream
5,637
yt-dlp/yt-dlp
132,642
Python
bashonly
JC-Chung
def _real_extract(self, url): uploader_id = self._match_id(url) webpage = self._download_webpage(url, uploader_id, headers={'User-Agent': 'User-Agent:Mozilla/5.0'}) room_id = self._html_search_regex(r'snssdk\d*://live\?room_id=(\d+)', webpage, 'room ID', default=None) if room_id: ...
```suggestion formats = self._extract_m3u8_formats(live_url, room_id, 'mp4', live=is_live) ```
render_data_json, video_id, transform_source=compat_urllib_parse_unquote) return self._parse_aweme_video_web(get_first(render_data, ('aweme', 'detail')), url) class TikTokVMIE(InfoExtractor): _VALID_URL = r'https?://(?:(?:vm|vt)\.tiktok\.com|(?:www\.)tiktok\.com/t)/(?P<id>\w+)' IE_NAME = '...
@@ -911,3 +911,47 @@ def _real_extract(self, url): if self.suitable(new_url): # Prevent infinite loop in case redirect fails raise UnsupportedError(new_url) return self.url_result(new_url) + + +class TikTokLiveIE(InfoExtractor): + _VALID_URL = r'https?://(?:www\.)?tiktok\.com/@(?P<id>...
yt_dlp/extractor/tiktok.py
26
Python
0.786
refactor
112
39
51
false
[extractor/TikTok] Add `TikTokLiveIE` to download Live Stream
5,637
yt-dlp/yt-dlp
132,642
Python
bashonly
JC-Chung
title = (traverse_obj(video_js_data, ('LiveRoomInfo', 'title'), expected_type=str) or self._html_search_meta(['og:title', 'twitter:title'], webpage, fatal=True)) # thumbnail = traverse_obj(video_js_data, ('LiveRoomInfo', 'coverUrl')) status = traverse_obj(video_j...
move all those info_dict values into return ```suggestion return { 'id': room_id, 'title': title, 'uploader': uploader, 'formats': formats, 'is_live': is_live, } ```
_TESTS = [{ 'url': 'https://www.tiktok.com/t/ZTRC5xgJp', 'info_dict': { 'id': '7170520270497680683', 'ext': 'mp4', 'title': 'md5:c64f6152330c2efe98093ccc8597871c', 'uploader_id': '6687535061741700102', 'upload_date': '20221127', ...
@@ -911,3 +911,47 @@ def _real_extract(self, url): if self.suitable(new_url): # Prevent infinite loop in case redirect fails raise UnsupportedError(new_url) return self.url_result(new_url) + + +class TikTokLiveIE(InfoExtractor): + _VALID_URL = r'https?://(?:www\.)?tiktok\.com/@(?P<id>...
yt_dlp/extractor/tiktok.py
26
Python
0.857
suggestion
306
31
51
false
[extractor/TikTok] Add `TikTokLiveIE` to download Live Stream
5,637
yt-dlp/yt-dlp
132,642
Python
bashonly
JC-Chung
status = traverse_obj(video_js_data, ('LiveRoomInfo', 'status'), expected_type=int) or 4 is_live = status == 2 # Not currently live is 4, other numbers have not been encountered for the time being base_dict = { 'title': title, 'uploader_id': uploader...
instead of having so much code in an `if is_live:` block, this ExtractorError could be moved up and raised `if not is_live` add `expected=True`
'id': '7170520270497680683', 'ext': 'mp4', 'title': 'md5:c64f6152330c2efe98093ccc8597871c', 'uploader_id': '6687535061741700102', 'upload_date': '20221127', 'view_count': int, 'like_count': int, 'comment_count': int, ...
@@ -911,3 +911,47 @@ def _real_extract(self, url): if self.suitable(new_url): # Prevent infinite loop in case redirect fails raise UnsupportedError(new_url) return self.url_result(new_url) + + +class TikTokLiveIE(InfoExtractor): + _VALID_URL = r'https?://(?:www\.)?tiktok\.com/@(?P<id>...
yt_dlp/extractor/tiktok.py
26
Python
0.714
refactor
146
28
51
false
[extractor/TikTok] Add `TikTokLiveIE` to download Live Stream
5,637
yt-dlp/yt-dlp
132,642
Python
bashonly
JC-Chung
is_live = status == 2 # Not currently live is 4, other numbers have not been encountered for the time being base_dict = { 'title': title, 'uploader_id': uploader_id, 'is_live': is_live, } if is_live: liveU...
again, instead of indenting most of the code in a `if room_id:` block, this `raise` could be moved up like this: ```py room_id = self._html_search_regex(r'snssdk\d*://live\?room_id=(\d+)', webpage, 'room ID', default=None) if not room_id: raise ExtractorError('The user is not currently...
'ext': 'mp4', 'title': 'md5:c64f6152330c2efe98093ccc8597871c', 'uploader_id': '6687535061741700102', 'upload_date': '20221127', 'view_count': int, 'like_count': int, 'comment_count': int, 'uploader_url': 'https://www.tiktok....
@@ -911,3 +911,47 @@ def _real_extract(self, url): if self.suitable(new_url): # Prevent infinite loop in case redirect fails raise UnsupportedError(new_url) return self.url_result(new_url) + + +class TikTokLiveIE(InfoExtractor): + _VALID_URL = r'https?://(?:www\.)?tiktok\.com/@(?P<id>...
yt_dlp/extractor/tiktok.py
26
Python
1
refactor
373
27
51
false
[extractor/TikTok] Add `TikTokLiveIE` to download Live Stream
5,637
yt-dlp/yt-dlp
132,642
Python
bashonly
JC-Chung
} }, { 'url': 'https://vt.tiktok.com/ZSe4FqkKd', 'only_matching': True, }] def _real_extract(self, url): new_url = self._request_webpage( HEADRequest(url), self._match_id(url), headers={'User-Agent': 'facebookexternalhit/1.1'}).geturl() if self.suitable(n...
this is a bit cleaner and will be easier to maintain if we need to add more query params in the future ```suggestion video_js_data = self._download_json( 'https://www.tiktok.com/api/live/detail/', room_id, query={ 'aid': '1988', 'roomID': room_id, })...
try: return self._extract_aweme_app(video_id) except ExtractorError as e: e.expected = True self.to_screen(f'{e}; trying with webpage') webpage = self._download_webpage(url, video_id) render_data_json = self._search_regex( r'<script [^>]*\...
@@ -911,3 +911,35 @@ def _real_extract(self, url): if self.suitable(new_url): # Prevent infinite loop in case redirect fails raise UnsupportedError(new_url) return self.url_result(new_url) + + +class TikTokLiveIE(InfoExtractor): + _VALID_URL = r'https?://(?:www\.)?tiktok\.com/@(?P<id>...
yt_dlp/extractor/tiktok.py
26
Python
0.786
suggestion
325
45
51
false
[extractor/TikTok] Add `TikTokLiveIE` to download Live Stream
5,637
yt-dlp/yt-dlp
132,642
Python
bashonly
JC-Chung
return self.url_result(new_url) class TikTokLiveIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?tiktok\.com/@(?P<id>[\w\.-]+)/live' IE_NAME = 'tiktok:live' def _real_extract(self, url): uploader = self._match_id(url) webpage = self._download_webpage(url, uploader, headers={'U...
`formats` could be inlined in return too
# TODO: Run verification challenge code to generate signature cookies cookies = self._get_cookies(self._WEBPAGE_HOST) expected = not cookies.get('s_v_web_id') or not cookies.get('ttwid') raise ExtractorError( 'Fresh cookies (not necessarily logged in) are ...
@@ -911,3 +911,35 @@ def _real_extract(self, url): if self.suitable(new_url): # Prevent infinite loop in case redirect fails raise UnsupportedError(new_url) return self.url_result(new_url) + + +class TikTokLiveIE(InfoExtractor): + _VALID_URL = r'https?://(?:www\.)?tiktok\.com/@(?P<id>...
yt_dlp/extractor/tiktok.py
26
Python
0.286
suggestion
40
34
51
false
[extractor/TikTok] Add `TikTokLiveIE` to download Live Stream
5,637
yt-dlp/yt-dlp
132,642
Python
bashonly
JC-Chung
} }, { 'url': 'https://vt.tiktok.com/ZSe4FqkKd', 'only_matching': True, }] def _real_extract(self, url): new_url = self._request_webpage( HEADRequest(url), self._match_id(url), headers={'User-Agent': 'facebookexternalhit/1.1'}).geturl() if self.suitable(n...
it's fine to match `uploader` from the URL here it looks like the project in the comment uses a 3rd party web API for signing URLs; that's not a viable solution for yt-dlp. it's better to omit the comment. ```suggestion uploader = self._match_id(url) webpage = self._download_webpage(url, uploader,...
try: return self._extract_aweme_app(video_id) except ExtractorError as e: e.expected = True self.to_screen(f'{e}; trying with webpage') webpage = self._download_webpage(url, video_id) render_data_json = self._search_regex( r'<script [^>]*\...
@@ -911,3 +911,45 @@ def _real_extract(self, url): if self.suitable(new_url): # Prevent infinite loop in case redirect fails raise UnsupportedError(new_url) return self.url_result(new_url) + + +class TikTokLiveIE(InfoExtractor): + _VALID_URL = r'https?://(?:www\.)?tiktok\.com/@(?P<id>...
yt_dlp/extractor/tiktok.py
26
Python
0.857
suggestion
375
51
51
false
[extractor/TikTok] Add `TikTokLiveIE` to download Live Stream
5,637
yt-dlp/yt-dlp
132,642
Python
bashonly
JC-Chung
# TODO: add support for TikTok Live events, see https://github.com/isaackogan/TikTokLive for reference webpage = self._download_webpage(url, self._match_id(url), headers={'User-Agent': 'User-Agent:Mozilla/5.0'}) room_id = self._html_search_regex(r'snssdk\d*://live\?room_id=(\d+)', webpage, 'room...
the `thumbnail` workaround is too much of an unknown to include it, IMO. we want `uploader_id` and `creator` to be `None` if not found in the JSON response. and if we set the var `uploader` above, it can be used as fallback value ```suggestion 'uploader': traverse_obj(video_js_data, ('LiveRoomInfo', '...
IE_NAME = 'vm.tiktok' _TESTS = [{ 'url': 'https://www.tiktok.com/t/ZTRC5xgJp', 'info_dict': { 'id': '7170520270497680683', 'ext': 'mp4', 'title': 'md5:c64f6152330c2efe98093ccc8597871c', 'uploader_id': '6687535061741700102', 'upload_dat...
@@ -911,3 +911,45 @@ def _real_extract(self, url): if self.suitable(new_url): # Prevent infinite loop in case redirect fails raise UnsupportedError(new_url) return self.url_result(new_url) + + +class TikTokLiveIE(InfoExtractor): + _VALID_URL = r'https?://(?:www\.)?tiktok\.com/@(?P<id>...
yt_dlp/extractor/tiktok.py
26
Python
0.857
suggestion
552
31
51
false
[extractor/TikTok] Add `TikTokLiveIE` to download Live Stream
5,637
yt-dlp/yt-dlp
132,642
Python
bashonly
JC-Chung
'info_dict': { 'id': '63756df1c638b008a5659dec', 'title': 'Facundo González sufrió fuerte golpe durante competencia frente a Hugo García en EEG', 'description': 'md5:9490c034264afd756eef7b2c3adee69e', 'thumbnail': 're:^https?://[^?#]+63756df1c638b008a5659dec', ...
```suggestion yield from re.findall( r'<iframe[^>]src\s*=\s*"(https://mdstrm.com/[\w-]+/\w+)', webpage) ```
'info_dict': { 'id': '63756df1c638b008a5659dec', 'title': 'Facundo González sufrió fuerte golpe durante competencia frente a Hugo García en EEG', 'description': 'md5:9490c034264afd756eef7b2c3adee69e', 'thumbnail': 're:^https?://[^?#]+63756df1c638b008a5659dec', ...
@@ -0,0 +1,159 @@ +import re + +from .common import InfoExtractor +from ..utils import clean_html, get_element_html_by_class + + +class MediaStreamIE(InfoExtractor): + _VALID_URL = r'https?://mdstrm.com/(?:embed|live-stream)/(?P<id>\w+)' + + _TESTS = [{ + 'url': 'https://mdstrm.com/embed/6318e3f1d1d316083a...
yt_dlp/extractor/mediastream.py
26
Python
0.714
suggestion
130
51
51
false
[mediastream] Add extractor
5,640
yt-dlp/yt-dlp
132,642
Python
pukkandan
elyse0
'ext': 'mp4', }, }] @classmethod def _extract_embed_urls(cls, url, webpage): for mobj in re.finditer(r'<script[^>]+>[^>]*playerMdStream.mdstreamVideo\(\s*[\'"](?P<video_id>\w+)', webpage): yield f'https://mdstrm.com/embed/{mobj.group("video_id")}' for mobj i...
```suggestion video_type = 'live-stream' if mobj.group('video_type') == 'live else 'embed' yield f'https://mdstrm.com/{video_type}/{mobj.group("video_id")}' ```
'ext': 'mp4', }, }] @classmethod def _extract_embed_urls(cls, url, webpage): for mobj in re.finditer(r'<script[^>]+>[^>]*playerMdStream.mdstreamVideo\(\s*[\'"](?P<video_id>\w+)', webpage): yield f'https://mdstrm.com/embed/{mobj.group("video_id")}' yield from...
@@ -0,0 +1,159 @@ +import re + +from .common import InfoExtractor +from ..utils import clean_html, get_element_html_by_class + + +class MediaStreamIE(InfoExtractor): + _VALID_URL = r'https?://mdstrm.com/(?:embed|live-stream)/(?P<id>\w+)' + + _TESTS = [{ + 'url': 'https://mdstrm.com/embed/6318e3f1d1d316083a...
yt_dlp/extractor/mediastream.py
26
Python
0.857
suggestion
187
51
51
false
[mediastream] Add extractor
5,640
yt-dlp/yt-dlp
132,642
Python
pukkandan
elyse0
''', webpage): video_type = 'embed' if mobj.group('video_type') == 'live': video_type = 'live-stream' yield f'https://mdstrm.com/{video_type}/{mobj.group("video_id")}' def _real_extract(self, url): video_id = self._match_id(url) ...
No info about the format is available?
video_type = 'live-stream' if mobj.group('video_type') == 'live' else 'embed' yield f'https://mdstrm.com/{video_type}/{mobj.group("video_id")}' def _real_extract(self, url): video_id = self._match_id(url) webpage = self._download_webpage(url, video_id) if 'Debido a...
@@ -0,0 +1,159 @@ +import re + +from .common import InfoExtractor +from ..utils import clean_html, get_element_html_by_class + + +class MediaStreamIE(InfoExtractor): + _VALID_URL = r'https?://mdstrm.com/(?:embed|live-stream)/(?P<id>\w+)' + + _TESTS = [{ + 'url': 'https://mdstrm.com/embed/6318e3f1d1d316083a...
yt_dlp/extractor/mediastream.py
26
Python
0.071
question
38
51
51
false
[mediastream] Add extractor
5,640
yt-dlp/yt-dlp
132,642
Python
pukkandan
elyse0
import binascii import hashlib import re from .common import InfoExtractor from ..aes import aes_cbc_decrypt_bytes, unpad_pkcs7 from ..compat import compat_urllib_parse_unquote from ..utils import ( ExtractorError, int_or_none, float_or_none, mimetype2ext, str_or_none, try_get, unified_tim...
When extracting from series playlist, this has `season_number`, `description`. Are they not extractable here?
'info_dict': { 'id': '8761', 'display_id': 'frank-and-kastaniegaarden', 'title': 'Frank & Kastaniegaarden', 'series': 'Frank & Kastaniegaarden', }, 'playlist_mincount': 19 }] def _real_extract(self, url): display_id, season_id = se...
@@ -372,3 +373,91 @@ def _real_extract(self, url): 'formats': formats, 'is_live': True, } + + +class DRTVSeasonIE(InfoExtractor): + IE_NAME = 'drtv:season' + _VALID_URL = r'''(?x) + https?:// + (?: + (?:www\.)?...
yt_dlp/extractor/drtv.py
26
Python
0.571
refactor
109
375
51
false
[extractor/drtv] Add series and season support for DRTV extractor
5,644
yt-dlp/yt-dlp
132,642
Python
pukkandan
FrederikNJS
import binascii import hashlib import re from .common import InfoExtractor from ..aes import aes_cbc_decrypt_bytes, unpad_pkcs7 from ..compat import compat_urllib_parse_unquote from ..utils import ( ExtractorError, int_or_none, float_or_none, mimetype2ext, str_or_none, try_get, unified_tim...
Isn't it better to use `id=9008`, `display_id=frank-and-kastaniegaarden` ?
'%s/%s' % (server, stream_path), {'b': ''}) if link_type == 'HLS': formats.extend(self._extract_m3u8_formats( stream_url, channel_id, 'mp4', m3u8_id=link_type, fatal=False, live=True)) ...
@@ -372,3 +373,91 @@ def _real_extract(self, url): 'formats': formats, 'is_live': True, } + + +class DRTVSeasonIE(InfoExtractor): + IE_NAME = 'drtv:season' + _VALID_URL = r'''(?x) + https?:// + (?: + (?:www\.)?...
yt_dlp/extractor/drtv.py
26
Python
0.429
question
74
375
51
false
[extractor/drtv] Add series and season support for DRTV extractor
5,644
yt-dlp/yt-dlp
132,642
Python
pukkandan
FrederikNJS
import binascii import hashlib import re from .common import InfoExtractor from ..aes import aes_cbc_decrypt_bytes, unpad_pkcs7 from ..compat import compat_urllib_parse_unquote from ..utils import ( ExtractorError, int_or_none, float_or_none, mimetype2ext, str_or_none, try_get, unified_tim...
```suggestion SERIES_API = 'https://production-cdn.dr-massive.com/api/page?device=web_browser&item_detail_expand=all&lang=da&max_list_prefetch=3&path=%s' data = self._download_json(SERIES_API % f'/saeson/{season_id}', season_id) ``` SERIES_API is common b/w the extractors and can be a global variable
return { 'id': channel_id, 'title': title, 'thumbnail': channel_data.get('PrimaryImageUri'), 'formats': formats, 'is_live': True, } class DRTVSeasonIE(InfoExtractor): IE_NAME = 'drtv:season' _VALID_URL = r'https?://(?:www\.)?(?:dr\.d...
@@ -372,3 +373,91 @@ def _real_extract(self, url): 'formats': formats, 'is_live': True, } + + +class DRTVSeasonIE(InfoExtractor): + IE_NAME = 'drtv:season' + _VALID_URL = r'''(?x) + https?:// + (?: + (?:www\.)?...
yt_dlp/extractor/drtv.py
26
Python
0.857
refactor
313
375
51
false
[extractor/drtv] Add series and season support for DRTV extractor
5,644
yt-dlp/yt-dlp
132,642
Python
pukkandan
FrederikNJS
elif link_type == 'HDS': formats.extend(self._extract_f4m_formats(update_url_query( '%s/%s' % (server, stream_path), {'hdcore': '3.7.0'}), channel_id, f4m_id=link_type, fatal=False)) return { 'id': c...
Why so complicated? ```suggestion _VALID_URL = r'https?://(?:www\.)?(?:dr\.dk|dr-massive\.com)/drtv/saeson/(?P<display_id>[\w-]+)_(?P<id>\d+)' ``` also see next comment
continue stream_url = update_url_query( '%s/%s' % (server, stream_path), {'b': ''}) if link_type == 'HLS': formats.extend(self._extract_m3u8_formats( stream_url, channel_id, 'mp4',...
@@ -372,3 +373,107 @@ def _real_extract(self, url): 'formats': formats, 'is_live': True, } + + +SERIES_API = 'https://production-cdn.dr-massive.com/api/page?device=web_browser&item_detail_expand=all&lang=da&max_list_prefetch=3&path=%s' + + +class DRTVSeasonIE(InfoExtractor): + IE_N...
yt_dlp/extractor/drtv.py
26
Python
0.714
question
176
51
51
false
[extractor/drtv] Add series and season support for DRTV extractor
5,644
yt-dlp/yt-dlp
132,642
Python
pukkandan
FrederikNJS
''' _GEO_COUNTRIES = ['DK'] _TESTS = [{ 'url': 'https://www.dr.dk/drtv/saeson/frank-and-kastaniegaarden_9008', # Season 2008 of "Frank & Kastaniegaarden" 'info_dict': { 'id': '9008', 'display_id': 'frank-and-kastaniegaarden', 'title': 'Fra...
```suggestion display_id, season_id = self._match_valid_url(url).group('display_id', 'id') data = self._download_json(SERIES_API % f'/saeson/{display_id}_{season_id}', display_id) ```
_TESTS = [{ 'url': 'https://www.dr.dk/drtv/saeson/frank-and-kastaniegaarden_9008', 'info_dict': { 'id': '9008', 'display_id': 'frank-and-kastaniegaarden', 'title': 'Frank & Kastaniegaarden', 'series': 'Frank & Kastaniegaarden', }, 'play...
@@ -372,3 +373,107 @@ def _real_extract(self, url): 'formats': formats, 'is_live': True, } + + +SERIES_API = 'https://production-cdn.dr-massive.com/api/page?device=web_browser&item_detail_expand=all&lang=da&max_list_prefetch=3&path=%s' + + +class DRTVSeasonIE(InfoExtractor): + IE_N...
yt_dlp/extractor/drtv.py
26
Python
0.786
suggestion
202
51
51
false
[extractor/drtv] Add series and season support for DRTV extractor
5,644
yt-dlp/yt-dlp
132,642
Python
pukkandan
FrederikNJS
}] def _real_extract(self, url): season_id = self._match_id(url) id_split = season_id.rsplit('_', 1) data = self._download_json(SERIES_API % f'/saeson/{season_id}', season_id) entries = [{ '_type': 'url', 'url': f'https://www.dr.dk/drtv{episode["path"]}'...
```suggestion 'season_number': traverse_obj(data, ('entries', 0, 'item', 'seasonNumber'), 'entries': entries, ``` Why not this?
def _real_extract(self, url): display_id, season_id = self._match_valid_url(url).group('display_id', 'id') data = self._download_json(SERIES_API % f'/saeson/{display_id}_{season_id}', display_id) entries = [{ '_type': 'url', 'url': f'https://www.dr.dk/drtv{episode["p...
@@ -372,3 +373,107 @@ def _real_extract(self, url): 'formats': formats, 'is_live': True, } + + +SERIES_API = 'https://production-cdn.dr-massive.com/api/page?device=web_browser&item_detail_expand=all&lang=da&max_list_prefetch=3&path=%s' + + +class DRTVSeasonIE(InfoExtractor): + IE_N...
yt_dlp/extractor/drtv.py
26
Python
0.714
question
155
51
51
false
[extractor/drtv] Add series and season support for DRTV extractor
5,644
yt-dlp/yt-dlp
132,642
Python
pukkandan
FrederikNJS
class DRTVSeriesIE(InfoExtractor): IE_NAME = 'drtv:series' _VALID_URL = r'''(?x) https?:// (?: (?:www\.)?(?:dr\.dk|dr-massive\.com)/drtv/(?:serie)/ ) (?P<id>[\da-z_-]+) ''...
Is season_number unavailable here?
IE_NAME = 'drtv:series' _VALID_URL = r'https?://(?:www\.)?(?:dr\.dk|dr-massive\.com)/drtv/serie/(?P<display_id>[\w-]+)_(?P<id>\d+)' _GEO_COUNTRIES = ['DK'] _TESTS = [{ 'url': 'https://www.dr.dk/drtv/serie/frank-and-kastaniegaarden_6954', 'info_dict': { 'id': '6954', ...
@@ -372,3 +373,107 @@ def _real_extract(self, url): 'formats': formats, 'is_live': True, } + + +SERIES_API = 'https://production-cdn.dr-massive.com/api/page?device=web_browser&item_detail_expand=all&lang=da&max_list_prefetch=3&path=%s' + + +class DRTVSeasonIE(InfoExtractor): + IE_N...
yt_dlp/extractor/drtv.py
26
Python
0.071
question
34
44
36
false
[extractor/drtv] Add series and season support for DRTV extractor
5,644
yt-dlp/yt-dlp
132,642
Python
pukkandan
FrederikNJS
if video_id: video_id = compat_urllib_parse_unquote(video_id) _PROGRAMCARD_BASE = 'https://www.dr.dk/mu-online/api/1.4/programcard' query = {'expanded': 'true'} if video_id: programcard_url = '%s/%s' % (_PROGRAMCARD_BASE, video_id) else: ...
```suggestion SERIES_API % f'/episode/{raw_video_id}', raw_video_id, default={}) if re.search(r'_\d+$', raw_video_id) else {} ```
if video_id: video_id = compat_urllib_parse_unquote(video_id) _PROGRAMCARD_BASE = 'https://www.dr.dk/mu-online/api/1.4/programcard' query = {'expanded': 'true'} if video_id: programcard_url = '%s/%s' % (_PROGRAMCARD_BASE, video_id) else: ...
@@ -182,6 +186,9 @@ def _real_extract(self, url): data = self._download_json( programcard_url, video_id, 'Downloading video JSON', query=query) + supplementary_data = self._download_json( + SERIES_API % f'/episode/{raw_video_id}', raw_video_id) if re.match(r'.+_\d+$', raw_video...
yt_dlp/extractor/drtv.py
26
Python
0.714
suggestion
156
51
51
false
[extractor/drtv] Add series and season support for DRTV extractor
5,644
yt-dlp/yt-dlp
132,642
Python
pukkandan
FrederikNJS
'url': 'http://www.tv4play.se/sport/3060959', 'only_matching': True, }, { 'url': 'http://www.tv4play.se/film/2378136', 'only_matching': True, }, { 'url': 'http://www.tv4play.se/barn/looney-tunes?video_id=3062412', 'o...
use f-strings for both API URLs for consistency / readability ```suggestion f'https://playback2.a2d.tv/asset/{video_id}', ```
'ext': 'mp4', 'title': 'Så här jobbar ficktjuvarna - se avslöjande bilder', 'thumbnail': r're:^https?://.*\.jpg$', 'description': 'Unika bilder avslöjar hur turisternas fickor vittjas mitt på Stockholms central. Två experter på ficktjuvarna avslöjar knepen...
@@ -73,7 +73,7 @@ def _real_extract(self, url): video_id = self._match_id(url) info = self._download_json( - 'https://playback-api.b17g.net/asset/%s' % video_id, + 'https://playback2.a2d.tv/asset/%s' % video_id,
yt_dlp/extractor/tv4.py
26
Python
0.786
suggestion
140
51
51
false
[extractor/tv4] Fix tv4 extraction
5,649
yt-dlp/yt-dlp
132,642
Python
bashonly
TxI5
{ 'url': 'http://www.tv4play.se/program/farang/3922081', 'only_matching': True, }, { 'url': 'https://www.tv4play.se/program/nyheterna/avsnitt/13315940', 'only_matching': True, } ] def _real_extract(self, url): video_id = se...
```suggestion f'https://playback2.a2d.tv/play/{video_id}', ```
'only_matching': True, }, { 'url': 'http://www.tv4play.se/film/2378136', 'only_matching': True, }, { 'url': 'http://www.tv4play.se/barn/looney-tunes?video_id=3062412', 'only_matching': True, }, { 'url...
@@ -84,7 +84,7 @@ def _real_extract(self, url): title = info['title'] manifest_url = self._download_json( - 'https://playback-api.b17g.net/media/' + video_id, + 'https://playback2.a2d.tv/play/' + video_id,
yt_dlp/extractor/tv4.py
26
Python
0.571
suggestion
76
51
51
false
[extractor/tv4] Fix tv4 extraction
5,649
yt-dlp/yt-dlp
132,642
Python
bashonly
TxI5
}, { 'url': 'http://www.tv4play.se/program/farang/3922081', 'only_matching': True, }, { 'url': 'https://www.tv4play.se/program/nyheterna/avsnitt/13315940', 'only_matching': True, } ] def _real_extract(self, url): vi...
This step (manifest download) requires geo-verification outside Sweden. The following update would solve that part: ``` manifest_url = self._download_json( 'https://playback2.a2d.tv/play/%s' % video_id, video_id, query={ 'service': 'tv4', 'device': 'browser', 'browser': 'GoogleChr...
'url': 'http://www.tv4play.se/sport/3060959', 'only_matching': True, }, { 'url': 'http://www.tv4play.se/film/2378136', 'only_matching': True, }, { 'url': 'http://www.tv4play.se/barn/looney-tunes?video_id=3062412', 'o...
@@ -84,7 +84,7 @@ def _real_extract(self, url): title = info['title'] manifest_url = self._download_json(
yt_dlp/extractor/tv4.py
26
Python
0.786
suggestion
542
51
51
false
[extractor/tv4] Fix tv4 extraction
5,649
yt-dlp/yt-dlp
132,642
Python
aejdl
TxI5
filename_real_ext = os.path.splitext(filename)[1][1:] filename_wo_ext = ( os.path.splitext(filename)[0] if filename_real_ext in (old_ext, new_ext) else filename) re...
This should be handled in FFmpegFD imo since the two formats could need different headers in theory
filename_real_ext = os.path.splitext(filename)[1][1:] filename_wo_ext = ( os.path.splitext(filename)[0] if filename_real_ext in (old_ext, new_ext) else filename) re...
@@ -3171,6 +3171,8 @@ def correct_ext(filename, ext=new_ext): 'f%s' % f['format_id'], info_dict['ext']) downloaded.append(fname) info_dict['url'] = '\n'.join(f['url'] for f in requested_formats) + info_dict['ht...
yt_dlp/YoutubeDL.py
26
Python
0.429
suggestion
99
51
51
false
Fix headers for ffmpeg and video+audio formats
5,659
yt-dlp/yt-dlp
132,642
Python
pukkandan
bashonly
args += ['-rtmp_playpath', play_path] if tc_url is not None: args += ['-rtmp_tcurl', tc_url] if flash_version is not None: args += ['-rtmp_flashver', flash_version] if live: args += ['-rtmp_live', 'live'] if ...
```suggestion if fmt.get('http_headers') and re.match(r'^https?://', fmt['url']): headers_dict = handle_youtubedl_headers(fmt['http_headers']) # Trailing \r\n after each HTTP header is important to prevent warning from ffmpeg/avconv: # [http @ 00000000003d...
args += ['-rtmp_playpath', play_path] if tc_url is not None: args += ['-rtmp_tcurl', tc_url] if flash_version is not None: args += ['-rtmp_flashver', flash_version] if live: args += ['-rtmp_live', 'live'] if ...
@@ -434,21 +423,30 @@ def _call_downloader(self, tmpfilename, info_dict): start_time, end_time = info_dict.get('section_start') or 0, info_dict.get('section_end') - for i, url in enumerate(urls): - if http_headers is not None and re.match(r'^https?://', url): - args += http...
yt_dlp/downloader/external.py
26
Python
0.929
bug
506
51
51
false
Fix headers for ffmpeg and video+audio formats
5,659
yt-dlp/yt-dlp
132,642
Python
pukkandan
bashonly
info.update({ 'description': info.get('description') or feed_data.get('description') or feed_data.get('longDescription'), 'uploader': publish_info.get('description'), 'uploader_id': publish_info.get('channel'), 'view_count': int_or_none(feed_d...
Used by GenericIE for embed detection https://github.com/yt-dlp/yt-dlp/blob/88f20eff1b13f70d332ef97fc1be175271bec130/yt_dlp/extractor/generic.py#L1550-L1562
nodrm_manifest = re.sub(r'_sampleaes/(\w+)_fp_', r'/\1_no_', drm_manifest) if has_nondrm or nodrm_manifest == drm_manifest: return tp_formats.extend(self._extract_m3u8_formats( nodrm_manifest, video_id, m3u8_id='hls', fatal=False) or []) def _real_extract(self, url)...
@@ -129,71 +85,23 @@ class MediasetIE(ThePlatformBaseIE): 'uploader_id': 'B6', 'chapters': [{'start_time': 0.0, 'end_time': 1938.56}, {'start_time': 1938.56, 'end_time': 5233.01}], }, + 'params': { + 'ignore_no_formats_error': True, + }, + 'expected_war...
yt_dlp/extractor/mediaset.py
26
Python
0.429
refactor
159
51
51
false
[extractor/mediaset] Better DRM/Paywall message + _EMBED_REGEX
5,664
yt-dlp/yt-dlp
132,642
Python
pukkandan
nixxo
return tp_formats.extend(self._extract_m3u8_formats( nodrm_manifest, video_id, m3u8_id='hls', fatal=False) or []) def _real_extract(self, url): guid = self._match_id(url) tp_path = f'PR1GhC/media/guid/2702976343/{guid}' info = self._extract_theplatform_metad...
```suggestion e.orig_msg = 'This video is DRM protected' ``` is the standard message used by other IEs
'thumbnail': r're:^https?://.*\.jpg$', 'uploader': 'Mediaset Play', 'uploader_id': 'QY', 'upload_date': '20201005', 'timestamp': 1601866168, 'chapters': [], }, 'params': { 'skip_download': True, } }, { ...
@@ -217,23 +125,25 @@ def _check_drm_formats(self, tp_formats, video_id): def _real_extract(self, url): guid = self._match_id(url) - tp_path = 'PR1GhC/media/guid/2702976343/' + guid + tp_path = f'PR1GhC/media/guid/2702976343/{guid}' info = self._extract_theplatform_metadata(tp_pat...
yt_dlp/extractor/mediaset.py
26
Python
0.786
suggestion
125
51
51
false
[extractor/mediaset] Better DRM/Paywall message + _EMBED_REGEX
5,664
yt-dlp/yt-dlp
132,642
Python
pukkandan
nixxo
urljoin, update_url_query, ) class MediasetIE(ThePlatformBaseIE): _TP_TLD = 'eu' _VALID_URL = r'''(?x) (?: mediaset:| https?:// (?:\w+\.)+mediaset\.it/ (?: ...
Leave one of the tests in old domain
urljoin, update_url_query, ) class MediasetIE(ThePlatformBaseIE): _TP_TLD = 'eu' _GUID_RE = r'F[0-9A-Z]{15}' _VALID_URL = rf'''(?x) (?: mediaset:| https?:// (?:\w+\.)+mediaset\.it/ ...
@@ -29,7 +28,7 @@ class MediasetIE(ThePlatformBaseIE): ''' _TESTS = [{ # full episode - 'url': 'https://www.mediasetplay.mediaset.it/video/mrwronglezionidamore/episodio-1_F310575103000102', + 'url': 'https://mediasetinfinity.mediaset.it/video/mrwronglezionidamore/episodi...
yt_dlp/extractor/mediaset.py
26
Python
0.071
suggestion
36
51
51
false
[extractor/mediaset] Better DRM/Paywall message + _EMBED_REGEX
5,664
yt-dlp/yt-dlp
132,642
Python
pukkandan
nixxo
formats = [f for f in formats if f.get('is_from_start')] def refetch_manifest(format_id, delay): nonlocal formats, start_time, is_live if time.time() <= start_time + delay: return _, _, prs, player_url = self._download_player_responses(url, smuggled_...
```suggestion for retry in self.RetryManager(fatal=False): ``` Then remove the outer try
formats = [f for f in formats if f.get('is_from_start')] def refetch_manifest(format_id, delay): nonlocal formats, start_time, is_live if time.time() <= start_time + delay: return _, _, prs, player_url = self._download_player_responses(url, smuggled_...
@@ -2617,22 +2617,32 @@ def refetch_manifest(format_id, delay): is_live = live_status == 'is_live' start_time = time.time() + class MpdFeedException(Exception): + pass + def mpd_feed(format_id, delay): """ @returns (manifest_url, manifest_...
yt_dlp/extractor/youtube.py
26
Python
0.786
suggestion
107
51
51
false
[extractor/youtube] Retry manifest refresh to avoid ending download early when live stream is temporarily offline
5,670
yt-dlp/yt-dlp
132,642
Python
pukkandan
mzhou
start_time = time.time() class MpdFeedException(Exception): pass def mpd_feed(format_id, delay): """ @returns (manifest_url, manifest_stream_number, is_live) or None """ try: for retry in self.RetryManager(): ...
No need to throw and catch error ```suggestion if f: return f['manifest_url'], f['manifest_stream_number'], is_live elif is_live: retry.error = f'Cannot find refreshed manifest for format {format_id}{bug_reports...
start_time = time.time() def mpd_feed(format_id, delay): """ @returns (manifest_url, manifest_stream_number, is_live) or None """ for retry in self.RetryManager(fatal=False): with lock: refetch_manifest(format_id, d...
@@ -2617,22 +2617,32 @@ def refetch_manifest(format_id, delay): is_live = live_status == 'is_live' start_time = time.time() + class MpdFeedException(Exception): + pass + def mpd_feed(format_id, delay): """ @returns (manifest_url, manifest_...
yt_dlp/extractor/youtube.py
26
Python
0.929
bug
450
51
51
false
[extractor/youtube] Retry manifest refresh to avoid ending download early when live stream is temporarily offline
5,670
yt-dlp/yt-dlp
132,642
Python
pukkandan
mzhou
if self._WORKING_APP_VERSION: app_version, manifest_app_version = self._WORKING_APP_VERSION real_query = self._build_api_query(query, app_version, manifest_app_version) return self._call_api_impl(ep, real_query, manifest_app_version, video_id, fatal, note, errnote) f...
```suggestion feed_list = self._call_api( 'feed', {'aweme_id': aweme_id}, aweme_id, note='Downloading video feed', errnote='Unable to download video feed').get('aweme_list') or [] ```
if self._WORKING_APP_VERSION: app_version, manifest_app_version = self._WORKING_APP_VERSION real_query = self._build_api_query(query, app_version, manifest_app_version) return self._call_api_impl(ep, real_query, manifest_app_version, video_id, fatal, note, errnote) ...
@@ -126,11 +126,20 @@ def _call_api(self, ep, query, video_id, fatal=True, continue raise e + def _extract_aweme_app(self, aweme_id): + feed_list = self._call_api('feed', {'aweme_id': aweme_id}, aweme_id, + note='Downloading video feed'...
yt_dlp/extractor/tiktok.py
26
Python
0.786
suggestion
227
51
51
false
[extractor/tiktok] Fix subs, DouyinIE, improve shortlink support
5,676
yt-dlp/yt-dlp
132,642
Python
pukkandan
bashonly
# aweme/detail endpoint subs captions_info = traverse_obj( aweme_detail, ('interaction_stickers', ..., 'auto_video_caption_info', 'auto_captions', ...), expected_type=dict) for caption in captions_info: caption_url = traverse_obj(caption, ('url', 'url_list', ...), expecte...
```suggestion if not caption.get('url'): continue subtitles.setdefault(caption.get('lang') or 'en', []).append({ 'ext': remove_start(caption.get('caption_format'), 'web'), 'url': caption['url'], }) ```
# TODO: Extract text positioning info subtitles = {} # aweme/detail endpoint subs captions_info = traverse_obj( aweme_detail, ('interaction_stickers', ..., 'auto_video_caption_info', 'auto_captions', ...), expected_type=dict) for caption in captions_info: ...
@@ -145,6 +154,24 @@ def _get_subtitles(self, aweme_detail, aweme_id): f'{i + 1}\n{srt_subtitles_timecode(line["start_time"] / 1000)} --> {srt_subtitles_timecode(line["end_time"] / 1000)}\n{line["text"]}' for i, line in enumerate(caption_json['utterances']) if line.get('text'))...
yt_dlp/extractor/tiktok.py
26
Python
0.857
suggestion
316
51
51
false
[extractor/tiktok] Fix subs, DouyinIE, improve shortlink support
5,676
yt-dlp/yt-dlp
132,642
Python
pukkandan
bashonly
'uploader_url': 'https://www.douyin.com/user/MS4wLjABAAAAEKnfa654JAJ_N5lgZDQluwsxmY0lhfmEYNQBBkwGG98', 'creator': '杨超越', 'duration': 15115, 'timestamp': 1621261163, 'upload_date': '20210517', 'track': '@杨超越创作的原声', 'view_count': int, ...
Merge with master. Then do: ```suggestion e.expected = True self.to_screen(f'{e}; trying with webpage') ```
'description': '#哪个爱豆的105度最甜 换个角度看看我哈哈', 'uploader_id': '110403406559', 'uploader_url': 'https://www.douyin.com/user/MS4wLjABAAAAEKnfa654JAJ_N5lgZDQluwsxmY0lhfmEYNQBBkwGG98', 'creator': '杨超越', 'duration': 15115, 'timestamp': 1621261163, ...
@@ -859,47 +895,54 @@ def _real_extract(self, url): try: return self._extract_aweme_app(video_id) except ExtractorError as e: - self.report_warning(f'{e}; trying with webpage') + self.to_screen(f'{str(e).split(";")[0]}; trying with webpage')
yt_dlp/extractor/tiktok.py
26
Python
0.714
suggestion
135
51
51
false
[extractor/tiktok] Fix subs, DouyinIE, improve shortlink support
5,676
yt-dlp/yt-dlp
132,642
Python
pukkandan
bashonly
filter_dict, int_or_none, parse_iso8601, parse_qs, traverse_obj, ) class NiconicoChannelPlusBaseIE(InfoExtractor): _WEBPAGE_BASE_URL = 'https://nicochannel.jp' def _call_api(self, path, item_id, *args, **kwargs): return self._download_json( f'https://nfc-api.nicochanne...
```suggestion fanclub_list_json = self._call_api( 'content_providers/channels', item_id=f'channels/{channel_name}', note='Fetching channel list', errnote='Unable to fetch channel list', ) fanclub_id = traverse_obj(fanclub_list_json, ( 'data', 'content_pr...
int_or_none, parse_qs, str_or_none, traverse_obj, unified_timestamp, url_or_none, ) class NiconicoChannelPlusBaseIE(InfoExtractor): _WEBPAGE_BASE_URL = 'https://nicochannel.jp' def _call_api(self, path, item_id, *args, **kwargs): return self._download_json( f'https...
@@ -0,0 +1,455 @@ +import functools +import json + +from .common import InfoExtractor +from ..utils import ( + ExtractorError, + OnDemandPagedList, + UserNotLive, + filter_dict, + int_or_none, + parse_iso8601, + parse_qs, + traverse_obj, +) + + +class NiconicoChannelPlusBaseIE(InfoExtractor): + ...
yt_dlp/extractor/niconicochannelplus.py
26
Python
1
refactor
587
51
51
false
[extractor/niconicochannelplus] Add extractor
5,686
yt-dlp/yt-dlp
132,642
Python
Lesmiscore
pzhlkj6612
'content_providers/channels', item_id=f'channels/{channel_name}', note='Fetching channel list', errnote='Unable to fetch channel list', )['data']['content_providers'] for fanclub in fanclub_list_json: if fanclub.get('domain') == f'{self._WEBPAGE_BASE_URL}/{channel_na...
why Channel**Plus**? Imo, `NiconicoChannelIE` is sufficient. Also, everything should be moved into `niconico.py`
fanclub_list_json = self._call_api( 'content_providers/channels', item_id=f'channels/{channel_name}', note='Fetching channel list', errnote='Unable to fetch channel list', )['data']['content_providers'] fanclub_id = traverse_obj(fanclub_list_json, ( lambda _, ...
@@ -0,0 +1,455 @@ +import functools +import json + +from .common import InfoExtractor +from ..utils import ( + ExtractorError, + OnDemandPagedList, + UserNotLive, + filter_dict, + int_or_none, + parse_iso8601, + parse_qs, + traverse_obj, +) + + +class NiconicoChannelPlusBaseIE(InfoExtractor): + ...
yt_dlp/extractor/niconicochannelplus.py
26
Python
0.571
question
112
51
51
false
[extractor/niconicochannelplus] Add extractor
5,686
yt-dlp/yt-dlp
132,642
Python
pukkandan
pzhlkj6612
note='Fetching channel base info', errnote='Unable to fetch channel base info', )['data']['fanclub_site'] def _get_channel_user_info(self, fanclub_site_id): return self._call_api( f'fanclub_sites/{fanclub_site_id}/user_info', item_id=f'fanclub_sites/{fanclub_site_id}', ...
```suggestion ``` None values is not needed in test defenition
f'fanclub_sites/{fanclub_site_id}/page_base_info', item_id=f'fanclub_sites/{fanclub_site_id}', note='Fetching channel base info', errnote='Unable to fetch channel base info', fatal=False, ), ('data', 'fanclub_site', {dict})) or {} def _get_channel_user_info(self, fanclub_site_id): ...
@@ -54,6 +61,7 @@ class NiconicoChannelPlusIE(NiconicoChannelPlusBaseIE): 'channel': '前田佳織里の世界攻略計画', 'channel_id': 'kaorin', 'channel_url': 'https://nicochannel.jp/kaorin', + 'age_limit': None,
yt_dlp/extractor/niconicochannelplus.py
26
Python
0.571
suggestion
64
51
51
false
[extractor/niconicochannelplus] Add extractor
5,686
yt-dlp/yt-dlp
132,642
Python
pukkandan
pzhlkj6612
f'https://nfc-api.nicochannel.jp/fc/{path}', video_id=item_id, *args, **kwargs) def _find_fanclub_site_id(self, channel_name): fanclub_list_json = self._call_api( 'content_providers/channels', item_id=f'channels/{channel_name}', note='Fetching channel list', errnote='Una...
```py def _get_channel_info(self, fanclub_site_id, endpoint=page_base_info, data=None): return self._call_api( f'fanclub_sites/{fanclub_site_id}/{endpoint}', item_id=f'fanclub_sites/{fanclub_site_id}', data=data, note='Fetching channel base info', errnote='Unable to fetch channel...
return self._download_json( f'https://nfc-api.nicochannel.jp/fc/{path}', video_id=item_id, *args, **kwargs) def _find_fanclub_site_id(self, channel_name): fanclub_list_json = self._call_api( 'content_providers/channels', item_id=f'channels/{channel_name}', note='...
@@ -33,10 +33,17 @@ def _find_fanclub_site_id(self, channel_name): raise ExtractorError(f'Channel {channel_name} does not exist', expected=True) return fanclub_id - def _get_channel_info(self, fanclub_site_id): + def _get_channel_base_info(self, fanclub_site_id): return self._call...
yt_dlp/extractor/niconicochannelplus.py
26
Python
1
suggestion
512
51
51
false
[extractor/niconicochannelplus] Add extractor
5,686
yt-dlp/yt-dlp
132,642
Python
pukkandan
pzhlkj6612
)['data']['content_providers'] fanclub_id = traverse_obj(fanclub_list_json, ( lambda _, v: v.get('domain') == f'{self._WEBPAGE_BASE_URL}/{channel_name}', 'id'), get_all=False) if not fanclub_id: raise ExtractorError(f'Channel {channel_name} does not exist', ex...
```suggestion _VALID_URL = r'https?://nicochannel\.jp/(?P<channel>[\w.-]+)/(?:video|live)/(?P<code>sm\w+)' ```
'content_providers/channels', item_id=f'channels/{channel_name}', note='Fetching channel list', errnote='Unable to fetch channel list', )['data']['content_providers'] fanclub_id = traverse_obj(fanclub_list_json, ( lambda _, v: v['domain'] == f'{self._WEBPAGE_BASE_URL}...
@@ -0,0 +1,497 @@ +import functools +import json + +from .common import InfoExtractor +from ..utils import ( + ExtractorError, + OnDemandPagedList, + filter_dict, + int_or_none, + parse_iso8601, + parse_qs, + traverse_obj, +) + + +class NiconicoChannelPlusBaseIE(InfoExtractor): + _WEBPAGE_BASE_U...
yt_dlp/extractor/niconicochannelplus.py
26
Python
0.714
suggestion
116
51
51
false
[extractor/niconicochannelplus] Add extractor
5,686
yt-dlp/yt-dlp
132,642
Python
pukkandan
pzhlkj6612
lambda _, v: v.get('domain') == f'{self._WEBPAGE_BASE_URL}/{channel_name}', 'id'), get_all=False) if not fanclub_id: raise ExtractorError(f'Channel {channel_name} does not exist', expected=True) return fanclub_id def _get_channel_base_info(self, fanclub_site_id):...
```suggestion # normal channel name. ``` Same below. Only fake needs to be mentioned.
)['data']['content_providers'] fanclub_id = traverse_obj(fanclub_list_json, ( lambda _, v: v['domain'] == f'{self._WEBPAGE_BASE_URL}/{channel_name}', 'id'), get_all=False) if not fanclub_id: raise ExtractorError(f'Channel {channel_name} does not exist', expect...
@@ -0,0 +1,497 @@ +import functools +import json + +from .common import InfoExtractor +from ..utils import ( + ExtractorError, + OnDemandPagedList, + filter_dict, + int_or_none, + parse_iso8601, + parse_qs, + traverse_obj, +) + + +class NiconicoChannelPlusBaseIE(InfoExtractor): + _WEBPAGE_BASE_U...
yt_dlp/extractor/niconicochannelplus.py
26
Python
0.571
suggestion
96
51
51
false
[extractor/niconicochannelplus] Add extractor
5,686
yt-dlp/yt-dlp
132,642
Python
pukkandan
pzhlkj6612
'duration': 86465, 'comment_count': int, 'view_count': int, 'tags': [], 'upload_date': '20221021', }, 'params': { 'skip_download': True, }, }, { # real video url, numbers in channel name. 'url': 'https://...
What's the point of these tests?
'timestamp': 1666344616, 'duration': 86465, 'comment_count': int, 'view_count': int, 'tags': [], 'upload_date': '20221021', }, 'params': { 'skip_download': True, }, }] def _real_extract(self, url): ...
@@ -0,0 +1,497 @@ +import functools +import json + +from .common import InfoExtractor +from ..utils import ( + ExtractorError, + OnDemandPagedList, + filter_dict, + int_or_none, + parse_iso8601, + parse_qs, + traverse_obj, +) + + +class NiconicoChannelPlusBaseIE(InfoExtractor): + _WEBPAGE_BASE_U...
yt_dlp/extractor/niconicochannelplus.py
26
Python
0.071
question
32
51
51
false
[extractor/niconicochannelplus] Add extractor
5,686
yt-dlp/yt-dlp
132,642
Python
pukkandan
pzhlkj6612
# real video url, numbers in channel name. 'url': 'https://nicochannel.jp/dateno8noba/video/smVGqtKpdmva4Mcrw7rbeQ8Y', 'only_matching': True, }, { # real video url, hyphens in channel name. 'url': 'https://nicochannel.jp/owstv-plus/video/smUPTNizUxVspEu5YeDtV3VB', 'on...
How can fake_url have "normal channel name"? And what's even the point of this test?
}] def _real_extract(self, url): content_code, channel_id = self._match_valid_url(url).group('code', 'channel') fanclub_site_id = self._find_fanclub_site_id(channel_id) data_json = self._call_api( f'video_pages/{content_code}', item_id=content_code, headers={'fc_use_device'...
@@ -0,0 +1,497 @@ +import functools +import json + +from .common import InfoExtractor +from ..utils import ( + ExtractorError, + OnDemandPagedList, + filter_dict, + int_or_none, + parse_iso8601, + parse_qs, + traverse_obj, +) + + +class NiconicoChannelPlusBaseIE(InfoExtractor): + _WEBPAGE_BASE_U...
yt_dlp/extractor/niconicochannelplus.py
26
Python
0.214
question
84
51
51
false
[extractor/niconicochannelplus] Add extractor
5,686
yt-dlp/yt-dlp
132,642
Python
pukkandan
pzhlkj6612
'skip_download': False, }, 'skip': '404 Not Found', }, { # was real live url, but 404 now. 'url': 'https://nicochannel.jp/matsuda_shota/live/sm5VuVsRQSRqkyvLWFZtcou7', 'info_dict': { 'id': 'smpptPykLAjmZQchK4k4p93P', 'ext': 'mp4', }...
Again, what' the point of these?
else: formats = self._extract_m3u8_formats( # "authenticated_url" is a format string that contains "{session_id}". m3u8_url=data_json['video_stream']['authenticated_url'].format(session_id=session_id), video_id=content_code) return { ...
@@ -0,0 +1,497 @@ +import functools +import json + +from .common import InfoExtractor +from ..utils import ( + ExtractorError, + OnDemandPagedList, + filter_dict, + int_or_none, + parse_iso8601, + parse_qs, + traverse_obj, +) + + +class NiconicoChannelPlusBaseIE(InfoExtractor): + _WEBPAGE_BASE_U...
yt_dlp/extractor/niconicochannelplus.py
26
Python
0.071
question
32
51
51
false
[extractor/niconicochannelplus] Add extractor
5,686
yt-dlp/yt-dlp
132,642
Python
pukkandan
pzhlkj6612
from .common import InfoExtractor from ..utils import ( ExtractorError, OnDemandPagedList, filter_dict, int_or_none, parse_iso8601, parse_qs, traverse_obj, ) class NiconicoChannelPlusBaseIE(InfoExtractor): _WEBPAGE_BASE_URL = 'https://nicochannel.jp' def _call_api(self, path, item...
this is still non-fatal and more readable imo ```suggestion lambda _, v: v['domain'] == f'{self._WEBPAGE_BASE_URL}/{channel_name}', 'id'), ```
from .common import InfoExtractor from ..utils import ( ExtractorError, OnDemandPagedList, filter_dict, int_or_none, parse_qs, str_or_none, traverse_obj, unified_timestamp, url_or_none, ) class NiconicoChannelPlusBaseIE(InfoExtractor): _WEBPAGE_BASE_URL = 'https://nicochannel.j...
@@ -0,0 +1,441 @@ +import functools +import json + +from .common import InfoExtractor +from ..utils import ( + ExtractorError, + OnDemandPagedList, + filter_dict, + int_or_none, + parse_iso8601, + parse_qs, + traverse_obj, +) + + +class NiconicoChannelPlusBaseIE(InfoExtractor): + _WEBPAGE_BASE_U...
yt_dlp/extractor/niconicochannelplus.py
26
Python
0.714
suggestion
157
51
51
false
[extractor/niconicochannelplus] Add extractor
5,686
yt-dlp/yt-dlp
132,642
Python
bashonly
pzhlkj6612
}] def _real_extract(self, url): content_code, channel_id = self._match_valid_url(url).group('code', 'channel') fanclub_site_id = self._find_fanclub_site_id(channel_id) data_json = self._call_api( f'video_pages/{content_code}', item_id=content_code, headers={'fc_use_device'...
```suggestion if live_status == 'is_upcoming': if release_timestamp_str: msg = f'This live event will begin at {release_timestamp_str} UTC' else: msg = 'This event has not started yet' self.raise_no_formats(msg, expected=True, video_id=co...
'skip_download': True, }, }] def _real_extract(self, url): content_code, channel_id = self._match_valid_url(url).group('code', 'channel') fanclub_site_id = self._find_fanclub_site_id(channel_id) data_json = self._call_api( f'video_pages/{content_code}', ...
@@ -0,0 +1,441 @@ +import functools +import json + +from .common import InfoExtractor +from ..utils import ( + ExtractorError, + OnDemandPagedList, + filter_dict, + int_or_none, + parse_iso8601, + parse_qs, + traverse_obj, +) + + +class NiconicoChannelPlusBaseIE(InfoExtractor): + _WEBPAGE_BASE_U...
yt_dlp/extractor/niconicochannelplus.py
26
Python
0.786
suggestion
336
51
51
false
[extractor/niconicochannelplus] Add extractor
5,686
yt-dlp/yt-dlp
132,642
Python
bashonly
pzhlkj6612
class NiconicoChannelPlusBaseIE(InfoExtractor): _WEBPAGE_BASE_URL = 'https://nicochannel.jp' def _call_api(self, path, item_id, *args, **kwargs): return self._download_json( f'https://nfc-api.nicochannel.jp/fc/{path}', video_id=item_id, *args, **kwargs) def _find_fanclub_site_id(self...
Since the result is only used for metadata, this should be non-fatal: ```suggestion def _get_channel_base_info(self, fanclub_site_id): return traverse_obj(self._call_api( f'fanclub_sites/{fanclub_site_id}/page_base_info', item_id=f'fanclub_sites/{fanclub_site_id}', note='Fetchin...
url_or_none, ) class NiconicoChannelPlusBaseIE(InfoExtractor): _WEBPAGE_BASE_URL = 'https://nicochannel.jp' def _call_api(self, path, item_id, *args, **kwargs): return self._download_json( f'https://nfc-api.nicochannel.jp/fc/{path}', video_id=item_id, *args, **kwargs) def _find_f...
@@ -0,0 +1,441 @@ +import functools +import json + +from .common import InfoExtractor +from ..utils import ( + ExtractorError, + OnDemandPagedList, + filter_dict, + int_or_none, + parse_iso8601, + parse_qs, + traverse_obj, +) + + +class NiconicoChannelPlusBaseIE(InfoExtractor): + _WEBPAGE_BASE_U...
yt_dlp/extractor/niconicochannelplus.py
26
Python
0.857
suggestion
456
51
51
false
[extractor/niconicochannelplus] Add extractor
5,686
yt-dlp/yt-dlp
132,642
Python
bashonly
pzhlkj6612
def _find_fanclub_site_id(self, channel_name): fanclub_list_json = self._call_api( 'content_providers/channels', item_id=f'channels/{channel_name}', note='Fetching channel list', errnote='Unable to fetch channel list', )['data']['content_providers'] fanclub_id = trav...
Non-fatal metadata again: ```suggestion def _get_channel_user_info(self, fanclub_site_id): return traverse_obj(self._call_api( f'fanclub_sites/{fanclub_site_id}/user_info', item_id=f'fanclub_sites/{fanclub_site_id}', note='Fetching channel user info', errnote='Unable to fetch ch...
return self._download_json( f'https://nfc-api.nicochannel.jp/fc/{path}', video_id=item_id, *args, **kwargs) def _find_fanclub_site_id(self, channel_name): fanclub_list_json = self._call_api( 'content_providers/channels', item_id=f'channels/{channel_name}', note='...
@@ -0,0 +1,441 @@ +import functools +import json + +from .common import InfoExtractor +from ..utils import ( + ExtractorError, + OnDemandPagedList, + filter_dict, + int_or_none, + parse_iso8601, + parse_qs, + traverse_obj, +) + + +class NiconicoChannelPlusBaseIE(InfoExtractor): + _WEBPAGE_BASE_U...
yt_dlp/extractor/niconicochannelplus.py
26
Python
1
suggestion
461
51
51
false
[extractor/niconicochannelplus] Add extractor
5,686
yt-dlp/yt-dlp
132,642
Python
bashonly
pzhlkj6612
'id': content_code, 'title': data_json['title'], 'formats': formats, # optional metafields '_format_sort_fields': ('tbr', 'vcodec', 'acodec'), 'channel': self._get_channel_base_info(fanclub_site_id).get('fanclub_site_name'), 'channe...
merge master into the PR branch, and then you could do this: ```suggestion return { 'id': content_code, 'formats': formats, '_format_sort_fields': ('tbr', 'vcodec', 'acodec'), 'channel': self._get_channel_base_info(fanclub_site_id).get('fanclub_site_name'), ...
'_format_sort_fields': ('tbr', 'vcodec', 'acodec'), 'channel': self._get_channel_base_info(fanclub_site_id).get('fanclub_site_name'), 'channel_id': channel_id, 'channel_url': f'{self._WEBPAGE_BASE_URL}/{channel_id}', 'age_limit': traverse_obj(self._get_channel...
@@ -0,0 +1,441 @@ +import functools +import json + +from .common import InfoExtractor +from ..utils import ( + ExtractorError, + OnDemandPagedList, + filter_dict, + int_or_none, + parse_iso8601, + parse_qs, + traverse_obj, +) + + +class NiconicoChannelPlusBaseIE(InfoExtractor): + _WEBPAGE_BASE_U...
yt_dlp/extractor/niconicochannelplus.py
26
Python
0.857
refactor
1,342
51
51
false
[extractor/niconicochannelplus] Add extractor
5,686
yt-dlp/yt-dlp
132,642
Python
bashonly
pzhlkj6612
f'video_pages/{content_code}/comments_user_token', item_id, note='Getting comment token', errnote='Unable to get comment token', )['data']['access_token'] comment_list = self._download_json( 'https://comm-api.sheeta.com/messages.history', video_id=item_id, ...
also may need merge from master ```suggestion for comment in traverse_obj(comment_list, ...): yield traverse_obj(comment, { 'author': ('nickname', {str}), 'author_id': ('sender_id', {str_or_none}), 'id': ('id', {str_or_none}), 't...
query={ 'sort_direction': 'asc', 'limit': int_or_none(self._configuration_arg('max_comments', [''])[0]) or 120, }, data=json.dumps({ 'token': comment_access_token, 'group_id': comment_group_id, }).encode('asc...
@@ -0,0 +1,441 @@ +import functools +import json + +from .common import InfoExtractor +from ..utils import ( + ExtractorError, + OnDemandPagedList, + filter_dict, + int_or_none, + parse_iso8601, + parse_qs, + traverse_obj, +) + + +class NiconicoChannelPlusBaseIE(InfoExtractor): + _WEBPAGE_BASE_U...
yt_dlp/extractor/niconicochannelplus.py
26
Python
0.786
security
553
51
51
false
[extractor/niconicochannelplus] Add extractor
5,686
yt-dlp/yt-dlp
132,642
Python
bashonly
pzhlkj6612
'group_id': comment_group_id, }).encode('ascii')) for comment in comment_list: yield { 'author': comment.get('nickname'), 'author_id': comment.get('sender_id'), 'id': comment.get('id'), 'text': comment.get('...
could inline this and remove var above ```suggestion if not data_json.get('live_started_at'): ```
'text': ('message', {str}), 'timestamp': (('updated_at', 'sent_at', 'created_at'), {unified_timestamp}), 'author_is_uploader': ('sender_id', {lambda x: x == '-1'}), }, get_all=False) def _get_live_status_and_session_id(self, content_code, data_json): ...
@@ -0,0 +1,441 @@ +import functools +import json + +from .common import InfoExtractor +from ..utils import ( + ExtractorError, + OnDemandPagedList, + filter_dict, + int_or_none, + parse_iso8601, + parse_qs, + traverse_obj, +) + + +class NiconicoChannelPlusBaseIE(InfoExtractor): + _WEBPAGE_BASE_U...
yt_dlp/extractor/niconicochannelplus.py
26
Python
0.786
suggestion
112
51
51
false
[extractor/niconicochannelplus] Add extractor
5,686
yt-dlp/yt-dlp
132,642
Python
bashonly
pzhlkj6612
query={ 'sort_direction': 'asc', 'limit': traverse_obj(self._configuration_arg('max_comments', [120]), (0, )), }, data=json.dumps({ 'token': comment_access_token, 'group_id': comment_group_id, }).encode('asci...
this will save some repetition ```suggestion payload = {} if video_type == 'vod': ```
for comment in traverse_obj(comment_list, ...): yield traverse_obj(comment, { 'author': ('nickname', {str}), 'author_id': ('sender_id', {str_or_none}), 'id': ('id', {str_or_none}), 'text': ('message', {str}), 'timestamp...
@@ -0,0 +1,441 @@ +import functools +import json + +from .common import InfoExtractor +from ..utils import ( + ExtractorError, + OnDemandPagedList, + filter_dict, + int_or_none, + parse_iso8601, + parse_qs, + traverse_obj, +) + + +class NiconicoChannelPlusBaseIE(InfoExtractor): + _WEBPAGE_BASE_U...
yt_dlp/extractor/niconicochannelplus.py
26
Python
0.857
suggestion
105
51
51
false
[extractor/niconicochannelplus] Add extractor
5,686
yt-dlp/yt-dlp
132,642
Python
bashonly
pzhlkj6612
'author': comment.get('nickname'), 'author_id': comment.get('sender_id'), 'id': comment.get('id'), 'text': comment.get('message'), 'timestamp': int_or_none(traverse_obj(comment, 'updated_at', 'sent_at', 'created_at')), 'auth...
see above suggestion ```suggestion live_status = 'is_live' ```
def _get_live_status_and_session_id(self, content_code, data_json): video_type = data_json.get('type') live_finished_at = data_json.get('live_finished_at') payload = {} if video_type == 'vod': if live_finished_at: live_status = 'was_live' else...
@@ -0,0 +1,441 @@ +import functools +import json + +from .common import InfoExtractor +from ..utils import ( + ExtractorError, + OnDemandPagedList, + filter_dict, + int_or_none, + parse_iso8601, + parse_qs, + traverse_obj, +) + + +class NiconicoChannelPlusBaseIE(InfoExtractor): + _WEBPAGE_BASE_U...
yt_dlp/extractor/niconicochannelplus.py
26
Python
0.571
suggestion
81
51
51
false
[extractor/niconicochannelplus] Add extractor
5,686
yt-dlp/yt-dlp
132,642
Python
bashonly
pzhlkj6612
'Content-Type': 'application/json', 'fc_use_device': 'null', 'origin': 'https://nicochannel.jp', }, note='Getting session id', errnote='Unable to get session id', )['data']['session_id'] return live_status, session_id class Nicon...
I would do it like this, but your way is fine too ```suggestion response = self._call_api( path, item_id, query={ **query, 'page': (page + 1), 'per_page': self._PAGE_SIZE, }, headers={'fc_use_device': 'null'}, ...
def _fetch_paged_channel_video_list(self, path, query, channel_name, item_id, page): response = self._call_api( path, item_id, query={ **query, 'page': (page + 1), 'per_page': self._PAGE_SIZE, }, headers={'fc_use_device': '...
@@ -0,0 +1,441 @@ +import functools +import json + +from .common import InfoExtractor +from ..utils import ( + ExtractorError, + OnDemandPagedList, + filter_dict, + int_or_none, + parse_iso8601, + parse_qs, + traverse_obj, +) + + +class NiconicoChannelPlusBaseIE(InfoExtractor): + _WEBPAGE_BASE_U...
yt_dlp/extractor/niconicochannelplus.py
26
Python
1
suggestion
530
51
51
false
[extractor/niconicochannelplus] Add extractor
5,686
yt-dlp/yt-dlp
132,642
Python
bashonly
pzhlkj6612
'view_count': ('video_aggregate_info', 'total_views', {int_or_none}), 'tags': ('video_tags', ..., 'tag', {str}), }), '__post_extractor': self.extract_comments( content_code=content_code, comment_group_id=traverse_obj(data_json, ('vi...
to ensure user input is a number ```suggestion 'limit': int_or_none(self._configuration_arg('max_comments', [''])[0]) or 120, ```
'view_count': ('video_aggregate_info', 'total_views', {int_or_none}), 'tags': ('video_tags', ..., 'tag', {str}), }), '__post_extractor': self.extract_comments( content_code=content_code, comment_group_id=traverse_obj(data_json, ('vi...
@@ -0,0 +1,428 @@ +import functools +import json + +from .common import InfoExtractor +from ..utils import ( + ExtractorError, + OnDemandPagedList, + filter_dict, + int_or_none, + parse_qs, + str_or_none, + traverse_obj, + unified_timestamp, + url_or_none, +) + + +class NiconicoChannelPlusBas...
yt_dlp/extractor/niconicochannelplus.py
26
Python
0.786
suggestion
148
51
51
false
[extractor/niconicochannelplus] Add extractor
5,686
yt-dlp/yt-dlp
132,642
Python
bashonly
pzhlkj6612
else: live_status = 'not_live' elif video_type == 'live': if not data_json.get('live_started_at'): return 'is_upcoming', '' if not live_finished_at: live_status = 'is_live' else: live_status = 'was_l...
```suggestion self.write_debug(f'{content_code}: video_type={video_type}, live_status={live_status}') ```
else: live_status = 'not_live' elif video_type == 'live': if not data_json.get('live_started_at'): return 'is_upcoming', '' if not live_finished_at: live_status = 'is_live' else: live_status = 'was_l...
@@ -0,0 +1,428 @@ +import functools +import json + +from .common import InfoExtractor +from ..utils import ( + ExtractorError, + OnDemandPagedList, + filter_dict, + int_or_none, + parse_qs, + str_or_none, + traverse_obj, + unified_timestamp, + url_or_none, +) + + +class NiconicoChannelPlusBas...
yt_dlp/extractor/niconicochannelplus.py
26
Python
0.857
bug
115
51
51
false
[extractor/niconicochannelplus] Add extractor
5,686
yt-dlp/yt-dlp
132,642
Python
bashonly
pzhlkj6612
'videoiodonna-vh.akamaihd': 'iodonna', 'media2-leitv-it.akamaized': 'leitv', 'videoleitv-vh.akamaihd': 'leitv', 'videoliving-vh.akamaihd': 'living', 'media2-living-corriere-it.akamaized': 'living', 'media2-oggi-it.akamaized': 'oggi', 'videooggi-vh.akamaihd': 'oggi...
Cant u use utils.mimetype2ext?
'videooggi-vh.akamaihd': 'oggi', 'media2-quimamme-it.akamaized': 'quimamme', 'quimamme-vh.akamaihd': 'quimamme', 'videorunning-vh.akamaihd': 'running', 'media2-style-corriere-it.akamaized': 'style', 'style-vh.akamaihd': 'style', 'videostyle-vh.akamaihd': 'style', ...
@@ -90,112 +72,91 @@ class RCSBaseIE(InfoExtractor): 'vivimilano-vh.akamaihd': 'vivimilano', 'media2-youreporter-it.akamaized': 'youreporter' } - _MIGRATION_MEDIA = { - 'advrcs-vh.akamaihd': '', - 'corriere-f.akamaihd': '', - 'corrierepmd-corriere-it.akamaized': '', - ...
yt_dlp/extractor/rcs.py
26
Python
0.286
question
30
51
51
false
[extractor/rcs] Improved and fixed RCS extractor
5,700
yt-dlp/yt-dlp
132,642
Python
pukkandan
nixxo
'audio/mpeg': 'mp3', 'video/mp4': 'mp4', # unreliable: use _create_http_formats instead 'application/f4m': 'dash', # TODO } def _get_video_src(self, video): mediaFiles = traverse_obj(video, ('mediaProfile', 'mediaFile')) sources = [] for source in mediaFiles: ...
this can be simplified. But since it's legacy code, I wont insist
('corrierepmd.corriere.it.edgesuite.net', 'corrierepmd-corriere-it.akamaized.net'), ('media2vam-corriere-it.akamaized.net/fcs.quotidiani/vr/videos/', 'video.corriere.it/vr360/videos/'), ('http://', 'https://'), ): url = url.replace(s, r) ...
@@ -90,112 +72,91 @@ class RCSBaseIE(InfoExtractor): 'vivimilano-vh.akamaihd': 'vivimilano', 'media2-youreporter-it.akamaized': 'youreporter' } - _MIGRATION_MEDIA = { - 'advrcs-vh.akamaihd': '', - 'corriere-f.akamaihd': '', - 'corrierepmd-corriere-it.akamaized': '', - ...
yt_dlp/extractor/rcs.py
26
Python
0.214
suggestion
65
51
51
false
[extractor/rcs] Improved and fixed RCS extractor
5,700
yt-dlp/yt-dlp
132,642
Python
pukkandan
nixxo
format_id = http_f['format_id'].replace('hls-', 'https-') urlh = self._request_webpage( HEADRequest(http_url), video_id, note=f'Check filesize for {format_id}', fatal=False) if urlh: http_f.update({ ...
```suggestion formats.extend(self._create_http_formats( source['url'], m3u8_formats or [], video_id)) elif source['type'] == 'mp3': ```
yield http_f def _create_formats(self, sources, video_id): for source in sources: if source['type'] == 'm3u8': m3u8_formats = self._extract_m3u8_formats( source['url'], video_id, 'mp4', m3u8_id='hls', fatal=False) yield from m3u8_f...
@@ -90,112 +72,91 @@ class RCSBaseIE(InfoExtractor): 'vivimilano-vh.akamaihd': 'vivimilano', 'media2-youreporter-it.akamaized': 'youreporter' } - _MIGRATION_MEDIA = { - 'advrcs-vh.akamaihd': '', - 'corriere-f.akamaihd': '', - 'corrierepmd-corriere-it.akamaized': '', - ...
yt_dlp/extractor/rcs.py
26
Python
0.857
suggestion
187
51
51
false
[extractor/rcs] Improved and fixed RCS extractor
5,700
yt-dlp/yt-dlp
132,642
Python
pukkandan
nixxo
}) return formats def _real_extract(self, url): mobj = self._match_valid_url(url) video_id = mobj.group('id') if 'cdn' not in mobj.groupdict(): raise ExtractorError('CDN not found in url: %s' % url) # for leitv/youreporter don't use the embed p...
```suggestion /fragment-includes/video-includes/[^"']+?\.json ```
if data_config.get('newspaper'): cdn = f'{data_config["newspaper"]}.it' display_id, video_id = video_id, data_config.get('uuid') or video_id url = f'https://video.{cdn}/video-json/{video_id}' else: json_url = self._search_re...
@@ -205,26 +166,27 @@ def _real_extract(self, url): if 'cdn' not in mobj.groupdict(): raise ExtractorError('CDN not found in url: %s' % url) - # for leitv/youreporter/viaggi don't use the embed page - if ((mobj.group('cdn') not in ['leitv.it', 'youreporter.it']) - an...
yt_dlp/extractor/rcs.py
26
Python
0.571
suggestion
83
51
51
false
[extractor/rcs] Improved and fixed RCS extractor
5,700
yt-dlp/yt-dlp
132,642
Python
pukkandan
nixxo
}] @staticmethod def _sanitize_urls(urls): # add protocol if missing and clean iframes urls for url in urls: url = sanitize_url(url, scheme='https') url = urljoin(base_url(url), url_basename(url)) return urls @classmethod def _extract_embed_urls(cls,...
```suggestion /(?!video-embed/)[^?#]+?/(?P<id>[^/\?]+)(?=\?|/$|$)''' ``` URLs can technically have space. `.+?` is fine when matching against URL. The problem is when matching against large data (i.e, webpage)
'title': 'Vettel guida la Ferrari SF90 al Mugello e al suo fianco c\'è Leclerc (bendato): il video è esilarante', 'description': 'md5:3915ce5ebb3d2571deb69a5eb85ac9b5', 'uploader': 'Corriere Tv', } }, { # search for video id inside the page 'url': 'https:/...
@@ -349,10 +308,10 @@ class RCSIE(RCSBaseIE): |corrierefiorentino\. )?corriere\.it |(?:gazzanet\.)?gazzetta\.it) - /(?!video-embed/).+?/(?P<id>[^/\?]+)(?=\?|/$|$)''' + /(?!video-embed/)\S+?/(?P<id>[^/\?]+)(?=\?|/$|$...
yt_dlp/extractor/rcs.py
26
Python
0.786
suggestion
232
51
51
false
[extractor/rcs] Improved and fixed RCS extractor
5,700
yt-dlp/yt-dlp
132,642
Python
pukkandan
nixxo
if data_config: data_config = self._parse_json( extract_attributes(data_config).get('data-config'), video_id, fatal=False) or {} if data_config.get('newspaper'): cdn = f'{data_config["newspaper"]}.it' ...
```suggestion video_data = self._search_json( '##start-video##', webpage, 'video data', video_id, default=None, end_pattern='##end-video##', transform_source=js_to_json) ```
if data_config: data_config = self._parse_json( extract_attributes(data_config).get('data-config'), video_id, fatal=False) or {} if data_config.get('newspaper'): cdn = f'{data_config["newspaper"]}.it' ...
@@ -90,183 +66,140 @@ class RCSBaseIE(InfoExtractor): 'vivimilano-vh.akamaihd': 'vivimilano', 'media2-youreporter-it.akamaized': 'youreporter' } - _MIGRATION_MEDIA = { - 'advrcs-vh.akamaihd': '', - 'corriere-f.akamaihd': '', - 'corrierepmd-corriere-it.akamaized': '', - ...
yt_dlp/extractor/rcs.py
26
Python
0.786
suggestion
221
51
51
false
[extractor/rcs] Improved and fixed RCS extractor
5,700
yt-dlp/yt-dlp
132,642
Python
pukkandan
nixxo
qualities, remove_start, srt_subtitles_timecode, str_or_none, traverse_obj, try_get, url_or_none, ) class TikTokBaseIE(InfoExtractor): _APP_VERSIONS = [('26.1.3', '260103'), ('26.1.2', '260102'), ('26.1.1', '260101'), ('25.6.2', '250602')] _WORKING_APP_VERSION = None _APP_NAME ...
```suggestion @property def _API_HOSTNAME(self): return self._configuration_arg( 'api_hostname', ['api16-normal-c-useast1a.tiktokv.com'], ie_key=TikTokIE)[0] ```
qualities, remove_start, srt_subtitles_timecode, str_or_none, traverse_obj, try_get, url_or_none, ) class TikTokBaseIE(InfoExtractor): _APP_VERSIONS = [('26.1.3', '260103'), ('26.1.2', '260102'), ('26.1.1', '260101'), ('25.6.2', '250602')] _WORKING_APP_VERSION = None _APP_NAME ...
@@ -35,6 +35,13 @@ class TikTokBaseIE(InfoExtractor): _WEBPAGE_HOST = 'https://www.tiktok.com/' QUALITIES = ('360p', '540p', '720p', '1080p') + def _real_initialize(self): + api_hostname = traverse_obj( + self._configuration_arg('api_hostname', ie_key=TikTokIE.ie_key()), -1) + if...
yt_dlp/extractor/tiktok.py
26
Python
0.786
suggestion
194
51
51
false
[extractor/tiktok] Update `_VALID_URL`, add `api_hostname` arg
5,708
yt-dlp/yt-dlp
132,642
Python
pukkandan
bashonly
'info_dict': { 'id': 'warszawa-plac-zamkowy', 'ext': 'mp4', 'title': 'WIDOK NA PLAC ZAMKOWY W WARSZAWIE', } }, { 'url': 'https://gdansk-stare-miasto.webcamera.pl/', 'info_dict': { 'id': 'gdansk-stare-miasto', 'ext': 'mp4', ...
We usually extract `subtitles` as well ```suggestion formats, subtitles = self._extract_m3u8_formats_and_subtitles(m3u8_url, video_id, ext='mp4') ```
'info_dict': { 'id': 'warszawa-plac-zamkowy', 'ext': 'mp4', 'title': r're:WIDOK NA PLAC ZAMKOWY W WARSZAWIE \d{4}-\d{2}-\d{2} \d{2}:\d{2}$', 'live_status': 'is_live', } }, { 'url': 'https://gdansk-stare-miasto.webcamera.pl/', 'info_dict...
@@ -0,0 +1,43 @@ +from codecs import decode + +from .common import InfoExtractor + + +class WebcameraplIE(InfoExtractor): + _VALID_URL = r'https?://(?P<id>[^\.]+)\.webcamera\.pl/?' + _TESTS = [{ + 'url': 'https://warszawa-plac-zamkowy.webcamera.pl', + 'info_dict': { + 'id': 'warszawa-plac...
yt_dlp/extractor/webcamerapl.py
26
Python
0.786
refactor
160
35
36
false
[webcamerapl] Add extractor
5,715
yt-dlp/yt-dlp
132,642
Python
HobbyistDev
ghost
_VALID_URL = r'https?://(?P<id>[^\.]+)\.webcamera\.pl/?' _TESTS = [{ 'url': 'https://warszawa-plac-zamkowy.webcamera.pl', 'info_dict': { 'id': 'warszawa-plac-zamkowy', 'ext': 'mp4', 'title': 'WIDOK NA PLAC ZAMKOWY W WARSZAWIE', } }, { 'url'...
Why not set `rot13_m3u8_url` to fatal ?
_VALID_URL = r'https?://(?P<id>[\w-]+)\.webcamera\.pl' _TESTS = [{ 'url': 'https://warszawa-plac-zamkowy.webcamera.pl', 'info_dict': { 'id': 'warszawa-plac-zamkowy', 'ext': 'mp4', 'title': r're:WIDOK NA PLAC ZAMKOWY W WARSZAWIE \d{4}-\d{2}-\d{2} \d{2}:\d{2}$',...
@@ -0,0 +1,43 @@ +from codecs import decode + +from .common import InfoExtractor + + +class WebcameraplIE(InfoExtractor): + _VALID_URL = r'https?://(?P<id>[^\.]+)\.webcamera\.pl/?' + _TESTS = [{ + 'url': 'https://warszawa-plac-zamkowy.webcamera.pl', + 'info_dict': { + 'id': 'warszawa-plac...
yt_dlp/extractor/webcamerapl.py
26
Python
0.214
question
39
38
39
false
[webcamerapl] Add extractor
5,715
yt-dlp/yt-dlp
132,642
Python
HobbyistDev
ghost
'info_dict': { 'id': 'gdansk-stare-miasto', 'ext': 'mp4', 'title': 'GDAŃSK - widok na Stare Miasto' } }] def _real_extract(self, url): video_id = self._match_id(url) webpage = self._download_webpage(url, video_id) title = self._html_s...
If formats already extracted, it not necessary to set `url` and `ext` field, as this information already in `formats` field ```suggestion ```
'url': 'https://gdansk-stare-miasto.webcamera.pl/', 'info_dict': { 'id': 'gdansk-stare-miasto', 'ext': 'mp4', 'title': r're:GDAŃSK - widok na Stare Miasto \d{4}-\d{2}-\d{2} \d{2}:\d{2}$', 'live_status': 'is_live', } }] def _real_extract(se...
@@ -0,0 +1,43 @@ +from codecs import decode + +from .common import InfoExtractor + + +class WebcameraplIE(InfoExtractor): + _VALID_URL = r'https?://(?P<id>[^\.]+)\.webcamera\.pl/?' + _TESTS = [{ + 'url': 'https://warszawa-plac-zamkowy.webcamera.pl', + 'info_dict': { + 'id': 'warszawa-plac...
yt_dlp/extractor/webcamerapl.py
26
Python
0.786
refactor
143
28
29
false
[webcamerapl] Add extractor
5,715
yt-dlp/yt-dlp
132,642
Python
HobbyistDev
ghost
import codecs from .common import InfoExtractor class WebcameraplIE(InfoExtractor): _VALID_URL = r'https?://(?P<id>[\w-]+)\.webcamera\.pl' _TESTS = [{ 'url': 'https://warszawa-plac-zamkowy.webcamera.pl', 'info_dict': { 'id': 'warszawa-plac-zamkowy', 'ext': 'mp4', ...
```suggestion 'title': r're:WIDOK NA PLAC ZAMKOWY W WARSZAWIE \d{4}-\d{2}-\d{2} \d{2}:\d{2}$', ``` yt-dlp adds timestamp to title for livestreams. Do same for the other test
import codecs from .common import InfoExtractor class WebcameraplIE(InfoExtractor): _VALID_URL = r'https?://(?P<id>[\w-]+)\.webcamera\.pl' _TESTS = [{ 'url': 'https://warszawa-plac-zamkowy.webcamera.pl', 'info_dict': { 'id': 'warszawa-plac-zamkowy', 'ext': 'mp4', ...
@@ -0,0 +1,42 @@ +import codecs + +from .common import InfoExtractor + + +class WebcameraplIE(InfoExtractor): + _VALID_URL = r'https?://(?P<id>[\w-]+)\.webcamera\.pl' + _TESTS = [{ + 'url': 'https://warszawa-plac-zamkowy.webcamera.pl', + 'info_dict': { + 'id': 'warszawa-plac-zamkowy', + ...
yt_dlp/extractor/webcamerapl.py
13
Python
0.714
suggestion
188
38
38
false
[webcamerapl] Add extractor
5,715
yt-dlp/yt-dlp
132,642
Python
pukkandan
ghost
import time import random import string import hashlib from .common import InfoExtractor from ..utils import traverse_obj class KankaNewsIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?kankanews\.com/a/[0-9]+\-[0-9]+\-[0-9]+/[0-9]+\.shtml.*' _TESTS = [{ 'url': 'https://www.kankanews.com/a/2022-1...
```suggestion _VALID_URL = r'https?://(?:www\.)?kankanews\.com/a/\d+\-\d+\-\d+/(?P<id>\d+)\.shtml' ```
import time import random import string import hashlib import urllib.parse from .common import InfoExtractor class KankaNewsIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?kankanews\.com/a/\d+\-\d+\-\d+/(?P<id>\d+)\.shtml' _TESTS = [{ 'url': 'https://www.kankanews.com/a/2022-11-08/00310276054.sh...
@@ -0,0 +1,47 @@ +import time +import random +import string +import hashlib + +from .common import InfoExtractor +from ..utils import traverse_obj + + +class KankaNewsIE(InfoExtractor): + _VALID_URL = r'https?://(?:www\.)?kankanews\.com/a/[0-9]+\-[0-9]+\-[0-9]+/[0-9]+\.shtml.*'
yt_dlp/extractor/kankanews.py
11
Python
0.714
suggestion
108
36
36
false
[extractor/kankanews] Add new extractor
5,729
yt-dlp/yt-dlp
132,642
Python
pukkandan
synthpop123
import time import random import string import hashlib from .common import InfoExtractor from ..utils import traverse_obj class KankaNewsIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?kankanews\.com/a/[0-9]+\-[0-9]+\-[0-9]+/[0-9]+\.shtml.*' _TESTS = [{ 'url': 'https://www.kankanews.com/a/2022-1...
```suggestion display_id = self._match_id(url) webpage = self._download_webpage(url, display_id) ```
import time import random import string import hashlib import urllib.parse from .common import InfoExtractor class KankaNewsIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?kankanews\.com/a/\d+\-\d+\-\d+/(?P<id>\d+)\.shtml' _TESTS = [{ 'url': 'https://www.kankanews.com/a/2022-11-08/00310276054.sh...
@@ -0,0 +1,47 @@ +import time +import random +import string +import hashlib + +from .common import InfoExtractor +from ..utils import traverse_obj + + +class KankaNewsIE(InfoExtractor): + _VALID_URL = r'https?://(?:www\.)?kankanews\.com/a/[0-9]+\-[0-9]+\-[0-9]+/[0-9]+\.shtml.*' + _TESTS = [{ + 'url': 'http...
yt_dlp/extractor/kankanews.py
25
Python
0.714
suggestion
119
48
49
false
[extractor/kankanews] Add new extractor
5,729
yt-dlp/yt-dlp
132,642
Python
pukkandan
synthpop123
import time import random import string import hashlib from .common import InfoExtractor from ..utils import traverse_obj class KankaNewsIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?kankanews\.com/a/[0-9]+\-[0-9]+\-[0-9]+/[0-9]+\.shtml.*' _TESTS = [{ 'url': 'https://www.kankanews.com/a/2022-1...
```suggestion video_id = self._search_regex(r'omsid\s*=\s*"(\d+)"', webpage, 'video id') ```
import time import random import string import hashlib import urllib.parse from .common import InfoExtractor class KankaNewsIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?kankanews\.com/a/\d+\-\d+\-\d+/(?P<id>\d+)\.shtml' _TESTS = [{ 'url': 'https://www.kankanews.com/a/2022-11-08/00310276054.sh...
@@ -0,0 +1,47 @@ +import time +import random +import string +import hashlib + +from .common import InfoExtractor +from ..utils import traverse_obj + + +class KankaNewsIE(InfoExtractor): + _VALID_URL = r'https?://(?:www\.)?kankanews\.com/a/[0-9]+\-[0-9]+\-[0-9]+/[0-9]+\.shtml.*' + _TESTS = [{ + 'url': 'http...
yt_dlp/extractor/kankanews.py
26
Python
0.714
suggestion
102
48
49
false
[extractor/kankanews] Add new extractor
5,729
yt-dlp/yt-dlp
132,642
Python
pukkandan
synthpop123
'info_dict': { 'id': '4485057', 'url': 'http://mediaplay.kksmg.com/2022/11/08/h264_450k_mp4_1a388ad771e0e4cc28b0da44d245054e_ncm.mp4', 'ext': 'mp4', 'title': '视频|第23个中国记者节,我们在进博切蛋糕', 'thumbnail': r're:^https?://.*\.jpg*', } }] def _rea...
```suggestion params = { 'nonce': ''.join(random.choices(string.ascii_lowercase + string.digits, k=8)), 'omsid': video_id, 'platform': 'pc', 'timestamp': int(time.time()), 'version': '1.0', '28c8edde3d61a0411511d3b1866f0636': '', ...
'info_dict': { 'id': '4485057', 'url': 'http://mediaplay.kksmg.com/2022/11/08/h264_450k_mp4_1a388ad771e0e4cc28b0da44d245054e_ncm.mp4', 'ext': 'mp4', 'title': '视频|第23个中国记者节,我们在进博切蛋糕', 'thumbnail': r're:^https?://.*\.jpg*', } }] def _rea...
@@ -0,0 +1,47 @@ +import time +import random +import string +import hashlib + +from .common import InfoExtractor +from ..utils import traverse_obj + + +class KankaNewsIE(InfoExtractor): + _VALID_URL = r'https?://(?:www\.)?kankanews\.com/a/[0-9]+\-[0-9]+\-[0-9]+/[0-9]+\.shtml.*' + _TESTS = [{ + 'url': 'http...
yt_dlp/extractor/kankanews.py
26
Python
0.786
suggestion
628
34
35
false
[extractor/kankanews] Add new extractor
5,729
yt-dlp/yt-dlp
132,642
Python
pukkandan
synthpop123
'title': '视频|第23个中国记者节,我们在进博切蛋糕', 'thumbnail': r're:^https?://.*\.jpg*', } }] def _real_extract(self, url): webpage = self._download_webpage(url, None) video_id = self._search_regex(r'omsid="(\d+)"', webpage, 'video_id') params = [ 'nonce=' +...
```suggestion 'url': meta['videourl'], ```
'title': '视频|第23个中国记者节,我们在进博切蛋糕', 'thumbnail': r're:^https?://.*\.jpg*', } }] def _real_extract(self, url): display_id = self._match_id(url) webpage = self._download_webpage(url, display_id) video_id = self._search_regex(r'omsid\s*=\s*"(\d+)"', webpage, '...
@@ -0,0 +1,47 @@ +import time +import random +import string +import hashlib + +from .common import InfoExtractor +from ..utils import traverse_obj + + +class KankaNewsIE(InfoExtractor): + _VALID_URL = r'https?://(?:www\.)?kankanews\.com/a/[0-9]+\-[0-9]+\-[0-9]+/[0-9]+\.shtml.*' + _TESTS = [{ + 'url': 'http...
yt_dlp/extractor/kankanews.py
26
Python
0.571
suggestion
56
30
31
false
[extractor/kankanews] Add new extractor
5,729
yt-dlp/yt-dlp
132,642
Python
pukkandan
synthpop123
'thumbnail': r're:^https?://.*\.jpg*', } }] def _real_extract(self, url): webpage = self._download_webpage(url, None) video_id = self._search_regex(r'omsid="(\d+)"', webpage, 'video_id') params = [ 'nonce=' + str(''.join(random.choices(string.ascii_lette...
```suggestion 'title': self._search_regex(r'g\.title\s*=\s*"([^"]+)"', webpage, 'title'), ``` Why the `g\.`?
'thumbnail': r're:^https?://.*\.jpg*', } }] def _real_extract(self, url): display_id = self._match_id(url) webpage = self._download_webpage(url, display_id) video_id = self._search_regex(r'omsid\s*=\s*"(\d+)"', webpage, 'video id') params = { 'no...
@@ -0,0 +1,47 @@ +import time +import random +import string +import hashlib + +from .common import InfoExtractor +from ..utils import traverse_obj + + +class KankaNewsIE(InfoExtractor): + _VALID_URL = r'https?://(?:www\.)?kankanews\.com/a/[0-9]+\-[0-9]+\-[0-9]+/[0-9]+\.shtml.*' + _TESTS = [{ + 'url': 'http...
yt_dlp/extractor/kankanews.py
26
Python
0.714
question
125
29
30
false
[extractor/kankanews] Add new extractor
5,729
yt-dlp/yt-dlp
132,642
Python
pukkandan
synthpop123
}] def _real_extract(self, url): display_id = self._match_id(url) webpage = self._download_webpage(url, display_id) video_id = self._search_regex(r'omsid\s*=\s*"(\d+)"', webpage, 'video id') params = { 'nonce': ''.join(random.choices(string.ascii_lowercase + string....
```suggestion 'thumbnail': meta.get('titlepic'), ```
}] def _real_extract(self, url): display_id = self._match_id(url) webpage = self._download_webpage(url, display_id) video_id = self._search_regex(r'omsid\s*=\s*"(\d+)"', webpage, 'video id') params = { 'nonce': ''.join(random.choices(string.ascii_lowercase + string....
@@ -0,0 +1,48 @@ +import time +import random +import string +import hashlib +import urllib.parse + +from .common import InfoExtractor + + +class KankaNewsIE(InfoExtractor): + _VALID_URL = r'https?://(?:www\.)?kankanews\.com/a/\d+\-\d+\-\d+/(?P<id>\d+)\.shtml' + _TESTS = [{ + 'url': 'https://www.kankanews.c...
yt_dlp/extractor/kankanews.py
26
Python
0.571
suggestion
66
28
28
false
[extractor/kankanews] Add new extractor
5,729
yt-dlp/yt-dlp
132,642
Python
pukkandan
synthpop123
info.get('title') or '', 'episode metadata', group=('season_no', 'episode_no', 'episode', 'series'), default=(None, None, None, None)) description = traverse_obj(video_data, ('data', 'ongoing_ondemand', 'description', 'fin'), expected_type=str) subtitles = {} for sub in ...
```suggestion return { '_type': 'url_transparent', 'url': smuggle_url( f'kaltura:1955031:{video_data["data"]["ongoing_ondemand"]["kaltura"]["id"]}', {'source_url': url}), ```
subtitles = {} for sub in traverse_obj(video_data, ('data', 'ongoing_ondemand', 'subtitles', ...)): if url_or_none(sub.get('uri')): subtitles.setdefault(sub.get('language') or 'und', []).append({ 'url': sub['uri'], 'ext': 'srt', ...
@@ -52,20 +94,33 @@ def _real_extract(self, url): 'name': sub.get('kind'), }) + # Video manifest URL + manifest_url = traverse_obj(video_data, ('data', 'ongoing_ondemand', 'manifest_url')) + # Extract video release date + start_time = traverse_obj(vide...
yt_dlp/extractor/yle_areena.py
26
Python
0.929
suggestion
246
44
31
false
[yle_areena] Extended to proceed protected content.
5,735
yt-dlp/yt-dlp
132,642
Python
pukkandan
docbender
# Extract video release date start_time = traverse_obj(video_data, ('data', 'ongoing_ondemand', 'start_time'), expected_type=str) release_date = '%s%s%s' % (start_time[0:4], start_time[5:7], start_time[8:10]) # Service URL kaltura_url = 'kaltura:1955031:%s' % traverse_obj(video_d...
webpage_url is auto-generated. manifest_url makes no sense for `_type=url_transparent` ```suggestion ```
from .common import InfoExtractor from .kaltura import KalturaIE from ..utils import ( int_or_none, smuggle_url, traverse_obj, unified_strdate, url_or_none, ) class YleAreenaIE(InfoExtractor): _VALID_URL = r'https?://areena\.yle\.fi/(?P<id>[\d-]+)' _TESTS = [ { 'url': '...
@@ -52,20 +94,33 @@ def _real_extract(self, url): 'name': sub.get('kind'), }) + # Video manifest URL + manifest_url = traverse_obj(video_data, ('data', 'ongoing_ondemand', 'manifest_url')) + # Extract video release date + start_time = traverse_obj(vide...
yt_dlp/extractor/yle_areena.py
26
Python
0.857
suggestion
106
29
114
false
[yle_areena] Extended to proceed protected content.
5,735
yt-dlp/yt-dlp
132,642
Python
pukkandan
docbender
# Example title: 'K1, J2: Pouchit | Modernit miehet' series, season_number, episode_number, episode = self._search_regex( r'K(?P<season_no>[\d]+),\s*J(?P<episode_no>[\d]+):?\s*\b(?P<episode>[^|]+)\s*|\s*(?P<series>.+)', info.get('title') or '', 'episode metadata', group=('season...
Unnecessary single use variables
r'K(?P<season_no>[\d]+),\s*J(?P<episode_no>[\d]+):?\s*\b(?P<episode>[^|]+)\s*|\s*(?P<series>.+)', info.get('title') or '', 'episode metadata', group=('season_no', 'episode_no', 'episode', 'series'), default=(None, None, None, None)) description = traverse_obj(video_data, ('da...
@@ -52,20 +94,33 @@ def _real_extract(self, url): 'name': sub.get('kind'), }) + # Video manifest URL + manifest_url = traverse_obj(video_data, ('data', 'ongoing_ondemand', 'manifest_url')) + # Extract video release date + start_time = traverse_obj(vide...
yt_dlp/extractor/yle_areena.py
26
Python
0.143
suggestion
32
48
35
false
[yle_areena] Extended to proceed protected content.
5,735
yt-dlp/yt-dlp
132,642
Python
pukkandan
docbender
'subtitles': {}, 'age_limit': 0, 'webpage_url': 'https://areena.yle.fi/1-2158940' } } ] def generate_api_headers( self): """Prepare requested site header""" headers = { 'origin': 'https://areena.yle.fi',...
```suggestion video_id, headers=real_headers) ``` it is the default
'uploader_id': 'ovp@yle.fi', 'duration': 319, 'view_count': int, 'upload_date': '20211202', 'release_date': '20211215', 'timestamp': 1638448202, 'subtitles': {}, 'age_limit': 0, ...
@@ -1,40 +1,82 @@ from .common import InfoExtractor from .kaltura import KalturaIE -from ..utils import int_or_none, traverse_obj, url_or_none +from ..utils import int_or_none, traverse_obj, url_or_none, filter_dict, smuggle_url class YleAreenaIE(InfoExtractor): _VALID_URL = r'https?://areena\.yle\.fi/(?P<i...
yt_dlp/extractor/yle_areena.py
26
Python
0.571
suggestion
82
51
51
false
[yle_areena] Extended to proceed protected content.
5,735
yt-dlp/yt-dlp
132,642
Python
pukkandan
docbender
from ..utils import ( HEADRequest, UserNotLive, float_or_none, merge_dicts, str_or_none, traverse_obj, unified_timestamp, url_or_none, ) class KickBaseIE(InfoExtractor): _API_HEADERS = {} def _call_api(self, path, display_id, note='Downloading API JSON', headers={}, **kwargs):...
put this in `_real_initialize`
from ..utils import ( HEADRequest, UserNotLive, float_or_none, merge_dicts, str_or_none, traverse_obj, unified_timestamp, url_or_none, ) class KickBaseIE(InfoExtractor): def _real_initialize(self): self._request_webpage(HEADRequest('https://kick.com/'), None, 'Setting up se...
@@ -0,0 +1,129 @@ +from .common import InfoExtractor + +from ..utils import ( + HEADRequest, + UserNotLive, + float_or_none, + merge_dicts, + str_or_none, + traverse_obj, + unified_timestamp, + url_or_none, +) + + +class KickBaseIE(InfoExtractor): + _API_HEADERS = {} + + def _call_api(self...
yt_dlp/extractor/kick.py
26
Python
0.214
suggestion
30
51
51
false
[extractor/kick] Add extractor
5,736
yt-dlp/yt-dlp
132,642
Python
pukkandan
bashonly
from ..utils import ( HEADRequest, UserNotLive, float_or_none, merge_dicts, str_or_none, traverse_obj, unified_timestamp, url_or_none, ) class KickBaseIE(InfoExtractor): _API_HEADERS = {} def _real_initialize(self): self._request_webpage(HEADRequest('https://kick.com/...
```suggestion def _real_initialize(self): self._request_webpage(HEADRequest('https://kick.com/'), None, 'Setting up session') xsrf_token = self._get_cookies('https://kick.com/').get('XSRF-TOKEN') if not xsrf_token: self.write_debug('kick.com did not set XSRF-TOKEN cookie') ...
from ..utils import ( HEADRequest, UserNotLive, float_or_none, merge_dicts, str_or_none, traverse_obj, unified_timestamp, url_or_none, ) class KickBaseIE(InfoExtractor): def _real_initialize(self): self._request_webpage(HEADRequest('https://kick.com/'), None, 'Setting up s...
@@ -0,0 +1,130 @@ +from .common import InfoExtractor + +from ..utils import ( + HEADRequest, + UserNotLive, + float_or_none, + merge_dicts, + str_or_none, + traverse_obj, + unified_timestamp, + url_or_none, +) + + +class KickBaseIE(InfoExtractor): + _API_HEADERS = {} + + def _real_initiali...
yt_dlp/extractor/kick.py
26
Python
0.929
bug
500
51
51
false
[extractor/kick] Add extractor
5,736
yt-dlp/yt-dlp
132,642
Python
pukkandan
bashonly
return self._download_json( 'https://www.pinterest.com/resource/%sResource/get/' % resource, video_id, 'Download %s JSON metadata' % resource, query={ 'data': json.dumps({'options': options}) })['resource_response'] def _extract_video(self, data, extract_...
```suggestion 'title': strip_or_none(traverse_obj(data, 'title', 'grid_title') or video_id)), ```
com|fr|de|ch|jp|cl|ca|it|co\.uk|nz|ru|com\.au|at|pt|co\.kr|es|com\.mx| dk|ph|th|com\.uy|co|nl|info|kr|ie|vn|com\.vn|ec|mx|in|pe|co\.at|hu| co\.in|co\.nz|id|com\.ec|com\.py|tw|be|uk|com\.bo|com\.pe)''' def _call_api(self, resource, video_id, options): return self._downloa...
@@ -24,14 +24,51 @@ def _call_api(self, resource, video_id, options): def _extract_video(self, data, extract_formats=True): video_id = data['id'] + thumbnails = [] + images = data.get('images') + if isinstance(images, dict): + for thumbnail_id, thumbnail in images.items()...
yt_dlp/extractor/pinterest.py
26
Python
0.714
suggestion
111
51
51
false
[extractor/pinterest] Fix extractor
5,739
yt-dlp/yt-dlp
132,642
Python
pukkandan
bashonly
'https://www.pinterest.com/resource/%sResource/get/' % resource, video_id, 'Download %s JSON metadata' % resource, query={ 'data': json.dumps({'options': options}) })['resource_response'] def _extract_video(self, data, extract_formats=True): video_id = da...
```suggestion 'description': traverse_obj(data, 'seo_description', 'description'), ```
dk|ph|th|com\.uy|co|nl|info|kr|ie|vn|com\.vn|ec|mx|in|pe|co\.at|hu| co\.in|co\.nz|id|com\.ec|com\.py|tw|be|uk|com\.bo|com\.pe)''' def _call_api(self, resource, video_id, options): return self._download_json( 'https://www.pinterest.com/resource/%sResource/get/' % resource...
@@ -24,14 +24,51 @@ def _call_api(self, resource, video_id, options): def _extract_video(self, data, extract_formats=True): video_id = data['id'] + thumbnails = [] + images = data.get('images') + if isinstance(images, dict): + for thumbnail_id, thumbnail in images.items()...
yt_dlp/extractor/pinterest.py
26
Python
0.714
suggestion
100
51
51
false
[extractor/pinterest] Fix extractor
5,739
yt-dlp/yt-dlp
132,642
Python
pukkandan
bashonly
}) info = { 'id': video_id, 'title': (data.get('title') or data.get('grid_title') or video_id).strip(), 'description': data.get('seo_description') or data.get('description'), 'timestamp': unified_timestamp(data.get('created_at')), 'thu...
`url` shouldn't return `extractor_key` etc
continue thumbnails.append({ 'url': thumbnail_url, 'width': int_or_none(thumbnail.get('width')), 'height': int_or_none(thumbnail.get('height')), }) info = { 'title': strip_or_none(travers...
@@ -24,14 +24,51 @@ def _call_api(self, resource, video_id, options): def _extract_video(self, data, extract_formats=True): video_id = data['id'] + thumbnails = [] + images = data.get('images') + if isinstance(images, dict): + for thumbnail_id, thumbnail in images.items()...
yt_dlp/extractor/pinterest.py
26
Python
0.286
refactor
42
51
51
false
[extractor/pinterest] Fix extractor
5,739
yt-dlp/yt-dlp
132,642
Python
pukkandan
bashonly
if isinstance(images, dict): for thumbnail_id, thumbnail in images.items(): if not isinstance(thumbnail, dict): continue thumbnail_url = url_or_none(thumbnail.get('url')) if not thumbnail_url: continue ...
```suggestion 'extractor_key': PinterestIE.ie_key(), 'extractor': PinterestIE.IE_NAME, 'webpage_url': ..., ``` Could u also add these?
def _extract_video(self, data, extract_formats=True): video_id = data['id'] thumbnails = [] images = data.get('images') if isinstance(images, dict): for thumbnail_id, thumbnail in images.items(): if not isinstance(thumbnail, dict): con...
@@ -24,14 +24,51 @@ def _call_api(self, resource, video_id, options): def _extract_video(self, data, extract_formats=True): video_id = data['id'] + thumbnails = [] + images = data.get('images') + if isinstance(images, dict): + for thumbnail_id, thumbnail in images.items()...
yt_dlp/extractor/pinterest.py
26
Python
0.786
refactor
175
51
51
false
[extractor/pinterest] Fix extractor
5,739
yt-dlp/yt-dlp
132,642
Python
pukkandan
bashonly
import itertools from .common import InfoExtractor from ..compat import ( compat_str, ) from ..utils import ( determine_ext, bool_or_none, int_or_none, parse_qs, try_get, unified_timestamp, url_or_none, ) class RutubeBaseIE(InfoExtractor): def _download_api_info(self, video_id, qu...
secret should just be passed as part of `query`. Same below
import itertools from .common import InfoExtractor from ..compat import ( compat_str, ) from ..utils import ( determine_ext, bool_or_none, int_or_none, parse_qs, try_get, unified_timestamp, url_or_none, ) class RutubeBaseIE(InfoExtractor): def _download_api_info(self, video_id, qu...
@@ -16,12 +16,16 @@ class RutubeBaseIE(InfoExtractor): - def _download_api_info(self, video_id, query=None): + def _download_api_info(self, video_id, query=None, secret=None):
yt_dlp/extractor/rutube.py
19
Python
0.429
security
59
44
44
false
[extractor/rutube] Support private videos
5,761
yt-dlp/yt-dlp
132,642
Python
pukkandan
mexus
'url': 'https://rutube.ru/video/private/884fb55f07a97ab673c7d654553e0f48/?p=x2QojCumHTS3rsKHWXN8Lg', 'md5': 'd106225f15d625538fe22971158e896f', 'info_dict': { 'id': '884fb55f07a97ab673c7d654553e0f48', 'ext': 'mp4', 'title': 'Яцуноками, Nioh2', 'des...
Isn't it better to pass on all query? ```suggestion query = parse_qs(url) ``` or atleast, parse the secret like this - I see no reason to parse it with regex ```suggestion query = {'p': parse_qs(url).get('p')} ``` (`from utils import parse_qs`)
'uploader': 'mexus', 'uploader_id': '24222106', 'timestamp': 1670646232, 'upload_date': '20221210', 'age_limit': 0, 'view_count': int, 'thumbnail': 'http://pic.rutubelist.ru/video/f2/d4/f2d42b54be0a6e69c1c22539e3152156.jpg', ...
@@ -129,8 +159,9 @@ def suitable(cls, url): def _real_extract(self, url): video_id = self._match_id(url) - info = self._download_and_extract_info(video_id) - info['formats'] = self._download_and_extract_formats(video_id) + secret = self._match_valid_url(url).group('secret')
yt_dlp/extractor/rutube.py
26
Python
0.857
security
268
51
51
false
[extractor/rutube] Support private videos
5,761
yt-dlp/yt-dlp
132,642
Python
pukkandan
mexus
data = json.loads(recv) if not isinstance(data, dict): continue if data.get('type') == 'stream': m3u8_url = data['data']['uri'] qualities = data['data']['availableQualities'] break elif data.get('type') == 'd...
```suggestion if not isinstance(value, dict): ```
data = json.loads(recv) if not isinstance(data, dict): continue if data.get('type') == 'stream': m3u8_url = data['data']['uri'] qualities = data['data']['availableQualities'] break elif data.get('type') == 'd...
@@ -866,3 +870,162 @@ def _entries(self, list_id): def _real_extract(self, url): list_id = self._match_id(url) return self.playlist_result(self._entries(list_id), list_id, ie=NiconicoIE.ie_key()) + + +class NiconicoLiveIE(InfoExtractor): + IE_NAME = 'niconico:live' + IE_DESC = 'ニコニコ生放送' + ...
yt_dlp/extractor/niconico.py
26
Python
0.571
suggestion
63
51
51
false
[extractor/niconico:live] Add extractor
5,764
yt-dlp/yt-dlp
132,642
Python
Lesmiscore
Lesmiscore
def test_js_to_json_vars_strings(self): def parse_js_to_json(js, vars): try: return json.loads(js_to_json(js, vars)) except json.JSONDecodeError as e: raise ValueError(f'JSON: {e.msg}: line {e.lineno} column {e.colno} "{e.doc}"') self.assertD...
The tests are wrong? This should be ```suggestion { 'a': null, 'b': 'null', 'c': True, 'd': 'true', 'e': False, 'f': 'false', } ```
def test_js_to_json_vars_strings(self): self.assertDictEqual( json.loads(js_to_json( '''{ 'null': a, 'nullStr': b, 'true': c, 'trueStr': d, 'false': e, 'falseS...
@@ -954,6 +954,88 @@ def test_escape_url(self): ) self.assertEqual(escape_url('http://vimeo.com/56015672#at=0'), 'http://vimeo.com/56015672#at=0') + def test_js_to_json_vars_strings(self): + def parse_js_to_json(js, vars): + try: + return json.loads(js_to_json(js,...
test/test_utils.py
26
Python
1
bug
293
51
51
false
[extractor/sovietscloset] Fix __NUXT_JSONP__ extraction
5,771
yt-dlp/yt-dlp
132,642
Python
pukkandan
ChillingPepper
self.to_screen(f'delivery_status = {delivery_status}, archive_mode = {archive_mode}') if delivery_status == 'PREPARING': raise UserNotLive('This event has not started yet.') elif delivery_status == 'STARTED': # FFmpeg is unable to update HTTP request headers during downl...
```suggestion if delivery_status == 'PREPARING': raise UserNotLive('This event has not started yet') elif delivery_status == 'STARTED': # FIXME: HTTP request headers need to be updated to continue download self.report_warning( 'Due to technical l...
webpage = self._download_webpage(url, video_id) data_json = self._search_json(r'<script>\s*var app\s*=', webpage, 'data json', video_id) delivery_status = data_json.get('delivery_status') archive_mode = data_json.get('archive_mode') release_timestamp = try_call(lambda: unified_...
@@ -0,0 +1,85 @@ +import calendar +import datetime + +from .common import InfoExtractor +from ..utils import ( + ExtractorError, + UserNotLive, + traverse_obj, +) + + +class EplusIbIE(InfoExtractor): + IE_NAME = 'eplus:inbound' + IE_DESC = 'e+ (イープラス). Only works for the link starts with "live.eplus.jp/e...
yt_dlp/extractor/eplus.py
26
Python
1
refactor
1,438
51
51
false
[extractor/eplus] Add extractor for URLs from "ib.eplus.jp"
5,782
yt-dlp/yt-dlp
132,642
Python
pukkandan
pzhlkj6612
'Due to technical limitations, the download will be interrupted after one hour.') live_status = 'is_live' elif delivery_status == 'STOPPED': # check archive status errmsg = 'This event has been ended. ' if archive_mode == 'ON': # I didn't see valu...
```suggestion if not m3u8_playlist_urls: self.raise_no_formats( 'Could not find the playlist URL. This event may not be accessible', expected=True) ```
release_timestamp_str = data_json.get('event_datetime_text') # JST self.write_debug(f'delivery_status = {delivery_status}, archive_mode = {archive_mode}') if delivery_status == 'PREPARING': live_status = 'is_upcoming' elif delivery_status == 'STARTED': live_sta...
@@ -0,0 +1,85 @@ +import calendar +import datetime + +from .common import InfoExtractor +from ..utils import ( + ExtractorError, + UserNotLive, + traverse_obj, +) + + +class EplusIbIE(InfoExtractor): + IE_NAME = 'eplus:inbound' + IE_DESC = 'e+ (イープラス). Only works for the link starts with "live.eplus.jp/e...
yt_dlp/extractor/eplus.py
26
Python
0.786
suggestion
191
44
51
false
[extractor/eplus] Add extractor for URLs from "ib.eplus.jp"
5,782
yt-dlp/yt-dlp
132,642
Python
pukkandan
pzhlkj6612
else: raise ExtractorError(f'Unknown delivery_status: {delivery_status}', expected=False) # TODO: if there are multiple playlists, tell me. m3u8_playlist_urls = self._html_search_regex( r'var listChannels = (.+);\n', webpage, 'listChannels', default=None) if not ...
```suggestion return { 'id': data_json['app_id'], 'title': data_json.get('app_name'), 'formats': self._extract_m3u8_formats(m3u8_playlist_url, video_id), 'live_status': live_status, 'description': traverse_obj(data_json, 'content'), ...
else: self.report_warning(f'Unknown delivery_status {delivery_status}, treat it as a live') live_status = 'is_live' formats = [] m3u8_playlist_urls = self._search_json( r'var listChannels\s*=', webpage, 'hls URLs', video_id, contains_pattern=r'\[.+\]', defau...
@@ -0,0 +1,85 @@ +import calendar +import datetime + +from .common import InfoExtractor +from ..utils import ( + ExtractorError, + UserNotLive, + traverse_obj, +) + + +class EplusIbIE(InfoExtractor): + IE_NAME = 'eplus:inbound' + IE_DESC = 'e+ (イープラス). Only works for the link starts with "live.eplus.jp/e...
yt_dlp/extractor/eplus.py
26
Python
0.857
refactor
422
27
38
false
[extractor/eplus] Add extractor for URLs from "ib.eplus.jp"
5,782
yt-dlp/yt-dlp
132,642
Python
pukkandan
pzhlkj6612
live_status = 'was_live' else: raise ExtractorError(f'Unknown delivery_status: {delivery_status}', expected=False) # TODO: if there are multiple playlists, tell me. m3u8_playlist_urls = self._html_search_regex( r'var listChannels = (.+);\n', webpage, 'listCha...
```suggestion 'timestamp': try_call(lambda: unified_timestamp(data_json['event_datetime']) - 32400), ```
live_status = 'was_live' else: self.report_warning(f'Unknown delivery_status {delivery_status}, treat it as a live') live_status = 'is_live' formats = [] m3u8_playlist_urls = self._search_json( r'var listChannels\s*=', webpage, 'hls URLs', video_...
@@ -0,0 +1,85 @@ +import calendar +import datetime + +from .common import InfoExtractor +from ..utils import ( + ExtractorError, + UserNotLive, + traverse_obj, +) + + +class EplusIbIE(InfoExtractor): + IE_NAME = 'eplus:inbound' + IE_DESC = 'e+ (イープラス). Only works for the link starts with "live.eplus.jp/e...
yt_dlp/extractor/eplus.py
26
Python
0.714
suggestion
118
28
39
false
[extractor/eplus] Add extractor for URLs from "ib.eplus.jp"
5,782
yt-dlp/yt-dlp
132,642
Python
pukkandan
pzhlkj6612