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

Long initial loading times over large number of pages #561

Closed
2 of 4 tasks
brainfork opened this issue May 29, 2021 · 17 comments
Closed
2 of 4 tasks

Long initial loading times over large number of pages #561

brainfork opened this issue May 29, 2021 · 17 comments

Comments

@brainfork
Copy link

brainfork commented May 29, 2021

Addon used

  • Amazon VOD (plugin.video.amazon-test)
  • Browser Launcher (plugin.program.browser.launcher)
  • Addon version: 0.9.3

Account type

  • primevideo.com
  • amazon.(com/co.uk/de/jp)

System Setup (please provide the following information):

  • Hardware: Raspberry PI4
  • OS version: Libreelec 9.2.6
  • Kodi version number: 18.9

Upload Logs

Describe the bug

I'm not sure if this is a bug but I was hoping to get some clarification about how this addon works. I recently installed it on my system and have logged in using my Amazon Prime account. I went to access the "Included With Prime" category which resulted in the a loading spinner and a series of messages indicating that new pages are being loaded. It's been doing this for the last 7 hours and it's now on page 12404. Is this expected behaviour and if so how much time/many pages should I be anticipating before completion?

I had also loaded it up earlier and did the same thing indicated in #501 (abort loading, receive error, videos seem to be loaded) but I found that I was missing categories such as "Recently Added TV" and figured I'd try resetting the cache and letting it run in full to see if that resulted in all the content loading as expected. Does cancelling the loading process have any negative effects, such as corrupted caches or any other issues? Is this a useable workaround for the extended page loading?

@brainfork
Copy link
Author

Just to confirm, I'm trying to access it from Canada and can provide a log if someone is able to confirm this is a bug and not just expected behaviour.

@Varstahl
Copy link
Collaborator

Varstahl commented May 29, 2021

To be loading for a while the first time is normal, but 12400+ pages is totally not. In the addon settings you can force pagination for the main categories, to mitigate your issues.

That's the first I hear of it, it might be just Amazon doing weird things on some of their servers, I'm unsure.

@brainfork
Copy link
Author

Yeah, I figured that was an insane number of pages. I had set it to paginate 250 items per page before starting because it was taking a while during the first run as well. I let it run when I went to bed and just checked it again, it's at 27000+ pages now so I'm just going to cancel it and submit an error log.

@brainfork
Copy link
Author

here's the kodi log: https://paste.kodi.tv/usebonuhub

I'm not sure how useful it'll be since I didn't think to turn on verbose logging or debugging options. I'm seeing some things related to the amaon addon though so maybe there's something useful in there. I can clear the cache and start it again with debugging on if needed.

@Sandmann79
Copy link
Owner

@Varstahl checked this issue for amazon.tld and it seems that */api/* urls now needs the X-Requested-With: XMLHttpRequest header.
Without this you'll get http 307 error and a empty response.

But i don't know if this is related to this issue here, because i'm getting an connection error and not infinite loading times.

@jgaudet
Copy link

jgaudet commented Jun 4, 2021

I'm having the same issue. I'm not sure what the expected behaviour is, but I'm not getting 307 and an empty response; The json files in the cache all contain data and are ~1MB in size. Each json file is different, so it's not like it is re-downloading the same data over and over. Obviously it should run out of data at some point, but it does seem to just continue forever. I can try to post a cache file if anyone thinks that will be useful.

excerpt from verbose logging: https://paste.kodi.tv/adequsewet.kodi

@Sandmann79
Copy link
Owner

@jgaudet if you compare the urls in your log, you'll see that the queries are always the same (except serviceToken). So its basicly downloads the same url every time.

If you want, you can test the attached network.py (remove the txt extension):
network.py.txt
It enables the header posted above for /api/ urls.
Don't forget to clear the catalog cache.

@jgaudet
Copy link

jgaudet commented Jun 5, 2021

Updating the network.py file to the one above worked! So weird - the json files are different sizes and I did a diff on a few pairs and they were way different.

@MarcoViti
Copy link

Hi reading the posts above I deduce that a solution to infinite loading has been found, I just can't figure out what I should do to get the add on working again. It would be possible to have some more detailed explanation thanks.

@klinkf
Copy link

klinkf commented Jun 6, 2021

That did the trick for me as well.
Replace the existing network.py by the one @Sandmann79 provided above.
That file is located under \storage\emulated\0\Android\data\org.xbmc.kodi\files.kodi\addons\plugin.video.amazon-test\resources\lib
I'm on Android with a Odroid N2+. The first part of the path may be different if you have installed Kodi on another OS.

Thank you very much @Sandmann79 and @brainfork

@Sandmann79
Copy link
Owner

@klinkf @jgaudet can you please check, if there is more than one page, if you're on a video list? (like on recently added movies section)

@MarcoViti
Copy link

Thanks, now work good...
For user Windows 10 ..
C:\Users\Marco\AppData\Roaming\Kodi\addons\plugin.video.amazon-test\resources\lib

@klinkf
Copy link

klinkf commented Jun 6, 2021

@klinkf @jgaudet can you please check, if there is more than one page, if you're on a video list? (like on recently added movies section)

There seems to be only one page loaded for each sub-section.

@Sandmann79
Copy link
Owner

Thanks for testing.
Can you replace the attached primevideo.py with this inside the addon folder and check if this works:
primevideo.py.txt
Like before remove the txt extension and clear catalog cache at addon settings.

@jgaudet
Copy link

jgaudet commented Jun 6, 2021

@Sandmann79 you are correct, it was previously only loading one page for a video list. I've update the primevideo.py file and it appears to be loading multiple pages again.

@Sandmann79
Copy link
Owner

Thanks for the fast response, i'll integrate this in the next update. Should be released in a few hours.

@Sandmann79
Copy link
Owner

fixed with release d3bab8a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants