mihaeu/sub-collector

Sub-Collector 是一个基于控制台的 PHP 应用程序,其主要目的是批量收集字幕。

2.0.2 2014-07-13 09:03 UTC

This package is auto-updated.

Last update: 2024-09-04 18:26:58 UTC


README

Build Status Coverage Status

sub-collector usage example

Sub-Collector 是一个我发起的小项目,因为我厌倦了手动搜索我的电影收藏库中的字幕。

市面上还有其他更成熟且功能丰富的工具。然而,这些工具并非用 PHP 编写,而且这个是基于控制台的,所以让我们看看它会走向何方。

安装

我假设你已经熟悉 Composer。如果你不熟悉并且到达了这里,我强烈建议你花 5 分钟阅读 入门 部分。这会改变你的生活(至少是写 PHP 的方式)。

确保 ~/.composer/bin 在你的 $PATH 中,然后只需执行

composer global require mihaeu/sub-collector:dev-master

用法

目前 Sub-Collector 的功能非常有限。要下载路径中所有电影(或单个电影)的字幕,只需使用

sub-collector download [PATH_TO_YOUR_MOVIE_COLLECTION]

测试

我目标是尽可能接近 100% 的测试覆盖率。如果你想亲自检查测试,请通过 composer 安装 require-dev 依赖项(默认),然后运行

vendor/bin/phpunit --testdoc --coverage-text

--testdox 会产生更“敏捷”(嗡嗡声!)的输出,这对于检查功能是一个很好的开始。整个命令将产生类似这样的结果

# ...

DownloadCommand
 [x] Downloading of subtitles for a movie without subtitle and existing subtitle on server
 [x] Download of subtitles for movie without subtitle but no subtitle on server
 [x] Downloading of subtitles for a movie which has subtitles is skipped

Finder
 [x] Only accepts directories
 [x] Only movies are found in a folder
 [x] Movies can be nested deeply inside a folder
 [x] Movie with subtitle will be detected
 [x] Movie without subtitle will be detected
 [x] Custom file extensions will be detected

SubCollector
 [x] Subtitle can be downloaded if exists
 [x] Subtitle cannot be downloaded if it does not exist
 [x] Downloaded subtitle will be saved as a srt file
 [x] Subtitle file will only be saved when subtitle was found

# ...

Code Coverage Report

 Summary:
  Classes: 83.33% (5/6)
  Methods: 88.24% (15/17)
  Lines:   84.00% (84/100)

感谢

许可证

MIT,请参阅 LICENSE 文件。