Commit 415055f3 by Phạm Văn Đoan

test lấy lượt nghe ở youtube

parent 750bd510
<?php
namespace App\Console\Commands\Youtube;
use Alaouy\Youtube\Facades\Youtube;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Hash;
use Yangqi\Htmldom\Htmldom;
class YoutubeCrawlerListenCommand extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'get:youtube-listen';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Command description';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
ini_set('max_execution_time', -1);
}
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
echo 'OK';
$url = 'https://www.youtube.com/watch?v=8mC7oNkz9t4';
//$video = Youtube::getVideoInfo('8mC7oNkz9t4');
//print_r($video);
echo Hash::make('123456a@A');
}
}
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
"type": "project", "type": "project",
"require": { "require": {
"php": ">=5.6.4", "php": ">=5.6.4",
"alaouy/youtube": "^2.2",
"ixudra/curl": "^6.19", "ixudra/curl": "^6.19",
"laravel/framework": "5.4.*", "laravel/framework": "5.4.*",
"laravel/tinker": "~1.0", "laravel/tinker": "~1.0",
......
...@@ -170,6 +170,7 @@ return [ ...@@ -170,6 +170,7 @@ return [
Yangqi\Htmldom\HtmldomServiceProvider::class, Yangqi\Htmldom\HtmldomServiceProvider::class,
Maatwebsite\Excel\ExcelServiceProvider::class, Maatwebsite\Excel\ExcelServiceProvider::class,
Ixudra\Curl\CurlServiceProvider::class, Ixudra\Curl\CurlServiceProvider::class,
//Alaouy\Youtube\YoutubeServiceProvider::class,
/* /*
* Application Service Providers... * Application Service Providers...
...@@ -231,6 +232,7 @@ return [ ...@@ -231,6 +232,7 @@ return [
'Htmldom' => Yangqi\Htmldom\Htmldom::class, 'Htmldom' => Yangqi\Htmldom\Htmldom::class,
'Excel' => Maatwebsite\Excel\Facades\Excel::class, 'Excel' => Maatwebsite\Excel\Facades\Excel::class,
'Curl' => Ixudra\Curl\Facades\Curl::class, 'Curl' => Ixudra\Curl\Facades\Curl::class,
'Youtube' => Alaouy\Youtube\Facades\Youtube::class,
], ],
......
...@@ -325,8 +325,8 @@ class Htmldomnode ...@@ -325,8 +325,8 @@ class Htmldomnode
switch ($this->nodetype) switch ($this->nodetype)
{ {
case YANGQI_HDOM_TYPE_TEXT: return $this->dom->restore_noise($this->_[YANGQI_HDOM_INFO_TEXT]); case YANGQI_HDOM_TYPE_TEXT: return $this->dom->restore_noise($this->_[YANGQI_HDOM_INFO_TEXT]);
case HDOM_TYPE_COMMENT: return ''; case YANGQI_HDOM_TYPE_COMMENT: return '';
case HDOM_TYPE_UNKNOWN: return ''; case YANGQI_HDOM_TYPE_UNKNOWN: return '';
} }
if (strcasecmp($this->tag, 'script')===0) return ''; if (strcasecmp($this->tag, 'script')===0) return '';
if (strcasecmp($this->tag, 'style')===0) return ''; if (strcasecmp($this->tag, 'style')===0) return '';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment