PHPackages                             nqt/crawler-otruyen - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. nqt/crawler-otruyen

ActiveLibrary

nqt/crawler-otruyen
===================

Laravel package: crawler cho OTruyen — Artisan + Backpack admin (auto-discover)

v1.0.2(1mo ago)25↑2900%MITPHPPHP ^8.3

Since Mar 29Pushed 1mo agoCompare

[ Source](https://github.com/onezoroone/crawler-otruyen)[ Packagist](https://packagist.org/packages/nqt/crawler-otruyen)[ RSS](/packages/nqt-crawler-otruyen/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (1)Versions (4)Used By (0)

crawler-otruyen
===============

[](#crawler-otruyen)

Package Laravel: công cụ **cào &amp; import** truyện từ API OTruyen — giao diện wizard trong Backpack admin, lệnh Artisan, tùy chọn ảnh (remote / storage / S3) và viết lại mô tả qua OpenAI.

Yêu cầu
-------

[](#yêu-cầu)

- PHP 8.3+
- Laravel 13+
- Gợi ý: [Backpack for Laravel](https://backpackforlaravel.com/) (middleware `admin`, menu), package [Backpack Settings](https://github.com/Laravel-Backpack/Settings) để lưu cấu hình crawler trong DB

Cài đặt
-------

[](#cài-đặt)

### Monorepo / path

[](#monorepo--path)

Trong `composer.json` của app:

```
{
    "repositories": [
        {
            "type": "path",
            "url": "packages/crawler-otruyen"
        }
    ],
    "require": {
        "nqt/crawler-otruyen": "@dev"
    }
}
```

```
composer update nqt/crawler-otruyen
```

Service provider được **auto-discover** (`extra.laravel.providers`).

### Seeder Settings (Backpack)

[](#seeder-settings-backpack)

```
php artisan db:seed --class=Database\\Seeders\\CrawlerOtruyenSettingsSeeder
```

Hoặc gọi từ `DatabaseSeeder` (đã có sẵn trong project mẫu).

Cấu hình
--------

[](#cấu-hình)

File config: `config/crawler-otruyen.php` (merge từ package).

Biến môi trường thường dùng:

BiếnÝ nghĩa`CRAWLER_IMAGE_MODE``remote` | `local` | `s3``CRAWLER_CONTENT_REWRITE``true` / `false` — bật viết lại mô tả`OPENAI_API_KEY`Key OpenAI (hoặc nhập trong Settings)Ảnh **local**: cần `php artisan storage:link`. Ảnh **S3**: cấu hình disk `s3` và biến AWS trong `.env`.

### Backpack Settings (sau khi seed)

[](#backpack-settings-sau-khi-seed)

Các key: `crawler_content_rewrite_enabled`, `crawler_image_mode`, `crawler_openai_prompt`, `crawler_openai_api_key`, `crawler_openai_model`.

Truy cập: **Admin → Settings** (hoặc route `setting` của Backpack).

Giao diện wizard
----------------

[](#giao-diện-wizard)

URL (prefix Backpack mặc định `admin`):

`GET /admin/plugin/crawler-otruyen`

- Bước 1: danh sách API hoặc nhập slug/URL.
- Bước 2: chọn truyện + **tùy chọn xử lý** (chế độ ảnh, bật/tắt viết lại mô tả) cho **lần import đó**.
- Bước 3: tóm tắt kết quả + nhật ký (SSE khi trình duyệt hỗ trợ).

Menu: nhóm **Crawler** (cấu hình `plugins.menu_partials`).

Lệnh Artisan
------------

[](#lệnh-artisan)

```
php artisan crawler-otruyen:import --slug=ten-slug
php artisan crawler-otruyen:import --list --list-url="..." --page-start=1 --page-end=1
php artisan crawler-otruyen:import --file=slugs.txt
```

Tùy chọn ghi đè Settings:

```
php artisan crawler-otruyen:import --slug=x --image-mode=local --rewrite
php artisan crawler-otruyen:import --slug=x --no-rewrite
```

Không dùng đồng thời `--rewrite` và `--no-rewrite`.

### Log file (terminal)

[](#log-file-terminal)

Lệnh ghi thêm vào kênh log **`crawler_otruyen`** (driver `daily`):

- Đường dẫn: `storage/logs/crawler-otruyen-YYYY-MM-DD.log`
- Mỗi dòng do Laravel ghi có **đầy đủ ngày giờ** (theo timezone app, `config/app.php` → `timezone`).
- Biến tùy chọn: `LOG_CRAWLER_OTRUYEN_LOG_DAYS` (mặc định giữ file 14 ngày).

Publish tài nguyên
------------------

[](#publish-tài-nguyên)

Sao chép view / seeder ra app để chỉnh sửa:

```
# Chỉ Blade
php artisan vendor:publish --tag=crawler-otruyen-views

# Chỉ stub seeder (ghi đè database/seeders/CrawlerOtruyenSettingsSeeder.php)
php artisan vendor:publish --tag=crawler-otruyen-seeders

# Cả hai
php artisan vendor:publish --tag=crawler-otruyen
```

- View publish: `resources/views/vendor/crawler-otruyen/` (ưu tiên hơn view trong package).
- Seeder publish: file app gọi seeder gốc trong package; có thể sửa `run()` sau khi publish.

Mở rộng nguồn crawl
-------------------

[](#mở-rộng-nguồn-crawl)

Đăng ký class implements `Nqt\CrawlerOtruyen\Contracts\CrawlerSourceContract` trong `config('crawler-otruyen.sources')` và đặt `CRAWLER_SOURCE` hoặc chọn nguồn trên wizard nếu có nhiều driver.

Giấy phép
---------

[](#giấy-phép)

MIT

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance90

Actively maintained with recent releases

Popularity8

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

3

Last Release

46d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d13c69ea57fe5eb9ab758aeab7eb2576e8280369c26e17dc7fc570aa8f78c1d7?d=identicon)[onezoroone](/maintainers/onezoroone)

### Embed Badge

![Health badge](/badges/nqt-crawler-otruyen/health.svg)

```
[![Health](https://phpackages.com/badges/nqt-crawler-otruyen/health.svg)](https://phpackages.com/packages/nqt-crawler-otruyen)
```

###  Alternatives

[anourvalar/eloquent-serialize

Laravel Query Builder (Eloquent) serialization

11320.2M21](/packages/anourvalar-eloquent-serialize)[namu/wirechat

A Laravel Livewire messaging app for teams with private chats and group conversations.

54324.5k](/packages/namu-wirechat)[statamic-rad-pack/runway

Eloquently manage your database models in Statamic.

135192.6k5](/packages/statamic-rad-pack-runway)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
