standard_library.install_aliases() breaks dependent addon call
#1
My addon calls Youtube.dl's YDStreamExtractor.getVideoInfo. My addon also imports from __future__ and calls standard_library.install_aliases().

The call works fine if I comment out install_aliases(), but otherwise returns None. I was a bit surprised to see that using future in my module would impact use of referenced a referenced addon, but then I am still fairly new to python. I suspect the issue is over httplib, urllib or urlparse.

Is there a known work around to this?

I probably could work around using install_aliases(), but that would be a mountain of work. I am sure that I could create a separate service to make the call and then use addonSignals (which I am already using), but that is not ideal, but what I will probably end up doing.

For the code curious:

from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from __future__ import unicode_literals
from future import standard_library
from future.utils import native
# standard_library.install_aliases()
import YDStreamExtractor
import xbmc
import pydevd
import sys

...

url = 'ozf32hrXGiY'
x = YDStreamExtractor.getVideoInfo(native(url.encode('utf-8')),   quality=1)
 
Returns None if I uncomment out install_aliases, above.
Reply
#2
Why do you need native() call in the last line? Also, are you sure that youtube-dl is compatible with Python 3?
Reply
#3
(2019-04-22, 14:05)Roman_V_M Wrote: Why do you need native() call in the last line? Also, are you sure that youtube-dl is compatible with Python 3?

Turns out that I don't need native.
I think youtube-dl is python 3 compatible, but if not, I have a work around.
Reply

Logout Mark Read Team Forum Stats Members Help
standard_library.install_aliases() breaks dependent addon call0