]> jfr.im git - yt-dlp.git/commitdiff
[youtube:tab] Add `approximate_date` extractor-arg
authorpukkandan <redacted>
Tue, 22 Feb 2022 20:03:36 +0000 (01:33 +0530)
committerpukkandan <redacted>
Tue, 22 Feb 2022 22:55:55 +0000 (04:25 +0530)
README.md
yt_dlp/extractor/youtube.py

index 7f7e9428931cfc77ab200883b319b48f68c0d70a..88ddb2f3b767fcaf3450d37fc164af1a513ab730 100644 (file)
--- a/README.md
+++ b/README.md
@@ -1663,6 +1663,7 @@ #### youtube
 
 #### 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)
+* `approximate_date`: Extract approximate `upload_date` in flat-playlist. This may cause date-based filters to be slightly off
 
 #### funimation
 * `language`: Languages to extract. Eg: `funimation:language=english,japanese`
index 4d9815eb32a72d85485c4930bca12568dbcbecec..fbf9581c6b997f806d5ac2817d95e0c90a204085 100644 (file)
@@ -844,7 +844,7 @@ def _extract_video(self, renderer):
             'uploader': uploader,
             'channel_id': channel_id,
             'thumbnails': thumbnails,
-            #  'upload_date': strftime_or_none(timestamp, '%Y%m%d'),
+            'upload_date': strftime_or_none(timestamp, '%Y%m%d') if self._configuration_arg('approximate_date', ie_key='youtubetab') else None,
             'live_status': ('is_upcoming' if scheduled_timestamp is not None
                             else 'was_live' if 'streamed' in time_text.lower()
                             else 'is_live' if overlay_style is not None and overlay_style == 'LIVE' or 'live now' in badges