2017 © Pedro Peláez
 

library youscrape

Unofficial Public YouTube Scrapper

image

mirazmac/youscrape

Unofficial Public YouTube Scrapper

  • Friday, January 12, 2018
  • by mirazmac
  • Repository
  • 3 Watchers
  • 2 Stars
  • 9 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 2 Versions
  • 125 % Grown

The README.md

YouScrape

YouTube Public Data Scrapper, (*1)

YouScrape is an unofficial replacement of YouTube Data API v3 for retrieving YouTube public data. Currently it can scrape channels, videos, playlists and single video information., (*2)

Install via Composer

composer require mirazmac/youscrape

Limitations

  • You can't limit or change the amount of results per page
  • It depends on YouTube's internal ajax endpoints, as a result it can only show the information the endpoint provides.
  • Its illegal and YouTube may block your IP if you send too many requests

Usage

Check examples folder for complete usage examples., (*3)

Searching Videos

use MirazMac\YouScrape\YouScrape;

$youtube = new YouScrape;

try {
    $videos = $youtube->videos('Honest Trailer');
} catch (\Exception $e) {
    echo $e->getMessage();
    exit;
}

print_r($videos->getAll());

Fetching Information of a Single Video

use MirazMac\YouScrape\YouScrape;

$youtube = new YouScrape;

try {
    $single = $youtube->single('V7h01x1oiQs');
} catch (\Exception $e) {
    echo $e->getMessage();
    exit;
}

var_dump($single);

Searching Channels

use MirazMac\YouScrape\YouScrape;

$youtube = new YouScrape;

try {
    $channels = $youtube->channels('Entertainment');
} catch (\Exception $e) {
    echo $e->getMessage();
    exit;
}

print_r($channels->getAll());

Searching Playlists

use MirazMac\YouScrape\YouScrape;

$youtube = new YouScrape;

try {
    $playlists = $youtube->playlists('Entertainment');
} catch (\Exception $e) {
    echo $e->getMessage();
    exit;
}

print_r($playlists->getAll());

Todos

  • Implement tests
  • Run a benchmark to see if it gets blocked on too heavy requests
  • Better and complete documentation

The Versions

12/01 2018

dev-master

9999999-dev

Unofficial Public YouTube Scrapper

  Sources   Download

MIT

The Requires

 

12/01 2018

v0.1

0.1.0.0

Unofficial Public YouTube Scrapper

  Sources   Download

MIT

The Requires