upload_date appears not to work #67

Closed
opened 2026-02-20 22:24:38 -05:00 by deekerman · 1 comment
Owner

Originally created by @miriam-e on GitHub (Apr 8, 2011).

Downloading a video with
-o '%(upload_date)s'
in the options produces a video name with 'NA' where the uploader date should be.

I'm using youtube-dl v 2011.02.25c
on Linux kernel 2.6.33.2 with python 2.6

(By the way, I love this program. Kudos to you Ricardo.)

Originally created by @miriam-e on GitHub (Apr 8, 2011). Downloading a video with -o '%(upload_date)s' in the options produces a video name with 'NA' where the uploader date should be. I'm using youtube-dl v 2011.02.25c on Linux kernel 2.6.33.2 with python 2.6 (By the way, I love this program. Kudos to you Ricardo.)
deekerman 2026-02-20 22:24:38 -05:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@miriam-e commented on GitHub (Apr 10, 2011):

I'm very much a python noobie so I'm kinda stumbling around in the dark here, but this is what I've found so far.

It looks like the upload date section of the code is searching for:
'id="eow-date".?>(.?)'
The regular expression is given as re.DOTALL so wildcards match newlines too.

An example from a video page is:

Apr 6, 2011

I worry about wildcards being greedy and gobbling up the longest possible string so I replaced the ".*" wildcards with "[^<]+" which only matches up til the next "<" character. The other thing I noticed is that the string "eow-date" doesn't always end there (as in my example above which is "eow-date-short", so I dropped the second double-quote.

Now it works! Yay!

@miriam-e commented on GitHub (Apr 10, 2011): I'm very much a python noobie so I'm kinda stumbling around in the dark here, but this is what I've found so far. It looks like the upload date section of the code is searching for: 'id="eow-date"._?>(._?)</span>' The regular expression is given as re.DOTALL so wildcards match newlines too. An example from a video page is: <span id="eow-date-short" class="watch-video-date"> Apr 6, 2011 </span> I worry about wildcards being greedy and gobbling up the longest possible string so I replaced the ".*" wildcards with "[^<]+" which only matches up til the next "<" character. The other thing I noticed is that the string "eow-date" doesn't always end there (as in my example above which is "eow-date-short", so I dropped the second double-quote. Now it works! Yay!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/youtube-dl-ytdl-org#67
No description provided.