codebuglab/laravel-opensubtitles
Composer 安装命令:
composer require codebuglab/laravel-opensubtitles
包简介
Simple integration with OpenSubtitles API to search for and download subtitles.
关键字:
README 文档
README
Simple integration with OpenSubtitles API to search for and download subtitles.
Table of contents
Setup
Installation
To install this package through composer run the following command in the terminal
composer require codebuglab/laravel-opensubtitles
Publish
You have to publish config file with this artisan command:
php artisan vendor:publish --provider="CodeBugLab\OpenSubtitles\OpenSubtitlesServiceProvider"
- File
opensubtitles.phpwill be publish inconfigfolder after that. - Then you have to put your opensubtitles api key in your
envfile like thisOpenSubtitles_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.
Instructions
- You can use opensubtitles api and get information your want, first take a quick look at official api page.
- For all next API requests you have to use OpenSubtitles facade
use CodeBugLab\OpenSubtitles\Facades\OpenSubtitles;
- Every request have it's own parameters and response and we gonna explain it in details
Subtitles
Search For Subtitles
$parameters = [ 'imdb_id' => "315642", 'languages' => 'en', 'type' => 'movie' ]; $opensubtitles = OpenSubtitles::subtitles()->searchForSubtitles($parameters)->toArray();
- Simply this will search for subtitles depends on movie id in opensubtitles, IMDB id or even TMDB id.
- For more information about parameters and response click here.
Download
Details
$parameters = [ 'file_id' => "2712566", 'sub_format' => 'srt' ]; $srtFile = OpenSubtitles::download()->details($parameters)->getSrt();
- Here you can get srt file by file_id that you can get from search for subtitles query.
- You can download the file with other format, take a look at this link to know all other formats you can download.
- Unfortunately there is a limit depends on your opensubtitle account start from 10 up to 1000 download per day.
- For more information about parameters and response click here.
Get Zip File By Legacy Subtitle Id
$legacySubtitleId = "7090487"; $zipFile = OpenSubtitles::download()->getZipFileByLegacySubtitleId($legacySubtitleId);
- This is unofficial way to download the subtitles but it still supported by opensubtitles website.
- We need legacy subtitle id instead of file id and both are available in search for subtitles response.
- There is no specific limit to download by using this method.
License
This package is a free software distributed under the terms of the MIT license.
codebuglab/laravel-opensubtitles 适用场景与选型建议
codebuglab/laravel-opensubtitles 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 523 次下载、GitHub Stars 达 4, 最近一次更新时间为 2021 年 12 月 05 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「php」 「api」 「laravel」 「subtitles」 「subtitle」 「opensubtitles」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 codebuglab/laravel-opensubtitles 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 codebuglab/laravel-opensubtitles 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 codebuglab/laravel-opensubtitles 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A PSR-7 compatible library for making CRUD API endpoints
Alfabank REST API integration
Zero-dependency raw PHP DNS resolver, domain-ownership verification, and intoDNS/MxToolbox-style diagnostics. Queries authoritative nameservers directly over sockets — never trusts the recursive cache for ownership checks.
Laravel package for Accurate Online API integration.
A lightweight plain-PHP framework for database-backed CRUD APIs.
bughq error tracking - PHP SDK
统计信息
- 总下载量: 523
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 24
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-12-05
