Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unified_strdate returns None on dates with "3rd" and "23rd" #23197

Closed
5 of 6 tasks
Nyaa-rlathotep opened this issue Nov 24, 2019 · 0 comments · Fixed by #23199
Closed
5 of 6 tasks

unified_strdate returns None on dates with "3rd" and "23rd" #23197

Nyaa-rlathotep opened this issue Nov 24, 2019 · 0 comments · Fixed by #23199

Comments

@Nyaa-rlathotep
Copy link
Contributor

Checklist

  • I'm reporting a broken site support issue
  • I've verified that I'm running youtube-dl version 2019.11.22
  • 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 bug reports including closed ones
  • I've read bugs section in FAQ

Verbose log

[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['https://www.bitchute.com/video/KDAtOH7nEUGe/', '--no-check-certificate', '--verbose']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2019.11.22
[debug] Git HEAD: 8267f2f
[debug] Python version 3.7.4 (CPython) - Linux-5.3.8-gnu-x86_64-with-glibc2.2.5
[debug] exe versions: ffmpeg 4.2.1, ffprobe 4.2.1
[debug] Proxy map: {}
[BitChute] KDAtOH7nEUGe: Downloading webpage
[BitChute] KDAtOH7nEUGe: Checking video URL

(Custom output snipped. See description for details.)

Description

"unified_strdate" from utils returns None instead of a date if the string sent contains "3rd" or "23rd".

I initially discovered this issue when creating pull #23193. Other sites (such as youtube) don't seem to have prefixes such as "*st", "*nd", "*rd", etc, on the day of the month, and thus don't seem to run into this problem when getting dates.

I hacked together a quick test patch that runs through all possible dates and displays them along with the converted version from unified_strdate. The full output and the test patch are attached. To run it, just apply the patch and tell youtube-dl to download any bitchute video (I used "https://www.bitchute.com/video/KDAtOH7nEUGe/" in this example, but any video will work).

date_test_patch.txt
output.txt

As you can see from this snippet, all of the 3rd and 23rd days return "None" instead of a date. The full output also has "None" in days that do not exist (such as February 31st), since this was just a quick hack to check which dates worked and which didn't.

January 1st, 2019:  20190101
January 2nd, 2019:  20190102
January 3rd, 2019:  None
January 4th, 2019:  20190104
...
January 22nd, 2019:  20190122
January 23rd, 2019:  None
January 24th, 2019:  20190124
...
February 2nd, 2019:  20190202
February 3rd, 2019:  None
February 4th, 2019:  20190204
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant