Skip to content

Commit

Permalink
[utils] Handle rd-suffixed day parts in unified_strdate (ytdl-org#23199)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nyaa-rlathotep authored and dstftw committed Nov 26, 2019
1 parent cf3c9ea commit 9d30c21
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,8 @@ def test_unified_dates(self):
self.assertEqual(unified_strdate('July 15th, 2013'), '20130715')
self.assertEqual(unified_strdate('September 1st, 2013'), '20130901')
self.assertEqual(unified_strdate('Sep 2nd, 2013'), '20130902')
self.assertEqual(unified_strdate('November 3rd, 2019'), '20191103')
self.assertEqual(unified_strdate('October 23rd, 2005'), '20051023')

def test_unified_timestamps(self):
self.assertEqual(unified_timestamp('December 21, 2010'), 1292889600)
Expand Down
3 changes: 3 additions & 0 deletions youtube_dl/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1718,13 +1718,16 @@ def random_user_agent():
'%B %d %Y',
'%B %dst %Y',
'%B %dnd %Y',
'%B %drd %Y',
'%B %dth %Y',
'%b %d %Y',
'%b %dst %Y',
'%b %dnd %Y',
'%b %drd %Y',
'%b %dth %Y',
'%b %dst %Y %I:%M',
'%b %dnd %Y %I:%M',
'%b %drd %Y %I:%M',
'%b %dth %Y %I:%M',
'%Y %m %d',
'%Y-%m-%d',
Expand Down

0 comments on commit 9d30c21

Please sign in to comment.