• 1
  • 2
  • 3(current)
  • 4
  • 5
  • 20
[RELEASE] Apple iTunes Trailers (Video Add-on)
#31
(2013-04-04, 14:40)namtih Wrote: Unfortunately it isn't showing the movie posters for me. Just a placeholder.
I have the same issue with the IMDB Trailers addon:
http://forum.xbmc.org/showthread.php?tid=95603

The original The Trailers addon is showing it:
http://forum.xbmc.org/showthread.php?tid=119587

I'm using the popular reFocus BIG skin:
http://forum.xbmc.org/showthread.php?tid=132897

Maybe because the movies are some kind of folders in this add-on (They have not "isPlayable"-Flag). IMO this should be fixed in the skin.
My GitHub. My Add-ons:
Image
#32
Regarding the folders idea I don't think so, as the addon IMDB trailers don't handle them as folders and it has the same issue.
But I don't know what the addon "The Trailers" is making different as it's working there.
#33
(2013-04-05, 10:19)namtih Wrote: Regarding the folders idea I don't think so, as the addon IMDB trailers don't handle them as folders and it has the same issue.
But I don't know what the addon "The Trailers" is making different as it's working there.

Hi,

I took a closer look and found the reason for the problem, its related to the skin, I reported the issue in the skin's thread.
My GitHub. My Add-ons:
Image
#34
(2013-04-03, 00:02)sphere Wrote: Version 1.0.0 is in the official xbmc.org repository now.

At present time it's only 0.0.2 version is available from xbmc repo for me. No updates available. Is something wrong on my side?

Also there's one major problem. The Add-on refuses to stream and play video without any error messages. When I hit <Enter> nothing happens. I can only download video files using pop-up menu. Very similar problem I've expirienced with "The Trailers" 1.9.5 Add-on - when I hit <Enter> and after selection of video quality, progress wheel starting to animate for a few seconds, then freezes with the whole screen and only the sound of trailer comes out of speakers, no video at all.

Can you tell what kind of problem it can be and where I must look for solutiuon?
Using 13.0 ALPHA1 on MBA/OSX 10.8.3 but exactly the same I've got on 12.0 and 12.1 versions of XBMC.

Thank you!
#35
works like a charm on rasperry pi

thanks a lot for sharing!

roscho
#36
(2013-04-06, 15:14)EvilCartman Wrote:
(2013-04-03, 00:02)sphere Wrote: Version 1.0.0 is in the official xbmc.org repository now.

At present time it's only 0.0.2 version is available from xbmc repo for me. No updates available. Is something wrong on my side?

Hi,

sorry, it was a copy&paste error, of course version 0.0.2 (the most recent) is in the repo.

regards,
sphere
My GitHub. My Add-ons:
Image
#37
(2013-04-08, 11:57)sphere Wrote: sorry, it was a copy&paste error, of course version 0.0.2 (the most recent) is in the repo.

Hey

I have uninstalled previous version and installed again from the repo, but I'm still getting error described above. Anything I can do to help fixing it?
My skins:

Amber
Quartz

#38
(2013-04-08, 11:59)pecinko Wrote: I have uninstalled previous version and installed again from the repo, but I'm still getting error described above. Anything I can do to help fixing it?

Ah, forgot to reply to your problem, sorry.
Regarding your problem:
I believe that your system has two versions of python installed and the json module is taken from the wrong one (<2.6). Or you have only one (old) python version installed.
Could you execute the following in a shell and send me the output?
Code:
# open the python interactive interpreter
python  
# following commands should go into the python interactive interpreter
import json
print json.__file__
My GitHub. My Add-ons:
Image
#39
(2013-04-08, 11:57)sphere Wrote: sorry, it was a copy&paste error, of course version 0.0.2 (the most recent) is in the repo.
Oh, I get it.

Do you have any ideas about my other described problems with video playback?
#40
(2013-04-08, 12:08)sphere Wrote: Could you execute the following in a shell and send me the output?

Sure, here it is:

Code:
Python 2.7.2 (default, Oct 11 2012, 20:14:37)
[GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import json
>>> print json.__file__
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/__init__.pyc
>>>

Thanks.
My skins:

Amber
Quartz

#41
(2013-04-08, 20:24)pecinko Wrote: >>> print json.__file__
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/__init__.pyc
>>>
[/code]

Hm - looks ok, could you do it again, but this time direct in the addon code?
Open "/Users/mini/Library/Application Support/XBMC/addons/plugin.video.itunes_trailers/resources/lib/scraper.py" and search this line (22):
Code:
import json
change it to:
Code:
import json
print '#' * 40
print json.__file__
print dir(json)

after that start the addon and send me the two lines after the line with fourty dash signs Wink

thanks,
sphere
My GitHub. My Add-ons:
Image
#42
(2013-04-08, 20:30)sphere Wrote: Hm - looks ok, could you do it again, but this time direct in the addon code?

Done. Here they are:

PHP Code:
07:53:44 T:2953318400   DEBUGProcess Entering source directory /Users/mini/Library/Application Support/XBMC/addons/plugin.video.itunes_trailers
07
:53:44 T:2953318400   DEBUGInstantiating addon using automatically obtained id of "plugin.video.itunes_trailers" dependent on version 2.1.0 of the xbmc.python api
07
:53:44 T:2953318400  NOTICE########################################
07:53:44 T:2953318400  NOTICE: /Users/mini/Library/Application Support/XBMC/addons/script.module.dmd-czech.common/lib/json.pyc
07
:53:44 T:2953318400  NOTICE: ['JsonReader''JsonWriter''ReadException''WriteException''_StringGenerator''__builtins__''__doc__''__file__''__name__''__package__''read''string''types''write']
07:53:44 T:2953318400   DEBUG: [xbmcswift2Adding url rule "/" named "show_movies" pointing to function "show_movies"
07:53:44 T:2953318400   DEBUG: [xbmcswift2Adding url rule "/movie/<movie_title>/<location>/show/" named "show_trailers" pointing to function "show_trailers"
07:53:44 T:2953318400   DEBUG: [xbmcswift2Adding url rule "/trailer/play/<play_url>" named "play_trailer" pointing to function "play_trailer"
07:53:44 T:2953318400   DEBUG: [xbmcswift2Adding url rule "/trailer/download/<download_url>/<play_url>" named "download_trailer" pointing to function "download_trailer"
07:53:44 T:2953318400   DEBUG: [xbmcswift2Loaded storage ".functions" from disk
07
:53:44 T:2953318400   DEBUG: [xbmcswift2Handling incoming request for /
07:53:44 T:2953318400  NOTICE: [xbmcswift2Request for "/" matches rule for function "show_movies"
07:53:44 T:2953318400   DEBUG: [xbmcswift2Storage miss for function "get_movies" with args "('all', 0)" and kwargs "{}"
07:53:44 T:2953318400   ERROREXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - 
NOTEIGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            
Error Type: <type 'exceptions.AttributeError'>
                                            
Error Contents'module' object has no attribute 'loads'
                                            
Traceback (most recent call last):
                                              
File "/Users/mini/Library/Application Support/XBMC/addons/plugin.video.itunes_trailers/addon.py"line 226in <module>
                                                
plugin.run()
                                              
File "/Users/mini/Library/Application Support/XBMC/addons/script.module.xbmcswift2/lib/xbmcswift2/plugin.py"line 332in run
                                                items 
self._dispatch(self.request.path)
                                              
File "/Users/mini/Library/Application Support/XBMC/addons/script.module.xbmcswift2/lib/xbmcswift2/plugin.py"line 306in _dispatch
                                                listitems 
view_func(**items)
                                              
File "/Users/mini/Library/Application Support/XBMC/addons/plugin.video.itunes_trailers/addon.py"line 51in show_movies
                                                items 
get_movies(sourcelimit)
                                              
File "/Users/mini/Library/Application Support/XBMC/addons/script.module.xbmcswift2/lib/xbmcswift2/xbmcmixin.py"line 81in wrapper
                                                result 
= function(*args, **kwargs)
                                              
File "/Users/mini/Library/Application Support/XBMC/addons/plugin.video.itunes_trailers/addon.py"line 166in get_movies
                                                
} for imovie in enumerate(movies)]
                                              
File "/Users/mini/Library/Application Support/XBMC/addons/plugin.video.itunes_trailers/resources/lib/scraper.py"line 80in _get_movies
                                                
for imovie in enumerate(self.__get_json(source)):
                                              
File "/Users/mini/Library/Application Support/XBMC/addons/plugin.video.itunes_trailers/resources/lib/scraper.py"line 106in __get_json
                                                
return json.loads(urllib2.urlopen(req).read())
                                            
AttributeError'module' object has no attribute 'loads'
                                            
-->End of Python script error report<--
07:53:44 T:2953318400    INFOPython script stopped 
My skins:

Amber
Quartz

#43
Well that's a known problem i've seen before Smile
Another addon is shipping it's own JSON module which is so bad.

Also I use this
PHP Code:
if sys.version_info < (27):
    
import simplejson as json
else:
    
import json 
because below version 2.7 simplejson is faster
Read/follow the forum rules.
For troubleshooting and bug reporting, read this first
Interested in seeing some YouTube videos about Kodi? Go here and subscribe
#44
(2013-04-09, 08:14)Martijn Wrote: Well that's a known problem i've seen before Smile
Another addon is shipping it's own JSON module which is so bad.

Also I use this
PHP Code:
if sys.version_info < (27):
    
import simplejson as json
else:
    
import json 
because below version 2.7 simplejson is faster

Well, some comments Smile
1. Yes, another xbmc add-on provides a different json module which is really bad
2. Its partly XBMC's add-on system's fault because it inserts third party modules' path _before_ system modules' path - even on add-ons which don't require this third party module
3. simplejson is not faster than json Wink Indeed it is slower (until 2.7, then its exactly the same module, maybe in an older version), also it doesn't provide the "load" method, only "loads" which require a string and not a "file like object" which can be a speed improvement on machines with less ram like the rpi.
4. Your code won't help here because he really has python 2.7 so you won't hit the if-part Wink
5. simplejson is not part of the standard modules on < python 2.7, do you require it always via addon.xml?

We really need a xbmc core fix for 2: Only insert module paths from add-ons which are required via addon.xml. Rethink if inserting _before_ system modules is really needed.

@pecinko:
This should work:
PHP Code:
import json
if not 'loads' in dir(json):
    
import simplejson as json 

regards,
sphere
My GitHub. My Add-ons:
Image
#45
did some test runs last year with ronie and that what we found out that in general python 2.7 runs faster with json than simplejson
so on point 5 yes we add it as required (could perhaps make it optional="true" and see if it gets imported when it needs to (not sure if that'll work)

ah i found what we did (or somewhere around those pages)
http://forum.xbmc.org/showthread.php?tid...pid1006841

create a ticket for point 2. if you will.

i think we should document these these on the wiki in some general how-to/faq page with small pieces of code how to solve these things.
already have gathered some of these but need to update the pages.
this should help other to prevent hitting this issue.
Read/follow the forum rules.
For troubleshooting and bug reporting, read this first
Interested in seeing some YouTube videos about Kodi? Go here and subscribe
  • 1
  • 2
  • 3(current)
  • 4
  • 5
  • 20

Logout Mark Read Team Forum Stats Members Help
[RELEASE] Apple iTunes Trailers (Video Add-on)2