darkshram / periscopio-mate

Python module for searching subtitles on the web. Includes a caja extension. Forked from persicope by Patrick Dessalle.
GNU General Public License v2.0
3 stars 0 forks source link

ERROR:periscopio.plugins.SubtitleDatabase:Error occured #1

Open nerijus opened 6 years ago

nerijus commented 6 years ago

When running from the command line:

INFO:periscopio.periscopio:Searching on SubDivX 
INFO:periscopio.plugins.SubtitleDatabase:SubDivX writing 0 items to queue
ERROR:periscopio.plugins.SubtitleDatabase:Error occured
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/periscopio/plugins/SubtitleDatabase.py", line 45, in searchInThread
    subs = self.process(filename, langs)
  File "/usr/lib/python2.7/site-packages/periscopio/plugins/OpenSubtitles.py", line 97, in process
    return self.query(moviehash=filehash, langs=langs, bytesize=size, filename=fname)
  File "/usr/lib/python2.7/site-packages/periscopio/plugins/OpenSubtitles.py", line 153, in query
    sublinks += self.get_results(token, search)
  File "/usr/lib/python2.7/site-packages/periscopio/plugins/OpenSubtitles.py", line 176, in get_results
    if results['data']:
KeyError: 'data'
INFO:periscopio.plugins.SubtitleDatabase:TheSubDB writing 0 items to queue
INFO:periscopio.plugins.SubtitleDatabase:Podnapisi writing 0 items to queue
INFO:periscopio.periscopio:lang-in-name read from config: False
INFO:__main__:**************************************************
INFO:__main__:Downloaded 0 subtitles
INFO:__main__:**************************************************
darkshram commented 6 years ago

OpenSubtitles plugin is broken. Working on it during the weekend.

I'm currently cleaning the code from upstream (periscope-gnome). Code was little messy: lots trailing spaces everywhere, too long lines, unused modules, undefined variable, etc. For the time being, I suggest to edit ~/.config/periscopio/config and enable only the other plugins. This is, put all the ones that are useful for you and exclude OpenSubtitles.

SubtitleDatabase is a parser for the rest of the plugins.

The ones tha work Ok are:

nerijus commented 6 years ago

Could you please add to the default config file all the plugins, so that people could disable unneeded ones easily, just by commenting them out or removing them from the list?

Or to make something like that work - use minus to disable plugin, for example: plugins = -LegendasTV -SubDivX

nerijus commented 6 years ago

OpenSubtitles plugin is still broken.

nerijus commented 6 years ago

If I add plugins = -OpenSubtitles to config, I get

Traceback (most recent call last):
  File "/usr/bin/periscopio", line 136, in <module>
    main()
  File "/usr/bin/periscopio", line 100, in main
    sub = periscopio_client.downloadSubtitle(arg, langs)
  File "/usr/lib/python2.7/site-packages/periscopio/periscopio.py", line 210, in downloadSubtitle
    subtitles = self.listSubtitles(filename, langs)
  File "/usr/lib/python2.7/site-packages/periscopio/periscopio.py", line 154, in listSubtitles
    plugin = getattr(plugins, name)(self.config, self.cache_path)
AttributeError: 'module' object has no attribute '-OpenSubtitles'