前言:
老司机发车基地,慎入。
操作环境:
服务器:CentOS7
运行环境:PHP7.2+MySql5.7+Nginx1.15
安装步骤:
源码地址:
https://github.com/guyueyingmu/avbook
备用:https://github.com/weiyidu/avbook
1、安装宝塔面板,并安装运行环境。
2、把源码git clone 到/www/wwwroot目录下
1 |
git clone https://github.com/guyueyingmu/avbook.git |
添加网站并创建数据库,网站目录选择avbook,然后修改网站配置(如下图所示)
更改权限
把所有目录及文件都改www、755
添加伪静态
3、安装扩展、修改php禁用函数
将proc_open删除
4、修改数据库配置
1 2 3 |
cd avbook cp .env.example .env vi .env |
然后执行以下操作
1 2 3 |
composer install php artisan migrate php artisan key:generate |
5、采集数据
目标网址配置文件 avbook/config/urlconfig.php,如果你是在本地或国内服务器测试,可能需要修改网址,最新网址自己去找吧。
以下命令一定要在avbook根目录下运行
1 2 3 4 5 6 7 8 9 10 |
#启动avmoo爬虫 php artisan avbook:avmoo #在带宽够用的情况下,可将并发设置为500 php artisan avbook:avmoo --max=500 一定要采集avmoo运行结束再运行下面的命令。 php artisan avbook:javbus --movie=1 --page=10 --magpage=10 #启动javbus爬虫 php artisan avbook:javlib --genre --movie #javlibrary爬虫 |
2019.07.18更新
1、出现下图问题:
解决方法:
2、如果服务器条件不允许安装MySql5.7,安装其它版本的数据库会出现下面的提示。
1 2 3 4 5 |
[Illuminate\Database\QueryException] SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes (SQL: alter table users add unique users_email_unique(email)) [PDOException] SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes |
原因:Laravel 5.4+默认使用utf8mb4字符编码,而不是之前的utf8编码
解决方法:
修改config/database.php,把utf8mb4改成utf8
1 2 |
'charset' => 'utf8', 'collation' => 'utf8_unicode_ci', |
以下是官方给的解决方法(仅供参考),我试过之后没有解决问题,用上面的解决了。
1 |
Laravel uses the utf8mb4 character set by default, which includes support for storing "emojis" in the database. If you are running a version of MySQL older than the 5.7.7 release or MariaDB older than the 10.2.2 release, you may need to manually configure the default string length generated by migrations in order for MySQL to create indexes for them. You may configure this by calling the Schema::defaultStringLength method within your AppServiceProvider: |
大概意思是手动更改默认索引长度
把app/Providers/AppServiceProvider.php修改为
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
<?php namespace App\Providers; use Illuminate\Support\ServiceProvider; use Illuminate\Support\Facades\Schema; class AppServiceProvider extends ServiceProvider { /** * Register any application services. * * @return void */ public function register() { // } /** * Bootstrap any application services. * * @return void */ public function boot() { Schema::defaultStringLength(191); } } |
3、不能采集到磁力链接
查查config/urlconfig.php配置中的网址是否能正常访问
文章评论
avmoo反爬了,作者说可以修改ua。可是这要怎么修改ua
@fh 已经2年没更新了
做到一半到改数据库的时候不知道怎么做了
已加入收藏夹,时不时的来看看有没有更新博文!
谢谢分享,这正是我要找的 ,我的博客,欢迎回访