-
Notifications
You must be signed in to change notification settings - Fork 113
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
Recommendations empty & rightclick=>More=>Related Videos error #508
Comments
I think this is a Youtube API issue. The same error occurs when accessing via the Data API explorer and there are reports of this effecting official clients: https://nitter.net/TeamYouTube/status/1689826896224137216?s=20#m |
Apparently the relatedToVideoId parameter is now deprecated in the search endpoint of the V3 Data API. Nothing to fix, except to remove the functionality. Unfortunately there doesn't seem to be any equivalent functionality available through the API. When I have some time might try and see how the app and website fetch related videos. |
Probably a good idea to leave the api all together and remake the addon as a scraper addon. |
yt-dlp doesn't scrape the website for anything except for some javascript. It also doesn't try to be a client so it can limit the scope of its functionality. Invidious is the only project that I can think of that may try to provide this functionality without using the API. Regardless scraping is even more of a moving target than what the current situation is, and would mean having to implement a javascript parser/interpreter (like yt-dlp has done) but in the constrained python module environment that Kodi supports, without relying on existing projects that use C modules compiled for different platforms. It is all more work that no one has time for I think. |
Thanks for the thorough explanation. |
As a side effect of this issue, the option ”Autoplay suggested videos” (automatically chain first video related to the one currently playing) does not work either. That is a true pity for me. It was very relaxing to select a video and let Kodi play related ones for hours. Issue confirmed with version 7.0.2-alpha7, as expected. |
There is an option under "More" that's called "More links from the description" that doesn't work either, however if that one could be re-programmed to do an actual search from the link description you would have something that's a step in the right direction. If i do a manual search from a link description,(it's title) i get some alternatives to watch. |
Related videos are still available via the next endpoint of the V1 API. Can change to using that instead, but I don't have time or access to git at the moment, so will have to wait. |
I hope this isn't against any rules but, is there any work around currently? anything I can do on my end to alleviate some of these issues like auto-play not working? |
I am not aware of any workaround, no. The plugin will need to be updated to use a different API endpoint. |
I just realized I use this feature a lot heh... To try it, you copy all of the code at the bottom of this comment, then paste it so as to overwrite the entire The modifications include a modified As always, be careful when copy-pasting unknown code that you find online.
|
Me too :) Your drop-in code is working fine... |
Thanks for the drop-in code @RNavega it works nice. 👍 |
@dobbelina it seems there was an API route to get recommended Home videos, but it was deprecated (removed on purpose): I think this is Google not wanting to have APIs that empower competitor apps, because of ads on the home screen. Edit: maybe there is a hidden API that the official YouTube app uses, but I haven't been able to use mitmproxy to inspect how it requests these things. Invidious: NewPipe (this is a cool method, based on watch history): |
The website mainly uses the
This plugin does something very similar already and it should work if the modified plugin.video.youtube/resources/lib/youtube_plugin/youtube/client/youtube.py Lines 294 to 433 in 86434a0
|
I noticed that There must be some cookie that identifies the account of the user, so the Home screen can show relevant videos based on their browsing history and other data from them. That's why I'm thinking we cannot make a Home screen under such a logged-in state, because the account login methods used by the official app or the website --needed to get the session cookies that identify the user-- are probably behind lots of anti-bot measures like reCaptcha v3. I mean, even on desktop platforms people need to use "headless browsers" to log-in to scrape YouTube stuff, I don't think it's feasible in a cross-platform way with Kodi. |
@RNavega - I guess it depends on what the aim is, but I think (haven't tested it) that the Authorization header with OAuth access token can also be used with the V1 API requests. This may not be sufficient for a multi-user setup using a common API key, or for someone logged in across multiple different clients, however the only other relatively easy (though not particularly user friendly) alternative would be similar to what youtube-dl/yt-dlp does with manually extracting cookies from a browser session to retrieve the SAPISID cookie (or equivalent) in order to calculate the SAPISIDHASH value for the Authorization header. While related video information is quite useful, personally I don't use the existing recommended video functionality at all, and the effort required to develop a new Kodi specific but platform agnostic login, authentication and tracking mechanism for this would be too high, with too little personal benefit, for me to bother with trying to implement this. You are also probably right that it may not be feasible even if someone did try. I think the better option is to just use the existing functionality (even if it is a little rough around the edges) as it should be able to be fixed. One thing I did try to do was add the ability to enable remote and local history tracking independently of each other, so perhaps the way forward would be:
|
@RNavega Any chance you can do your magic for 7.0.2.2 unofficial matrix? I tried to add the lines myself but I end up with a python error. I did try to get the indentation correct but apparently didn't succeed. Probably it's not good to create such Frankenstein code. I was hoping the different versions would be similar enough in structure.
|
For your situation alone (7.0.2.2 matrix unofficial), the modified Click on the "Raw" button on the top-right corner of the code viewer to download the file for replacing (or rather, right-click or long-press, then "Save Link As..."). |
@RNavega Thanks! That worked!! Happy to get Related Videos back! |
@drelephant thanks for the follow-up. |
- Partially fix anxdpanic#508 - TODO: Improve support of InnerTube requests to handle configured max_result number of results - TODO: Result is coerced into a V3 Data API result. Support native JSON result in ResourceManager
- Use new Youtube.get_related_videos and local history - Fix anxdpanic#508
Context
Recommendations is empty starting yesterday.
And right-clicking a link when choosing More=>Related Videos produces an error
as in the screenshot below, debug log link below as well.
Please provide any relevant information about your setup
Expected Behavior
Please describe the behavior you are expecting.
Current Behavior
What is the current behavior?
Steps to Reproduce
Please provide detailed steps for reproducing the issue.
Log
https://paste.kodi.tv/yukugisoco.kodi
Please include a complete debug log.
Additional Information
Please provide any additional information that may be helpful.
The text was updated successfully, but these errors were encountered: