doko-desuka / doko-desuka.github.io

Alternative way to install the repository, using a link.
0 stars 0 forks source link

Question #1

Closed jewbmx closed 5 years ago

jewbmx commented 5 years ago

You think you can help me figure out a error in my addon? I clear providers then all cache and go to click the moviewidget thats set to in theaters and it loads so crazy list instead of the normal in theaters list. Sometimes its normal then sometimes it isnt lol. Addon is Scrubs

doko-desuka commented 5 years ago

Hi. Can you host the code directly on github? (the actual script files, not just the downloadable zip).
It's easier for me to see.

jewbmx commented 5 years ago

Sure I'll get it up in about 15

doko-desuka commented 5 years ago

If I compare your /indexers/movies.py script with the one from Placenta, it shows some differences in the imdb_list() function (the function used by the "in theaters" search).
What fork did you get it from?
Did you change that file in any way?
Is it working properly in the original fork you got it from?

jewbmx commented 5 years ago

Was originally forked from yoda but my buddy tossed in some parts from a few others too lol. If I remember correctly the yoda addon does the same thing some times after the cache cleaning

doko-desuka commented 5 years ago

Okay, wait. The self.theaters_link url uses date sorting with this flag, "sort=release_date_us,desc". But if you go on IMDB and manually do a search, you'll see they changed that sorting-method name to just "release_date".

So try using this updated self.theaters_link value:
self.theaters_link = 'http://www.imdb.com/search/title?title_type=feature&num_votes=1000,&release_date=date[365],date[0]&sort=release_date,desc&count=40&start=1'

doko-desuka commented 5 years ago

btw, I'm closing issue this since we can still comment on it, even after it's closed.

Also, from that same movies.py.
See how you feel about these two blocks: 1) The original from the script.

        ### The Ultimate List Menu ###
        self.imdbtul1_link = 'http://www.imdb.com/list/ls051120791/?view=detail&sort=alpha,asc&title_type=movie,tvMovie&start=1'
        self.imdbtul2_link = 'http://www.imdb.com/list/ls059324807/?view=detail&sort=alpha,asc&title_type=movie,tvMovie&start=1'
        self.imdbtul3_link = 'http://www.imdb.com/list/ls058532916/?view=detail&sort=alpha,asc&title_type=movie,tvMovie&start=1'
        self.imdbtul4_link = 'http://www.imdb.com/list/ls051226058/?view=detail&sort=alpha,asc&title_type=movie,tvMovie&start=1'
        self.imdbtul5_link = 'http://www.imdb.com/list/ls055895628/?view=detail&sort=alpha,asc&title_type=movie,tvMovie&start=1'
        self.imdbtul6_link = 'http://www.imdb.com/list/ls050549896/?view=detail&sort=alpha,asc&title_type=movie,tvMovie&start=1'
        self.imdbtul7_link = 'http://www.imdb.com/list/ls051868612/?view=detail&sort=alpha,asc&title_type=movie,tvMovie&start=1'
        self.imdbtul8_link = 'http://www.imdb.com/list/ls058229527/?view=detail&sort=alpha,asc&title_type=movie,tvMovie&start=1'
        self.imdbtul9_link = 'http://www.imdb.com/list/ls052680925/?view=detail&sort=alpha,asc&title_type=movie,tvMovie&start=1'
        self.imdbtul10_link = 'http://www.imdb.com/list/ls050169117/?view=detail&sort=alpha,asc&title_type=movie,tvMovie&start=1'
        self.imdbtul11_link = 'http://www.imdb.com/list/ls052167156/?view=detail&sort=alpha,asc&title_type=movie,tvMovie&start=1'
        self.imdbtul12_link = 'http://www.imdb.com/list/ls058510754/?view=detail&sort=alpha,asc&title_type=movie,tvMovie&start=1'
        self.imdbtul13_link = 'http://www.imdb.com/list/ls051776567/?view=detail&sort=alpha,asc&title_type=movie,tvMovie&start=1'
        self.imdbtul14_link = 'http://www.imdb.com/list/ls050374454/?view=detail&sort=alpha,asc&title_type=movie,tvMovie&start=1'
        self.imdbtul15_link = 'http://www.imdb.com/list/ls054799711/?view=detail&sort=alpha,asc&title_type=movie,tvMovie&start=1'
        self.imdbtul16_link = 'http://www.imdb.com/list/ls050616277/?view=detail&sort=alpha,asc&title_type=movie,tvMovie&start=1'
        self.imdbtul17_link = 'http://www.imdb.com/list/ls057112572/?view=detail&sort=alpha,asc&title_type=movie,tvMovie&start=1'
        self.imdbtul18_link = 'http://www.imdb.com/list/ls070605453/?view=detail&sort=alpha,asc&title_type=movie,tvMovie&start=1'
        self.imdbtul19_link = 'http://www.imdb.com/list/ls054021431/?view=detail&sort=alpha,asc&title_type=movie,tvMovie&start=1'
        self.imdbtul20_link = 'http://www.imdb.com/list/ls059998134/?view=detail&sort=alpha,asc&title_type=movie,tvMovie&start=1'
        self.imdbtul21_link = 'http://www.imdb.com/list/ls070560280/?view=detail&sort=alpha,asc&title_type=movie,tvMovie&start=1'
        self.imdbtul22_link = 'http://www.imdb.com/list/ls055559957/?view=detail&sort=alpha,asc&title_type=movie,tvMovie&start=1'
        self.imdbtul23_link = 'http://www.imdb.com/list/ls052767261/?view=detail&sort=alpha,asc&title_type=movie,tvMovie&start=1'
        self.imdbtul24_link = 'http://www.imdb.com/list/ls058459196/?view=detail&sort=alpha,asc&title_type=movie,tvMovie&start=1'
        self.imdbtul25_link = 'http://www.imdb.com/list/ls051374072/?view=detail&sort=alpha,asc&title_type=movie,tvMovie&start=1'
        self.imdbtul26_link = 'http://www.imdb.com/list/ls050784999/?view=detail&sort=alpha,asc&title_type=movie,tvMovie&start=1'
        self.imdbtul27_link = 'http://www.imdb.com/list/ls052206353/?view=detail&sort=alpha,asc&title_type=movie,tvMovie&start=1'
        self.imdbtul28_link = 'http://www.imdb.com/list/ls058459400/?view=detail&sort=alpha,asc&title_type=movie,tvMovie&start=1'
        self.imdbtul29_link = 'http://www.imdb.com/list/ls050510323/?view=detail&sort=alpha,asc&title_type=movie,tvMovie&start=1'
        self.imdbtul30_link = 'http://www.imdb.com/list/ls058287184/?view=detail&sort=alpha,asc&title_type=movie,tvMovie&start=1'
        self.imdbtul31_link = 'http://www.imdb.com/list/ls058450812/?view=detail&sort=alpha,asc&title_type=movie,tvMovie&start=1'
        self.imdbtul32_link = 'http://www.imdb.com/list/ls053988992/?view=detail&sort=alpha,asc&title_type=movie,tvMovie&start=1'
        self.imdbtul33_link = 'http://www.imdb.com/list/ls051374549/?view=detail&sort=alpha,asc&title_type=movie,tvMovie&start=1'
        self.imdbtul34_link = 'http://www.imdb.com/list/ls053711583/?view=detail&sort=alpha,asc&title_type=movie,tvMovie&start=1'
        self.imdbtul35_link = 'http://www.imdb.com/list/ls059415760/?view=detail&sort=alpha,asc&title_type=movie,tvMovie&start=1'
        self.imdbtul36_link = 'http://www.imdb.com/list/ls008946126/?view=detail&sort=alpha,asc&title_type=movie,tvMovie&start=1'
        self.imdbtul37_link = 'http://www.imdb.com/list/ls054765242/?view=detail&sort=alpha,asc&title_type=movie,tvMovie&start=1'
        self.imdbtul38_link = 'http://www.imdb.com/list/ls008941464/?view=detail&sort=alpha,asc&title_type=movie,tvMovie&start=1'
        self.imdbtul39_link = 'http://www.imdb.com/list/ls053226015/?view=detail&sort=alpha,asc&title_type=movie,tvMovie&start=1'
        self.imdbtul40_link = 'http://www.imdb.com/list/ls057116679/?view=detail&sort=alpha,asc&title_type=movie,tvMovie&start=1'
        self.imdbtul41_link = 'http://www.imdb.com/list/ls050673652/?view=detail&sort=alpha,asc&title_type=movie,tvMovie&start=1'
        self.imdbtul42_link = 'http://www.imdb.com/list/ls050566435/?view=detail&sort=alpha,asc&title_type=movie,tvMovie&start=1'
        self.imdbtul43_link = 'http://www.imdb.com/list/ls053173569/?view=detail&sort=alpha,asc&title_type=movie,tvMovie&start=1'
        self.imdbtul44_link = 'http://www.imdb.com/list/ls050009305/?view=detail&sort=alpha,asc&title_type=movie,tvMovie&start=1'
        self.imdbtul45_link = 'http://www.imdb.com/list/ls008946046/?view=detail&sort=alpha,asc&title_type=movie,tvMovie&start=1'
        self.imdbtul46_link = 'http://www.imdb.com/list/ls054153182/?view=detail&sort=alpha,asc&title_type=movie,tvMovie&start=1'
        self.imdbtul47_link = 'http://www.imdb.com/list/ls059431052/?view=detail&sort=alpha,asc&title_type=movie,tvMovie&start=1'

2) A suggestion of mine:

    self.imdbUltimateListBase = 'http://www.imdb.com/list/%s/?view=detail&sort=alpha,asc&title_type=movie,tvMovie&start=1'

    self.imdbUltimateListIDs = (
        'ls051120791', 'ls059324807', 'ls058532916', 'ls051226058', 'ls055895628', 'ls050549896',
        'ls051868612', 'ls058229527', 'ls052680925', 'ls050169117', 'ls052167156', 'ls058510754',
        'ls051776567', 'ls050374454', 'ls054799711', 'ls050616277', 'ls057112572', 'ls070605453',
        'ls054021431', 'ls059998134', 'ls070560280', 'ls055559957', 'ls052767261', 'ls058459196',
        'ls051374072', 'ls050784999', 'ls052206353', 'ls058459400', 'ls050510323', 'ls058287184',
        'ls058450812', 'ls053988992', 'ls051374549', 'ls053711583', 'ls059415760', 'ls008946126',
        'ls054765242', 'ls008941464', 'ls053226015', 'ls057116679', 'ls050673652', 'ls050566435',
        'ls053173569', 'ls050009305', 'ls008946046', 'ls054153182', 'ls059431052'
    )

    def getIMDBUltimateList(self):
        '''
        :returns: A generator expression for all the urls of "The Ultimate List Menu".

        Example: for ultimateListURL in self.getIMDBUltimateList(): ...
        '''
        return ((self.imdbUltimateListBase % id) for id in self.imdbUltimateListIDs)
jewbmx commented 5 years ago

I didnt think of that. Both urls seem to work on my browser and addon but seem to also bring up the same thing.

I changed my personal copy of the addon to the normal in theaters url and it works fine with the 20 results playing in my area lol

self.theaterslink = 'https://www.imdb.com/movies-in-theaters/?ref=ft_inth'

doko-desuka commented 5 years ago

That sounds like a better choice, because movies-in-theaters also shows re-releases, like a movie released on festivals in 2017 that's now getting a limited release on theaters in 2018. If the page structure is the same (same HTML) then the add-on should be able to parse it just fine

jewbmx commented 5 years ago

No problem this was just a way to contact you easily lol.

As for your lists comment it can be tried, i found that some of the list code needs modified anyways because some have shows and movies but coded to just movies.

jewbmx commented 5 years ago

The short movies-in-theaters url has been in my copy of scrubs for about 9 hours and i havent seen any issues. Might add both tho since the old url has its perks

jewbmx commented 5 years ago

One downfall to making those lists shorthand is that if a url goes down it will be a little more work to trace back compared to the way it is now.

doko-desuka commented 5 years ago

If an url goes down you will know what ID you used to create it. You can dump it in a xbmcaddon.Addon().setSetting() string to ignore it the next time, or something else, like using a raw Github file with the lists, something that you can remotely maintain for everyone using your add-on.

jewbmx commented 5 years ago

I gotcha i think lol, pretty much the same thing just way easier then how it was done already and the trace back would be the same but instead of looking for a name itd be the actual list itself.

doko-desuka commented 5 years ago

No, like, in the function that requests the webpage w/ the IMDB list, you were sent the ID to use in the url for the request. If you detect that the page is bad or couldn't be loaded, then the ID is bad.

def myFunction(self, listID)
  url = self.imdbUltimateListBase % listID

  r = requests.get(url, ...)  
  if r.ok:
    (...) # Try to parse the web page.
    # If something goes wrong, you know 'listID' points to a bad list.
  else:
    # Bad response, so you know 'listID' points to a bad list.
jewbmx commented 5 years ago

You think you can help me figure out how to toggle the RD setting in resolveurl from my Scrubs exo fork addon? Heres what i got so far but it still isnt working lol. (Im still a little fresh at this lmao)

elif action == 'ToggleRealDbird': try: import resolveurl except: pass if xbmcaddon.Addon(id='script.module.resolveurl').getSetting("RealDebridResolver_enabled") == "false": xbmcaddon.Addon(id='script.module.resolveurl').getSetting("RealDebridResolver_enabled", value="true") else: xbmcaddon.Addon(id='script.module.resolveurl').getSetting("RealDebridResolver_enabled", value="false") xbmc.executebuiltin("XBMC.Container.Refresh")

Heres a setting i tossed in to try it out...

doko-desuka commented 5 years ago

Hi.
I don't have the XBMC API memorized, so whenever I have to do something with it I always open a tab to this: https://codedocs.xyz/xbmc/xbmc/group__python__xbmc.html (Note that it's now for Kodi v18, so there'll be some functions that aren't available on v17. It always tells when a certain function is a "v18 Python Change: new function added" so you can ignore these new functions.)

Anyway after looking in the docs, getSetting( ) only asks for the value of settings. To change the settings you use setSetting( ).

What you had was mostly right. I don't think you need to import resolveurl to change its settings since you're doing that through xbmcaddon. I'd try it this way:

elif action == 'ToggleRealDbird':
  try:
    resolveURLAddon = xbmcaddon.Addon(id='script.module.resolveurl')
    if resolveURLAddon:
      isEnabled = resolveURLAddon.getSetting('RealDebridResolver_enabled') == 'true'
      resolveURLAddon.setSetting('RealDebridResolver_enabled', 'false' if isEnabled else 'true')
      xbmc.executebuiltin('Container.Refresh')
    else:
      raise Exception()
  except:
    # Show some notification that 'resolveurl' was not found? etc.
    pass