-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
API: Add playlist and start time to resolve_url #4205
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good to me. I'm not entirely sure about the additional redirect check though.
The resolve url endpoint in Invidious is mostly used as a limited proxy to InnerTube's resolve url. As the original doesn't support youtu.be
should Invidious even tact on that extra functionality?
I agree with you, the main reason I did add it is because a web client wouldn't be able to do that redirect check because of CORS. Because it's an endpoint that is not often used, it felt that adding the HEAD call wouldn't be a big deal, and adds the benefit of supporting short URLs and web clients. |
It sounds like your use case is passing every URL to Invidious to pass to YouTube to resolve, personally I feel like that is the wrong approach. Parsing YouTube URLs is not that hard to do, especially youtu.be ones, also means your app will be faster, because you aren't making unnecessary network requests. Your reasoning for web clients goes out the window too, if you add parsing code. The only use case, where you have to use the resolve endpoint, is resolving vanity channel URLs ( |
I second Absidue's comment here: adding support for As for the rest, are there cases where the playlist ID or the video's start time are hidden in a shortened URL? |
What's the recommendation? Should I remove the redirect? Or close the PR? |
I added this for completeness on both fronts, the resolveUrl api and the short urls. Youtube introduces things all the time (mixes, shorts, etc) and it's nice to have an endpoint you can rely on to tell you what things are. Also, if the resolveUrl is returning data (like playlistId or startTimeSeconds) then Invidious should return it |
This reverts commit 7e267da.
Looks like there's a consensus on not doing the HEAD call. It's removed |
Captures the start time and the playlist id (if any) of the resolved url.
Also, make a head request to check for redirects. This is to resolve short urls (
https://youtu.be/<videoId>?t=60
)