You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
with guessit plugin: series: list index out of range #2176
Hi :)
I'm using latest flexget from git on develop branch on gentoo linux ~amd64 with Python 3.5.5
running flexget check returns no warnings or errors
after I enabled the guessit plugin for series when I run a task i named tv-sort, for sorting my tv-shows, flexget crashes.
I added some debug information in the plugins/parsers/parser_guessit.py file
i'll show here the last several lines of the log:
2018-07-21 13:27 INFO parser_guessit tv-sort Parsing series: `new.girl.s07e08.1080p.web.x264-tbs` [op
tions: {'identified_by': 'ep', 'date_yearfirst': None, 'name': 'new girl', 'sequence_regexps': [], 'ep_regexps':
[], 'special_ids': [], 'date_dayfirst': None, 'name_regexps': [], 'date_regexps': [], 'alternate_names': [], 'str
ict_name': False, 'prefer_specials': None, 'allow_groups': [], 'assume_special': None, 'id_regexps': []}]
2018-07-21 13:27 INFO parser_guessit tv-sort MEEEE NAME new girl COUNTRY None
2018-07-21 13:27 INFO parser_guessit tv-sort before
2018-07-21 13:27 INFO parser_guessit tv-sort {'type': [<episode:(34, 34)+name=type>], 'title': [<new
girl:(0, 8)+name=title+tags=['expected', 'title', 'equivalent-ignore', 'equivalent-ignore', 'equivalent-ignore',
'equivalent-ignore', 'equivalent-ignore', 'equivalent-ignore', 'equivalent-ignore', 'equivalent-ignore', 'equival
ent-ignore', 'equivalent-ignore', 'equivalent-ignore', 'equivalent-ignore', 'equivalent-ignore', 'equivalent-igno
re', 'equivalent-ignore', 'equivalent-ignore', 'equivalent-ignore', 'equivalent-ignore', 'equivalent-ignore', 'eq
uivalent-ignore', 'equivalent-ignore', 'equivalent-ignore', 'equivalent-ignore']>], 'format': [<WEB-DL:(22, 25)+n
ame=format+tags=['video-codec-prefix', 'streaming_service.suffix']>], 'video_codec': [<h264:(26, 30)+name=video_c
odec+tags=['format-suffix', 'streaming_service.suffix']>], 'release_group': [<tbs:(30, 34)+name=release_group+tag
s=['scene']>], 'season': [<7:(10, 12)+name=season+tags=['SxxExx']+initiator=s07e08>], 'episode': [<8:(13, 15)+nam
e=episode+tags=['SxxExx']+initiator=s07e08>], 'screen_size': [<1080p:(16, 21)+name=screen_size>]}
2018-07-21 13:27 INFO parser_guessit tv-sort after
2018-07-21 13:27 INFO parser_guessit tv-sort Parsing series: `NL0QPP7xNWPJd11fiBRXdhPhwOm5n50ZSy5l4Ys
h3G6EK1kK8bFzWk` [options: {'identified_by': 'ep', 'date_yearfirst': None, 'name': 'new girl', 'sequence_regexps'
: [], 'ep_regexps': [], 'special_ids': [], 'date_dayfirst': None, 'name_regexps': [], 'date_regexps': [], 'altern
ate_names': [], 'strict_name': False, 'prefer_specials': None, 'allow_groups': [], 'assume_special': None, 'id_re
gexps': []}]
2018-07-21 13:27 INFO parser_guessit tv-sort MEEEE NAME new girl COUNTRY None
2018-07-21 13:27 INFO parser_guessit tv-sort before
2018-07-21 13:27 INFO parser_guessit tv-sort {'uuid': [<NL0QPP7xNWPJd11fiBRXdhPhwOm5n50ZSy5l4Ysh3G6EK
1kK8bFzWk:(0, 54)+name=uuid>], 'type': [<episode:(54, 54)+name=type>]}
2018-07-21 13:27 INFO parser_guessit tv-sort after
2018-07-21 13:27 CRITICAL task tv-sort BUG: Unhandled error in plugin series: list index out of
range
i think a confirmation that it has found the proper name of the movie should be implemented.
yeah I have a long movie name with random characters, it should not crash 'guessit' parseer either way.
welp adding try catch and a proper error message allowed the task to continue and finish
--- a/flexget/plugins/parsers/parser_guessit.py
+++ b/flexget/plugins/parsers/parser_guessit.py
@@ -186,38 +186,41 @@ class ParserGuessit(object):
else:
# Make sure the name match is up to FlexGet standards
# Check there is no unmatched cruft before the matched name
- title_start = guess_result.matches['title'][0].start
- title_end = guess_result.matches['title'][0].end
- if title_start != 0:
- try:
- pre_title = max((match[0].end for match in guess_result.matches.values() if
- match[0].end <= title_start))
- except ValueError:
- pre_title = 0
- for char in reversed(data[pre_title:title_start]):
- if char.isalnum() or char.isdigit():
- return SeriesParseResult(data=data, valid=False)
- if char.isspace() or char in '._':
- continue
- else:
- break
- # Check the name doesn't end mid-word (guessit might put the border before or after the space after title)
- if data[title_end - 1].isalnum() and len(data) <= title_end or \
- not self._is_valid_name(data, guessit_options=guessit_options):
- valid = False
- # If we are in exact mode, make sure there is nothing after the title
- if kwargs.get('strict_name'):
- post_title = sys.maxsize
- for match_type, matches in guess_result.matches.items():
- if match_type in ['season', 'episode', 'date', 'regexpId']:
- if matches[0].start < title_end:
- continue
- post_title = min(post_title, matches[0].start)
- if matches[0].parent:
- post_title = min(post_title, matches[0].parent.start)
- for char in data[title_end:post_title]:
- if char.isalnum() or char.isdigit():
- valid = False
+ try:
+ title_start = guess_result.matches['title'][0].start
+ title_end = guess_result.matches['title'][0].end
+ if title_start != 0:
+ try:
+ pre_title = max((match[0].end for match in guess_result.matches.values() if
+ match[0].end <= title_start))
+ except ValueError:
+ pre_title = 0
+ for char in reversed(data[pre_title:title_start]):
+ if char.isalnum() or char.isdigit():
+ return SeriesParseResult(data=data, valid=False)
+ if char.isspace() or char in '._':
+ continue
+ else:
+ break
+ # Check the name doesn't end mid-word (guessit might put the border before or after the space after title)
+ if data[title_end - 1].isalnum() and len(data) <= title_end or \
+ not self._is_valid_name(data, guessit_options=guessit_options):
+ valid = False
+ # If we are in exact mode, make sure there is nothing after the title
+ if kwargs.get('strict_name'):
+ post_title = sys.maxsize
+ for match_type, matches in guess_result.matches.items():
+ if match_type in ['season', 'episode', 'date', 'regexpId']:
+ if matches[0].start < title_end:
+ continue
+ post_title = min(post_title, matches[0].start)
+ if matches[0].parent:
+ post_title = min(post_title, matches[0].parent.start)
+ for char in data[title_end:post_title]:
+ if char.isalnum() or char.isdigit():
+ valid = False
+ except:
+ log.error('FAILED Parsing movie: `%s` [options: %s]', data, kwargs)
season = guess_result.get('season')
episode = guess_result.get('episode')
if episode is None and 'part' in guess_result:
Activity
paranoidi commentedon Jul 20, 2018
Secure Connection Failed
The connection to paste.pound-python.org was interrupted while the page, please follow the ticket format.
kfirufk commentedon Jul 20, 2018
sorry! :)
attached the crash report
and this is my config.yml
crash_report.2018.07.20.000942885382.log
kfirufk commentedon Jul 21, 2018
I added some debug information in the plugins/parsers/parser_guessit.py file
i'll show here the last several lines of the log:
i think a confirmation that it has found the proper name of the movie should be implemented.
yeah I have a long movie name with random characters, it should not crash 'guessit' parseer either way.
kfirufk commentedon Jul 21, 2018
welp adding try catch and a proper error message allowed the task to continue and finish