abbi031892 / periscope

Automatically exported from code.google.com/p/periscope
0 stars 0 forks source link

AttributeError: Periscope instance has no attribute 'cache_path' #99

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Using latest svn version i am getting this when trying to download a subtitle:

/usr/bin/periscope -l en --debug 
/mnt/usb_hd/Media/Movies/Battle.Los.Angeles.2011.720p.BluRay.x264-BLA/
INFO:__main__:/mnt/usb_hd/Media/Movies/Battle.Los.Angeles.2011.720p.BluRay.x264-
BLA/battle.los.angeles.2011.720p.bluray.x264-bla.jpg mimetype is 'image/jpeg' 
which is not a supported video format (('video/x-msvideo', 'video/quicktime', 
'video/x-matroska', 'video/mp4'))
INFO:__main__:/mnt/usb_hd/Media/Movies/Battle.Los.Angeles.2011.720p.BluRay.x264-
BLA/battle.los.angeles.2011.720p.bluray.x264-bla.nfo mimetype is 'None' which 
is not a supported video format (('video/x-msvideo', 'video/quicktime', 
'video/x-matroska', 'video/mp4'))
INFO:periscope.periscope:Searching subtitles for 
/mnt/usb_hd/Media/Movies/Battle.Los.Angeles.2011.720p.BluRay.x264-BLA/Sample/bat
tle.los.angeles.2011.720p.bluray.x264-bla-sample.mkv with langs ['en']
Traceback (most recent call last):
  File "/usr/bin/periscope", line 5, in <module>
    pkg_resources.run_script('periscope==dev', 'periscope')
  File "/usr/lib64/python2.7/site-packages/pkg_resources.py", line 468, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/usr/lib64/python2.7/site-packages/pkg_resources.py", line 1201, in run_script
    execfile(script_filename, namespace, namespace)
  File "/usr/lib64/python2.7/site-packages/periscope-dev-py2.7.egg/EGG-INFO/scripts/periscope", line 117, in <module>
    main()
  File "/usr/lib64/python2.7/site-packages/periscope-dev-py2.7.egg/EGG-INFO/scripts/periscope", line 81, in main
    sub = periscope_client.downloadSubtitle(arg, langs)
  File "/usr/lib64/python2.7/site-packages/periscope-dev-py2.7.egg/periscope/periscope.py", line 179, in downloadSubtitle
    subtitles = self.listSubtitles(filename, langs)
  File "/usr/lib64/python2.7/site-packages/periscope-dev-py2.7.egg/periscope/periscope.py", line 139, in listSubtitles
    plugin = getattr(plugins, name)(self.config, self.cache_path)
AttributeError: Periscope instance has no attribute 'cache_path'

Regards

Original issue reported on code.google.com by daniel.d...@gmail.com on 18 May 2011 at 12:24

GoogleCodeExporter commented 8 years ago
Ok, this is due to the changes I've committed earlier.

Do you have a freedesktop compatible desktop environment (Gnome, KDE, XFCE, 
...) ?
If yes, could you install python-xdg, if not, I'll need to come up with another 
approach.

Original comment by patrick....@gmail.com on 18 May 2011 at 7:32

GoogleCodeExporter commented 8 years ago
Thanks for the quick reply. I am sorry but i am not running any desktop at all, 
it is a server running only console :-)

Original comment by daniel.d...@gmail.com on 18 May 2011 at 8:08

GoogleCodeExporter commented 8 years ago
Update to the latest, try the command given in issue 93 (add a --cache-folder 
to the command and point to one that will remain between reboots)

http://code.google.com/p/periscope/issues/detail?id=93

Original comment by patrick....@gmail.com on 20 May 2011 at 5:18

GoogleCodeExporter commented 8 years ago
I have updated to the latest revison, but now i am getting this:

periscope -l en --cache-folder /home/transmission/periscope/ 
/mnt/usb_hd/Media/Movies/2012_2009_720p_BluRay_x264-METiS/m-2012-720p.mkv 
INFO:periscope.periscope:Searching subtitles for 
/mnt/usb_hd/Media/Movies/2012_2009_720p_BluRay_x264-METiS/m-2012-720p.mkv with 
langs ['en']
INFO:periscope.periscope:Searching on OpenSubtitles 
Traceback (most recent call last):
  File "/usr/bin/periscope", line 5, in <module>
    pkg_resources.run_script('periscope==dev', 'periscope')
  File "/usr/lib64/python2.7/site-packages/pkg_resources.py", line 468, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/usr/lib64/python2.7/site-packages/pkg_resources.py", line 1201, in run_script
    execfile(script_filename, namespace, namespace)
  File "/usr/lib64/python2.7/site-packages/periscope-dev-py2.7.egg/EGG-INFO/scripts/periscope", line 118, in <module>
    main()
  File "/usr/lib64/python2.7/site-packages/periscope-dev-py2.7.egg/EGG-INFO/scripts/periscope", line 82, in main
    sub = periscope_client.downloadSubtitle(arg, langs)
  File "/usr/lib64/python2.7/site-packages/periscope-dev-py2.7.egg/periscope/periscope.py", line 185, in downloadSubtitle
    subtitles = self.listSubtitles(filename, langs)
  File "/usr/lib64/python2.7/site-packages/periscope-dev-py2.7.egg/periscope/periscope.py", line 145, in listSubtitles
    plugin = getattr(plugins, name)(self.config, self.cache_path)
  File "/usr/lib64/python2.7/site-packages/periscope-dev-py2.7.egg/periscope/plugins/SubtitleSource.py", line 53, in __init__
    self.host = "http://www.subtitlesource.org/api/%s/3.0/xmlsearch" %key
UnboundLocalError: local variable 'key' referenced before assignment
INFO:periscope.plugins.SubtitleDatabase:OpenSubtitles writing 1 items to queue
intersect includes # ls 
/mnt/usb_hd/Media/Movies/2012_2009_720p_BluRay_x264-METiS
m-2012-720p.mkv

It seems to find and que the subtitle, but wierd warnings, and no subtitle is 
actually downloaded.

Regards

Original comment by daniel.d...@gmail.com on 22 May 2011 at 10:58

GoogleCodeExporter commented 8 years ago
Yes, my bad. SubtitleSource API is only for web apps and should not have been 
activated by default.

You have 2 options:
1) wait for the update that coming tonight or tomorrow
2) comment SubtitleSource in the file plugins/__init__.py

Cheers

Original comment by patrick....@gmail.com on 23 May 2011 at 7:25

GoogleCodeExporter commented 8 years ago
As i've been busy i chose option 1 :D And the fix is working out nicely for me 
and everything seems to be working now, and subtitles are again downloaded. 
Happy to report bugs in this software which makes the subtitles downloading so 
easy :-) Keep up the good work!

Cheers

Original comment by daniel.d...@gmail.com on 26 May 2011 at 6:41

GoogleCodeExporter commented 8 years ago

Original comment by patrick....@gmail.com on 26 May 2011 at 8:15