Youtube - upload_date functionality changed and requires clarified documentation
See original GitHub issueChecklist
- I’m reporting a broken site
- I’ve verified that I’m running yt-dlp version 2022.03.08.1. (update instructions)
- I’ve checked that all provided URLs are alive and playable in a browser
- I’ve checked that all URLs and arguments with special characters are properly quoted or escaped
- I’ve searched the bugtracker for similar issues including closed ones. DO NOT post duplicates
- I’ve read the guidelines for opening an issue
- I’ve read about sharing account credentials and I’m willing to share it if required
Region
No response
Description
using upload_date for some videos results in the date being a day ahead for some videos, I believe this is because the functionality changed in the update to use true UTC and not adjust for local time.
Example: https://www.youtube.com/watch?v=ey8B30KyOMQ Date published (on youtube) is reported as November 8th, 2021 because it adjusts to my local time yt-dlp is reporting it as November 9th, 2021 as seen in logs as it was 4am UTC
This has changed compared to previous versions, as I run batch scripts and noticed way more web traffic than normal on directories which have videos already in it.
The following image has the latest download details on the left, and the previous versions’ download on the right. https://i.imgur.com/JWBbu1F.png
Note that the timestamp is the same but the title is adjusted. It’s not clear that the functionality of “upload_date” has changed/now defaults to naming it based on UTC.
Ideally this could be changed in the documentation to specify that it names based on UTC, since the documentation doesn’t specify either way
Verbose log
PS I:\Video\YT-Archive> .\yt-dlp.exe -vU
[debug] Command-line config: ['-vU']
[debug] Encodings: locale cp1252, fs utf-8, out utf-8, err utf-8, pref cp1252
[debug] yt-dlp version 2022.03.08 [535eb16] (win_exe)
[debug] Python version 3.8.10 (CPython 64bit) - Windows-10-10.0.19044-SP0
[debug] exe versions: none
[debug] Optional libraries: brotli, Cryptodome, mutagen, sqlite, websockets
[debug] Proxy map: {}
Latest version: 2022.03.08.1, Current version: 2022.03.08
Current Build Hash 728c6e072133451bbe26825b329577e4a40242af74582a73d6d8a10ac45c6b3e
Updating to version 2022.03.08.1 ...
Updated yt-dlp to version 2022.03.08.1
PS I:\Video\YT-Archive> .\yt-dlp.exe -S 'height:720' -o "%(uploader)s/%(title)s-%(upload_date)s.%(ext)s" -w -c --throttled-rate 100K https://www.youtube.com/watch?v=ey8B30KyOMQ
[youtube] ey8B30KyOMQ: Downloading webpage
[youtube] ey8B30KyOMQ: Downloading android player API JSON
[info] ey8B30KyOMQ: Downloading 1 format(s): 22
[download] DaThings\{YTP} ~ Pocket Mans!-20211109.mp4 has already been downloaded
[download] 100% of 33.36MiB
PS I:\Video\YT-Archive>
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:11 (4 by maintainers)
Do not depend on filenames to detect duplicates for the long term. Filenames can change for a variety of reasons. (1) Video metadata including title changes all the time. (2) The file extension changes if the preferred format changes. (3) Extraction of some metadata fields may break. (4) Less likely, but the default outtmpl may change
Also, it is much slower than using archive
Previously, US time was being (mistakenly) used for upload_date. now UTC is being used, which is the correct behavior. This change will not be reverted. Instead I will document it as such.