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

More accurate published value from the API? #570

Closed
pixlwave opened this issue Jun 1, 2019 · 2 comments
Closed

More accurate published value from the API? #570

pixlwave opened this issue Jun 1, 2019 · 2 comments
Labels
question Further information is requested

Comments

@pixlwave
Copy link

pixlwave commented Jun 1, 2019

Hi

I'm experimenting with your API and have noticed that when using /api/v1/channels/:ucid/videos the value included for published matches the publishedText approximation. For example, the last 3 videos of the following link all show the same published value.
https://invidio.us/api/v1/channels/UCIgz0nzsOHSpXs7EpmJLOlQ/videos

Whereas via /api/v1/videos/:id you get more accurate values, but all at UTC 0:00.
https://invidio.us/api/v1/videos/KuhVJFZS_qw
https://invidio.us/api/v1/videos/cecxXsMhPRM
https://invidio.us/api/v1/videos/deScHJGoVc8

Is this by design of how you're retrieving the data, or is there something I can do to improve this? I'm aiming to retrieve the video lists for multiple channels and then merge them into a single by list that's sorted by published.

Thanks for your great project 🙂

@omarroth omarroth added the question Further information is requested label Jun 1, 2019
@omarroth
Copy link
Contributor

omarroth commented Jun 1, 2019

Unfortunately this is a limitation of what YouTube provides.

published is generated from the "x ago" from the /videos page on YouTube:

image

which becomes less accurate over time.

/api/v1/videos/:id generates published from the datePublished meta tag on the watch page
:
image

which is limited to an accuracy of about one day.

I'm still looking into ways to improve this. For now I would recommend combining /api/v1/channels/#{videos, latest}/:ucid with data from https://invidio.us/feed/channel/#{author or UCID}, or using the feed directly if there's enough data there for your needs. You might also take a look through #469.

@pixlwave
Copy link
Author

pixlwave commented Jun 2, 2019

published is generated from the "x ago" from the /videos page on YouTube:

I wondered if that was the case.

I hadn't realised you had an RSS feed! 15-entries isn't a huge amount, but it may well be enough for my needs, and if not I'll investigate caching the published dates from there 👍🏻

Thanks for your help 🙂

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants