leandro noferini wrote:
Ciao a tutti,

I am  trying to activate youtube  plugin in my  freevo (1.9.0-3.1 debian
package from lenny) but I get this error and then a crash

Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/freevo/main.py", line 306, in 
eventhandler
    app.eventhandler(event)
  File "/usr/share/pyshared/freevo/menu.py", line 842, in eventhandler
    self._handle_play_item(menu, event)
  File "/usr/share/pyshared/freevo/menu.py", line 654, in _handle_play_item
    action(arg=arg, menuw=self)
  File "/usr/share/pyshared/freevo/menu.py", line 106, in select
    self.function(arg=self.arg, menuw=menuw)
  File "/usr/share/pyshared/freevo/video/plugins/youtube.py", line 226, in 
watchvideo
    playvideo2 = YoutubeVideoItem(_('bla'), stream, self)
UnboundLocalError: local variable 'stream' referenced before assignment

It's a problem of the plug-in not handling a failed download of the video.

Upgrading your youtube downloader will help, before you do so can you try this patch to see if the error handling has improved?

Thanks
Duncan
Index: src/video/plugins/youtube.py
===================================================================
--- src/video/plugins/youtube.py        (revision 11653)
+++ src/video/plugins/youtube.py        (working copy)
@@ -215,6 +215,7 @@
 
     def watchvideo(self, arg=None, menuw=None):
         """Watch it"""
+        stream = None
         cmd = config.YOUTUBE_DL + ' -g "http://www.youtube.com/watch?v=' + 
arg[1] + '"'
         proceso = Popen(cmd, shell=True, bufsize=1024, stdout=subprocess.PIPE, 
universal_newlines=1)
         follow = proceso.stdout
@@ -222,6 +223,9 @@
             mess = follow.readline()
             if mess:
                 stream =  mess.strip()
+        if stream is None:
+            _debug_("Cannot process command '%s'" % (cmd,), DWARNING)
+            return
         # Create a fake VideoItem
         playvideo2 = YoutubeVideoItem(_('bla'), stream, self)
         playvideo2.player_rating = 10
------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
Freevo-users mailing list
Freevo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freevo-users

Reply via email to