YouTube Public Data Scrapper
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.
composer require mirazmac/youscrape
- 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
Check examples folder for complete usage examples.
use MirazMac\YouScrape\YouScrape;
$youtube = new YouScrape;
try {
$videos = $youtube->videos('Honest Trailer');
} catch (\Exception $e) {
echo $e->getMessage();
exit;
}
print_r($videos->getAll());
use MirazMac\YouScrape\YouScrape;
$youtube = new YouScrape;
try {
$single = $youtube->single('V7h01x1oiQs');
} catch (\Exception $e) {
echo $e->getMessage();
exit;
}
var_dump($single);
use MirazMac\YouScrape\YouScrape;
$youtube = new YouScrape;
try {
$channels = $youtube->channels('Entertainment');
} catch (\Exception $e) {
echo $e->getMessage();
exit;
}
print_r($channels->getAll());
use MirazMac\YouScrape\YouScrape;
$youtube = new YouScrape;
try {
$playlists = $youtube->playlists('Entertainment');
} catch (\Exception $e) {
echo $e->getMessage();
exit;
}
print_r($playlists->getAll());
- Implement tests
- Run a benchmark to see if it gets blocked on too heavy requests
- Better and complete documentation