I know the thread title only mentions WABC, but this post is regarding the WNBC addon (it refers to this thread).
I tried the add to library feature, and I noticed a couple things that were not quite as consistently implemented as I've seen in other addons.
I am not a developer, and I hope this is not insulting, but I offer two suggestions for modifications to the code.
There is one file that is modified: plugin.video.wnbc/resources/lib/scraper.py.
The section of the code that I modified follows:
Code:
def doFunction(self, url):
func = url[0:2]
url = url[2:]
if func == 'AL':
name = xbmc.getInfoLabel('ListItem.Title')
profile = self.addon.getAddonInfo('profile').decode(UTF8)
# moviesDir = xbmc.translatePath(os.path.join(profile,'TV Shows'))
moviesDir = xbmc.translatePath(os.path.join(profile,'TVShows'))
movieDir = xbmc.translatePath(os.path.join(moviesDir, name))
if not os.path.isdir(movieDir):
os.makedirs(movieDir)
ilist = []
ilist = self.getAddonEpisodes(url, ilist, getFileData = True)
for season, episode, url in ilist:
# se = 'S%sE%s' % (str(season), str(episode))
se = 'S%02dE%02d' % (int(season), int(episode))
xurl = '%s?mode=GV&url=%s' % (sys.argv[0], qp(url))
strmFile = xbmc.translatePath(os.path.join(movieDir, se+'.strm'))
with open(strmFile, 'w') as outfile:
outfile.write(xurl)
json_cmd = '{"jsonrpc":"2.0","method":"VideoLibrary.Scan", "params": {"directory":"%s/"},"id":1}' % movieDir.replace('\\','/')
jsonRespond = xbmc.executeJSONRPC(json_cmd)
It seems a bit more consistent with the naming of the "TVShows" directory, and it zero-pads the .strm files.
At least that was my goal.
Thanks for the addon!