The script showing how to get a language of a subtitle file by reading through and finding the closest matching language.

This commit is contained in:
Kevin Midboe
2017-04-05 18:54:25 +02:00
parent 300aa93b97
commit 591bd323b1

12
modules/subLangfinder.py Executable file
View File

@@ -0,0 +1,12 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from langdetect import detect
def main():
f = open('/Volumes/media/movies/The Man from UNCLE (2015)/The.Man.from.U.N.C.L.E.2015.1080p.nl.srt', 'r', encoding = "ISO-8859-15")
print(detect(f.read()))
f.close()
print(f.close())
if __name__ == '__main__':
main()