@@ -36,8 +36,8 @@ def __init__(self, aname):
36
36
self .addonName = self .addon .getAddonInfo ('name' )
37
37
self .localLang = self .addon .getLocalizedString
38
38
self .homeDir = self .addon .getAddonInfo ('path' )
39
- self .addonIcon = xbmc .translatePath (os .path .join (self .homeDir , 'resources' , 'icon.png' ))
40
- self .addonFanart = xbmc .translatePath (os .path .join (self .homeDir ,'resources' 'fanart.jpg' ))
39
+ self .addonIcon = xbmcvfs .translatePath (os .path .join (self .homeDir , 'resources' , 'icon.png' ))
40
+ self .addonFanart = xbmcvfs .translatePath (os .path .join (self .homeDir ,'resources' 'fanart.jpg' ))
41
41
self .defaultHeaders = httpHeaders
42
42
self .defaultVidStream = {'codec' : 'h264' , 'width' : 1280 , 'height' : 720 , 'aspect' : 1.78 }
43
43
self .defaultAudStream = {'codec' : 'aac' , 'language' : 'en' }
@@ -175,8 +175,8 @@ def makeLibraryPath(self, ftype, name=None):
175
175
if name is None :
176
176
name = self .cleanFilename (xbmc .getInfoLabel ('ListItem.Title' ).replace ('(Series)' ,'' ,1 ).strip ())
177
177
profile = self .script .getAddonInfo ('profile' )
178
- moviesDir = xbmc .translatePath (os .path .join (profile ,str (ftype )))
179
- movieDir = xbmc .translatePath (os .path .join (moviesDir , name ))
178
+ moviesDir = xbmcvfs .translatePath (os .path .join (profile ,str (ftype )))
179
+ movieDir = xbmcvfs .translatePath (os .path .join (moviesDir , name ))
180
180
if not os .path .isdir (movieDir ):
181
181
os .makedirs (movieDir )
182
182
return movieDir
@@ -189,20 +189,20 @@ def doScan(self,movieDir):
189
189
def addMusicVideoToLibrary (self , url ):
190
190
from xml .etree .ElementTree import Element
191
191
from xml .etree .ElementTree import tostring
192
- import html . parser
192
+ import html
193
193
from xml .dom import minidom
194
- UNESCAPE = html .parser . HTMLParser (). unescape
194
+ UNESCAPE = html .unescape
195
195
196
196
url , infoList = urllib .parse .unquote_plus (url ).split ('||' ,1 )
197
197
infoList = eval (infoList )
198
198
artist = infoList .get ('artist' )
199
199
title = infoList .get ('title' )
200
200
movieDir = self .makeLibraryPath ('music_videos' , name = self .cleanFilename (artist ))
201
- strmFile = xbmc .translatePath (os .path .join (movieDir , '' .join ([self .cleanFilename (title ),'.strm' ])))
201
+ strmFile = xbmcvfs .translatePath (os .path .join (movieDir , '' .join ([self .cleanFilename (title ),'.strm' ])))
202
202
url = '' .join ([sys .argv [0 ],'?mode=GV&url=' ,url ])
203
203
with open (strmFile , 'w' ) as outfile :
204
204
outfile .write (url )
205
- nfoFile = xbmc .translatePath (os .path .join (movieDir , '' .join ([self .cleanFilename (title ),'.nfo' ])))
205
+ nfoFile = xbmcvfs .translatePath (os .path .join (movieDir , '' .join ([self .cleanFilename (title ),'.nfo' ])))
206
206
nfoData = Element ('musicvideo' )
207
207
for key , val in infoList .items ():
208
208
child = Element (key )
@@ -219,7 +219,7 @@ def addMusicVideoToLibrary(self, url):
219
219
def addMovieToLibrary (self , url ):
220
220
name = self .cleanFilename ('' .join ([xbmc .getInfoLabel ('ListItem.Title' ),'.strm' ]))
221
221
movieDir = self .makeLibraryPath ('movies' )
222
- strmFile = xbmc .translatePath (os .path .join (movieDir , name ))
222
+ strmFile = xbmcvfs .translatePath (os .path .join (movieDir , name ))
223
223
url = '' .join ([sys .argv [0 ],'?mode=GV&url=' ,url ])
224
224
with open (strmFile , 'w' ) as outfile :
225
225
outfile .write (url )
@@ -238,7 +238,7 @@ def addShowByDate(self,url):
238
238
title = self .cleanFilename (str (liz .getVideoInfoTag ().getTitle ()))
239
239
TVShowTitle = self .cleanFilename (str (liz .getVideoInfoTag ().getTVShowTitle ()))
240
240
se = '' .join ([TVShowTitle ,' ' ,pdate ,' [' ,title ,'].strm' ])
241
- strmFile = xbmc .translatePath (os .path .join (movieDir , se ))
241
+ strmFile = xbmcvfs .translatePath (os .path .join (movieDir , se ))
242
242
with open (strmFile , 'w' ) as outfile :
243
243
outfile .write (url )
244
244
self .doScan (movieDir )
@@ -253,7 +253,7 @@ def addShowToLibrary(self,url):
253
253
episode = str (liz .getVideoInfoTag ().getEpisode ())
254
254
title = self .cleanFilename (str (liz .getVideoInfoTag ().getTitle ()))
255
255
se = '' .join (['S' ,season ,'E' ,episode ,' ' ,title ,'.strm' ])
256
- strmFile = xbmc .translatePath (os .path .join (movieDir , se ))
256
+ strmFile = xbmcvfs .translatePath (os .path .join (movieDir , se ))
257
257
with open (strmFile , 'w' ) as outfile :
258
258
outfile .write (url )
259
259
self .doScan (movieDir )
0 commit comments