承接 codebuglab/laravel-opensubtitles 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

codebuglab/laravel-opensubtitles

最新稳定版本:1.0.1

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.

Laravel OpenSubtitles

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.php will be publish in config folder after that.
  • Then you have to put your opensubtitles api key in your env file like this OpenSubtitles_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.

统计信息

  • 总下载量: 517
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 4
  • 点击次数: 4
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 4
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-12-05

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固