Compare commits

..

No commits in common. "f1db454ac2511e686054ae55773ed91665f04b41" and "283152b1d0861ff0de0e004ae7f18153d228de6f" have entirely different histories.

2 changed files with 5 additions and 3 deletions

View File

@ -1846,7 +1846,7 @@ The following extractors use this feature:
* `dr`: dynamic range to ignore - one or more of `sdr`, `hdr10`, `dv` * `dr`: dynamic range to ignore - one or more of `sdr`, `hdr10`, `dv`
#### niconicochannelplus #### niconicochannelplus
* `max_comments`: Maximum number of comments to extract - default is `120` * `max_comments`: Limit the amount of comments to gather (default: `120`)
#### tiktok #### tiktok
* `api_hostname`: Hostname to use for mobile API requests, e.g. `api-h2.tiktokv.com` * `api_hostname`: Hostname to use for mobile API requests, e.g. `api-h2.tiktokv.com`

View File

@ -121,7 +121,7 @@ class NiconicoChannelPlusIE(NiconicoChannelPlusBaseIE):
self.raise_no_formats(msg, expected=True, video_id=content_code) self.raise_no_formats(msg, expected=True, video_id=content_code)
else: else:
formats = self._extract_m3u8_formats( formats = self._extract_m3u8_formats(
# "authenticated_url" is a format string that contains "{session_id}". # "authenticated_url" is a format string contains "{session_id}".
m3u8_url=data_json['video_stream']['authenticated_url'].format(session_id=session_id), m3u8_url=data_json['video_stream']['authenticated_url'].format(session_id=session_id),
video_id=content_code) video_id=content_code)
@ -213,8 +213,10 @@ class NiconicoChannelPlusIE(NiconicoChannelPlusBaseIE):
raise ExtractorError( raise ExtractorError(
'Live was ended, there is no video for download.', video_id=content_code, expected=True) 'Live was ended, there is no video for download.', video_id=content_code, expected=True)
else: else:
# new type appears, we will handle it soon.
raise ExtractorError(f'Unknown type: {video_type}', video_id=content_code, expected=False) raise ExtractorError(f'Unknown type: {video_type}', video_id=content_code, expected=False)
# help us to analyze when error occurs
self.write_debug(f'{content_code}: video_type={video_type}, live_status={live_status}') self.write_debug(f'{content_code}: video_type={video_type}, live_status={live_status}')
session_id = self._call_api( session_id = self._call_api(
@ -245,7 +247,7 @@ class NiconicoChannelPlusChannelBaseIE(NiconicoChannelPlusBaseIE):
errnote=f'Unable to get channel info (page {page + 1})') errnote=f'Unable to get channel info (page {page + 1})')
for content_code in traverse_obj(response, ('data', 'video_pages', 'list', ..., 'content_code')): for content_code in traverse_obj(response, ('data', 'video_pages', 'list', ..., 'content_code')):
# "video/{content_code}" works for both VOD and live, but "live/{content_code}" doesn't work for VOD # "video/{code}" works for both VoD and live, but "live/{code}" doesn't work for VoD.
yield self.url_result( yield self.url_result(
f'{self._WEBPAGE_BASE_URL}/{channel_name}/video/{content_code}', NiconicoChannelPlusIE) f'{self._WEBPAGE_BASE_URL}/{channel_name}/video/{content_code}', NiconicoChannelPlusIE)