#
# Custom Movie Scanner for Mediafiles including the IMDBID
#----------------------------------------------------------
# This scanner uses the IMDBID in the filename instead of the movie name!
#
import re, os, os.path, sys, datetime
import Media, VideoFiles, unicodedata
def Scan(path, files, mediaList, subdirs):
# If files are "valid"
if len(files) >= 1:
# Iterate through all the files
for file in files:
# Example file format:
# Die Huberbuam 3D (tt2363242) - 3D.ts
# Check if its really a *.ts file:
if (file.endswith(".ts")):
# Remove path:
tsfile = os.path.basename(file)
# C:\Filme\Spielfilme\3D\Die Huberbuam 3D (tt2363242) - 3D.ts -> Die Huberbuam 3D (tt2363242) - 3D.ts
# Remove extension:
tsfile = os.path.splitext(tsfile)[0]
# Die Huberbuam 3D (tt2363242) - 3D.ts -> Die Huberbuam 3D (tt2363242) - 3D
# Search for the beginning of the IMDBID and save it in i:
i = str.rfind(' (tt')
# Add two to start with tt...:
i=i+2
# Search for the end of the IMDBID and save it in j:
j = str.rfind(') ')
# Save the part beginning at i and ending at j of tsfile in imdbid:
imdbid = tsfile[i:j]
#
# Custom Movie Scanner for Mediafiles including the IMDBID
#----------------------------------------------------------
# This scanner uses the IMDBID in the filename instead of the movie name!
#
import re, os, os.path, sys, datetime
import Media, VideoFiles, unicodedata
def Scan(path, files, mediaList, subdirs):
# If files are "valid"
if len(files) >= 1:
# Iterate through all the files
for file in files:
# Example file format:
# Die Huberbuam 3D (tt2363242) - 3D.ts
# Check if its really a *.ts file:
if (file.endswith(".ts")):
# Remove path:
tsfile = os.path.basename(file)
# C:\Filme\Spielfilme\3D\Die Huberbuam 3D (tt2363242) - 3D.ts -> Die Huberbuam 3D (tt2363242) - 3D.ts
# Remove extension:
tsfile = os.path.splitext(tsfile)[0]
# Die Huberbuam 3D (tt2363242) - 3D.ts -> Die Huberbuam 3D (tt2363242) - 3D
# Search for the beginning of the IMDBID and save it in i:
i = tsfile.rfind(" (tt")
# Add two to start with tt...:
i=i+2
# Search for the end of the IMDBID and save it in j:
j = tsfile.rfind(") ")
# Save the part beginning at i and ending at j of tsfile in imdbid:
imdbid = tsfile[i:j]