下载并查找电影的匹配字幕。

Title的Python项目详细描述


titley-下载字幕的python脚本。

问题-

你下载一部外语电影。您可以在其中一个字幕网站中查找字幕。但你找不到与你所拥有的电影的拷贝同名的副标题。所以你盲目地下载一个字幕,提取出来,然后用它开始电影。但时间并不同步。沮丧的是,你下载了另一个字幕,却发现它和第一个字幕是一样的。如果这个网站有30个电影字幕,你必须下载并手动检查每一个,然后才能找到确切的字幕,否则你会失望地放弃。

Titley如何帮助-

蒂特利在这种情况下帮助你。

一。您可以使用imdb id或电影名称的一部分调用titley(在这种情况下,它将搜索omdb数据库以查找匹配的电影,并且您可以从显示的列表中选择电影)。 一。一旦选择了正确的电影,它将从字幕站点获取电影的所有可用字幕。 2.提取所有这些内容,并在字幕中搜索一个中等长度且不重复的对话框。然后,它将列出所有检索到的字幕以及每个字幕中出现特定对话框的时间。你可以播放你的电影,找到对话播放的时间。一旦找到了近似时间,就可以选择最短时间的字幕。

请参阅下载电影“费里斯·布勒休息日”字幕的示例运行。

样本运行

>titley --name=ferris
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): www.omdbapi.com

The following movies were found matching your search key 'ferris'

1) Ferris Bueller's Day Off (1986), IMDB: tt0091042
2) Ferris Bueller (19901991), IMDB: tt0098795
3) The Night Ferris Bueller Died (1999), IMDB: tt0240760
4) Ferris Wheels & Funky Breath (2013), IMDB: tt2223660
5) The Ferris Wheel (1977), IMDB: tt0743732
6) The Black Ferris (1990), IMDB: tt0683206
7) Inside Story: Ferris Bueller's Day Off (2011), IMDB: tt2150301
8) Ferris Bueller's Day Off (2010), IMDB: tt1877452
9) The Ferris Wheel (1958), IMDB: tt0910758
10) Pam Ferris (1991), IMDB: tt0721863

Select the correct one.  Enter a number between 1 and 10. Enter "x" to exit
1
INFO:titley:Downloading subtitles for movie 'Ferris Bueller's Day Off'(1986), IMDB:tt0091042
INFO:titley:Fetching http://www.opensubtitles.org/en/search/sublanguageid-all/imdbid-tt0091042/offset-0/xml
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): www.opensubtitles.org
INFO:titley:Fetching http://www.opensubtitles.org/en/search/sublanguageid-all/imdbid-tt0091042/offset-40/xml
INFO:titley:Fetching http://www.opensubtitles.org/en/search/sublanguageid-all/imdbid-tt0091042/offset-80/xml
INFO:titley:Fetching http://www.opensubtitles.org/en/search/sublanguageid-all/imdbid-tt0091042/offset-120/xml
INFO:titley:Downloading 17 subtitles
INFO:titley:Getting subs from http://dl.opensubtitles.org/en/download/sub/3212297
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): dl.opensubtitles.org
INFO:titley:Getting subs from http://dl.opensubtitles.org/en/download/sub/66485
INFO:titley:Getting subs from http://dl.opensubtitles.org/en/download/sub/4458597
INFO:titley:Getting subs from http://dl.opensubtitles.org/en/download/sub/3659099
INFO:titley:Getting subs from http://dl.opensubtitles.org/en/download/sub/3557846
INFO:titley:Getting subs from http://dl.opensubtitles.org/en/download/sub/3523972
INFO:titley:Getting subs from http://dl.opensubtitles.org/en/download/sub/3438100
INFO:titley:Getting subs from http://dl.opensubtitles.org/en/download/sub/3215718
INFO:titley:Getting subs from http://dl.opensubtitles.org/en/download/sub/3603116
INFO:titley:Getting subs from http://dl.opensubtitles.org/en/download/sub/5456752
INFO:titley:Getting subs from http://dl.opensubtitles.org/en/download/sub/4801531
INFO:titley:Getting subs from http://dl.opensubtitles.org/en/download/sub/66484
INFO:titley:Getting subs from http://dl.opensubtitles.org/en/download/sub/5116427
INFO:titley:Getting subs from http://dl.opensubtitles.org/en/download/sub/4617238
INFO:titley:Getting subs from http://dl.opensubtitles.org/en/download/sub/5249775
INFO:titley:Getting subs from http://dl.opensubtitles.org/en/download/sub/4801528
INFO:titley:Getting subs from http://dl.opensubtitles.org/en/download/sub/3490076
INFO:titley:writing file ferris-bueller-s-day-off-1986\10\extraction__2\Ferris.Bueller's.Day.Off.1986.720p.BluRay.x264-ESiR [PublicHD].srt
INFO:titley:writing file ferris-bueller-s-day-off-1986\11\extraction__3\Ferris Bueller's Day Off.Eng (SDH).srt
INFO:titley:writing file ferris-bueller-s-day-off-1986\12\extraction__4\Ferris Bueller's Day Off (ENG) (Director's Commentary).srt
INFO:titley:writing file ferris-bueller-s-day-off-1986\12\extraction__4\Ferris Bueller's Day Off CD1 (ENG) (Director's commentary).srt
INFO:titley:writing file ferris-bueller-s-day-off-1986\12\extraction__4\Ferris Bueller's Day Off CD2 (ENG) (Director's Commentary).srt
INFO:titley:writing file ferris-bueller-s-day-off-1986\13\extraction__5\Ferris Bueller's Day Off.srt
INFO:titley:writing file ferris-bueller-s-day-off-1986\15\extraction__7\fbdo-cg.srt
INFO:titley:writing file ferris-bueller-s-day-off-1986\16\extraction__8\Ferris Bueller's Day Off.srt
INFO:titley:writing file ferris-bueller-s-day-off-1986\17\extraction__9\Ferris.Buellers.Day.Off.srt
INFO:titley:writing file ferris-bueller-s-day-off-1986\2\extraction__10\Ferris Bueller's Day Off (ENG) (Hearing Impaired).srt
INFO:titley:writing file ferris-bueller-s-day-off-1986\2\extraction__10\Ferris Bueller's Day Off CD1 (ENG) (Hearing Impaired).srt
INFO:titley:writing file ferris-bueller-s-day-off-1986\2\extraction__10\Ferris Bueller's Day Off CD2 (ENG) (Hearing Impaired).srt
INFO:titley:writing file ferris-bueller-s-day-off-1986\3\extraction__11\Ferris.Bueller's.Day.Off.1986.576p.BDRip.x264.AC3-gx.en.srt
INFO:titley:writing file ferris-bueller-s-day-off-1986\5\extraction__13\Ferris.Buellers.Day.Off.1986.1080p.BluRay.x264-CiNEFiLE.ENG.srt
INFO:titley:writing file ferris-bueller-s-day-off-1986\6\extraction__14\Ferris.Bueller's.Day.Off.1986.720P.BDRip.X264-TLF.srt
INFO:titley:writing file ferris-bueller-s-day-off-1986\7\extraction__15\Ferris Bueller's Day Off Eng.srt
INFO:titley:writing file ferris-bueller-s-day-off-1986\9\extraction__17\Ferris Bueller's Day Off_BDrip_aviM1280_en.srt
====================

13 Subtitles found/retrived. You can use the following dialogue and the time it appears to find the matching subtitle.
-------------------

"Whatever miles we put on,we'll take off."

00:26:45,800 | ferris-bueller-s-day-off-1986\7\extraction__15
00:27:58,718 | ferris-bueller-s-day-off-1986\15\extraction__7
00:27:57,842 | ferris-bueller-s-day-off-1986\11\extraction__3
00:27:57,843 | ferris-bueller-s-day-off-1986\5\extraction__13
00:27:57,840 | ferris-bueller-s-day-off-1986\10\extraction__2
00:26:48,000 | ferris-bueller-s-day-off-1986\12\extraction__4
00:27:58,194 | ferris-bueller-s-day-off-1986\6\extraction__14
00:26:48,484 | ferris-bueller-s-day-off-1986\13\extraction__5
00:26:48,440 | ferris-bueller-s-day-off-1986\2\extraction__10
00:27:57,842 | ferris-bueller-s-day-off-1986\16\extraction__8
00:27:57,842 | ferris-bueller-s-day-off-1986\3\extraction__11
00:27:58,194 | ferris-bueller-s-day-off-1986\9\extraction__17
00:26:33,484 | ferris-bueller-s-day-off-1986\17\extraction__9
-------------------

安装

您可以使用pip安装titley。

$pip安装titley $titley–名字ferris 或 $titley–名字ferris–langauge=法语

对已下载的字幕使用titley

如果你已经下载了一些字幕文件作为zips,你可以使用titley。把蒂特利和消息来源联系起来 选项并指定要在其中查找字幕的目录。Titley将从中提取SRT文件 显示报表以便您可以选择正确的报表。

$titley–source=/home/mysubs/ferris

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java将数据从一个输入流传输到多个输出流的最佳方式   java如何使用反射机制调用驻留在具有默认可见性的基类中的公共方法?   在Java中将两个不同的方法调用为一个方法   集合的最佳Java线程安全锁定机制?   java在gae中存储json字符串   PHP/Java桥。如何从php服务器连接到桌面应用程序   java Spring:无法持久化用@JsonIgnore注释的实体   基准测试中的java非确定性分配行为   JavaSpring:使用Spring安全性为执行器端点配置安全性   java扩展spring应用程序上下文的最佳方式是什么?   在Mac OS上使用Java向终端窗口发送一些输入   java addInputStream(InputStream InputStream)方法失败   java为什么下面的代码打印为false?   java错误:类按钮中的addActionListener方法无法应用于给定类型;   java在spring数据jpa投影中使用嵌入式值对象   java访问匿名内部类中的变量的干净方法是什么?   java将POJO转换为JSON只返回“id”字段   jvm热点我在哪里可以找到MemoryConsumer。测试内存消耗的java程序?