-
Notifications
You must be signed in to change notification settings - Fork 42
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
Feature request: Check the publication date of a video & set limit by date #25
Comments
Hey! I'd also like this to be implemented, but after looking at the code I'm not sure is possible. The function parses the "Videos" tab and the published date is not there (or at least I couldn't find it). For my use case, I've solved the issue with this workaround: import os
from datetime import datetime
def fuzzy_date_parser(fuzzy_date: str):
date_format = "%Y-%m-%d %H:%M:%S"
process = os.popen(f"date -d '{fuzzy_date}' '+{date_format}' 2>&1")
exit_status = os.wait()[1]
output = process.read()
if exit_status != 0:
raise ValueError(f"Error parsing '{fuzzy_date}'. {output}")
return datetime.strptime(output[:19], date_format) Note that is just a wrapper of the linux |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It would be nice to have this feature when getting videos from a channel.
will return some strings like "13 days ago" or "2 weeks ago" but the result will change over time.
Also, there are some issues when converting text to date.
Is there a way to check the publication date of a video while running get_channel function?
The text was updated successfully, but these errors were encountered: