0

I have a bunch of movie and tv .strm files in kodi that im trying to search. The .strm files are located in library/video/movies and library/video/tv/{showname}

What im trying to do is enter a search string eg. Sta and get a list of movies or shows for example Star Wars, Star Wars - the Empire Strikes Back etc. note if I type Apex I do get Apex and Apex predators.

Also instead of printing it in the log I would like to display the results so that I can open the found links.

    PATH = xbmc.translatePath('special://home/userdata/library/') 
    fileName= xbmcgui.Dialog().input('Movie Title')

    @plugin.route('/movies_search')
    def movies_search():

        for root, dirs, files in os.walk(PATH):
            print('Looking in:',root)
            for Files in files:
                try:
                    found = Files.find(fileName)
                    # print(found)
                    if found != -1:
                        print()
                        print(fileName, 'Found\n')
                        break
                except:
                    exit()
kodi User
  • 23
  • 5
  • Does this answer your question? [Python list directory, subdirectory, and files](https://stackoverflow.com/questions/2909975/python-list-directory-subdirectory-and-files) – Amir Shamsi Mar 23 '22 at 05:41
  • I need to display the results and not just print them in the log first. Not sure how to do that – kodi User Mar 24 '22 at 02:56

0 Answers0