Improved LegendasDivx provider to get more accurate results and prevent unnecessary throttling

pull/1601/head
redglory 3 years ago committed by GitHub
parent 618bddebf9
commit f53ef40d57
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -272,7 +272,7 @@ class LegendasdivxProvider(Provider):
querytext = video.imdb_id if video.imdb_id else video.title
if isinstance(video, Episode):
querytext = '{} S{:02d}E{:02d}'.format(video.series, video.season, video.episode)
querytext = '%22{}%20S{:02d}E{:02d}%22'.format(video.series, video.season, video.episode)
querytext = quote(querytext.lower())
# language query filter
@ -430,12 +430,13 @@ class LegendasdivxProvider(Provider):
_guess = guessit(name)
if isinstance(subtitle.video, Episode):
logger.debug("Legendasdivx.pt :: guessing %s", name)
logger.debug("Legendasdivx.pt :: subtitle S%sE%s video S%sE%s", _guess['season'], _guess['episode'], subtitle.video.season, subtitle.video.episode)
if all(key in _guess for key in ('season', 'episode')):
logger.debug("Legendasdivx.pt :: guessing %s", name)
logger.debug("Legendasdivx.pt :: subtitle S%sE%s video S%sE%s", _guess['season'], _guess['episode'], subtitle.video.season, subtitle.video.episode)
if subtitle.video.episode != _guess['episode'] or subtitle.video.season != _guess['season']:
logger.debug('Legendasdivx.pt :: subtitle does not match video, skipping')
continue
if subtitle.video.episode != _guess['episode'] or subtitle.video.season != _guess['season']:
logger.debug('Legendasdivx.pt :: subtitle does not match video, skipping')
continue
matches = set()
matches |= guess_matches(subtitle.video, _guess)

Loading…
Cancel
Save