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

The sections movies, shows and kids show no results #322

Closed
Paco8 opened this issue Jul 27, 2019 · 15 comments · Fixed by #350
Closed

The sections movies, shows and kids show no results #322

Paco8 opened this issue Jul 27, 2019 · 15 comments · Fixed by #350

Comments

@Paco8
Copy link
Contributor

Paco8 commented Jul 27, 2019

I guess Amazon changed again the html. The watchlist and the search function still work, but I noticed that when I try to browse the other sections (movies, shows and kids) it displays an empty list.
There's no error in the log.

@Varstahl
Copy link
Collaborator

Probable, which is why we're moving away from it. I'm just not done with it though.

@Paco8
Copy link
Contributor Author

Paco8 commented Jul 31, 2019

I fixed it partially with this patch:

--- primevideo-orig.py	2019-07-31 22:13:40.175048136 +0200
+++ primevideo.py	2019-07-31 22:14:00.402793839 +0200
@@ -609,7 +609,7 @@
 
             for t in [('\\\\n', '\n'), ('\\n', '\n'), ('\\\\"', '"'), (r'^\s+', '')]:
                 cnt = re.sub(t[0], t[1], cnt, flags=re.DOTALL)
-            if None is not re.search('<div id="Storefront">', cnt):
+            if None is not re.search('<div\s+class="DVWebNode-storefront-wrapper|<div id="Storefront">', cnt):
                 ''' Categories list '''
                 Log('Storefront page', Log.DEBUG)
                 from BeautifulSoup import BeautifulSoup
@@ -648,7 +648,8 @@
                             else:
                                 # Widow carousel with movies/TV series. Most information has been stripped away from
                                 # the carousel, so we can't do more than just forwarding a request
-                                requestURLs.append((link, o[title], ExtractURN(link), True))
+                                if None is re.search(r'/search/', link):
+                                    requestURLs.append((link, o[title], ExtractURN(link), True))
                     else:
                         ''' The carousel has explore link '''
                         NotifyUser(getString(30253).format(title))

I didn't fix the "Genres/Categories" links.

I also noticed another problem, the addon crashes when scanning shows with a single season. This is because amazon changed class="_2XnrBy" with class="_3yWnmV _2XnrBy".

I fixed it by replacing "_2XnrBy" with ".*?_2XnrBy"

--- primevideo-orig.py	2019-07-31 22:13:40.175048136 +0200
+++ primevideo.py	2019-07-31 23:09:12.033161007 +0200
@@ -762,7 +762,7 @@
                     else:
                         ''' Episode list '''
                         # Find out what page revision we're in
-                        if None is not re.search(r'(class="_2XnrBy"|for="[^"]*-season-selector)', cnt):
+                        if None is not re.search(r'(class=".*?_2XnrBy"|for="[^"]*-season-selector)', cnt):
                             revision = 3
                         elif None is not re.search(r'<ol[^>]*>\s*<li id="[ap]v-ep-', cnt, flags=re.DOTALL):
                             revision = 2
@@ -836,7 +836,7 @@
                                         thumbnail = MaxSize(Unescape(gpr['catalogMetadata']['images']['imageUrls']['title']))
                                         self._videodata[refUrn]['metadata']['artmeta'] = {'thumb': thumbnail, 'poster': thumbnail, 'fanart': bgimg}
                                     if 'title' not in self._videodata[refUrn]:
-                                        bSingle = None is not re.search(r'(class="_2XnrBy"|[ap]v-season-single|DigitalVideoWebNodeDetail_seasons__single)', cnt)
+                                        bSingle = None is not re.search(r'(class=".*?_2XnrBy"|[ap]v-season-single|DigitalVideoWebNodeDetail_seasons__single)', cnt)
                                         self._videodata[refUrn]['title'] = Unescape(re.search([
                                             r'<span class="[^"]*[ap]v-season-single[^"]*">\s*(.*?)\s*(?:</a>|</span>)',  # r0 single
                                             r'<a class="[^"]*[ap]v-droplist--selected[^"]*"[^>]*>\s*(.*?)\s*</a>',  # r0 multi
@@ -844,7 +844,7 @@
                                             r'<div class="[^"]*dv-node-dp-seasons.*?<label[^>]*>\s*<span[^>]*>\s*(.*?)\s*</span>\s*</label>',  # r1 multi
                                             r'<span class="[^"]*[ap]v-season-single[^"]*">\s*(.*?)\s*(?:</a>|</span>)',  # r2 single
                                             r'<label class="[^"]*[ap]v-select-trigger[^"]*"[^>]*>\s*(.*?)\s*</label>',  # r2 multi
-                                            r'<span class="_2XnrBy">\s*<span>\s*(.*?)\s*</span>',  # r3 single
+                                            r'<span class=".*?_2XnrBy">\s*<span>\s*(.*?)\s*</span>',  # r3 single
                                             r'<label[^>]*\s+for="[^"]*-season-selector"[^>]*>\s*<span>\s*(.*?)\s*</span>',  # r3 multi
                                         ][(revision << 1) + (0 if bSingle else 1)], cnt, flags=re.DOTALL).group(1))
                                     if 'parent' not in self._videodata[refUrn]:

@sheldonmaschmeyer
Copy link

How do you install and use patch? I also have movies, shows and kids show no results. When typing in Star Trek, it says in the top right corner that it found Into Darkness but, does not appear in results list.

@sanangel
Copy link

@Paco8
How and where do you put your patches?
Gracias.

@Paco8
Copy link
Contributor Author

Paco8 commented Aug 12, 2019

I attach the patched primevideo.py:

primevideo.zip

I also have this repo with my modifications:
https://github.com/Paco8/kodi-repo/tree/master/packages

@sanangel
Copy link

Thanks @Paco8 working perfecto.
Gracias!!!!

@Surajpd
Copy link

Surajpd commented Aug 14, 2019

Hi @Paco8,
Thanks for the updated Amazon VOD repository. This refreshes all movie contents flawlessly.
However while playing movies, I find that no Video is displayed. Instead the screen is filled with colours with some static disturbance at the top. I tried to toggle with the video settings to no avail. Audio works pefectly. Will be grateful if you have any suggestion for this. I am accessing from India. Thanks in advance.

Update: Got this solved. It was in Kodi Video settings. This video helped. https://youtu.be/rR3sENo_e3Q

@rytecbe
Copy link

rytecbe commented Aug 14, 2019

I attach the patched primevideo.py:

primevideo.zip

I also have this repo with my modifications:
https://github.com/Paco8/kodi-repo/tree/master/packages

Hello Paco8, how to install the patches please? With FTP and which folders?

Thank you.

@Paco8
Copy link
Contributor Author

Paco8 commented Aug 14, 2019

Extract primevideo.py from primevideo.zip, and copy it to plugin.video.amazon-test/resources/lib/ replacing the original one.

@sanangel
Copy link

@Paco8 I have put a link to this topic in the kodi forum. I hope that doesn't create any problem ...
https://forum.kodi.tv/showthread.php?tid=331136&pid=2877470#pid2877470

@Crancker969
Copy link

I attach the patched primevideo.py:

primevideo.zip

I also have this repo with my modifications:
https://github.com/Paco8/kodi-repo/tree/master/packages

Thanks @Paco8 working perfecto.
Gracias!!!! eres un fenomeno

@Fabrizio-93
Copy link

Fabrizio-93 commented Sep 20, 2019

how do i install on kodi? You can help me? @Paco8

@Paco8
Copy link
Contributor Author

Paco8 commented Sep 20, 2019

@Paco8
Copy link
Contributor Author

Paco8 commented Sep 20, 2019

By the way, it seems amazon made changes again and I think the code which gets the season number from the episode list is broken again.

I made a patch which gets the season number from the json data in case the regular expressions above fail. I attach the patch and the modified primevideo.py

primevideo-fix.zip

@Markef80
Copy link

Hi all

I had installed the path of August and it worked.
After an absence, I had another mistake.
So I installed the patch of September.
I have no more error but the directory is empty ...
Thanks for your help.

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

Successfully merging a pull request may close this issue.

9 participants