2017 © Pedro Peláez
 

library video-checker

Check if a video is available online.

image

mascame/video-checker

Check if a video is available online.

  • Tuesday, May 10, 2016
  • by marcmascarell
  • Repository
  • 1 Watchers
  • 0 Stars
  • 4,440 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 12 Versions
  • 5 % Grown

The README.md

Video Checker

Latest Stable Version License, (*1)

Check if a video is available online., (*2)

Installation

Require this package in your composer.json and run composer update:, (*3)

"mascame/video-checker": "2.*"

Usage

Just use $provider->check(videoId) with the provider you want, (*4)


$youtubeProvider = new Mascame\VideoChecker\YoutubeProvider(); var_dump($youtubeProvider->check('C7OfO6r_5m0')); // true var_dump($youtubeProvider->check('CWO3Tuo35-o')); // false // Check if a video is disponible with API $youtubeProviderWithAPI = new Mascame\VideoChecker\YoutubeProvider('MY_API_KEY'); var_dump($youtubeProviderWithAPI->check('GOHXRe9o_Ls')); //false // Check if a video is disponible on a certain country var_dump($youtubeProviderWithAPI->check('GOHXRe9o_Ls', 'ES')); // false var_dump($youtubeProviderWithAPI->check('CWO3Tuo35-o', 'IT')); // true // As array (youtube has an API limit of 50 ids per call) var_dump($youtubeProviderWithAPI->check(['CWO3Tuo35-o', 'GOHXRe9o_Ls'], 'ES')); // ['CWO3Tuo35-o' => true, 'GOHXRe9o_Ls' => false] $vimeoProvider = new Mascame\VideoChecker\VimeoProvider(); var_dump($vimeoProvider->check('31161781')); // true var_dump($vimeoProvider->check('34134308a')); // false $dailymotionProvider = new Mascame\VideoChecker\DailymotionProvider(); var_dump($dailymotionProvider->check('x38rpxc')); // true var_dump($dailymotionProvider->check('x38rpxc3232')); // false // As array var_dump($dailymotionProvider->check(['x38rpxc', 'x38rpxc3232'])); // ['x38rpxc' => true, 'x38rpxc3232' => false]

Running tests

Install composer dependencies in development mode, (*5)

composer update --dev, (*6)

vendor/bin/phpunit tests/TestVideoChecker.php, (*7)

Changelog

2.3

  • Youtube Provider: Throw exception if API call fails or has errors (to avoid false negatives)

2.2

  • Fixes stored Ids when was not in API response items
  • Youtube Provider: get total API calls

2.1

  • Allows array as parameter in 'check' method (output will be an array ['video-id' => bool, 'video-id2' => bool])
  • Youtube Provider: Using ids parameter as array will avoid unneeded API calls (and dont waste quota)

2.0

  • Allow Youtube API check without country specified
  • Simplified API
  • Updated tests

1.2

  • Added API key injection via constructor for YoutubeProvider

1.1

  • Added checkByCountry for YoutubeProvider

1.0

  • Added Youtube, Vimeo & Dailymotion providers

Support

If you want to give your opinion, you can send me an email, comment the project directly (if you want to contribute with information or resources) or fork the project and make a pull request., (*8)

Also I will be grateful if you want to make a donation, this project hasn't got a death date and it wants to be improved constantly:, (*9)

Website Button, (*10)

License

MIT, (*11)

The Versions

10/05 2016

dev-master

9999999-dev https://github.com/marcmascarell/video-checker

Check if a video is available online.

  Sources   Download

MIT

The Development Requires

by Marc Mascarell

video check online video checker youtube checker vimeo checker

10/05 2016

2.3

2.3.0.0 https://github.com/marcmascarell/video-checker

Check if a video is available online.

  Sources   Download

MIT

The Development Requires

by Marc Mascarell

video check online video checker youtube checker vimeo checker

29/02 2016

2.2

2.2.0.0 https://github.com/marcmascarell/video-checker

Check if a video is available online.

  Sources   Download

MIT

The Development Requires

by Marc Mascarell

video check online video checker youtube checker vimeo checker

19/02 2016

2.1

2.1.0.0 https://github.com/marcmascarell/video-checker

Check if a video is available online.

  Sources   Download

MIT

The Development Requires

by Marc Mascarell

video check online video checker youtube checker vimeo checker

19/02 2016

2.0

2.0.0.0 https://github.com/marcmascarell/video-checker

Check if a video is available online.

  Sources   Download

MIT

The Development Requires

by Marc Mascarell

video check online video checker youtube checker vimeo checker

20/11 2015

1.6

1.6.0.0 https://github.com/marcmascarell/video-checker

Check if a video is available online.

  Sources   Download

MIT

The Development Requires

by Marc Mascarell

video check online video checker youtube checker vimeo checker

10/11 2015

1.5

1.5.0.0 https://github.com/marcmascarell/video-checker

Check if a video is available online.

  Sources   Download

MIT

The Development Requires

by Marc Mascarell

video check online video checker youtube checker vimeo checker

09/11 2015

1.4

1.4.0.0 https://github.com/marcmascarell/video-checker

Check if a video is available online.

  Sources   Download

MIT

The Development Requires

by Marc Mascarell

video check online video checker youtube checker vimeo checker

27/10 2015

1.3

1.3.0.0 https://github.com/marcmascarell/video-checker

Check if a video is available online.

  Sources   Download

MIT

The Development Requires

by Marc Mascarell

video check online video checker youtube checker vimeo checker

21/10 2015

1.2

1.2.0.0 https://github.com/marcmascarell/video-checker

Check if a video is available online.

  Sources   Download

MIT

The Development Requires

by Marc Mascarell

video check online video checker youtube checker vimeo checker

20/10 2015

1.1

1.1.0.0 https://github.com/marcmascarell/video-checker

Check if a video is available online.

  Sources   Download

MIT

The Development Requires

by Marc Mascarell

video check online video checker youtube checker vimeo checker

08/10 2015

1.0

1.0.0.0 https://github.com/marcmascarell/video-checker

Check if a video is available online.

  Sources   Download

MIT

The Development Requires

by Marc Mascarell

video check online video checker youtube checker vimeo checker