https://github.com/mirazmac/youscrape
[DEPRECATED] No longer works due to YouTube's major change in ajax endpoint and protection.
https://github.com/mirazmac/youscrape
grabber scraper unofficial youtube youtube-api youtube-api-v3 youtube-channel youtube-playlist youtube-search youtube-video
Last synced: 1 day ago
JSON representation
[DEPRECATED] No longer works due to YouTube's major change in ajax endpoint and protection.
- Host: GitHub
- URL: https://github.com/mirazmac/youscrape
- Owner: MirazMac
- License: mit
- Archived: true
- Created: 2018-01-10T14:22:09.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-01-12T05:23:00.000Z (over 7 years ago)
- Last Synced: 2025-04-23T17:51:56.898Z (5 months ago)
- Topics: grabber, scraper, unofficial, youtube, youtube-api, youtube-api-v3, youtube-channel, youtube-playlist, youtube-search, youtube-video
- Language: PHP
- Homepage:
- Size: 16.6 KB
- Stars: 6
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# YouScrape
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.
### Install via Composer
```shell
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.### Searching Videos
```php
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
```php
use MirazMac\YouScrape\YouScrape;$youtube = new YouScrape;
try {
$single = $youtube->single('V7h01x1oiQs');
} catch (\Exception $e) {
echo $e->getMessage();
exit;
}var_dump($single);
```
### Searching Channels
```php
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```php
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