字幕,比你想的还快
subliminal的Python项目详细描述
用法
CLI
下载英文字幕:
$ subliminal download -l en The.Big.Bang.Theory.S05E18.HDTV.x264-LOL.mp4 Collecting videos [####################################] 100% 1 video collected / 0 video ignored / 0 error Downloading subtitles [####################################] 100% Downloaded 1 subtitle
库
在视频文件夹中下载不到两周的法语和英语视频的最佳字幕:
fromdatetimeimporttimedeltafrombabelfishimportLanguagefromsubliminalimportdownload_best_subtitles,region,save_subtitles,scan_videos# configure the cacheregion.configure('dogpile.cache.dbm',arguments={'filename':'cachefile.dbm'})# scan for videos newer than 2 weeks and their existing subtitles in a foldervideos=scan_videos('/video/folder',age=timedelta(weeks=2))# download best subtitlessubtitles=download_best_subtitles(videos,{Language('eng'),Language('fra')})# save them to disk, next to the videoforvinvideos:save_subtitles(v,subtitles[v])
码头工人
在Docker容器中运行潜意识:
$ docker run --rm --name subliminal -v subliminal_cache:/usr/src/cache -v /tvshows:/tvshows -it diaoulael/subliminal download -l en /tvshows/The.Big.Bang.Theory.S05E18.HDTV.x264-LOL.mp4