UpdateOuter.php 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <?php
  2. namespace App\Console\Commands;
  3. use GuzzleHttp\Cookie\SetCookie;
  4. use Illuminate\Console\Command;
  5. use GuzzleHttp\Client;
  6. use App\Modules\Book\Models\Book;
  7. use App\Modules\Book\Models\Chapter;
  8. class UpdateOuter extends Command
  9. {
  10. /**
  11. * The name and signature of the console command.
  12. *
  13. * @var string
  14. */
  15. protected $signature = 'book:updateouter {--type=} {--bid=}';
  16. /**
  17. * The console command description.
  18. *
  19. * @var string
  20. */
  21. protected $description = 'Command description';
  22. /**
  23. * Create a new command instance.
  24. *
  25. * @return void
  26. */
  27. public function __construct()
  28. {
  29. parent::__construct();
  30. }
  31. /**
  32. * Execute the console command.
  33. *
  34. * @return mixed
  35. */
  36. public function handle()
  37. {
  38. //
  39. }
  40. //微月云
  41. private function updateOneFromWyy($bid,$wyy_bid){
  42. $jar = new \GuzzleHttp\Cookie\CookieJar(false,[
  43. new SetCookie(['Name'=>'PHPSESSID','Value'=>'np1pu5oj2taacado7h4gn0usf2']),
  44. new SetCookie(['Name'=>'getuserinfo','Value'=>'1']),
  45. new SetCookie(['Name'=>'user_id','Value'=>'268860471']),
  46. new SetCookie(['Name'=>'subscribe','Value'=>'1']),
  47. new SetCookie(['Name'=>'user_name','Value'=>'we20190312']),
  48. new SetCookie(['Name'=>'admin_id','Value'=>'326695218']),
  49. new SetCookie(['Name'=>'shell','Value'=>'8de1e2d1789ed1a7a6f1673d9373123d']),
  50. new SetCookie(['Name'=>'OPENID','Value'=>'olpZ50lR6G-pLQ8WYiQXVw6Wg8U0']),
  51. new SetCookie(['Name'=>'VALIDON','Value'=>'1566467472']),
  52. new SetCookie(['Name'=>'CRC','Value'=>'5e3a06c9424d5c3c80ad82371d5dec16'])
  53. ]);
  54. $last_chapter = Chapter::where('bid',$bid)
  55. ->select('id','name','sequence','prev_cid','next_cid')
  56. ->orderBy('sequence','desc')
  57. ->first();
  58. $now_sequence = $last_chapter->sequence+1;
  59. $url_format = 'https://wxg6y88rwiqvjkvx.weiyueyunsc.com/ChapterContent/content/fromaid/326695218.html?bookid=%s&num=%s';
  60. while (true){
  61. }
  62. $url = sprintf($url_format,$wyy_bid,1);
  63. $client = new Client();
  64. }
  65. }