question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Issue arises after trying to download subtitles

See original GitHub issue

Trying to run subliminal, I faced this output:

Downloading subtitles  [#################################---]   94%  0d 00:03:13  Mr.Robot.S03E05.eps3.4_runtime-error.r00.WEBDL-1080p.mkv                                  
Traceback (most recent call last):
  File "/usr/local/bin/subliminal", line 11, in <module>
    sys.exit(subliminal())
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/click/decorators.py", line 27, in new_func
    return f(get_current_context().obj, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/subliminal/cli.py", line 403, in download
    hearing_impaired=hearing_impaired, only_one=single)
  File "/usr/local/lib/python2.7/dist-packages/subliminal/core.py", line 211, in download_best_subtitles
    for s in subtitles], key=operator.itemgetter(1), reverse=True)
  File "/usr/local/lib/python2.7/dist-packages/subliminal/score.py", line 106, in compute_score
    matches = subtitle.get_matches(video)
  File "/usr/local/lib/python2.7/dist-packages/subliminal/providers/opensubtitles.py", line 78, in get_matches
    matches |= guess_matches(video, guessit(self.movie_release_name, {'type': 'episode'}))
  File "/usr/local/lib/python2.7/dist-packages/guessit/api.py", line 69, in guessit
    return default_api.guessit(string, options)
  File "/usr/local/lib/python2.7/dist-packages/guessit/api.py", line 182, in guessit
    raise GuessitException(string, options)
guessit.api.GuessitException: An internal error has occured in guessit.
===================== Guessit Exception Report =====================
version=3.0.0
string=Mr.Robot.S03E05.WEB-DL.WEB-Rip
options={'type': 'episode'}
--------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/guessit/api.py", line 170, in guessit
    matches = self.rebulk.matches(string, options)
  File "/usr/local/lib/python2.7/dist-packages/rebulk/rebulk.py", line 288, in matches
    self._execute_rules(matches, context)
  File "/usr/local/lib/python2.7/dist-packages/rebulk/rebulk.py", line 319, in _execute_rules
    rules.execute_all_rules(matches, context)
  File "/usr/local/lib/python2.7/dist-packages/rebulk/rules.py", line 318, in execute_all_rules
    when_response = execute_rule(rule, matches, context)
  File "/usr/local/lib/python2.7/dist-packages/rebulk/rules.py", line 343, in execute_rule
    rule.then(matches, when_response, context)
  File "/usr/local/lib/python2.7/dist-packages/guessit/rules/processors.py", line 220, in then
    if match.raw[0] in seps_no_groups and (len(match.raw) < 3 or match.raw[2] not in seps_no_groups):
IndexError: string index out of range
--------------------------------------------------------------------
Please report at https://github.com/guessit-io/guessit/issues.

As it was written I opened an issue in guessit github, but trying to make this request by my own I found that the problem is that the wrong string are been sent to guessit:

python __main__.py "Mr.Robot.S03E05.eps3.4_runtime-error.r00.WEBDL-1080p.mkv"
For: Mr.Robot.S03E05.eps3.4_runtime-error.r00.WEBDL-1080p.mkv
GuessIt found: {
    "title": "Mr Robot", 
    "season": 3, 
    "episode": 5, 
    "episode_title": "eps3 4 runtime-error r00", 
    "source": "Web", 
    "screen_size": "1080p", 
    "container": "mkv", 
    "mimetype": "video/x-matroska", 
    "type": "episode"
}

python __main__.py "Mr.Robot.S03E05.WEB-DL.WEB-Rip"
For: Mr.Robot.S03E05.WEB-DL.WEB-Rip
Traceback (most recent call last):
  File "__main__.py", line 170, in <module>
    main()
  File "__main__.py", line 163, in main
    guess_filename(filename, options)
  File "__main__.py", line 42, in guess_filename
    guess = api.guessit(filename, options)
  File "/home/bkemmer/.local/lib/python2.7/site-packages/guessit/api.py", line 69, in guessit
    return default_api.guessit(string, options)
  File "/home/bkemmer/.local/lib/python2.7/site-packages/guessit/api.py", line 182, in guessit
    raise GuessitException(string, options)
guessit.api.GuessitException: An internal error has occured in guessit.
===================== Guessit Exception Report =====================
version=3.0.0
string=Mr.Robot.S03E05.WEB-DL.WEB-Rip
options={'allowed_languages': ['de', 'en', 'es', 'ca', 'cs', 'fr', 'he', 'hi', 'hu', 'it', 'ja', 'ko', 'nl', 'pl', 'pt', 'ro', 'ru', 'sv', 'te', 'uk', 'mul', 'und'], 'expected_title': ['OSS 117'], 'allowed_countries': ['au', 'us', 'gb'], 'filename': ['Mr.Robot.S03E05.WEB-DL.WEB-Rip']}
--------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/bkemmer/.local/lib/python2.7/site-packages/guessit/api.py", line 170, in guessit
    matches = self.rebulk.matches(string, options)
  File "/home/bkemmer/.local/lib/python2.7/site-packages/rebulk/rebulk.py", line 288, in matches
    self._execute_rules(matches, context)
  File "/home/bkemmer/.local/lib/python2.7/site-packages/rebulk/rebulk.py", line 319, in _execute_rules
    rules.execute_all_rules(matches, context)
  File "/home/bkemmer/.local/lib/python2.7/site-packages/rebulk/rules.py", line 318, in execute_all_rules
    when_response = execute_rule(rule, matches, context)
  File "/home/bkemmer/.local/lib/python2.7/site-packages/rebulk/rules.py", line 343, in execute_rule
    rule.then(matches, when_response, context)
  File "/home/bkemmer/.local/lib/python2.7/site-packages/guessit/rules/processors.py", line 220, in then
    if match.raw[0] in seps_no_groups and (len(match.raw) < 3 or match.raw[2] not in seps_no_groups):
IndexError: string index out of range
--------------------------------------------------------------------
Please report at https://github.com/guessit-io/guessit/issues.
====================================================================

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
duramatocommented, Jul 13, 2018

Yes, it is required AFAIK @bkemmer

0reactions
ratoaq2commented, Feb 17, 2019

Closing this since it’s a duplicate of #933 But can you still confirm that’s not an issue anymore with latest guessit 3.0.3 ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error when downloading subtitles for subfolders. #775 - GitHub
The issue is that there's a subtitle which its name is parsed by guessit and returns multiple titles. I bet it's an old...
Read more >
Plex Failed to download subtitle - Reddit
Something went wrong while trying to download the subtitle. Please try again later." Restating plex does not solve the problem.
Read more >
Issues with subtitles - General/Windows - Emby Community
During testing on at the very least 5 video files, I encounter more than one issue. First, during video playback, the english subtitles...
Read more >
Anyone facing the problem in downloading subtitles in MX ...
I just encountered this problem. It is because the subtitle file itself is encoded wrong; you can't change it in .VLC - you...
Read more >
How To Synchronize Subtitles With Movie [Quick Tip] - It's FOSS
Normally, you download movies from one source and the subtitles from another source. And that is where the problem arises. The movie and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found