I-A-C / script.module.lambdascrapers

Scrapers Module for Exodus based add ons
61 stars 39 forks source link

darewatch.py , Limit Links to 5 from 10 #23

Closed SerpentDrago closed 5 years ago

SerpentDrago commented 5 years ago

just to many show up in the list . is 5 enough ? i think 10 is to much .

Refereed to this by Doku , getting complaints on the forum

Mybee this can be changed to a Variable / string . and can be a Option in the settings ??

doko-desuka commented 5 years ago

That should work. I think in the future the list of found hosts could be reduced to one line per host type per source, like this:

1 | DAREWATCH | OPENLOAD (7 Links) 2 | DAREWATCH | VIDLOX (4 Links) 3 | SERIES9 | STREAMANGO (5 Links) . . .

Then selecting one line tries to play one from that group, and if it fails it picks another host group at random. So the behavior doesn't change from what it does now, just the way the list is organized.
This way we don't have to worry about how many links are found, all links from a host of a source will use one row.

SerpentDrago commented 5 years ago

That would be bad ass , Like absolutely amazing !

host505 commented 5 years ago

What about the link details (rip type, file size, codec, sound etc)? Edit: it seems darewatch scraper doesn't implement any of these functions. You might wanna have a look at source_utils.py.

doko-desuka commented 5 years ago

A "compact list mode" would have the trade-off of having to hide that information, I guess.

Thanks for the _utils pointer, I'll take a look.
I think that rip type, audio and video format etc. might be obtained by code outside of the provider code.
I remember it doing that to some hosts without the provider script doing anything special, just tagging the sources as "HD".

drinfernoo commented 5 years ago

@doko-desuka You mention trying the next link "at random"... but then we don't really have any way of predicting or determining which links are working, the way we do when links are tried sequentially.

doko-desuka commented 5 years ago

@drinfernoo I think even if you group the links by host, you can still play them sequentially. You just need to keep track of what links you already tried to resolve in each group, and try the next ones.

Something like this:

class HostGroup
    def __init__(self, items):
        self.items = items
        self.index = 0

    def getNextItem(self):
        item = self.items[self.index]
        self.index = self.index+1 if self.index < len(self.items)-1 else 0
        return item

allHostGroups.append(HostGroup(darewatchItems))
allHostGroups.append(HostGroup(watchonlineItems))
allHostGroups.append(HostGroup(xwatchseriesItems))
(...)

for x in xrange(totalItems):
    group = random.choice(allHostGroups) # Get a random group.
    item = group.getNextItem() # Get its next item (cycling back to the first item, if exhausted).
    # Try to play the item etc.

But this would be done at the video plugin level (Exodus Redux, not L.Scrapers).