Skip to content

[script.module.t1mlib] 4.0.8 #2443

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions script.module.t1mlib/addon.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
<addon id="script.module.t1mlib" name="t1m Library Routines" provider-name="t1m" version="4.0.7">
<addon id="script.module.t1mlib" name="t1m Library Routines" provider-name="t1m" version="4.0.8">
<requires>
<import addon="xbmc.python" version="3.0.0" />
<import addon="script.module.requests" version="2.22.0"/>
Expand All @@ -15,7 +15,7 @@
<forum>https://forum.kodi.tv/showthread.php?tid=247163</forum>
<source>https://github.com/learningit/repo-scripts></source>
<language>en</language>
<news>v4.0.7 - fix tv listings for live stream addons</news>
<news>v4.0.8 - nexus support</news>
<assets>
<icon>resources/icon.png</icon>
</assets>
Expand Down
22 changes: 11 additions & 11 deletions script.module.t1mlib/lib/t1mlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ def __init__(self, aname):
self.addonName = self.addon.getAddonInfo('name')
self.localLang = self.addon.getLocalizedString
self.homeDir = self.addon.getAddonInfo('path')
self.addonIcon = xbmc.translatePath(os.path.join(self.homeDir, 'resources', 'icon.png'))
self.addonFanart = xbmc.translatePath(os.path.join(self.homeDir,'resources' 'fanart.jpg'))
self.addonIcon = xbmcvfs.translatePath(os.path.join(self.homeDir, 'resources', 'icon.png'))
self.addonFanart = xbmcvfs.translatePath(os.path.join(self.homeDir,'resources' 'fanart.jpg'))
self.defaultHeaders = httpHeaders
self.defaultVidStream = {'codec': 'h264', 'width': 1280, 'height': 720, 'aspect': 1.78}
self.defaultAudStream = {'codec': 'aac', 'language': 'en'}
Expand Down Expand Up @@ -175,8 +175,8 @@ def makeLibraryPath(self, ftype, name=None):
if name is None:
name = self.cleanFilename(xbmc.getInfoLabel('ListItem.Title').replace('(Series)','',1).strip())
profile = self.script.getAddonInfo('profile')
moviesDir = xbmc.translatePath(os.path.join(profile,str(ftype)))
movieDir = xbmc.translatePath(os.path.join(moviesDir, name))
moviesDir = xbmcvfs.translatePath(os.path.join(profile,str(ftype)))
movieDir = xbmcvfs.translatePath(os.path.join(moviesDir, name))
if not os.path.isdir(movieDir):
os.makedirs(movieDir)
return movieDir
Expand All @@ -189,20 +189,20 @@ def doScan(self,movieDir):
def addMusicVideoToLibrary(self, url):
from xml.etree.ElementTree import Element
from xml.etree.ElementTree import tostring
import html.parser
import html
from xml.dom import minidom
UNESCAPE = html.parser.HTMLParser().unescape
UNESCAPE = html.unescape

url, infoList = urllib.parse.unquote_plus(url).split('||',1)
infoList = eval(infoList)
artist = infoList.get('artist')
title = infoList.get('title')
movieDir = self.makeLibraryPath('music_videos', name=self.cleanFilename(artist))
strmFile = xbmc.translatePath(os.path.join(movieDir, ''.join([self.cleanFilename(title),'.strm'])))
strmFile = xbmcvfs.translatePath(os.path.join(movieDir, ''.join([self.cleanFilename(title),'.strm'])))
url = ''.join([sys.argv[0],'?mode=GV&url=',url])
with open(strmFile, 'w') as outfile:
outfile.write(url)
nfoFile = xbmc.translatePath(os.path.join(movieDir, ''.join([self.cleanFilename(title),'.nfo'])))
nfoFile = xbmcvfs.translatePath(os.path.join(movieDir, ''.join([self.cleanFilename(title),'.nfo'])))
nfoData = Element('musicvideo')
for key, val in infoList.items():
child = Element(key)
Expand All @@ -219,7 +219,7 @@ def addMusicVideoToLibrary(self, url):
def addMovieToLibrary(self, url):
name = self.cleanFilename(''.join([xbmc.getInfoLabel('ListItem.Title'),'.strm']))
movieDir = self.makeLibraryPath('movies')
strmFile = xbmc.translatePath(os.path.join(movieDir, name))
strmFile = xbmcvfs.translatePath(os.path.join(movieDir, name))
url = ''.join([sys.argv[0],'?mode=GV&url=',url])
with open(strmFile, 'w') as outfile:
outfile.write(url)
Expand All @@ -238,7 +238,7 @@ def addShowByDate(self,url):
title = self.cleanFilename(str(liz.getVideoInfoTag().getTitle()))
TVShowTitle = self.cleanFilename(str(liz.getVideoInfoTag().getTVShowTitle()))
se = ''.join([TVShowTitle,' ',pdate,' [',title,'].strm'])
strmFile = xbmc.translatePath(os.path.join(movieDir, se))
strmFile = xbmcvfs.translatePath(os.path.join(movieDir, se))
with open(strmFile, 'w') as outfile:
outfile.write(url)
self.doScan(movieDir)
Expand All @@ -253,7 +253,7 @@ def addShowToLibrary(self,url):
episode = str(liz.getVideoInfoTag().getEpisode())
title = self.cleanFilename(str(liz.getVideoInfoTag().getTitle()))
se = ''.join(['S',season,'E',episode,' ',title,'.strm'])
strmFile = xbmc.translatePath(os.path.join(movieDir, se))
strmFile = xbmcvfs.translatePath(os.path.join(movieDir, se))
with open(strmFile, 'w') as outfile:
outfile.write(url)
self.doScan(movieDir)
Expand Down
3 changes: 2 additions & 1 deletion script.module.t1mlib/readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ Library of support routines for t1m addons

V4.0.4 Matrix version - added music video support
V4.0.6 - fix for Android file write having a Type Error
v4.0.7 - fix tv listings for live stream addons
v4.0.7 - fix tv listings for live stream addons
v4.0.8 - nexus support