mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-27 10:31:29 +00:00
[extractor/youtube:tab] Let approximate_date
return timestamp
This commit is contained in:
parent
94dc8604dd
commit
5225df50cf
|
@ -1724,7 +1724,7 @@ #### youtube
|
||||||
|
|
||||||
#### youtubetab (YouTube playlists, channels, feeds, etc.)
|
#### youtubetab (YouTube playlists, channels, feeds, etc.)
|
||||||
* `skip`: One or more of `webpage` (skip initial webpage download), `authcheck` (allow the download of playlists requiring authentication when no initial webpage is downloaded. This may cause unwanted behavior, see [#1122](https://github.com/yt-dlp/yt-dlp/pull/1122) for more details)
|
* `skip`: One or more of `webpage` (skip initial webpage download), `authcheck` (allow the download of playlists requiring authentication when no initial webpage is downloaded. This may cause unwanted behavior, see [#1122](https://github.com/yt-dlp/yt-dlp/pull/1122) for more details)
|
||||||
* `approximate_date`: Extract approximate `upload_date` in flat-playlist. This may cause date-based filters to be slightly off
|
* `approximate_date`: Extract approximate `upload_date` and `timestamp` in flat-playlist. This may cause date-based filters to be slightly off
|
||||||
|
|
||||||
#### funimation
|
#### funimation
|
||||||
* `language`: Audio languages to extract, e.g. `funimation:language=english,japanese`
|
* `language`: Audio languages to extract, e.g. `funimation:language=english,japanese`
|
||||||
|
|
|
@ -3843,8 +3843,8 @@ def _configuration_arg(self, key, default=NO_DEFAULT, *, ie_key=None, casesense=
|
||||||
@param default The default value to return when the key is not present (default: [])
|
@param default The default value to return when the key is not present (default: [])
|
||||||
@param casesense When false, the values are converted to lower case
|
@param casesense When false, the values are converted to lower case
|
||||||
'''
|
'''
|
||||||
val = traverse_obj(
|
ie_key = ie_key if isinstance(ie_key, str) else (ie_key or self).ie_key()
|
||||||
self._downloader.params, ('extractor_args', (ie_key or self.ie_key()).lower(), key))
|
val = traverse_obj(self._downloader.params, ('extractor_args', ie_key.lower(), key))
|
||||||
if val is None:
|
if val is None:
|
||||||
return [] if default is NO_DEFAULT else default
|
return [] if default is NO_DEFAULT else default
|
||||||
return list(val) if casesense else [x.lower() for x in val]
|
return list(val) if casesense else [x.lower() for x in val]
|
||||||
|
|
|
@ -948,8 +948,8 @@ def _extract_video(self, renderer):
|
||||||
'uploader': uploader,
|
'uploader': uploader,
|
||||||
'channel_id': channel_id,
|
'channel_id': channel_id,
|
||||||
'thumbnails': thumbnails,
|
'thumbnails': thumbnails,
|
||||||
'upload_date': (strftime_or_none(self._parse_time_text(time_text), '%Y%m%d')
|
'timestamp': (self._parse_time_text(time_text)
|
||||||
if self._configuration_arg('approximate_date', ie_key='youtubetab')
|
if self._configuration_arg('approximate_date', ie_key=YoutubeTabIE)
|
||||||
else None),
|
else None),
|
||||||
'release_timestamp': scheduled_timestamp,
|
'release_timestamp': scheduled_timestamp,
|
||||||
'availability':
|
'availability':
|
||||||
|
@ -6105,8 +6105,8 @@ def _extract_notification_renderer(self, notification):
|
||||||
title = self._search_regex(
|
title = self._search_regex(
|
||||||
rf'{re.escape(channel or "")}[^:]+: (.+)', notification_title,
|
rf'{re.escape(channel or "")}[^:]+: (.+)', notification_title,
|
||||||
'video title', default=None)
|
'video title', default=None)
|
||||||
upload_date = (strftime_or_none(self._parse_time_text(self._get_text(notification, 'sentTimeText')), '%Y%m%d')
|
timestamp = (self._parse_time_text(self._get_text(notification, 'sentTimeText'))
|
||||||
if self._configuration_arg('approximate_date', ie_key=YoutubeTabIE.ie_key())
|
if self._configuration_arg('approximate_date', ie_key=YoutubeTabIE)
|
||||||
else None)
|
else None)
|
||||||
return {
|
return {
|
||||||
'_type': 'url',
|
'_type': 'url',
|
||||||
|
@ -6117,7 +6117,7 @@ def _extract_notification_renderer(self, notification):
|
||||||
'channel_id': channel_id,
|
'channel_id': channel_id,
|
||||||
'channel': channel,
|
'channel': channel,
|
||||||
'thumbnails': self._extract_thumbnails(notification, 'videoThumbnail'),
|
'thumbnails': self._extract_thumbnails(notification, 'videoThumbnail'),
|
||||||
'upload_date': upload_date,
|
'timestamp': timestamp,
|
||||||
}
|
}
|
||||||
|
|
||||||
def _notification_menu_entries(self, ytcfg):
|
def _notification_menu_entries(self, ytcfg):
|
||||||
|
|
Loading…
Reference in a new issue