Justusethefilename incorrect structure
#16
Help this does not work for me. I converted the script to a tv show scraper like suggested and am able to install it. however when i point it to a tv show directory it scans it but does not list any episodes in the library.

i have some off the beaten track tv shows that dont show up in the tvdb etc.

i would like xbmc to just add the file to the library so i can see it normally from the tv section. yah i read about nfo files but that is a manual task and tough to keep on top of.

is there some way around this, is kodi team addressing this? i see in plex they add in the file even if the scraper cannot gather info from tvdb so why not xbmc?
Reply
#17
The solution is for you to be community minded and add your obscure shows to thetvdb.
If I have helped you or increased your knowledge, click the 'thumbs up' button to give thanks :) (People with less than 20 posts won't see the "thumbs up" button.)
Reply
#18
I never could get 'justusethefilename' to work so use this instead.
You need python and lxml.

Code:
#This script generates nfo files for later import into kodi
#From a cmd prompt, navigate to a directory tree containing movies
#The script asks you for a genre for the whole tree and a delimeter for the title
#os.walk will navigate the directory tree from there and create an nfo for each file it finds:
#   ref http://pythoncentral.io/how-to-traverse-a-directory-tree-in-python-guide-to-os-walk/
#   genre will be as you specified
#   delimeter will cut off the title.
#      So if you have 'name of movie, usefulinfo - uselessinfo.mp4'
#       you would specify ' - ' (without quotes) as the delimeter
#       and the title that appears in the library will be 'name of movie, usefulinfo'
#    set will be the parent directory for each file (not the whole tree--just the immediate parent)
#  Note this script is extremely stupid:  It will create .nfo files for any file it finds!

import os, sys
from lxml import etree

################################
#  Ask the user for the genre  #
################################
genretext = ''
while genretext=='':
    genretext = raw_input("Specify Genre:\n")

################################
#Ask the user for the seperator#
################################
sep = ''
while sep=='':
    sep = raw_input("Specify text where to cut-off the title:\n")

rootdir = os.getcwd()

for dirName, subdirList, fileList in os.walk(rootdir):
        for file in fileList:
            filename = os.path.splitext(file)[0]
            nfoname = dirName+'\\'+filename+'.nfo'
            settext = os.path.split(dirName)[1]
            titletext = filename.split(sep,1)[0]
            ################################
            #          create xml          #
            ################################
            root = etree.Element('movie')
            ################################
            #           add title          #
            ################################
            title = etree.SubElement(root, 'title')
            title.text = titletext
            root.append(title)
            ################################
            #          add genre           #
            ################################
            genre  = etree.SubElement(root, 'genre')
            genre.text = genretext
            root.append(genre)
            ################################
            #           add set            #
            ################################
            set  = etree.SubElement(root, 'set')
            set.text = settext
            root.append(set)
            ################################
            #create the tree from the parts#
            ################################
            nfo = etree.ElementTree(root)
            ################################
            #      write it to a file      #
            ################################
            outfile = open(nfoname,'w')
            nfo.write(outfile, pretty_print=True)
            print nfoname
Reply

Logout Mark Read Team Forum Stats Members Help
Justusethefilename incorrect structure0