├── .editorconfig ├── .env.example ├── .gitattributes ├── .gitignore ├── .styleci.yml ├── README.md ├── app ├── Console │ └── Kernel.php ├── Contracts │ ├── ScrapeItemInterface.php │ ├── ScraperFactoryInterface.php │ └── ScraperInterface.php ├── DTOs │ └── ScrapeItemDTO.php ├── Events │ └── ProcessingStarted.php ├── Exceptions │ ├── Handler.php │ └── ScraperDriverNotFoundException.php ├── Factories │ └── ScraperFactory.php ├── Http │ ├── Controllers │ │ ├── Controller.php │ │ ├── PageScrapeController.php │ │ └── ProgressController.php │ ├── Kernel.php │ └── Middleware │ │ ├── Authenticate.php │ │ ├── CheckForMaintenanceMode.php │ │ ├── EncryptCookies.php │ │ ├── RedirectIfAuthenticated.php │ │ ├── TrimStrings.php │ │ ├── TrustHosts.php │ │ ├── TrustProxies.php │ │ └── VerifyCsrfToken.php ├── Jobs │ ├── ProcessPhotoGallery.php │ └── ProcessVideo.php ├── PhotoGallery.php ├── Providers │ ├── AppServiceProvider.php │ ├── AuthServiceProvider.php │ ├── BroadcastServiceProvider.php │ ├── EventServiceProvider.php │ └── RouteServiceProvider.php ├── ScrapeItem.php ├── Scrapers │ ├── FullPornerScraper.php │ ├── GoodPornScraper.php │ ├── HQPornerScraper.php │ ├── PicHunterScraper.php │ ├── PornHubScraper.php │ ├── PornKTubeScraper.php │ ├── PornPicsScraper.php │ ├── PorntrexScraper.php │ ├── PornwildScraper.php │ ├── WhoresHubScraper.php │ └── YouJizzScraper.php ├── Traits │ └── ScrapeItemTrait.php ├── User.php └── Video.php ├── artisan ├── bootstrap ├── app.php └── cache │ └── .gitignore ├── composer.json ├── composer.lock ├── config ├── app.php ├── auth.php ├── broadcasting.php ├── cache.php ├── cors.php ├── database.php ├── filesystems.php ├── hashing.php ├── logging.php ├── mail.php ├── queue.php ├── scrapers.php ├── services.php ├── session.php └── view.php ├── database ├── .gitignore ├── factories │ └── UserFactory.php ├── migrations │ ├── 2014_10_12_000000_create_users_table.php │ ├── 2014_10_12_100000_create_password_resets_table.php │ ├── 2019_08_19_000000_create_failed_jobs_table.php │ ├── 2021_07_05_044011_create_jobs_table.php │ ├── 2021_07_05_205158_create_videos_table.php │ ├── 2022_10_23_165740_add_is_stream_column_to_videos_table.php │ ├── 2022_10_30_152342_create_photo_galleries_table.php │ ├── 2022_10_30_152624_create_scrape_items_table.php │ ├── 2022_10_31_051225_remove_columns_from_videos_table.php │ ├── 2022_11_05_180539_add_soft_deletes_to_videos_table.php │ ├── 2022_11_05_180550_add_soft_deletes_to_photo_galleries_table.php │ └── 2022_11_05_180601_add_soft_deletes_to_scrape_items_table.php └── seeds │ └── DatabaseSeeder.php ├── package-lock.json ├── package.json ├── phpunit.xml ├── public ├── .htaccess ├── favicon.ico ├── index.php ├── robots.txt └── web.config ├── resources ├── js │ ├── app.js │ ├── bootstrap.js │ └── components │ │ ├── ContentScraper.vue │ │ ├── CurrentlyScrapingItem.vue │ │ ├── ProgressBar.vue │ │ ├── ScrapeListTable.vue │ │ ├── ScrapeListTableRow.vue │ │ ├── ScrapeStatusBadge.vue │ │ ├── SiteLogo.vue │ │ └── icons │ │ ├── Checkmark.vue │ │ ├── Exclamation.vue │ │ └── Spinner.vue ├── lang │ └── en │ │ ├── auth.php │ │ ├── pagination.php │ │ ├── passwords.php │ │ └── validation.php ├── sass │ └── app.scss └── views │ └── welcome.blade.php ├── routes ├── api.php ├── channels.php ├── console.php └── web.php ├── server.php ├── storage ├── app │ └── public │ │ └── logos │ │ ├── fullporner.png │ │ ├── goodporn.png │ │ ├── hqporner.png │ │ ├── pichunter.png │ │ ├── pornhub.png │ │ ├── pornktube.png │ │ ├── pornpics.png │ │ ├── porntrex.png │ │ ├── pornwild.png │ │ ├── whoreshub.png │ │ └── youjizz.png ├── framework │ ├── cache │ │ └── .gitignore │ ├── sessions │ │ └── .gitignore │ └── views │ │ └── .gitignore └── logs │ └── .gitignore ├── tests ├── Browser │ ├── ExampleTest.php │ ├── Pages │ │ ├── HomePage.php │ │ └── Page.php │ ├── console │ │ └── .gitignore │ └── screenshots │ │ └── .gitignore ├── CreatesApplication.php ├── DuskTestCase.php ├── Feature │ └── ExampleTest.php ├── TestCase.php └── Unit │ └── ExampleTest.php └── webpack.mix.js /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | end_of_line = lf 6 | insert_final_newline = true 7 | indent_style = space 8 | indent_size = 4 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | trim_trailing_whitespace = false 13 | 14 | [*.{yml,yaml}] 15 | indent_size = 2 16 | 17 | [*.{js,vue,json}] 18 | indent_size = 2 19 | 20 | [*.{html,blade.php}] 21 | indent_size = 2 22 | -------------------------------------------------------------------------------- /.env.example: -------------------------------------------------------------------------------- 1 | APP_NAME=Scraper 2 | APP_ENV=local 3 | APP_KEY= 4 | APP_DEBUG=true 5 | APP_URL=http://localhost 6 | 7 | LOG_CHANNEL=stack 8 | 9 | DB_CONNECTION=sqlite 10 | 11 | BROADCAST_DRIVER=log 12 | CACHE_DRIVER=file 13 | QUEUE_CONNECTION=database 14 | SESSION_DRIVER=file 15 | SESSION_LIFETIME=120 16 | 17 | # Only needs configured if using Redis as QUEUE_CONNECTION 18 | REDIS_HOST=127.0.0.1 19 | REDIS_PASSWORD=null 20 | REDIS_PORT=6379 21 | 22 | FFMPEG_OUTPUT_PATH= # full system path where scraped videos are stored 23 | FFMPEG_LOG_PATH= # full system path where ffmpeg processing log files are stored 24 | 25 | PHOTO_OUTPUT_PATH= # full system path where scraped photo galleries are stored 26 | PHOTO_LOG_PATH= # full system path where scraped photo gallery processing log files are stored 27 | 28 | # (optional) Authentication credentials for accessing videos behind required login 29 | PORNTREX_USERNAME= 30 | PORNTREX_PASSWORD= 31 | PORNTREX_LOGIN_URL= 32 | 33 | PORNWILD_USERNAME= 34 | PORNWILD_PASSWORD= 35 | PORNWILD_LOGIN_URL= 36 | 37 | PORNKTUBE_USERNAME= 38 | PORNKTUBE_PASSWORD= 39 | PORNKTUBE_LOGIN_URL= 40 | 41 | HQPORNER_USERNAME= 42 | HQPORNER_PASSWORD= 43 | HQPORNER_LOGIN_URL= 44 | 45 | PORNHUB_USERNAME= 46 | PORNHUB_PASSWORD= 47 | PORNHUB_LOGIN_URL= 48 | 49 | PORNPICS_USERNAME= 50 | PORNPICS_PASSWORD= 51 | PORNPICS_LOGIN_URL= 52 | 53 | PICHUNTER_USERNAME= 54 | PICHUNTER_PASSWORD= 55 | PICHUNTER_LOGIN_URL= 56 | 57 | WHORESHUB_USERNAME= 58 | WHORESHUB_PASSWORD= 59 | WHORESHUB_LOGIN_URL= 60 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | *.css linguist-vendored 3 | *.scss linguist-vendored 4 | *.js linguist-vendored 5 | CHANGELOG.md export-ignore 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | /public/hot 3 | /public/storage 4 | /storage/*.key 5 | /vendor 6 | .env 7 | .env.backup 8 | .phpunit.result.cache 9 | Homestead.json 10 | Homestead.yaml 11 | npm-debug.log 12 | yarn-error.log 13 | .idea/* 14 | /public/js 15 | /public/css 16 | /public/mix-manifest.json 17 | -------------------------------------------------------------------------------- /.styleci.yml: -------------------------------------------------------------------------------- 1 | php: 2 | preset: laravel 3 | disabled: 4 | - unused_use 5 | finder: 6 | not-name: 7 | - index.php 8 | - server.php 9 | js: 10 | finder: 11 | not-name: 12 | - webpack.mix.js 13 | css: true 14 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Porn Site Scraper 2 | A web based scraper and UI monitoring tool for downloading videos and full photo galleries from various porn sites. Launches 3 | a web driver for scraping and can be configured to handle authentication 4 | for scraping media hidden behind logins. 5 | 6 | ### Currently supported sites 7 | 8 | **Videos** 9 | 1. PornHub (pornhub.com) 10 | 2. Porntrex (porntrex.com) 11 | 2. FullPorner (fullporner.com) 12 | 3. PornKTube (pornktube.tv) 13 | 4. HQPorner (hqporner.com) 14 | 5. WhoresHub (whoreshub.com) 15 | 6. YouJizz (youjizz.com) 16 | 7. Goodporn (goodporn.to) 17 | 18 | **Photo Galleries** 19 | 1. PornPics (pornpics.com) 20 | 2. PicHunter (pichunter.com) 21 | 22 | ## Usage 23 | 1. Visit one of the supported sites and navigate to a desired video. 24 | 2. Copy the URL from the site and paste it into the web UI input and add a name to be used for saved file. 25 | 3. Click scrape button to launch the job and monitor progress in the UI. 26 | 27 | ## Installation 28 | ### Pre-reqs 29 | 1. \>=PHP 7.2 30 | 2. [Chrome](https://www.google.com/chrome/) browser installed on host system 31 | 3. [FFmpeg](https://ffmpeg.org/) installed on host browser 32 | 33 | ### Installation steps 34 | 1. Clone the repository 35 | `git clone https://github.com/ed36080666/site_scraper.git` 36 | 2. Install PHP dependencies 37 | `composer install` 38 | 3. Install Laravel Dusk chrome driver 39 | `php artisan dusk:chrome-driver` 40 | 4. Install frontend dependencies 41 | `npm install` 42 | 5. Copy and configure `.env` 43 | `cp .env.example .env` 44 | 1. Set full system path for `FFMPEG_OUTPUT_PATH` variable in `.env`. This determines where saved videos are stored. 45 | 2. Set full system path for `FFMPEG_LOG_PATH` variable in `.env`. This determines where FFmpeg will store log files. 46 | 6. Generate Laravel application key 47 | `php artisan key:generate` 48 | 7. Create the base SQLite database 49 | `touch ./database/database.sqlite` 50 | 8. Run database migrations 51 | `php artisan migrate` 52 | 9. Build frontend assets 53 | `npm run dev` 54 | 10. Start a queue worker (handles scraping jobs in background) 55 | `php artisan queue:work` 56 | 11. Start the application 57 | `php artisan serve` 58 | 59 | ### Running queue workers 60 | To get the most out of this application, you should leverage the Laravel worker queue. The best way to do this is by running queue workers in the background using [Supervisor](http://supervisord.org/installing.html). Supervisor will launch a given number of worker threads and keep them running. 61 | 62 | 1. Install supervisor 63 | `sudo apt update && sudo apt install supervisor` 64 | 2. Create a new config file for our workers: 65 | `sudo vim /etc/supervisor/conf.d/site_scraper_worker.conf` 66 | 67 | ``` 68 | [program:site_scraper_worker] 69 | process_name=%(program_name)s_%(process_num)02d 70 | # cstomize system path to root of the site_scraper directory 71 | command=php /var/www/vhosts/site_scraper/artisan queue:work --tries=1 --timeout=7000 72 | autostart=true 73 | autorestart=true 74 | stopasgroup=true 75 | killasgroup=true 76 | redirect_stderr=true 77 | stopwaitsecs=7201 78 | user=# set appropriate system user 79 | numprocs=8 # Can add more or fewer works based on your hardware, network etc. 80 | stdout_logfile=# Customize this to wherever you want to place your queue worker logs. 81 | ``` 82 | 3. Reread the config files and update supervisor 83 | `sudo supervisorctl reread` 84 | `sudo supervisorctl update` 85 | 4. Check the workers are running 86 | `sudo supervisorctl update` 87 | You should see something along the following: 88 | ``` 89 | site_scraper_worker:site_scraper_worker_00 RUNNING pid 20567, uptime 0:02:55 90 | ... 1 entry for each worker 91 | ``` 92 | 93 | ### Troubleshooting 94 | 1. Chrome Web Driver exceptions 95 | 1. Ensure Chrome is installed on the host system 96 | 2. Ensure Laravel Dusk Chrome driver binary is installed 97 | 1. Visit [Laravel Dusk](https://github.com/ed36080666/site_scraper.git) docs for more info 98 | 2. Out of date errors. Sometimes Laravel Dusk will install a version of the Chrome driver that requires a higher version of the Chrome binary than what is installed on the system. If you see errors about unsupported versions during scraping, try updating the Chrome binary to a higher version (aka re-install/update Chrome browser). 99 | 2. Permission errors 100 | 1. Ensure ffmpeg binary has execute permissions allowing server to launch processes 101 | 2. Ensure server has write permissions to the video output directory 102 | 3. Ensure server has write permissions to all the log directories 103 | -------------------------------------------------------------------------------- /app/Console/Kernel.php: -------------------------------------------------------------------------------- 1 | command('inspire')->hourly(); 28 | } 29 | 30 | /** 31 | * Register the commands for the application. 32 | * 33 | * @return void 34 | */ 35 | protected function commands() 36 | { 37 | $this->load(__DIR__.'/Commands'); 38 | 39 | require base_path('routes/console.php'); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /app/Contracts/ScrapeItemInterface.php: -------------------------------------------------------------------------------- 1 | id = $item->id(); 24 | $this->name = $item->name(); 25 | $this->progress = $item->progress(); 26 | $this->height = $item->height(); 27 | $this->width = $item->width(); 28 | $this->status = $item->status(); 29 | $this->is_stream = $item->isStream(); 30 | $this->started_at = $item->startedAt(); 31 | $this->type = $item->type(); 32 | $this->file_exists = $item->fileExists(); 33 | $this->log_exists = $item->logExists(); 34 | } 35 | 36 | public function toArray(): array 37 | { 38 | return [ 39 | 'id' => $this->id, 40 | 'name' => $this->name, 41 | 'progress' => $this->progress, 42 | 'height' => $this->height, 43 | 'width' => $this->width, 44 | 'status' => $this->status, 45 | 'is_stream' => $this->is_stream, 46 | 'started_at' => $this->started_at, 47 | 'type' => $this->type, 48 | 'file_exists' => $this->file_exists, 49 | 'log_exists' => $this->log_exists, 50 | ]; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /app/Events/ProcessingStarted.php: -------------------------------------------------------------------------------- 1 | video = $video; 27 | } 28 | 29 | /** 30 | * Get the channels the event should broadcast on. 31 | * 32 | * @return \Illuminate\Broadcasting\Channel|array 33 | */ 34 | public function broadcastOn() 35 | { 36 | return new Channel('Queue'); 37 | } 38 | 39 | /** 40 | * Get the name of the event to listen for. 41 | * 42 | * @return string 43 | */ 44 | public function broadcastAs() 45 | { 46 | return 'processing.started'; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /app/Exceptions/Handler.php: -------------------------------------------------------------------------------- 1 | prepare(); 28 | return $scraper; 29 | } 30 | 31 | /** 32 | * Resolve an instance of a scraper by matching against URL (e.g. video url). 33 | * 34 | * @param string $url 35 | * @return ScraperInterface 36 | * @throws ScraperDriverNotFoundException 37 | */ 38 | public static function resolveFromUrl(string $url): ScraperInterface 39 | { 40 | $drivers = config('scrapers.drivers'); 41 | foreach ($drivers as $driver => $config) { 42 | if (str_contains($url, $config['base_url'])) { 43 | return self::make($driver); 44 | } 45 | } 46 | 47 | throw new ScraperDriverNotFoundException("Can't resolve matching driver from URL: `$url`"); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /app/Http/Controllers/Controller.php: -------------------------------------------------------------------------------- 1 | get(); 17 | 18 | $logo_map = array_values(array_map(function ($driver_config) { 19 | return [ 20 | 'src' => asset("storage/logos/{$driver_config['logo_filename']}"), 21 | 'base_url' => $driver_config['base_url'] 22 | ]; 23 | }, config('scrapers.drivers'))); 24 | 25 | return view('welcome', [ 26 | 'logo_map' => $logo_map, 27 | 'scrape_items' => $scrape_items->map(function (ScrapeItem $item) { 28 | return (new ScrapeItemDTO($item->scrapable))->toArray(); 29 | }) 30 | ]); 31 | } 32 | 33 | public function log(ScrapeItem $scrape_item): \Illuminate\Http\Response 34 | { 35 | $log_contents = file_get_contents($scrape_item->log_path); 36 | $response = Response::make($log_contents); 37 | $response->header('Content-Type', 'text/plain'); 38 | 39 | return $response; 40 | } 41 | 42 | /** 43 | * Store a newly created resource in storage. 44 | * 45 | * @param Request $request 46 | * @return JsonResponse 47 | */ 48 | public function store(Request $request): JsonResponse 49 | { 50 | try { 51 | $scraper = ScraperFactory::resolveFromUrl($request->video_url); 52 | $filename = str_replace("'", '', $request->filename); 53 | 54 | $scraper->scrape($request->video_url, $filename); 55 | 56 | return response()->json([ 57 | 'success' => true 58 | ]); 59 | } catch (\Exception $e) { 60 | return response()->json([ 61 | 'success' => false, 62 | 'message' => $e->getMessage() 63 | ], 500); 64 | } 65 | } 66 | 67 | public function destroy($id): JsonResponse 68 | { 69 | $item = ScrapeItem::findOrFail($id); 70 | 71 | $scrapable = $item->scrapable; 72 | 73 | if ($item->log_path && file_exists($item->log_path)) { 74 | unlink($item->log_path); 75 | } 76 | 77 | $scrapable->removeFiles(); 78 | 79 | $scrapable->delete(); 80 | $item->delete(); 81 | 82 | return response()->json([ 83 | 'success' => true, 84 | 'message' => 'Item: '.$item->id.' - '.$scrapable->name().' deleted!' 85 | ]); 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /app/Http/Controllers/ProgressController.php: -------------------------------------------------------------------------------- 1 | get() 24 | ->transform(function (ScrapeItem $item) { 25 | return (new ScrapeItemDTO($item->scrapable))->toArray(); 26 | }); 27 | 28 | return response()->json($in_progress); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /app/Http/Kernel.php: -------------------------------------------------------------------------------- 1 | [ 33 | \App\Http\Middleware\EncryptCookies::class, 34 | \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class, 35 | \Illuminate\Session\Middleware\StartSession::class, 36 | // \Illuminate\Session\Middleware\AuthenticateSession::class, 37 | \Illuminate\View\Middleware\ShareErrorsFromSession::class, 38 | \App\Http\Middleware\VerifyCsrfToken::class, 39 | \Illuminate\Routing\Middleware\SubstituteBindings::class, 40 | ], 41 | 42 | 'api' => [ 43 | 'throttle:60,1', 44 | \Illuminate\Routing\Middleware\SubstituteBindings::class, 45 | ], 46 | ]; 47 | 48 | /** 49 | * The application's route middleware. 50 | * 51 | * These middleware may be assigned to groups or used individually. 52 | * 53 | * @var array 54 | */ 55 | protected $routeMiddleware = [ 56 | 'auth' => \App\Http\Middleware\Authenticate::class, 57 | 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class, 58 | 'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class, 59 | 'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class, 60 | 'can' => \Illuminate\Auth\Middleware\Authorize::class, 61 | 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class, 62 | 'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class, 63 | 'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class, 64 | 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, 65 | 'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class, 66 | ]; 67 | } 68 | -------------------------------------------------------------------------------- /app/Http/Middleware/Authenticate.php: -------------------------------------------------------------------------------- 1 | expectsJson()) { 18 | return route('login'); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /app/Http/Middleware/CheckForMaintenanceMode.php: -------------------------------------------------------------------------------- 1 | check()) { 22 | return redirect(RouteServiceProvider::HOME); 23 | } 24 | 25 | return $next($request); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /app/Http/Middleware/TrimStrings.php: -------------------------------------------------------------------------------- 1 | allSubdomainsOfApplicationUrl(), 18 | ]; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /app/Http/Middleware/TrustProxies.php: -------------------------------------------------------------------------------- 1 | gallery_url = $gallery_url; 47 | $this->photo_urls = $photo_urls; 48 | $this->directory_name = $directory_name; 49 | $this->output_path = config('scrapers.photo_gallery.output_path'); 50 | $this->log_path = config('scrapers.photo_gallery.log_path'); 51 | 52 | $this->photo_gallery = PhotoGallery::create([ 53 | 'name' => $directory_name, 54 | 'number_photos' => count($this->photo_urls) 55 | ]); 56 | 57 | $this->scrape_item = ScrapeItem::create([ 58 | 'status' => ScrapeItem::STATUS_QUEUED, 59 | 'url' => $gallery_url, 60 | 'scrapable_id' => $this->photo_gallery->id, 61 | 'scrapable_type' => $this->photo_gallery->getMorphClass() 62 | ]); 63 | } 64 | 65 | /** 66 | * Execute the job. 67 | * 68 | * @return void 69 | */ 70 | public function handle() 71 | { 72 | $output_path = "{$this->output_path}/{$this->directory_name}"; 73 | $log_path = $this->log_path . '/' . str_replace(' ', '_', $this->directory_name) . '[' . now()->timestamp . '].txt'; 74 | 75 | $photo_count = count($this->photo_urls); 76 | file_put_contents($log_path, "Scraping {$photo_count} photos into {$output_path}...\n0"); 77 | 78 | $this->photo_gallery->update([ 79 | 'number_photos' => count($this->photo_urls), 80 | ]); 81 | 82 | $this->scrape_item->update([ 83 | 'status' => ScrapeItem::STATUS_PROCESSING, 84 | 'started_at' => now(), 85 | 'path' => $output_path, 86 | 'log_path' => $log_path 87 | ]); 88 | 89 | try { 90 | if (!is_dir($output_path)) { 91 | mkdir($output_path); 92 | } 93 | 94 | $i = 1; 95 | foreach($this->photo_urls as $photo_url) { 96 | $size = getimagesize($photo_url); 97 | $extension = image_type_to_extension($size[2]); 98 | $filename = str_pad($i, 4, "0", STR_PAD_LEFT); 99 | $filename .= $extension; 100 | 101 | $img_data = file_get_contents($photo_url); 102 | file_put_contents("{$output_path}/{$filename}", $img_data); 103 | 104 | $log_string = file_get_contents($log_path); 105 | $log_string .= "\n{$i}"; 106 | file_put_contents($log_path, $log_string); 107 | 108 | $i += 1; 109 | } 110 | } catch (\Exception $e) { 111 | $this->scrape_item->update([ 112 | 'status' => ScrapeItem::STATUS_ERROR 113 | ]); 114 | } 115 | 116 | $this->scrape_item->update([ 117 | 'status' => ScrapeItem::STATUS_DONE, 118 | 'finished_at' => now() 119 | ]); 120 | } 121 | 122 | public function failed(Throwable $exception) 123 | { 124 | $this->scrape_item->update([ 125 | 'status' => ScrapeItem::STATUS_ERROR 126 | ]); 127 | } 128 | } 129 | -------------------------------------------------------------------------------- /app/Jobs/ProcessVideo.php: -------------------------------------------------------------------------------- 1 | url = $url; 57 | $this->filename = $filename; 58 | $this->is_stream = $is_stream; 59 | $this->output_path = config('scrapers.ffmpeg.output_path'); 60 | $this->log_path = config('scrapers.ffmpeg.log_path'); 61 | $this->ffmpeg_args = $ffmpeg_args; 62 | $this->output_file_args = $output_file_args; 63 | 64 | $this->video = Video::create(['name' => $filename]); 65 | 66 | $this->scrape_item = ScrapeItem::create([ 67 | 'status' => ScrapeItem::STATUS_QUEUED, 68 | 'url' => $url, 69 | 'is_stream' => $is_stream, 70 | 'scrapable_id' => $this->video->id, 71 | 'scrapable_type' => $this->video->getMorphClass(), 72 | ]); 73 | } 74 | 75 | /** 76 | * Execute the job. 77 | * 78 | * @return void 79 | */ 80 | public function handle() 81 | { 82 | $output_path = $this->output_path; 83 | $log_path = $this->log_path . '/' . str_replace(' ', '_', $this->filename) . '[' . now()->timestamp . '].txt'; 84 | 85 | // if we are scraping a stream (m3u8) we cannot get metadata the same with ffprobe. 86 | // we can still scrape without this metadata but we don't currently have a way 87 | // to reliably get progress information. 88 | $meta = $this->is_stream 89 | ? null // todo look for a solution to allow us to get at least some metadata 90 | : json_decode(shell_exec("ffprobe -v quiet -print_format json -show_format -show_streams {$this->url}")); 91 | 92 | $this->video->update([ 93 | 'codec' => $meta->streams[0]->codec_name ?? null, 94 | 'width' => $meta->streams[0]->width ?? null, 95 | 'height' => $meta->streams[0]->height ?? null, 96 | 'duration' => $meta->format->duration ?? null, 97 | 'size' => $meta->format->size ?? null, 98 | 'bitrate' => $meta->format->bit_rate ?? null, 99 | ]); 100 | 101 | $this->scrape_item->update([ 102 | 'status' => ScrapeItem::STATUS_PROCESSING, 103 | 'started_at' => now(), 104 | 'path' => $output_path, 105 | 'log_path' => $log_path, 106 | ]); 107 | 108 | event(new ProcessingStarted($this->video)); 109 | 110 | try { 111 | shell_exec("ffmpeg -nostdin {$this->ffmpeg_args} -i \"{$this->url}\" {$this->output_file_args} \"$output_path/{$this->filename}\" 1>$log_path 2>&1"); 112 | // shell_exec("ffmpeg -i \"{$this->url}\" -c copy \"/home/eric/Downloads/ffmpeg_test/{$this->filename}\" > /dev/null 2>&1 &"); 113 | 114 | } catch (\Exception $e) { 115 | $this->scrape_item->update([ 116 | 'status' => ScrapeItem::STATUS_ERROR 117 | ]); 118 | } 119 | 120 | $this->scrape_item->update([ 121 | 'status' => ScrapeItem::STATUS_DONE, 122 | 'finished_at' => now() 123 | ]); 124 | } 125 | 126 | public function failed(Throwable $exception) 127 | { 128 | $this->scrape_item->update([ 129 | 'status' => ScrapeItem::STATUS_ERROR 130 | ]); 131 | } 132 | } 133 | -------------------------------------------------------------------------------- /app/PhotoGallery.php: -------------------------------------------------------------------------------- 1 | morphOne(ScrapeItem::class, 'scrapable'); 23 | } 24 | 25 | public function height(): ?int 26 | { 27 | return null; 28 | } 29 | 30 | public function width(): ?int 31 | { 32 | return null; 33 | } 34 | 35 | public function name(): string 36 | { 37 | return $this->name; 38 | } 39 | 40 | public function progress(): float 41 | { 42 | if (!$this->scrapeItem->log_path || !file_exists($this->scrapeItem->log_path)) { 43 | return 0; 44 | } 45 | 46 | $file = escapeshellarg($this->scrapeItem->log_path); 47 | $line = `tail -n 1 $file`; 48 | 49 | $progress = (int) $line; 50 | return (float) ($progress / $this->number_photos) * 100; 51 | } 52 | 53 | public function type(): string 54 | { 55 | return 'gallery'; 56 | } 57 | 58 | public function fileExists(): bool 59 | { 60 | return $this->path() && is_dir($this->path()); 61 | } 62 | 63 | public function removeFiles(): void 64 | { 65 | if ($this->fileExists()) { 66 | // delete all files in directory first 67 | array_map( 'unlink', array_filter((array) glob("{$this->path()}/*"))); 68 | rmdir($this->path()); 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /app/Providers/AppServiceProvider.php: -------------------------------------------------------------------------------- 1 | job, 'failed')) { 30 | // $event->job->failed(); 31 | // } 32 | // }); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /app/Providers/AuthServiceProvider.php: -------------------------------------------------------------------------------- 1 | 'App\Policies\ModelPolicy', 17 | ]; 18 | 19 | /** 20 | * Register any authentication / authorization services. 21 | * 22 | * @return void 23 | */ 24 | public function boot() 25 | { 26 | $this->registerPolicies(); 27 | 28 | // 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /app/Providers/BroadcastServiceProvider.php: -------------------------------------------------------------------------------- 1 | [ 19 | SendEmailVerificationNotification::class, 20 | ], 21 | ]; 22 | 23 | /** 24 | * Register any events for your application. 25 | * 26 | * @return void 27 | */ 28 | public function boot() 29 | { 30 | parent::boot(); 31 | 32 | // 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /app/Providers/RouteServiceProvider.php: -------------------------------------------------------------------------------- 1 | mapApiRoutes(); 46 | 47 | $this->mapWebRoutes(); 48 | 49 | // 50 | } 51 | 52 | /** 53 | * Define the "web" routes for the application. 54 | * 55 | * These routes all receive session state, CSRF protection, etc. 56 | * 57 | * @return void 58 | */ 59 | protected function mapWebRoutes() 60 | { 61 | Route::middleware('web') 62 | ->namespace($this->namespace) 63 | ->group(base_path('routes/web.php')); 64 | } 65 | 66 | /** 67 | * Define the "api" routes for the application. 68 | * 69 | * These routes are typically stateless. 70 | * 71 | * @return void 72 | */ 73 | protected function mapApiRoutes() 74 | { 75 | Route::prefix('api') 76 | ->middleware('api') 77 | ->namespace($this->namespace) 78 | ->group(base_path('routes/api.php')); 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /app/ScrapeItem.php: -------------------------------------------------------------------------------- 1 | 'boolean', 31 | ]; 32 | 33 | public function scrapable() 34 | { 35 | return $this->morphTo(); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /app/Scrapers/FullPornerScraper.php: -------------------------------------------------------------------------------- 1 | browse(function (Browser $browser) use ($url, $filename) { 22 | $browser->visit($url); 23 | 24 | $video_node = $browser->element('.single-video iframe'); 25 | $video_url = $video_node->getAttribute('src'); 26 | 27 | // the first 2 characters of scraped url are '//'. we need to append 28 | // https: for a valid path to give FFmpeg. 29 | $cdn_url = "https:$video_url"; 30 | 31 | $browser->visit($cdn_url); 32 | 33 | $browser->waitFor('#flvv', 5); 34 | $source_nodes = $browser->elements('#flvv source'); 35 | $highest_resolution_node = $this->findHighestResolution($source_nodes); 36 | 37 | $cdn_video_url = 'https:' . $highest_resolution_node->getAttribute('src'); 38 | 39 | ProcessVideo::dispatch($cdn_video_url, "$filename.mp4"); 40 | 41 | $browser->quit(); 42 | }); 43 | } 44 | 45 | private function findHighestResolution(array $dom_nodes) 46 | { 47 | // iterate all resolutions starting at highest. each video has multiple DOM nodes containing 48 | // resolutions stored in the title attribute. look for highest resolution and return associated node. 49 | foreach (self::RESOLUTIONS as $resolution) { 50 | foreach ($dom_nodes as $node) { 51 | if (str_contains($node->getAttribute('title'), $resolution)) { 52 | return $node; 53 | } 54 | } 55 | } 56 | 57 | throw new \Exception('Unable to find DOM node for supported resolutions.'); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /app/Scrapers/GoodPornScraper.php: -------------------------------------------------------------------------------- 1 | '-vf delogo=x=2:y=4:w=630:h=160', 28 | '1080' => '-vf delogo=x=3:y=6:w=320:h=70', 29 | ]; 30 | 31 | $this->browse(function (Browser $browser) use ($resolutions, $url, $filename, $watermark_stripper_args) { 32 | $browser->visit($url); 33 | 34 | $flashvars = $browser->script("return window.flashvars"); 35 | 36 | // filters flashvars to only the items that are related to video urls 37 | $urls = collect(array_filter($flashvars[0], function($key) { 38 | return strpos($key, 'video_alt_url') === 0; 39 | }, ARRAY_FILTER_USE_KEY)); 40 | 41 | foreach($resolutions as $resolution) { 42 | // starting with largest resolution, see if we have any video urls that 43 | // contain the resolution. 44 | $key = $urls->search(function ($item) use ($resolution) { 45 | return str_contains($item, $resolution); 46 | }); 47 | 48 | if ($key) { 49 | break; 50 | } 51 | } 52 | 53 | if (!isset($key)) { 54 | throw new \Exception('Could not find video URL for any supported resolutions.'); 55 | } 56 | 57 | $url = $flashvars[0][$key]; 58 | 59 | // attempt to find a watermark removal args 60 | $output_args = '-c copy'; 61 | foreach($watermark_stripper_args as $resolution => $arg) { 62 | if (str_contains($url, $resolution)) { 63 | $output_args = $arg; 64 | break; 65 | } 66 | } 67 | 68 | ProcessVideo::dispatch($url, "$filename.mp4", false, '', $output_args); 69 | }); 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /app/Scrapers/HQPornerScraper.php: -------------------------------------------------------------------------------- 1 | browse(function (Browser $browser) use ($url, $filename) { 22 | // hqporner does some funky stuff with referrers and some of the videos cannot 23 | // be accessed directly from their url in the browser. this only applies on some 24 | // and I cannot find a pattern. to bypass this, we will first visit the base 25 | // url and then call a window.location to navigate with valid referrers. 26 | $browser->visit('https://' . config('scrapers.drivers.hqporner.base_url')); 27 | $browser->script("return window.location.href = '$url'"); 28 | 29 | $browser->withinFrame('#playerWrapper iframe', function (Browser $iframe) use ($filename) { 30 | $source_nodes = $iframe->elements('source'); 31 | 32 | $node = $this->findHighestResolution($source_nodes); 33 | 34 | $video_src = $node->getAttribute('src'); 35 | 36 | // video src is already prefixed with 2 forward slashes so we just need to add "https:" 37 | $cdn_url = "https:$video_src"; 38 | ProcessVideo::dispatch($cdn_url, "$filename.mp4"); 39 | }); 40 | 41 | $browser->quit(); 42 | }); 43 | } 44 | 45 | private function findHighestResolution(array $dom_nodes) 46 | { 47 | // iterate all resolutions starting at highest. each video has multiple DOM nodes containing 48 | // resolutions stored in the title attribute. look for highest resolution and return associated node. 49 | foreach (self::RESOLUTIONS as $resolution) { 50 | foreach ($dom_nodes as $node) { 51 | if (str_contains($node->getAttribute('title'), $resolution)) { 52 | return $node; 53 | } 54 | } 55 | } 56 | 57 | throw new \Exception('Unable to find DOM node for supported resolutions.'); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /app/Scrapers/PicHunterScraper.php: -------------------------------------------------------------------------------- 1 | browse(function (Browser $browser) use ($url, $filename) { 29 | $browser->visit($url); 30 | 31 | $image_nodes = $browser->elements('#gallery figure img'); 32 | $photo_urls = collect([]); 33 | foreach($image_nodes as $node) { 34 | $photo_urls->push($node->getAttribute('xof')); 35 | } 36 | 37 | ProcessPhotoGallery::dispatch($url, $photo_urls->toArray(), $filename); 38 | 39 | $browser->quit(); 40 | }); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /app/Scrapers/PornHubScraper.php: -------------------------------------------------------------------------------- 1 | browse(function (Browser $browser) use ($resolutions, $url, $filename) { 25 | $browser->visit($url); 26 | 27 | $video_id = $browser->attribute('#player', 'data-video-id'); 28 | $data_key = "flashvars_$video_id"; 29 | $video_data = $browser->script("return window['$data_key']"); 30 | $media_data = collect($video_data[0]['mediaDefinitions']); 31 | 32 | $url = null; 33 | foreach ($resolutions as $resolution) { 34 | $video_definition = $media_data->first(function ($item) use ($resolution, $url) { 35 | return $item['quality'] === $resolution; 36 | }); 37 | 38 | if ($video_definition) { 39 | $url = $video_definition['videoUrl']; 40 | break; 41 | } 42 | } 43 | 44 | if (is_null($url)) { 45 | throw new \Exception('Could not find valid video URL for the supported resolutions.'); 46 | } 47 | 48 | ProcessVideo::dispatch($url, "$filename.mp4", true); 49 | 50 | $browser->quit(); 51 | }); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /app/Scrapers/PornKTubeScraper.php: -------------------------------------------------------------------------------- 1 | browse(function (Browser $browser) use ($url, $filename) { 31 | $browser->visit($url); 32 | 33 | // there are hidden divs that act as buttons for each resolution. these contain 34 | // all the url parts in a semi-colon delimited string in the `data-c` attribute. 35 | // the first child here will always be the highest available resolution. 36 | $data_url = $browser->attribute('.listlinks > div', 'data-c'); 37 | $url_parts = explode(';', $data_url); 38 | $url = $this->buildUrlFromParts($url_parts); 39 | 40 | ProcessVideo::dispatch($url, "$filename.mp4"); 41 | 42 | $browser->quit(); 43 | }); 44 | } 45 | 46 | private function buildUrlFromParts(array $url_parts) 47 | { 48 | // example url: https://s2.stormedia.info/whpvid/1657432818/Ntw9EdVYIRsyxZJAOuPL4A/18000/18248/18248_480p.mp4 49 | // reconstruct the direct CDN url using parts scraped from the DOM. first we 50 | // have to pull index 7. this will be an integer value typically `2` or `3` to 51 | // map to the `s2` or `s3` before the base url. 52 | $url = "https://s$url_parts[7]." . self::BASE_CDN_URL; 53 | 54 | // next we add an integer stored in part 5 55 | $url .= $url_parts[5] . '/'; 56 | 57 | // then we add a hash stored in part 6 58 | $url .= $url_parts[6] . '/'; 59 | 60 | // then we take the video id stored in part 4 and strip the first 61 | // 2 values and pad with 3x 0s (e.g. 18248 = 18000) 62 | $url .= substr($url_parts[4], 0, 2) . '000' . '/'; 63 | 64 | // then we add the video id 65 | $url .= $url_parts[4] . '/'; 66 | 67 | // then we create the filename which is always: _.mp4 68 | // unless resolution is 720, then it is just .mp4 69 | if ($url_parts[1] === '720p') { 70 | $url .= $url_parts[4] . '.mp4'; 71 | } else { 72 | $url .= $url_parts[4] . '_' . $url_parts[1] . '.mp4'; 73 | } 74 | 75 | return $url; 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /app/Scrapers/PornPicsScraper.php: -------------------------------------------------------------------------------- 1 | browse(function (Browser $browser) use ($url, $filename) { 29 | $browser->visit($url); 30 | 31 | $image_nodes = $browser->elements("#main #tiles a"); 32 | $photo_urls = collect([]); 33 | foreach ($image_nodes as $node) { 34 | $photo_urls->push($node->getAttribute('href')); 35 | } 36 | 37 | ProcessPhotoGallery::dispatch($url, $photo_urls->toArray(), $filename); 38 | 39 | $browser->quit(); 40 | }); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /app/Scrapers/PorntrexScraper.php: -------------------------------------------------------------------------------- 1 | browse(function (Browser $browser) use ($config, $resolutions, $url, $filename) { 33 | 34 | $browser->visit($url); 35 | 36 | // determines if login is required because video is private. 37 | $login_required = true; 38 | try { 39 | $browser->assertSee("This video is a private video"); 40 | } catch (ExpectationFailedException $e) { 41 | $login_required = false; 42 | } 43 | 44 | if ($login_required) { 45 | // navigate to & enter credentials for login form. 46 | $browser->visit($config['auth']['login_url']); 47 | $browser->type('#login_username', $config['auth']['username']); 48 | $browser->type('#login_pass', $config['auth']['password']); 49 | $browser->press('Log in'); 50 | 51 | // login always redirects to home so re-visit the original page and continue script. 52 | $browser->visit($url); 53 | } 54 | 55 | // video urls are stored in global js object "flashvars" 56 | $data = $browser->script("return window.flashvars;"); 57 | 58 | // filters data to only the items that are related to video urls 59 | $urls = collect(array_filter($data[0], function($key) { 60 | return strpos($key, 'video_alt_url') === 0; 61 | }, ARRAY_FILTER_USE_KEY)); 62 | 63 | // iterate each of the resolutions we'll process in descending 64 | // quality order (best is first choice). 65 | foreach ($resolutions as $resolution) { 66 | $url_key = $urls->search(function ($item, $key) use ($resolution) { 67 | return str_contains($item, $resolution . '.mp4'); 68 | }); 69 | 70 | if ($url_key) { 71 | break; 72 | } 73 | } 74 | 75 | if (!$url_key) { 76 | throw new \Exception('Could not find video URL for any supported resolutions.'); 77 | } 78 | 79 | ProcessVideo::dispatch($urls[$url_key], "$filename.mp4"); 80 | 81 | $browser->quit(); 82 | }); 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /app/Scrapers/PornwildScraper.php: -------------------------------------------------------------------------------- 1 | browse(function (Browser $browser) use ($url, $filename) { 34 | $config = config('scrapers.drivers.pornwild'); 35 | $browser->visit($url); 36 | 37 | $login_required = true; 38 | try { 39 | $browser->assertSee('private video'); 40 | } catch (ExpectationFailedException $e) { 41 | $login_required = false; 42 | } 43 | 44 | if ($login_required) { 45 | $browser->visit($config['auth']['login_url']); 46 | $browser->type('#login_username', $config['auth']['username']); 47 | $browser->type('#login_pass', $config['auth']['password']); 48 | $browser->press('Log in'); 49 | 50 | $browser->visit($url); 51 | } 52 | 53 | $data = $browser->script("return window.flashvars"); 54 | $data = $data[0]; // data array lives in the first item returned from javascript flashvars 55 | 56 | // the data will contain a series of alt_urls* for each resolution. The highest 57 | // alt url is the highest resolution which we always try to grab first. 58 | $cdn_video_url = $data['video_alt_url4'] // 4k 59 | ?? $data['video_alt_url3'] // 1440 60 | ?? $data['video_alt_url2'] // 1080 61 | ?? $data['video_alt_url'] // 720 62 | ?? $data['video_url'] // 480 63 | ?? null; 64 | 65 | if (!$cdn_video_url) { 66 | throw new \Exception('Cant find valid video URL in `flashvars`'); 67 | } 68 | 69 | ProcessVideo::dispatch($cdn_video_url, "$filename.mp4"); 70 | 71 | $browser->quit(); 72 | }); 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /app/Scrapers/WhoresHubScraper.php: -------------------------------------------------------------------------------- 1 | browse(function (Browser $browser) use ($config, $resolutions, $url, $filename) { 33 | 34 | $browser->visit($url); 35 | 36 | // determines if login is required because video is private. 37 | $login_required = true; 38 | try { 39 | $browser->assertSee("This video is a private video"); 40 | } catch (ExpectationFailedException $e) { 41 | $login_required = false; 42 | } 43 | 44 | if ($login_required) { 45 | // navigate to & enter credentials for login form. 46 | $browser->visit($config['auth']['login_url']); 47 | $browser->type('#login_username', $config['auth']['username']); 48 | $browser->type('#login_pass', $config['auth']['password']); 49 | $browser->press('Log in'); 50 | 51 | // login always redirects to home so re-visit the original page and continue script. 52 | $browser->visit($url); 53 | } 54 | 55 | // video urls are stored in global js object "flashvars" 56 | $data = $browser->script("return window.flashvars;"); 57 | 58 | // filters data to only the items that are related to video urls 59 | $urls = collect(array_filter($data[0], function($key) { 60 | return strpos($key, 'video_alt_url') === 0; 61 | }, ARRAY_FILTER_USE_KEY)); 62 | 63 | // iterate each of the resolutions we'll process in descending 64 | // quality order (best is first choice). 65 | foreach ($resolutions as $resolution) { 66 | $url_key = $urls->search(function ($item, $key) use ($resolution) { 67 | return str_contains($item, $resolution . '.mp4'); 68 | }); 69 | 70 | if ($url_key) { 71 | break; 72 | } 73 | } 74 | 75 | if (!$url_key) { 76 | throw new \Exception('Could not find video URL for any supported resolutions.'); 77 | } 78 | 79 | // the cdn requires a referer of the same url, or it will return a 403 80 | $ffmpeg_args = "-headers 'Referer: $url'"; 81 | 82 | ProcessVideo::dispatch($urls[$url_key], "$filename.mp4", true, $ffmpeg_args); 83 | 84 | $browser->quit(); 85 | }); 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /app/Scrapers/YouJizzScraper.php: -------------------------------------------------------------------------------- 1 | browse(function (Browser $browser) use ($url, $filename) { 25 | 26 | $browser->visit($url); 27 | 28 | $browser->waitFor('#yj-fluid', 5); 29 | $src_node = $browser->element('#yj-fluid source'); 30 | 31 | $url = 'https:' . $src_node->getAttribute('src'); 32 | 33 | ProcessVideo::dispatch($url, "$filename.mp4", true); 34 | }); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /app/Traits/ScrapeItemTrait.php: -------------------------------------------------------------------------------- 1 | scrapeItem->id; 12 | } 13 | 14 | public function startedAt(): ?string 15 | { 16 | return $this->scrapeItem->started_at; 17 | } 18 | 19 | public function logExists(): bool 20 | { 21 | return $this->scrapeItem->log_path && file_exists($this->scrapeItem->log_path); 22 | } 23 | 24 | public function path(): ?string 25 | { 26 | return $this->scrapeItem->path; 27 | } 28 | 29 | public function isStream(): bool 30 | { 31 | return (bool) $this->scrapeItem->is_stream; 32 | } 33 | 34 | public function status(): string 35 | { 36 | return $this->scrapeItem->status; 37 | } 38 | 39 | public function isProcessing(): bool 40 | { 41 | return $this->scrapeItem->status === ScrapeItem::STATUS_PROCESSING; 42 | } 43 | 44 | public function isDone(): bool 45 | { 46 | return $this->scrapeItem->status === ScrapeItem::STATUS_DONE; 47 | } 48 | 49 | public function isErrored(): bool 50 | { 51 | return $this->scrapeItem->status === ScrapeItem::STATUS_ERROR; 52 | } 53 | 54 | public function isQueued(): bool 55 | { 56 | return $this->scrapeItem->status === ScrapeItem::STATUS_QUEUED; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /app/User.php: -------------------------------------------------------------------------------- 1 | 'datetime', 38 | ]; 39 | } 40 | -------------------------------------------------------------------------------- /app/Video.php: -------------------------------------------------------------------------------- 1 | morphOne(ScrapeItem::class, 'scrapable'); 29 | } 30 | 31 | public function getLastLogLine() 32 | { 33 | if (!$this->scrapeItem->log_path || !file_exists($this->scrapeItem->log_path)) { 34 | return null; 35 | } 36 | 37 | $line = ''; 38 | $f = fopen($this->scrapeItem->log_path, 'r'); 39 | $cursor = -1; 40 | 41 | fseek($f, $cursor, SEEK_END); 42 | $char = fgetc($f); 43 | 44 | // Trim trailing newline chars of the file 45 | while ($char === "\n" || $char === "\r") { 46 | fseek($f, $cursor--, SEEK_END); 47 | $char = fgetc($f); 48 | } 49 | 50 | // Read until the start of file or first newline char 51 | while ($char !== false && $char !== "\n" && $char !== "\r") { 52 | $line = $char . $line; 53 | fseek($f, $cursor--, SEEK_END); 54 | $char = fgetc($f); 55 | } 56 | 57 | fclose($f); 58 | 59 | return $line; 60 | } 61 | 62 | public function currentProcessingTime() 63 | { 64 | $ffmpeg_log_line = $this->getLastLogLine(); 65 | 66 | if ($ffmpeg_log_line && str_contains($ffmpeg_log_line, 'time=')) { 67 | // example: frame=55972 fps= 60 q=-1.0 Lsize= 932819kB time=00:37:18.82 bitrate=3413.2kbits/s speed=2.41x 68 | // cut the string to begin at time=00:00:00 69 | $string = substr($ffmpeg_log_line, strpos($ffmpeg_log_line, 'time=') + 5); 70 | 71 | // trim end of the string to end up with only the timestamp 72 | $string = substr($string, 0, strpos($string, ' ')); 73 | 74 | $time = Carbon::createFromTimeString($string); 75 | 76 | // calculate & return processing duration in seconds 77 | $total_seconds = 0; 78 | $total_seconds += $time->hour * 3600; 79 | $total_seconds += $time->minute * 60; 80 | $total_seconds += $time->second; 81 | 82 | return $total_seconds; 83 | } 84 | 85 | return null; 86 | } 87 | 88 | public function processingProgress() 89 | { 90 | if ($this->isDone()) { 91 | return 100; 92 | } 93 | 94 | $total_length = (int) $this->duration; 95 | $seconds_processed = (int) $this->currentProcessingTime(); 96 | 97 | if (!$seconds_processed || !$total_length) { 98 | return 0; 99 | } 100 | 101 | return round(($seconds_processed / $total_length) * 100, 2); 102 | } 103 | 104 | public function height(): ?int 105 | { 106 | return $this->height; 107 | } 108 | 109 | public function width(): ?int 110 | { 111 | return $this->width; 112 | } 113 | 114 | public function name(): string 115 | { 116 | return $this->name; 117 | } 118 | 119 | public function progress(): float 120 | { 121 | return $this->processingProgress(); 122 | } 123 | 124 | public function type(): string 125 | { 126 | return 'video'; 127 | } 128 | 129 | public function fileExists(): bool 130 | { 131 | $filepath = $this->path() . '/' . $this->name(); 132 | return $this->path() && file_exists($filepath); 133 | } 134 | 135 | public function removeFiles(): void 136 | { 137 | $filepath = $this->path() . '/' . $this->name(); 138 | if ($this->fileExists()) { 139 | unlink($filepath); 140 | } 141 | } 142 | } 143 | -------------------------------------------------------------------------------- /artisan: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env php 2 | make(Illuminate\Contracts\Console\Kernel::class); 34 | 35 | $status = $kernel->handle( 36 | $input = new Symfony\Component\Console\Input\ArgvInput, 37 | new Symfony\Component\Console\Output\ConsoleOutput 38 | ); 39 | 40 | /* 41 | |-------------------------------------------------------------------------- 42 | | Shutdown The Application 43 | |-------------------------------------------------------------------------- 44 | | 45 | | Once Artisan has finished running, we will fire off the shutdown events 46 | | so that any final work may be done by the application before we shut 47 | | down the process. This is the last thing to happen to the request. 48 | | 49 | */ 50 | 51 | $kernel->terminate($input, $status); 52 | 53 | exit($status); 54 | -------------------------------------------------------------------------------- /bootstrap/app.php: -------------------------------------------------------------------------------- 1 | singleton( 30 | Illuminate\Contracts\Http\Kernel::class, 31 | App\Http\Kernel::class 32 | ); 33 | 34 | $app->singleton( 35 | Illuminate\Contracts\Console\Kernel::class, 36 | App\Console\Kernel::class 37 | ); 38 | 39 | $app->singleton( 40 | Illuminate\Contracts\Debug\ExceptionHandler::class, 41 | App\Exceptions\Handler::class 42 | ); 43 | 44 | /* 45 | |-------------------------------------------------------------------------- 46 | | Return The Application 47 | |-------------------------------------------------------------------------- 48 | | 49 | | This script returns the application instance. The instance is given to 50 | | the calling script so we can separate the building of the instances 51 | | from the actual running of the application and sending responses. 52 | | 53 | */ 54 | 55 | return $app; 56 | -------------------------------------------------------------------------------- /bootstrap/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "laravel/laravel", 3 | "type": "project", 4 | "description": "The Laravel Framework.", 5 | "keywords": [ 6 | "framework", 7 | "laravel" 8 | ], 9 | "license": "MIT", 10 | "require": { 11 | "php": "^7.2.5|^8.0", 12 | "fideloper/proxy": "^4.4", 13 | "fruitcake/laravel-cors": "^2.0", 14 | "guzzlehttp/guzzle": "^6.3.1|^7.0.1", 15 | "laravel/framework": "^7.29", 16 | "laravel/tinker": "^2.5" 17 | }, 18 | "require-dev": { 19 | "facade/ignition": "^2.0", 20 | "fakerphp/faker": "^1.9.1", 21 | "laravel/dusk": "^6.15", 22 | "mockery/mockery": "^1.3.1", 23 | "nunomaduro/collision": "^4.3", 24 | "phpunit/phpunit": "^8.5.8|^9.3.3" 25 | }, 26 | "config": { 27 | "optimize-autoloader": true, 28 | "preferred-install": "dist", 29 | "sort-packages": true 30 | }, 31 | "extra": { 32 | "laravel": { 33 | "dont-discover": [] 34 | } 35 | }, 36 | "autoload": { 37 | "psr-4": { 38 | "App\\": "app/" 39 | }, 40 | "classmap": [ 41 | "database/seeds", 42 | "database/factories" 43 | ] 44 | }, 45 | "autoload-dev": { 46 | "psr-4": { 47 | "Tests\\": "tests/" 48 | } 49 | }, 50 | "minimum-stability": "dev", 51 | "prefer-stable": true, 52 | "scripts": { 53 | "post-autoload-dump": [ 54 | "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump", 55 | "@php artisan package:discover --ansi" 56 | ], 57 | "post-root-package-install": [ 58 | "@php -r \"file_exists('.env') || copy('.env.example', '.env');\"" 59 | ], 60 | "post-create-project-cmd": [ 61 | "@php artisan key:generate --ansi" 62 | ] 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /config/app.php: -------------------------------------------------------------------------------- 1 | env('APP_NAME', 'Laravel'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Application Environment 21 | |-------------------------------------------------------------------------- 22 | | 23 | | This value determines the "environment" your application is currently 24 | | running in. This may determine how you prefer to configure various 25 | | services the application utilizes. Set this in your ".env" file. 26 | | 27 | */ 28 | 29 | 'env' => env('APP_ENV', 'production'), 30 | 31 | /* 32 | |-------------------------------------------------------------------------- 33 | | Application Debug Mode 34 | |-------------------------------------------------------------------------- 35 | | 36 | | When your application is in debug mode, detailed error messages with 37 | | stack traces will be shown on every error that occurs within your 38 | | application. If disabled, a simple generic error page is shown. 39 | | 40 | */ 41 | 42 | 'debug' => (bool) env('APP_DEBUG', false), 43 | 44 | /* 45 | |-------------------------------------------------------------------------- 46 | | Application URL 47 | |-------------------------------------------------------------------------- 48 | | 49 | | This URL is used by the console to properly generate URLs when using 50 | | the Artisan command line tool. You should set this to the root of 51 | | your application so that it is used when running Artisan tasks. 52 | | 53 | */ 54 | 55 | 'url' => env('APP_URL', 'http://localhost'), 56 | 57 | 'asset_url' => env('ASSET_URL', null), 58 | 59 | /* 60 | |-------------------------------------------------------------------------- 61 | | Application Timezone 62 | |-------------------------------------------------------------------------- 63 | | 64 | | Here you may specify the default timezone for your application, which 65 | | will be used by the PHP date and date-time functions. We have gone 66 | | ahead and set this to a sensible default for you out of the box. 67 | | 68 | */ 69 | 70 | 'timezone' => 'UTC', 71 | 72 | /* 73 | |-------------------------------------------------------------------------- 74 | | Application Locale Configuration 75 | |-------------------------------------------------------------------------- 76 | | 77 | | The application locale determines the default locale that will be used 78 | | by the translation service provider. You are free to set this value 79 | | to any of the locales which will be supported by the application. 80 | | 81 | */ 82 | 83 | 'locale' => 'en', 84 | 85 | /* 86 | |-------------------------------------------------------------------------- 87 | | Application Fallback Locale 88 | |-------------------------------------------------------------------------- 89 | | 90 | | The fallback locale determines the locale to use when the current one 91 | | is not available. You may change the value to correspond to any of 92 | | the language folders that are provided through your application. 93 | | 94 | */ 95 | 96 | 'fallback_locale' => 'en', 97 | 98 | /* 99 | |-------------------------------------------------------------------------- 100 | | Faker Locale 101 | |-------------------------------------------------------------------------- 102 | | 103 | | This locale will be used by the Faker PHP library when generating fake 104 | | data for your database seeds. For example, this will be used to get 105 | | localized telephone numbers, street address information and more. 106 | | 107 | */ 108 | 109 | 'faker_locale' => 'en_US', 110 | 111 | /* 112 | |-------------------------------------------------------------------------- 113 | | Encryption Key 114 | |-------------------------------------------------------------------------- 115 | | 116 | | This key is used by the Illuminate encrypter service and should be set 117 | | to a random, 32 character string, otherwise these encrypted strings 118 | | will not be safe. Please do this before deploying an application! 119 | | 120 | */ 121 | 122 | 'key' => env('APP_KEY'), 123 | 124 | 'cipher' => 'AES-256-CBC', 125 | 126 | /* 127 | |-------------------------------------------------------------------------- 128 | | Autoloaded Service Providers 129 | |-------------------------------------------------------------------------- 130 | | 131 | | The service providers listed here will be automatically loaded on the 132 | | request to your application. Feel free to add your own services to 133 | | this array to grant expanded functionality to your applications. 134 | | 135 | */ 136 | 137 | 'providers' => [ 138 | 139 | /* 140 | * Laravel Framework Service Providers... 141 | */ 142 | Illuminate\Auth\AuthServiceProvider::class, 143 | Illuminate\Broadcasting\BroadcastServiceProvider::class, 144 | Illuminate\Bus\BusServiceProvider::class, 145 | Illuminate\Cache\CacheServiceProvider::class, 146 | Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class, 147 | Illuminate\Cookie\CookieServiceProvider::class, 148 | Illuminate\Database\DatabaseServiceProvider::class, 149 | Illuminate\Encryption\EncryptionServiceProvider::class, 150 | Illuminate\Filesystem\FilesystemServiceProvider::class, 151 | Illuminate\Foundation\Providers\FoundationServiceProvider::class, 152 | Illuminate\Hashing\HashServiceProvider::class, 153 | Illuminate\Mail\MailServiceProvider::class, 154 | Illuminate\Notifications\NotificationServiceProvider::class, 155 | Illuminate\Pagination\PaginationServiceProvider::class, 156 | Illuminate\Pipeline\PipelineServiceProvider::class, 157 | Illuminate\Queue\QueueServiceProvider::class, 158 | Illuminate\Redis\RedisServiceProvider::class, 159 | Illuminate\Auth\Passwords\PasswordResetServiceProvider::class, 160 | Illuminate\Session\SessionServiceProvider::class, 161 | Illuminate\Translation\TranslationServiceProvider::class, 162 | Illuminate\Validation\ValidationServiceProvider::class, 163 | Illuminate\View\ViewServiceProvider::class, 164 | 165 | /* 166 | * Package Service Providers... 167 | */ 168 | 169 | /* 170 | * Application Service Providers... 171 | */ 172 | App\Providers\AppServiceProvider::class, 173 | App\Providers\AuthServiceProvider::class, 174 | App\Providers\BroadcastServiceProvider::class, 175 | App\Providers\EventServiceProvider::class, 176 | App\Providers\RouteServiceProvider::class, 177 | 178 | ], 179 | 180 | /* 181 | |-------------------------------------------------------------------------- 182 | | Class Aliases 183 | |-------------------------------------------------------------------------- 184 | | 185 | | This array of class aliases will be registered when this application 186 | | is started. However, feel free to register as many as you wish as 187 | | the aliases are "lazy" loaded so they don't hinder performance. 188 | | 189 | */ 190 | 191 | 'aliases' => [ 192 | 193 | 'App' => Illuminate\Support\Facades\App::class, 194 | 'Arr' => Illuminate\Support\Arr::class, 195 | 'Artisan' => Illuminate\Support\Facades\Artisan::class, 196 | 'Auth' => Illuminate\Support\Facades\Auth::class, 197 | 'Blade' => Illuminate\Support\Facades\Blade::class, 198 | 'Broadcast' => Illuminate\Support\Facades\Broadcast::class, 199 | 'Bus' => Illuminate\Support\Facades\Bus::class, 200 | 'Cache' => Illuminate\Support\Facades\Cache::class, 201 | 'Config' => Illuminate\Support\Facades\Config::class, 202 | 'Cookie' => Illuminate\Support\Facades\Cookie::class, 203 | 'Crypt' => Illuminate\Support\Facades\Crypt::class, 204 | 'DB' => Illuminate\Support\Facades\DB::class, 205 | 'Eloquent' => Illuminate\Database\Eloquent\Model::class, 206 | 'Event' => Illuminate\Support\Facades\Event::class, 207 | 'File' => Illuminate\Support\Facades\File::class, 208 | 'Gate' => Illuminate\Support\Facades\Gate::class, 209 | 'Hash' => Illuminate\Support\Facades\Hash::class, 210 | 'Http' => Illuminate\Support\Facades\Http::class, 211 | 'Lang' => Illuminate\Support\Facades\Lang::class, 212 | 'Log' => Illuminate\Support\Facades\Log::class, 213 | 'Mail' => Illuminate\Support\Facades\Mail::class, 214 | 'Notification' => Illuminate\Support\Facades\Notification::class, 215 | 'Password' => Illuminate\Support\Facades\Password::class, 216 | 'Queue' => Illuminate\Support\Facades\Queue::class, 217 | 'Redirect' => Illuminate\Support\Facades\Redirect::class, 218 | 'Redis' => Illuminate\Support\Facades\Redis::class, 219 | 'Request' => Illuminate\Support\Facades\Request::class, 220 | 'Response' => Illuminate\Support\Facades\Response::class, 221 | 'Route' => Illuminate\Support\Facades\Route::class, 222 | 'Schema' => Illuminate\Support\Facades\Schema::class, 223 | 'Session' => Illuminate\Support\Facades\Session::class, 224 | 'Storage' => Illuminate\Support\Facades\Storage::class, 225 | 'Str' => Illuminate\Support\Str::class, 226 | 'URL' => Illuminate\Support\Facades\URL::class, 227 | 'Validator' => Illuminate\Support\Facades\Validator::class, 228 | 'View' => Illuminate\Support\Facades\View::class, 229 | 230 | ], 231 | 232 | ]; 233 | -------------------------------------------------------------------------------- /config/auth.php: -------------------------------------------------------------------------------- 1 | [ 17 | 'guard' => 'web', 18 | 'passwords' => 'users', 19 | ], 20 | 21 | /* 22 | |-------------------------------------------------------------------------- 23 | | Authentication Guards 24 | |-------------------------------------------------------------------------- 25 | | 26 | | Next, you may define every authentication guard for your application. 27 | | Of course, a great default configuration has been defined for you 28 | | here which uses session storage and the Eloquent user provider. 29 | | 30 | | All authentication drivers have a user provider. This defines how the 31 | | users are actually retrieved out of your database or other storage 32 | | mechanisms used by this application to persist your user's data. 33 | | 34 | | Supported: "session", "token" 35 | | 36 | */ 37 | 38 | 'guards' => [ 39 | 'web' => [ 40 | 'driver' => 'session', 41 | 'provider' => 'users', 42 | ], 43 | 44 | 'api' => [ 45 | 'driver' => 'token', 46 | 'provider' => 'users', 47 | 'hash' => false, 48 | ], 49 | ], 50 | 51 | /* 52 | |-------------------------------------------------------------------------- 53 | | User Providers 54 | |-------------------------------------------------------------------------- 55 | | 56 | | All authentication drivers have a user provider. This defines how the 57 | | users are actually retrieved out of your database or other storage 58 | | mechanisms used by this application to persist your user's data. 59 | | 60 | | If you have multiple user tables or models you may configure multiple 61 | | sources which represent each model / table. These sources may then 62 | | be assigned to any extra authentication guards you have defined. 63 | | 64 | | Supported: "database", "eloquent" 65 | | 66 | */ 67 | 68 | 'providers' => [ 69 | 'users' => [ 70 | 'driver' => 'eloquent', 71 | 'model' => App\User::class, 72 | ], 73 | 74 | // 'users' => [ 75 | // 'driver' => 'database', 76 | // 'table' => 'users', 77 | // ], 78 | ], 79 | 80 | /* 81 | |-------------------------------------------------------------------------- 82 | | Resetting Passwords 83 | |-------------------------------------------------------------------------- 84 | | 85 | | You may specify multiple password reset configurations if you have more 86 | | than one user table or model in the application and you want to have 87 | | separate password reset settings based on the specific user types. 88 | | 89 | | The expire time is the number of minutes that the reset token should be 90 | | considered valid. This security feature keeps tokens short-lived so 91 | | they have less time to be guessed. You may change this as needed. 92 | | 93 | */ 94 | 95 | 'passwords' => [ 96 | 'users' => [ 97 | 'provider' => 'users', 98 | 'table' => 'password_resets', 99 | 'expire' => 60, 100 | 'throttle' => 60, 101 | ], 102 | ], 103 | 104 | /* 105 | |-------------------------------------------------------------------------- 106 | | Password Confirmation Timeout 107 | |-------------------------------------------------------------------------- 108 | | 109 | | Here you may define the amount of seconds before a password confirmation 110 | | times out and the user is prompted to re-enter their password via the 111 | | confirmation screen. By default, the timeout lasts for three hours. 112 | | 113 | */ 114 | 115 | 'password_timeout' => 10800, 116 | 117 | ]; 118 | -------------------------------------------------------------------------------- /config/broadcasting.php: -------------------------------------------------------------------------------- 1 | env('BROADCAST_DRIVER', 'null'), 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Broadcast Connections 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may define all of the broadcast connections that will be used 26 | | to broadcast events to other systems or over websockets. Samples of 27 | | each available type of connection are provided inside this array. 28 | | 29 | */ 30 | 31 | 'connections' => [ 32 | 33 | 'pusher' => [ 34 | 'driver' => 'pusher', 35 | 'key' => env('PUSHER_APP_KEY'), 36 | 'secret' => env('PUSHER_APP_SECRET'), 37 | 'app_id' => env('PUSHER_APP_ID'), 38 | 'options' => [ 39 | 'cluster' => env('PUSHER_APP_CLUSTER'), 40 | 'useTLS' => true, 41 | ], 42 | ], 43 | 44 | 'redis' => [ 45 | 'driver' => 'redis', 46 | 'connection' => 'default', 47 | ], 48 | 49 | 'log' => [ 50 | 'driver' => 'log', 51 | ], 52 | 53 | 'null' => [ 54 | 'driver' => 'null', 55 | ], 56 | 57 | ], 58 | 59 | ]; 60 | -------------------------------------------------------------------------------- /config/cache.php: -------------------------------------------------------------------------------- 1 | env('CACHE_DRIVER', 'file'), 22 | 23 | /* 24 | |-------------------------------------------------------------------------- 25 | | Cache Stores 26 | |-------------------------------------------------------------------------- 27 | | 28 | | Here you may define all of the cache "stores" for your application as 29 | | well as their drivers. You may even define multiple stores for the 30 | | same cache driver to group types of items stored in your caches. 31 | | 32 | */ 33 | 34 | 'stores' => [ 35 | 36 | 'apc' => [ 37 | 'driver' => 'apc', 38 | ], 39 | 40 | 'array' => [ 41 | 'driver' => 'array', 42 | 'serialize' => false, 43 | ], 44 | 45 | 'database' => [ 46 | 'driver' => 'database', 47 | 'table' => 'cache', 48 | 'connection' => null, 49 | ], 50 | 51 | 'file' => [ 52 | 'driver' => 'file', 53 | 'path' => storage_path('framework/cache/data'), 54 | ], 55 | 56 | 'memcached' => [ 57 | 'driver' => 'memcached', 58 | 'persistent_id' => env('MEMCACHED_PERSISTENT_ID'), 59 | 'sasl' => [ 60 | env('MEMCACHED_USERNAME'), 61 | env('MEMCACHED_PASSWORD'), 62 | ], 63 | 'options' => [ 64 | // Memcached::OPT_CONNECT_TIMEOUT => 2000, 65 | ], 66 | 'servers' => [ 67 | [ 68 | 'host' => env('MEMCACHED_HOST', '127.0.0.1'), 69 | 'port' => env('MEMCACHED_PORT', 11211), 70 | 'weight' => 100, 71 | ], 72 | ], 73 | ], 74 | 75 | 'redis' => [ 76 | 'driver' => 'redis', 77 | 'connection' => 'cache', 78 | ], 79 | 80 | 'dynamodb' => [ 81 | 'driver' => 'dynamodb', 82 | 'key' => env('AWS_ACCESS_KEY_ID'), 83 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 84 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), 85 | 'table' => env('DYNAMODB_CACHE_TABLE', 'cache'), 86 | 'endpoint' => env('DYNAMODB_ENDPOINT'), 87 | ], 88 | 89 | ], 90 | 91 | /* 92 | |-------------------------------------------------------------------------- 93 | | Cache Key Prefix 94 | |-------------------------------------------------------------------------- 95 | | 96 | | When utilizing a RAM based store such as APC or Memcached, there might 97 | | be other applications utilizing the same cache. So, we'll specify a 98 | | value to get prefixed to all our keys so we can avoid collisions. 99 | | 100 | */ 101 | 102 | 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache'), 103 | 104 | ]; 105 | -------------------------------------------------------------------------------- /config/cors.php: -------------------------------------------------------------------------------- 1 | ['api/*'], 19 | 20 | 'allowed_methods' => ['*'], 21 | 22 | 'allowed_origins' => ['*'], 23 | 24 | 'allowed_origins_patterns' => [], 25 | 26 | 'allowed_headers' => ['*'], 27 | 28 | 'exposed_headers' => [], 29 | 30 | 'max_age' => 0, 31 | 32 | 'supports_credentials' => false, 33 | 34 | ]; 35 | -------------------------------------------------------------------------------- /config/database.php: -------------------------------------------------------------------------------- 1 | env('DB_CONNECTION', 'mysql'), 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Database Connections 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here are each of the database connections setup for your application. 26 | | Of course, examples of configuring each database platform that is 27 | | supported by Laravel is shown below to make development simple. 28 | | 29 | | 30 | | All database work in Laravel is done through the PHP PDO facilities 31 | | so make sure you have the driver for your particular database of 32 | | choice installed on your machine before you begin development. 33 | | 34 | */ 35 | 36 | 'connections' => [ 37 | 38 | 'sqlite' => [ 39 | 'driver' => 'sqlite', 40 | 'url' => env('DATABASE_URL'), 41 | 'database' => env('DB_DATABASE', database_path('database.sqlite')), 42 | 'prefix' => '', 43 | 'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true), 44 | ], 45 | 46 | 'mysql' => [ 47 | 'driver' => 'mysql', 48 | 'url' => env('DATABASE_URL'), 49 | 'host' => env('DB_HOST', '127.0.0.1'), 50 | 'port' => env('DB_PORT', '3306'), 51 | 'database' => env('DB_DATABASE', 'forge'), 52 | 'username' => env('DB_USERNAME', 'forge'), 53 | 'password' => env('DB_PASSWORD', ''), 54 | 'unix_socket' => env('DB_SOCKET', ''), 55 | 'charset' => 'utf8mb4', 56 | 'collation' => 'utf8mb4_unicode_ci', 57 | 'prefix' => '', 58 | 'prefix_indexes' => true, 59 | 'strict' => true, 60 | 'engine' => null, 61 | 'options' => extension_loaded('pdo_mysql') ? array_filter([ 62 | PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'), 63 | ]) : [], 64 | ], 65 | 66 | 'pgsql' => [ 67 | 'driver' => 'pgsql', 68 | 'url' => env('DATABASE_URL'), 69 | 'host' => env('DB_HOST', '127.0.0.1'), 70 | 'port' => env('DB_PORT', '5432'), 71 | 'database' => env('DB_DATABASE', 'forge'), 72 | 'username' => env('DB_USERNAME', 'forge'), 73 | 'password' => env('DB_PASSWORD', ''), 74 | 'charset' => 'utf8', 75 | 'prefix' => '', 76 | 'prefix_indexes' => true, 77 | 'schema' => 'public', 78 | 'sslmode' => 'prefer', 79 | ], 80 | 81 | 'sqlsrv' => [ 82 | 'driver' => 'sqlsrv', 83 | 'url' => env('DATABASE_URL'), 84 | 'host' => env('DB_HOST', 'localhost'), 85 | 'port' => env('DB_PORT', '1433'), 86 | 'database' => env('DB_DATABASE', 'forge'), 87 | 'username' => env('DB_USERNAME', 'forge'), 88 | 'password' => env('DB_PASSWORD', ''), 89 | 'charset' => 'utf8', 90 | 'prefix' => '', 91 | 'prefix_indexes' => true, 92 | ], 93 | 94 | ], 95 | 96 | /* 97 | |-------------------------------------------------------------------------- 98 | | Migration Repository Table 99 | |-------------------------------------------------------------------------- 100 | | 101 | | This table keeps track of all the migrations that have already run for 102 | | your application. Using this information, we can determine which of 103 | | the migrations on disk haven't actually been run in the database. 104 | | 105 | */ 106 | 107 | 'migrations' => 'migrations', 108 | 109 | /* 110 | |-------------------------------------------------------------------------- 111 | | Redis Databases 112 | |-------------------------------------------------------------------------- 113 | | 114 | | Redis is an open source, fast, and advanced key-value store that also 115 | | provides a richer body of commands than a typical key-value system 116 | | such as APC or Memcached. Laravel makes it easy to dig right in. 117 | | 118 | */ 119 | 120 | 'redis' => [ 121 | 122 | 'client' => env('REDIS_CLIENT', 'phpredis'), 123 | 124 | 'options' => [ 125 | 'cluster' => env('REDIS_CLUSTER', 'redis'), 126 | 'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'), 127 | ], 128 | 129 | 'default' => [ 130 | 'url' => env('REDIS_URL'), 131 | 'host' => env('REDIS_HOST', '127.0.0.1'), 132 | 'password' => env('REDIS_PASSWORD', null), 133 | 'port' => env('REDIS_PORT', '6379'), 134 | 'database' => env('REDIS_DB', '0'), 135 | ], 136 | 137 | 'cache' => [ 138 | 'url' => env('REDIS_URL'), 139 | 'host' => env('REDIS_HOST', '127.0.0.1'), 140 | 'password' => env('REDIS_PASSWORD', null), 141 | 'port' => env('REDIS_PORT', '6379'), 142 | 'database' => env('REDIS_CACHE_DB', '1'), 143 | ], 144 | 145 | ], 146 | 147 | ]; 148 | -------------------------------------------------------------------------------- /config/filesystems.php: -------------------------------------------------------------------------------- 1 | env('FILESYSTEM_DRIVER', 'local'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Default Cloud Filesystem Disk 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Many applications store files both locally and in the cloud. For this 24 | | reason, you may specify a default "cloud" driver here. This driver 25 | | will be bound as the Cloud disk implementation in the container. 26 | | 27 | */ 28 | 29 | 'cloud' => env('FILESYSTEM_CLOUD', 's3'), 30 | 31 | /* 32 | |-------------------------------------------------------------------------- 33 | | Filesystem Disks 34 | |-------------------------------------------------------------------------- 35 | | 36 | | Here you may configure as many filesystem "disks" as you wish, and you 37 | | may even configure multiple disks of the same driver. Defaults have 38 | | been setup for each driver as an example of the required options. 39 | | 40 | | Supported Drivers: "local", "ftp", "sftp", "s3" 41 | | 42 | */ 43 | 44 | 'disks' => [ 45 | 46 | 'local' => [ 47 | 'driver' => 'local', 48 | 'root' => storage_path('app'), 49 | ], 50 | 51 | 'public' => [ 52 | 'driver' => 'local', 53 | 'root' => storage_path('app/public'), 54 | 'url' => env('APP_URL').'/storage', 55 | 'visibility' => 'public', 56 | ], 57 | 58 | 's3' => [ 59 | 'driver' => 's3', 60 | 'key' => env('AWS_ACCESS_KEY_ID'), 61 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 62 | 'region' => env('AWS_DEFAULT_REGION'), 63 | 'bucket' => env('AWS_BUCKET'), 64 | 'url' => env('AWS_URL'), 65 | 'endpoint' => env('AWS_ENDPOINT'), 66 | ], 67 | 68 | ], 69 | 70 | /* 71 | |-------------------------------------------------------------------------- 72 | | Symbolic Links 73 | |-------------------------------------------------------------------------- 74 | | 75 | | Here you may configure the symbolic links that will be created when the 76 | | `storage:link` Artisan command is executed. The array keys should be 77 | | the locations of the links and the values should be their targets. 78 | | 79 | */ 80 | 81 | 'links' => [ 82 | public_path('storage') => storage_path('app/public'), 83 | ], 84 | 85 | ]; 86 | -------------------------------------------------------------------------------- /config/hashing.php: -------------------------------------------------------------------------------- 1 | 'bcrypt', 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Bcrypt Options 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may specify the configuration options that should be used when 26 | | passwords are hashed using the Bcrypt algorithm. This will allow you 27 | | to control the amount of time it takes to hash the given password. 28 | | 29 | */ 30 | 31 | 'bcrypt' => [ 32 | 'rounds' => env('BCRYPT_ROUNDS', 10), 33 | ], 34 | 35 | /* 36 | |-------------------------------------------------------------------------- 37 | | Argon Options 38 | |-------------------------------------------------------------------------- 39 | | 40 | | Here you may specify the configuration options that should be used when 41 | | passwords are hashed using the Argon algorithm. These will allow you 42 | | to control the amount of time it takes to hash the given password. 43 | | 44 | */ 45 | 46 | 'argon' => [ 47 | 'memory' => 1024, 48 | 'threads' => 2, 49 | 'time' => 2, 50 | ], 51 | 52 | ]; 53 | -------------------------------------------------------------------------------- /config/logging.php: -------------------------------------------------------------------------------- 1 | env('LOG_CHANNEL', 'stack'), 21 | 22 | /* 23 | |-------------------------------------------------------------------------- 24 | | Log Channels 25 | |-------------------------------------------------------------------------- 26 | | 27 | | Here you may configure the log channels for your application. Out of 28 | | the box, Laravel uses the Monolog PHP logging library. This gives 29 | | you a variety of powerful log handlers / formatters to utilize. 30 | | 31 | | Available Drivers: "single", "daily", "slack", "syslog", 32 | | "errorlog", "monolog", 33 | | "custom", "stack" 34 | | 35 | */ 36 | 37 | 'channels' => [ 38 | 'stack' => [ 39 | 'driver' => 'stack', 40 | 'channels' => ['single'], 41 | 'ignore_exceptions' => false, 42 | ], 43 | 44 | 'single' => [ 45 | 'driver' => 'single', 46 | 'path' => storage_path('logs/laravel.log'), 47 | 'level' => 'debug', 48 | ], 49 | 50 | 'daily' => [ 51 | 'driver' => 'daily', 52 | 'path' => storage_path('logs/laravel.log'), 53 | 'level' => 'debug', 54 | 'days' => 14, 55 | ], 56 | 57 | 'slack' => [ 58 | 'driver' => 'slack', 59 | 'url' => env('LOG_SLACK_WEBHOOK_URL'), 60 | 'username' => 'Laravel Log', 61 | 'emoji' => ':boom:', 62 | 'level' => 'critical', 63 | ], 64 | 65 | 'papertrail' => [ 66 | 'driver' => 'monolog', 67 | 'level' => 'debug', 68 | 'handler' => SyslogUdpHandler::class, 69 | 'handler_with' => [ 70 | 'host' => env('PAPERTRAIL_URL'), 71 | 'port' => env('PAPERTRAIL_PORT'), 72 | ], 73 | ], 74 | 75 | 'stderr' => [ 76 | 'driver' => 'monolog', 77 | 'handler' => StreamHandler::class, 78 | 'formatter' => env('LOG_STDERR_FORMATTER'), 79 | 'with' => [ 80 | 'stream' => 'php://stderr', 81 | ], 82 | ], 83 | 84 | 'syslog' => [ 85 | 'driver' => 'syslog', 86 | 'level' => 'debug', 87 | ], 88 | 89 | 'errorlog' => [ 90 | 'driver' => 'errorlog', 91 | 'level' => 'debug', 92 | ], 93 | 94 | 'null' => [ 95 | 'driver' => 'monolog', 96 | 'handler' => NullHandler::class, 97 | ], 98 | 99 | 'emergency' => [ 100 | 'path' => storage_path('logs/laravel.log'), 101 | ], 102 | ], 103 | 104 | ]; 105 | -------------------------------------------------------------------------------- /config/mail.php: -------------------------------------------------------------------------------- 1 | env('MAIL_MAILER', 'smtp'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Mailer Configurations 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Here you may configure all of the mailers used by your application plus 24 | | their respective settings. Several examples have been configured for 25 | | you and you are free to add your own as your application requires. 26 | | 27 | | Laravel supports a variety of mail "transport" drivers to be used while 28 | | sending an e-mail. You will specify which one you are using for your 29 | | mailers below. You are free to add additional mailers as required. 30 | | 31 | | Supported: "smtp", "sendmail", "mailgun", "ses", 32 | | "postmark", "log", "array" 33 | | 34 | */ 35 | 36 | 'mailers' => [ 37 | 'smtp' => [ 38 | 'transport' => 'smtp', 39 | 'host' => env('MAIL_HOST', 'smtp.mailgun.org'), 40 | 'port' => env('MAIL_PORT', 587), 41 | 'encryption' => env('MAIL_ENCRYPTION', 'tls'), 42 | 'username' => env('MAIL_USERNAME'), 43 | 'password' => env('MAIL_PASSWORD'), 44 | 'timeout' => null, 45 | 'auth_mode' => null, 46 | ], 47 | 48 | 'ses' => [ 49 | 'transport' => 'ses', 50 | ], 51 | 52 | 'mailgun' => [ 53 | 'transport' => 'mailgun', 54 | ], 55 | 56 | 'postmark' => [ 57 | 'transport' => 'postmark', 58 | ], 59 | 60 | 'sendmail' => [ 61 | 'transport' => 'sendmail', 62 | 'path' => '/usr/sbin/sendmail -bs', 63 | ], 64 | 65 | 'log' => [ 66 | 'transport' => 'log', 67 | 'channel' => env('MAIL_LOG_CHANNEL'), 68 | ], 69 | 70 | 'array' => [ 71 | 'transport' => 'array', 72 | ], 73 | ], 74 | 75 | /* 76 | |-------------------------------------------------------------------------- 77 | | Global "From" Address 78 | |-------------------------------------------------------------------------- 79 | | 80 | | You may wish for all e-mails sent by your application to be sent from 81 | | the same address. Here, you may specify a name and address that is 82 | | used globally for all e-mails that are sent by your application. 83 | | 84 | */ 85 | 86 | 'from' => [ 87 | 'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'), 88 | 'name' => env('MAIL_FROM_NAME', 'Example'), 89 | ], 90 | 91 | /* 92 | |-------------------------------------------------------------------------- 93 | | Markdown Mail Settings 94 | |-------------------------------------------------------------------------- 95 | | 96 | | If you are using Markdown based email rendering, you may configure your 97 | | theme and component paths here, allowing you to customize the design 98 | | of the emails. Or, you may simply stick with the Laravel defaults! 99 | | 100 | */ 101 | 102 | 'markdown' => [ 103 | 'theme' => 'default', 104 | 105 | 'paths' => [ 106 | resource_path('views/vendor/mail'), 107 | ], 108 | ], 109 | 110 | ]; 111 | -------------------------------------------------------------------------------- /config/queue.php: -------------------------------------------------------------------------------- 1 | env('QUEUE_CONNECTION', 'sync'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Queue Connections 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Here you may configure the connection information for each server that 24 | | is used by your application. A default configuration has been added 25 | | for each back-end shipped with Laravel. You are free to add more. 26 | | 27 | | Drivers: "sync", "database", "beanstalkd", "sqs", "redis", "null" 28 | | 29 | */ 30 | 31 | 'connections' => [ 32 | 33 | 'sync' => [ 34 | 'driver' => 'sync', 35 | ], 36 | 37 | 'database' => [ 38 | 'driver' => 'database', 39 | 'table' => 'jobs', 40 | 'queue' => 'default', 41 | // allow 2 hours for long video processing 42 | 'retry_after' => 60 * 60 * 2, 43 | ], 44 | 45 | 'beanstalkd' => [ 46 | 'driver' => 'beanstalkd', 47 | 'host' => 'localhost', 48 | 'queue' => 'default', 49 | 'retry_after' => 90, 50 | 'block_for' => 0, 51 | ], 52 | 53 | 'sqs' => [ 54 | 'driver' => 'sqs', 55 | 'key' => env('AWS_ACCESS_KEY_ID'), 56 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 57 | 'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'), 58 | 'queue' => env('SQS_QUEUE', 'your-queue-name'), 59 | 'suffix' => env('SQS_SUFFIX'), 60 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), 61 | ], 62 | 63 | 'redis' => [ 64 | 'driver' => 'redis', 65 | 'connection' => 'default', 66 | 'queue' => env('REDIS_QUEUE', 'default'), 67 | 'retry_after' => 90, 68 | 'block_for' => null, 69 | ], 70 | 71 | ], 72 | 73 | /* 74 | |-------------------------------------------------------------------------- 75 | | Failed Queue Jobs 76 | |-------------------------------------------------------------------------- 77 | | 78 | | These options configure the behavior of failed queue job logging so you 79 | | can control which database and table are used to store the jobs that 80 | | have failed. You may change them to any database / table you wish. 81 | | 82 | */ 83 | 84 | 'failed' => [ 85 | 'driver' => env('QUEUE_FAILED_DRIVER', 'database'), 86 | 'database' => env('DB_CONNECTION', 'mysql'), 87 | 'table' => 'failed_jobs', 88 | ], 89 | 90 | ]; 91 | -------------------------------------------------------------------------------- /config/scrapers.php: -------------------------------------------------------------------------------- 1 | [ 15 | 'output_path' => env('FFMPEG_OUTPUT_PATH'), 16 | 'log_path' => env('FFMPEG_LOG_PATH'), 17 | ], 18 | 19 | /* 20 | |-------------------------------------------------------------------------- 21 | | Photo Galleries 22 | |-------------------------------------------------------------------------- 23 | | 24 | | Determines where scraped photo galleries and scraping logs are stored. Ensure these 25 | | are full system paths that already exist and have correct permissions. 26 | | 27 | */ 28 | 'photo_gallery' => [ 29 | 'output_path' => env('PHOTO_OUTPUT_PATH'), 30 | 'log_path' => env('PHOTO_LOG_PATH'), 31 | ], 32 | 33 | /* 34 | |-------------------------------------------------------------------------- 35 | | Drivers 36 | |-------------------------------------------------------------------------- 37 | | 38 | | Configurations for the various scrapers that are supported. Each driver 39 | | will contain some metadata, optional authentication credentials, and a 40 | | mapping to the Laravel Dusk class handling the scraping. 41 | | 42 | */ 43 | 44 | 'drivers' => [ 45 | 'porntrex' => [ 46 | 'display_name' => 'PornTrex', 47 | 'base_url' => 'porntrex.com', 48 | 'logo_filename' => 'porntrex.png', 49 | 'scraper' => \App\Scrapers\PorntrexScraper::class, 50 | 'auth' => [ 51 | 'username' => env('PORNTREX_USERNAME', null), // optional 52 | 'password' => env('PORNTREX_PASSWORD', null), // optional 53 | 'login_url' => env('PORNTREX_LOGIN_URL', null), // optional 54 | ] 55 | ], 56 | 57 | 'fullporner' => [ 58 | 'display_name' => 'FullPorner', 59 | 'base_url' => 'fullporner.com', 60 | 'logo_filename' => 'fullporner.png', 61 | 'scraper' => \App\Scrapers\FullPornerScraper::class, 62 | ], 63 | 64 | 'hqporner' => [ 65 | 'display_name' => 'HQ Porner', 66 | 'base_url' => 'hqporner.com', 67 | 'logo_filename' => 'hqporner.png', 68 | 'scraper' => \App\Scrapers\HQPornerScraper::class, 69 | 'auth' => [ 70 | 'username' => env('HQPORNER_USERNAME', null), // optional 71 | 'password' => env('HQPORNER_PASSWORD', null), // optional 72 | 'login_url' => env('HQPORNER_LOGIN_URL', null), // optional 73 | ] 74 | ], 75 | 76 | 'pornhub' => [ 77 | 'display_name' => 'PornHub', 78 | 'base_url' => 'pornhub.com', 79 | 'logo_filename' => 'pornhub.png', 80 | 'scraper' => \App\Scrapers\PornHubScraper::class, 81 | 'auth' => [ 82 | 'username' => env('PORNHUB_USERNAME', null), // optional 83 | 'password' => env('PORNHUB_PASSWORD', null), // optional 84 | 'login_url' => env('PORNHUB_LOGIN_URL', null), // optional 85 | ] 86 | ], 87 | 88 | 'pornpics' => [ 89 | 'display_name' => 'PornPics', 90 | 'base_url' => 'pornpics.com', 91 | 'logo_filename' => 'pornpics.png', 92 | 'scraper' => \App\Scrapers\PornPicsScraper::class, 93 | 'auth' => [ 94 | 'username' => env('PORNPICS_USERNAME', null), // optional 95 | 'password' => env('PORNPICS_PASSWORD', null), // optional 96 | 'login_url' => env('PORNPICS_LOGIN_URL', null), // optional 97 | ] 98 | ], 99 | 100 | 'pichunter' => [ 101 | 'display_name' => 'Pic Hunter', 102 | 'base_url' => 'pichunter.com', 103 | 'logo_filename' => 'pichunter.png', 104 | 'scraper' => \App\Scrapers\PicHunterScraper::class, 105 | 'auth' => [ 106 | 'username' => env('PICHUNTER_USERNAME', null), // optional 107 | 'password' => env('PICHUNTER_PASSWORD', null), // optional 108 | 'login_url' => env('PICHUNTER_LOGIN_URL', null), // optional 109 | ] 110 | ], 111 | 112 | 'whoreshub' => [ 113 | 'display_name' => 'WhoresHub', 114 | 'base_url' => 'whoreshub.com', 115 | 'logo_filename' => 'whoreshub.png', 116 | 'scraper' => \App\Scrapers\WhoresHubScraper::class, 117 | 'auth' => [ 118 | 'username' => env('WHORESHUB_USERNAME', null), // optional 119 | 'password' => env('WHORESHUB_PASSWORD', null), // optional 120 | 'login_url' => env('WHORESHUB_LOGIN_URL', null), // optional 121 | ] 122 | ], 123 | 124 | 'youjizz' => [ 125 | 'display_name' => 'YouJizz', 126 | 'base_url' => 'youjizz.com', 127 | 'logo_filename' => 'youjizz.png', 128 | 'scraper' => \App\Scrapers\YouJizzScraper::class, 129 | 'auth' => [ 130 | 'username' => env('WHORESHUB_USERNAME', null), // optional 131 | 'password' => env('WHORESHUB_PASSWORD', null), // optional 132 | 'login_url' => env('WHORESHUB_LOGIN_URL', null), // optional 133 | ] 134 | ], 135 | 136 | 'goodporn' => [ 137 | 'display_name' => 'GoodPorn', 138 | 'base_url' => 'goodporn.to', 139 | 'logo_filename' => 'goodporn.png', 140 | 'scraper' => \App\Scrapers\GoodPornScraper::class, 141 | 'auth' => [ 142 | 'username' => env('GOODPORN_USERNAME', null), // optional 143 | 'password' => env('GOODPORN_PASSWORD', null), // optional 144 | 'login_url' => env('GOODPORN_LOGIN_URL', null), // optional 145 | ] 146 | ], 147 | 148 | /* 149 | |-------------------------------------------------------------------------- 150 | | Deprecated Drivers 151 | |-------------------------------------------------------------------------- 152 | | 153 | | The following driver configs are for sites that appear to have been shut down. These 154 | | were all working prior to shutdowns and the underlying scrapers have not been removed. 155 | | These configs will be stashed here to remove them from the UI but allow 156 | | quick activation if the sties come back online. 157 | | 158 | */ 159 | // 'pornktube' => [ 160 | // 'display_name' => 'PornKTube', 161 | // 'base_url' => 'pornktube.tv', 162 | // 'logo_filename' => 'pornktube.png', 163 | // 'scraper' => \App\Scrapers\PornKTubeScraper::class, 164 | // 'auth' => [ 165 | // 'username' => env('PORNKTUBE_USERNAME', null), // optional 166 | // 'password' => env('PORNKTUBE_PASSWORD', null), // optional 167 | // 'login_url' => env('PORNKTUBE_LOGIN_URL', null), // optional 168 | // ] 169 | // ], 170 | 171 | // 'pornwild' => [ 172 | // 'display_name' => 'PornWild', 173 | // 'base_url' => 'pornwild.com', 174 | // 'logo_filename' => 'pornwild.png', 175 | // 'scraper' => \App\Scrapers\PornwildScraper::class, 176 | // 'auth' => [ 177 | // 'username' => env('PORNWILD_USERNAME', null), // optional 178 | // 'password' => env('PORNWILD_PASSWORD', null), // optional 179 | // 'login_url' => env('PORNWILD_LOGIN_URL', null), // optional 180 | // ] 181 | // ], 182 | ] 183 | ]; 184 | -------------------------------------------------------------------------------- /config/services.php: -------------------------------------------------------------------------------- 1 | [ 18 | 'domain' => env('MAILGUN_DOMAIN'), 19 | 'secret' => env('MAILGUN_SECRET'), 20 | 'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'), 21 | ], 22 | 23 | 'postmark' => [ 24 | 'token' => env('POSTMARK_TOKEN'), 25 | ], 26 | 27 | 'ses' => [ 28 | 'key' => env('AWS_ACCESS_KEY_ID'), 29 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 30 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), 31 | ], 32 | 33 | ]; 34 | -------------------------------------------------------------------------------- /config/session.php: -------------------------------------------------------------------------------- 1 | env('SESSION_DRIVER', 'file'), 22 | 23 | /* 24 | |-------------------------------------------------------------------------- 25 | | Session Lifetime 26 | |-------------------------------------------------------------------------- 27 | | 28 | | Here you may specify the number of minutes that you wish the session 29 | | to be allowed to remain idle before it expires. If you want them 30 | | to immediately expire on the browser closing, set that option. 31 | | 32 | */ 33 | 34 | 'lifetime' => env('SESSION_LIFETIME', 120), 35 | 36 | 'expire_on_close' => false, 37 | 38 | /* 39 | |-------------------------------------------------------------------------- 40 | | Session Encryption 41 | |-------------------------------------------------------------------------- 42 | | 43 | | This option allows you to easily specify that all of your session data 44 | | should be encrypted before it is stored. All encryption will be run 45 | | automatically by Laravel and you can use the Session like normal. 46 | | 47 | */ 48 | 49 | 'encrypt' => false, 50 | 51 | /* 52 | |-------------------------------------------------------------------------- 53 | | Session File Location 54 | |-------------------------------------------------------------------------- 55 | | 56 | | When using the native session driver, we need a location where session 57 | | files may be stored. A default has been set for you but a different 58 | | location may be specified. This is only needed for file sessions. 59 | | 60 | */ 61 | 62 | 'files' => storage_path('framework/sessions'), 63 | 64 | /* 65 | |-------------------------------------------------------------------------- 66 | | Session Database Connection 67 | |-------------------------------------------------------------------------- 68 | | 69 | | When using the "database" or "redis" session drivers, you may specify a 70 | | connection that should be used to manage these sessions. This should 71 | | correspond to a connection in your database configuration options. 72 | | 73 | */ 74 | 75 | 'connection' => env('SESSION_CONNECTION', null), 76 | 77 | /* 78 | |-------------------------------------------------------------------------- 79 | | Session Database Table 80 | |-------------------------------------------------------------------------- 81 | | 82 | | When using the "database" session driver, you may specify the table we 83 | | should use to manage the sessions. Of course, a sensible default is 84 | | provided for you; however, you are free to change this as needed. 85 | | 86 | */ 87 | 88 | 'table' => 'sessions', 89 | 90 | /* 91 | |-------------------------------------------------------------------------- 92 | | Session Cache Store 93 | |-------------------------------------------------------------------------- 94 | | 95 | | While using one of the framework's cache driven session backends you may 96 | | list a cache store that should be used for these sessions. This value 97 | | must match with one of the application's configured cache "stores". 98 | | 99 | | Affects: "apc", "dynamodb", "memcached", "redis" 100 | | 101 | */ 102 | 103 | 'store' => env('SESSION_STORE', null), 104 | 105 | /* 106 | |-------------------------------------------------------------------------- 107 | | Session Sweeping Lottery 108 | |-------------------------------------------------------------------------- 109 | | 110 | | Some session drivers must manually sweep their storage location to get 111 | | rid of old sessions from storage. Here are the chances that it will 112 | | happen on a given request. By default, the odds are 2 out of 100. 113 | | 114 | */ 115 | 116 | 'lottery' => [2, 100], 117 | 118 | /* 119 | |-------------------------------------------------------------------------- 120 | | Session Cookie Name 121 | |-------------------------------------------------------------------------- 122 | | 123 | | Here you may change the name of the cookie used to identify a session 124 | | instance by ID. The name specified here will get used every time a 125 | | new session cookie is created by the framework for every driver. 126 | | 127 | */ 128 | 129 | 'cookie' => env( 130 | 'SESSION_COOKIE', 131 | Str::slug(env('APP_NAME', 'laravel'), '_').'_session' 132 | ), 133 | 134 | /* 135 | |-------------------------------------------------------------------------- 136 | | Session Cookie Path 137 | |-------------------------------------------------------------------------- 138 | | 139 | | The session cookie path determines the path for which the cookie will 140 | | be regarded as available. Typically, this will be the root path of 141 | | your application but you are free to change this when necessary. 142 | | 143 | */ 144 | 145 | 'path' => '/', 146 | 147 | /* 148 | |-------------------------------------------------------------------------- 149 | | Session Cookie Domain 150 | |-------------------------------------------------------------------------- 151 | | 152 | | Here you may change the domain of the cookie used to identify a session 153 | | in your application. This will determine which domains the cookie is 154 | | available to in your application. A sensible default has been set. 155 | | 156 | */ 157 | 158 | 'domain' => env('SESSION_DOMAIN', null), 159 | 160 | /* 161 | |-------------------------------------------------------------------------- 162 | | HTTPS Only Cookies 163 | |-------------------------------------------------------------------------- 164 | | 165 | | By setting this option to true, session cookies will only be sent back 166 | | to the server if the browser has a HTTPS connection. This will keep 167 | | the cookie from being sent to you if it can not be done securely. 168 | | 169 | */ 170 | 171 | 'secure' => env('SESSION_SECURE_COOKIE'), 172 | 173 | /* 174 | |-------------------------------------------------------------------------- 175 | | HTTP Access Only 176 | |-------------------------------------------------------------------------- 177 | | 178 | | Setting this value to true will prevent JavaScript from accessing the 179 | | value of the cookie and the cookie will only be accessible through 180 | | the HTTP protocol. You are free to modify this option if needed. 181 | | 182 | */ 183 | 184 | 'http_only' => true, 185 | 186 | /* 187 | |-------------------------------------------------------------------------- 188 | | Same-Site Cookies 189 | |-------------------------------------------------------------------------- 190 | | 191 | | This option determines how your cookies behave when cross-site requests 192 | | take place, and can be used to mitigate CSRF attacks. By default, we 193 | | will set this value to "lax" since this is a secure default value. 194 | | 195 | | Supported: "lax", "strict", "none", null 196 | | 197 | */ 198 | 199 | 'same_site' => 'lax', 200 | 201 | ]; 202 | -------------------------------------------------------------------------------- /config/view.php: -------------------------------------------------------------------------------- 1 | [ 17 | resource_path('views'), 18 | ], 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Compiled View Path 23 | |-------------------------------------------------------------------------- 24 | | 25 | | This option determines where all the compiled Blade templates will be 26 | | stored for your application. Typically, this is within the storage 27 | | directory. However, as usual, you are free to change this value. 28 | | 29 | */ 30 | 31 | 'compiled' => env( 32 | 'VIEW_COMPILED_PATH', 33 | realpath(storage_path('framework/views')) 34 | ), 35 | 36 | ]; 37 | -------------------------------------------------------------------------------- /database/.gitignore: -------------------------------------------------------------------------------- 1 | *.sqlite 2 | *.sqlite-journal 3 | -------------------------------------------------------------------------------- /database/factories/UserFactory.php: -------------------------------------------------------------------------------- 1 | define(User::class, function (Faker $faker) { 21 | return [ 22 | 'name' => $faker->name, 23 | 'email' => $faker->unique()->safeEmail, 24 | 'email_verified_at' => now(), 25 | 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password 26 | 'remember_token' => Str::random(10), 27 | ]; 28 | }); 29 | -------------------------------------------------------------------------------- /database/migrations/2014_10_12_000000_create_users_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | $table->string('name'); 19 | $table->string('email')->unique(); 20 | $table->timestamp('email_verified_at')->nullable(); 21 | $table->string('password'); 22 | $table->rememberToken(); 23 | $table->timestamps(); 24 | }); 25 | } 26 | 27 | /** 28 | * Reverse the migrations. 29 | * 30 | * @return void 31 | */ 32 | public function down() 33 | { 34 | Schema::dropIfExists('users'); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /database/migrations/2014_10_12_100000_create_password_resets_table.php: -------------------------------------------------------------------------------- 1 | string('email')->index(); 18 | $table->string('token'); 19 | $table->timestamp('created_at')->nullable(); 20 | }); 21 | } 22 | 23 | /** 24 | * Reverse the migrations. 25 | * 26 | * @return void 27 | */ 28 | public function down() 29 | { 30 | Schema::dropIfExists('password_resets'); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /database/migrations/2019_08_19_000000_create_failed_jobs_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | $table->text('connection'); 19 | $table->text('queue'); 20 | $table->longText('payload'); 21 | $table->longText('exception'); 22 | $table->timestamp('failed_at')->useCurrent(); 23 | }); 24 | } 25 | 26 | /** 27 | * Reverse the migrations. 28 | * 29 | * @return void 30 | */ 31 | public function down() 32 | { 33 | Schema::dropIfExists('failed_jobs'); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /database/migrations/2021_07_05_044011_create_jobs_table.php: -------------------------------------------------------------------------------- 1 | bigIncrements('id'); 18 | $table->string('queue')->index(); 19 | $table->longText('payload'); 20 | $table->unsignedTinyInteger('attempts'); 21 | $table->unsignedInteger('reserved_at')->nullable(); 22 | $table->unsignedInteger('available_at'); 23 | $table->unsignedInteger('created_at'); 24 | }); 25 | } 26 | 27 | /** 28 | * Reverse the migrations. 29 | * 30 | * @return void 31 | */ 32 | public function down() 33 | { 34 | Schema::dropIfExists('jobs'); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /database/migrations/2021_07_05_205158_create_videos_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | $table->string('name'); 19 | $table->string('codec')->nullable(); 20 | $table->string('status'); 21 | $table->dateTime('started_at')->nullable(); 22 | $table->dateTime('finished_at')->nullable(); 23 | $table->string('width')->nullable(); 24 | $table->string('height')->nullable(); 25 | $table->string('duration')->nullable(); 26 | $table->string('size')->nullable(); 27 | $table->string('bitrate')->nullable(); 28 | $table->string('url')->nullable(); 29 | $table->string('path')->nullable(); 30 | $table->string('log_path')->nullable(); 31 | $table->timestamps(); 32 | }); 33 | } 34 | 35 | /** 36 | * Reverse the migrations. 37 | * 38 | * @return void 39 | */ 40 | public function down() 41 | { 42 | Schema::dropIfExists('videos'); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /database/migrations/2022_10_23_165740_add_is_stream_column_to_videos_table.php: -------------------------------------------------------------------------------- 1 | boolean('is_stream') 18 | ->default(false) 19 | ->after('url'); 20 | }); 21 | } 22 | 23 | /** 24 | * Reverse the migrations. 25 | * 26 | * @return void 27 | */ 28 | public function down() 29 | { 30 | Schema::table('videos', function (Blueprint $table) { 31 | $table->dropColumn(['is_stream']); 32 | }); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /database/migrations/2022_10_30_152342_create_photo_galleries_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | $table->string('name'); 19 | $table->integer('number_photos')->nullable(); 20 | $table->timestamps(); 21 | }); 22 | } 23 | 24 | /** 25 | * Reverse the migrations. 26 | * 27 | * @return void 28 | */ 29 | public function down() 30 | { 31 | Schema::dropIfExists('photo_galleries'); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /database/migrations/2022_10_30_152624_create_scrape_items_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | $table->morphs('scrapable'); 19 | $table->string('status'); 20 | $table->dateTime('started_at')->nullable(); 21 | $table->dateTime('finished_at')->nullable(); 22 | $table->dateTime('url')->nullable(); 23 | $table->boolean('is_stream')->default(false); 24 | $table->string('path')->nullable(); 25 | $table->string('log_path')->nullable(); 26 | $table->timestamps(); 27 | }); 28 | } 29 | 30 | /** 31 | * Reverse the migrations. 32 | * 33 | * @return void 34 | */ 35 | public function down() 36 | { 37 | Schema::dropIfExists('scrape_items'); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /database/migrations/2022_10_31_051225_remove_columns_from_videos_table.php: -------------------------------------------------------------------------------- 1 | id(); 21 | $table->string('name'); 22 | $table->string('codec')->nullable(); 23 | $table->string('width')->nullable(); 24 | $table->string('height')->nullable(); 25 | $table->string('duration')->nullable(); 26 | $table->string('size')->nullable(); 27 | $table->string('bitrate')->nullable(); 28 | $table->timestamps(); 29 | }); 30 | } 31 | 32 | /** 33 | * Reverse the migrations. 34 | * 35 | * @return void 36 | */ 37 | public function down() 38 | { 39 | // nothing to do anymore here 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /database/migrations/2022_11_05_180539_add_soft_deletes_to_videos_table.php: -------------------------------------------------------------------------------- 1 | softDeletes(); 18 | }); 19 | } 20 | 21 | /** 22 | * Reverse the migrations. 23 | * 24 | * @return void 25 | */ 26 | public function down() 27 | { 28 | Schema::table('videos', function (Blueprint $table) { 29 | $table->dropSoftDeletes(); 30 | }); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /database/migrations/2022_11_05_180550_add_soft_deletes_to_photo_galleries_table.php: -------------------------------------------------------------------------------- 1 | softDeletes(); 18 | }); 19 | } 20 | 21 | /** 22 | * Reverse the migrations. 23 | * 24 | * @return void 25 | */ 26 | public function down() 27 | { 28 | Schema::table('photo_galleries', function (Blueprint $table) { 29 | $table->dropSoftDeletes(); 30 | }); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /database/migrations/2022_11_05_180601_add_soft_deletes_to_scrape_items_table.php: -------------------------------------------------------------------------------- 1 | softDeletes(); 18 | }); 19 | } 20 | 21 | /** 22 | * Reverse the migrations. 23 | * 24 | * @return void 25 | */ 26 | public function down() 27 | { 28 | Schema::table('scrape_items', function (Blueprint $table) { 29 | $table->softDeletes(); 30 | }); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /database/seeds/DatabaseSeeder.php: -------------------------------------------------------------------------------- 1 | call(UserSeeder::class); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "scripts": { 4 | "dev": "npm run development", 5 | "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --config=node_modules/laravel-mix/setup/webpack.config.js", 6 | "watch": "npm run development -- --watch", 7 | "watch-poll": "npm run watch -- --watch-poll", 8 | "hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --disable-host-check --config=node_modules/laravel-mix/setup/webpack.config.js", 9 | "prod": "npm run production", 10 | "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --config=node_modules/laravel-mix/setup/webpack.config.js" 11 | }, 12 | "devDependencies": { 13 | "axios": "^0.19", 14 | "cross-env": "^7.0", 15 | "laravel-echo": "^1.11.0", 16 | "laravel-mix": "^5.0.1", 17 | "lodash": "^4.17.19", 18 | "pusher-js": "^7.0.3", 19 | "resolve-url-loader": "^3.1.0", 20 | "sass": "^1.15.2", 21 | "sass-loader": "^8.0.0", 22 | "vue-template-compiler": "^2.6.14" 23 | }, 24 | "dependencies": { 25 | "vue": "^2.6.14" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | ./tests/Unit 10 | 11 | 12 | ./tests/Feature 13 | 14 | 15 | 16 | 17 | ./app 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /public/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | 3 | Options -MultiViews -Indexes 4 | 5 | 6 | RewriteEngine On 7 | 8 | # Handle Authorization Header 9 | RewriteCond %{HTTP:Authorization} . 10 | RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] 11 | 12 | # Redirect Trailing Slashes If Not A Folder... 13 | RewriteCond %{REQUEST_FILENAME} !-d 14 | RewriteCond %{REQUEST_URI} (.+)/$ 15 | RewriteRule ^ %1 [L,R=301] 16 | 17 | # Send Requests To Front Controller... 18 | RewriteCond %{REQUEST_FILENAME} !-d 19 | RewriteCond %{REQUEST_FILENAME} !-f 20 | RewriteRule ^ index.php [L] 21 | 22 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ed36080666/site_scraper/01f43bf3425703f4983b06cc568bfb9e2e7278a7/public/favicon.ico -------------------------------------------------------------------------------- /public/index.php: -------------------------------------------------------------------------------- 1 | 8 | */ 9 | 10 | define('LARAVEL_START', microtime(true)); 11 | 12 | /* 13 | |-------------------------------------------------------------------------- 14 | | Register The Auto Loader 15 | |-------------------------------------------------------------------------- 16 | | 17 | | Composer provides a convenient, automatically generated class loader for 18 | | our application. We just need to utilize it! We'll simply require it 19 | | into the script here so that we don't have to worry about manual 20 | | loading any of our classes later on. It feels great to relax. 21 | | 22 | */ 23 | 24 | require __DIR__.'/../vendor/autoload.php'; 25 | 26 | /* 27 | |-------------------------------------------------------------------------- 28 | | Turn On The Lights 29 | |-------------------------------------------------------------------------- 30 | | 31 | | We need to illuminate PHP development, so let us turn on the lights. 32 | | This bootstraps the framework and gets it ready for use, then it 33 | | will load up this application so that we can run it and send 34 | | the responses back to the browser and delight our users. 35 | | 36 | */ 37 | 38 | $app = require_once __DIR__.'/../bootstrap/app.php'; 39 | 40 | /* 41 | |-------------------------------------------------------------------------- 42 | | Run The Application 43 | |-------------------------------------------------------------------------- 44 | | 45 | | Once we have the application, we can handle the incoming request 46 | | through the kernel, and send the associated response back to 47 | | the client's browser allowing them to enjoy the creative 48 | | and wonderful application we have prepared for them. 49 | | 50 | */ 51 | 52 | $kernel = $app->make(Illuminate\Contracts\Http\Kernel::class); 53 | 54 | $response = $kernel->handle( 55 | $request = Illuminate\Http\Request::capture() 56 | ); 57 | 58 | $response->send(); 59 | 60 | $kernel->terminate($request, $response); 61 | -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: 3 | -------------------------------------------------------------------------------- /public/web.config: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /resources/js/app.js: -------------------------------------------------------------------------------- 1 | require('./bootstrap'); 2 | 3 | // Globals 4 | import Vue from "vue"; 5 | import axios from "axios"; 6 | 7 | // Components 8 | import ContentScraper from "./components/ContentScraper"; 9 | import ScrapeListTable from "./components/ScrapeListTable"; 10 | 11 | Vue.component('content-scraper', ContentScraper); 12 | Vue.component('scrape-list-table', ScrapeListTable); 13 | 14 | var app = new Vue({ 15 | el: '#app', 16 | data: () => ({ 17 | logoMap: window.__INITIAL_STATE__.logo_map, 18 | scrapeItems: window.__INITIAL_STATE__.scrape_items 19 | }), 20 | created() { 21 | setInterval(this.pollProgress, 1500); 22 | }, 23 | methods: { 24 | onItemDelete(itemId) { 25 | axios.delete(`/${itemId}/delete`) 26 | .then(response => { 27 | const index = this.scrapeItems.findIndex(item => { 28 | return item.id === itemId; 29 | }); 30 | 31 | if (index > -1) { 32 | this.scrapeItems.splice(index, 1); 33 | } 34 | }) 35 | .catch(error => { 36 | console.error(error); 37 | alert("Could not delete!"); 38 | }) 39 | }, 40 | 41 | pollProgress() { 42 | axios.get('/in-progress') 43 | .then(response => { 44 | response.data.forEach(item => { 45 | const index = this.scrapeItems.findIndex(video => video.id === item.id); 46 | // if item already exists, refresh the entire item for new status, progress, etc. 47 | if (index > -1) { 48 | this.$set(this.scrapeItems, index, {...this.scrapeItems[index], ...item}); 49 | } else { 50 | // else a new item being added, push it to the list. 51 | this.scrapeItems.push(item); 52 | } 53 | }); 54 | }) 55 | .catch(error => { 56 | console.error(error); 57 | }); 58 | } 59 | } 60 | }) 61 | -------------------------------------------------------------------------------- /resources/js/bootstrap.js: -------------------------------------------------------------------------------- 1 | window._ = require('lodash'); 2 | 3 | /** 4 | * We'll load the axios HTTP library which allows us to easily issue requests 5 | * to our Laravel back-end. This library automatically handles sending the 6 | * CSRF token as a header based on the value of the "XSRF" token cookie. 7 | */ 8 | 9 | window.axios = require('axios'); 10 | 11 | window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; 12 | 13 | /** 14 | * Echo exposes an expressive API for subscribing to channels and listening 15 | * for events that are broadcast by Laravel. Echo and event broadcasting 16 | * allows your team to easily build robust real-time web applications. 17 | */ 18 | 19 | // import Echo from 'laravel-echo'; 20 | // 21 | // window.Pusher = require('pusher-js'); 22 | // 23 | // window.Echo = new Echo({ 24 | // broadcaster: 'pusher', 25 | // key: process.env.MIX_PUSHER_APP_KEY, 26 | // cluster: process.env.MIX_PUSHER_APP_CLUSTER, 27 | // forceTLS: true 28 | // }); 29 | -------------------------------------------------------------------------------- /resources/js/components/ContentScraper.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | 13 | 21 | 29 | 30 | 31 | Scrape 32 | 33 | 34 | 35 | 40 | 41 | 42 | 43 | 44 | 45 | 108 | -------------------------------------------------------------------------------- /resources/js/components/CurrentlyScrapingItem.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | {{ item.filename }} 10 | {{ item.video_url }} 11 | 12 | 13 | 14 | 15 | 46 | 47 | 55 | -------------------------------------------------------------------------------- /resources/js/components/ProgressBar.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 18 | 19 | 28 | {{ caption }} 29 | 30 | 31 | 32 | 33 | 59 | 60 | 76 | -------------------------------------------------------------------------------- /resources/js/components/ScrapeListTable.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | 13 | 14 | Name 15 | Started At 16 | Resolution 17 | 18 | 19 | 20 | $emit('delete', e)" 26 | /> 27 | 28 | 29 | 33 | No results found 34 | 35 | 36 | 37 | 38 | 77 | -------------------------------------------------------------------------------- /resources/js/components/ScrapeListTableRow.vue: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | {{ item.name }} 18 | 19 | 20 | 21 | {{ item.started_at }} 22 | 23 | 24 | {{ formatResolution(item.height, item.width) }} 25 | 26 | 27 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 85 | 86 | 89 | -------------------------------------------------------------------------------- /resources/js/components/ScrapeStatusBadge.vue: -------------------------------------------------------------------------------- 1 | 2 | 11 | {{ progress === 100 ? 'done' : status }} 12 | 13 | 14 | 15 | 30 | 31 | 34 | -------------------------------------------------------------------------------- /resources/js/components/SiteLogo.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 10 | 11 | 31 | 32 | 35 | -------------------------------------------------------------------------------- /resources/js/components/icons/Checkmark.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | -------------------------------------------------------------------------------- /resources/js/components/icons/Exclamation.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | -------------------------------------------------------------------------------- /resources/js/components/icons/Spinner.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 14 | 15 | 29 | -------------------------------------------------------------------------------- /resources/lang/en/auth.php: -------------------------------------------------------------------------------- 1 | 'These credentials do not match our records.', 17 | 'throttle' => 'Too many login attempts. Please try again in :seconds seconds.', 18 | 19 | ]; 20 | -------------------------------------------------------------------------------- /resources/lang/en/pagination.php: -------------------------------------------------------------------------------- 1 | '« Previous', 17 | 'next' => 'Next »', 18 | 19 | ]; 20 | -------------------------------------------------------------------------------- /resources/lang/en/passwords.php: -------------------------------------------------------------------------------- 1 | 'Your password has been reset!', 17 | 'sent' => 'We have emailed your password reset link!', 18 | 'throttled' => 'Please wait before retrying.', 19 | 'token' => 'This password reset token is invalid.', 20 | 'user' => "We can't find a user with that email address.", 21 | 22 | ]; 23 | -------------------------------------------------------------------------------- /resources/lang/en/validation.php: -------------------------------------------------------------------------------- 1 | 'The :attribute must be accepted.', 17 | 'active_url' => 'The :attribute is not a valid URL.', 18 | 'after' => 'The :attribute must be a date after :date.', 19 | 'after_or_equal' => 'The :attribute must be a date after or equal to :date.', 20 | 'alpha' => 'The :attribute may only contain letters.', 21 | 'alpha_dash' => 'The :attribute may only contain letters, numbers, dashes and underscores.', 22 | 'alpha_num' => 'The :attribute may only contain letters and numbers.', 23 | 'array' => 'The :attribute must be an array.', 24 | 'before' => 'The :attribute must be a date before :date.', 25 | 'before_or_equal' => 'The :attribute must be a date before or equal to :date.', 26 | 'between' => [ 27 | 'numeric' => 'The :attribute must be between :min and :max.', 28 | 'file' => 'The :attribute must be between :min and :max kilobytes.', 29 | 'string' => 'The :attribute must be between :min and :max characters.', 30 | 'array' => 'The :attribute must have between :min and :max items.', 31 | ], 32 | 'boolean' => 'The :attribute field must be true or false.', 33 | 'confirmed' => 'The :attribute confirmation does not match.', 34 | 'date' => 'The :attribute is not a valid date.', 35 | 'date_equals' => 'The :attribute must be a date equal to :date.', 36 | 'date_format' => 'The :attribute does not match the format :format.', 37 | 'different' => 'The :attribute and :other must be different.', 38 | 'digits' => 'The :attribute must be :digits digits.', 39 | 'digits_between' => 'The :attribute must be between :min and :max digits.', 40 | 'dimensions' => 'The :attribute has invalid image dimensions.', 41 | 'distinct' => 'The :attribute field has a duplicate value.', 42 | 'email' => 'The :attribute must be a valid email address.', 43 | 'ends_with' => 'The :attribute must end with one of the following: :values.', 44 | 'exists' => 'The selected :attribute is invalid.', 45 | 'file' => 'The :attribute must be a file.', 46 | 'filled' => 'The :attribute field must have a value.', 47 | 'gt' => [ 48 | 'numeric' => 'The :attribute must be greater than :value.', 49 | 'file' => 'The :attribute must be greater than :value kilobytes.', 50 | 'string' => 'The :attribute must be greater than :value characters.', 51 | 'array' => 'The :attribute must have more than :value items.', 52 | ], 53 | 'gte' => [ 54 | 'numeric' => 'The :attribute must be greater than or equal :value.', 55 | 'file' => 'The :attribute must be greater than or equal :value kilobytes.', 56 | 'string' => 'The :attribute must be greater than or equal :value characters.', 57 | 'array' => 'The :attribute must have :value items or more.', 58 | ], 59 | 'image' => 'The :attribute must be an image.', 60 | 'in' => 'The selected :attribute is invalid.', 61 | 'in_array' => 'The :attribute field does not exist in :other.', 62 | 'integer' => 'The :attribute must be an integer.', 63 | 'ip' => 'The :attribute must be a valid IP address.', 64 | 'ipv4' => 'The :attribute must be a valid IPv4 address.', 65 | 'ipv6' => 'The :attribute must be a valid IPv6 address.', 66 | 'json' => 'The :attribute must be a valid JSON string.', 67 | 'lt' => [ 68 | 'numeric' => 'The :attribute must be less than :value.', 69 | 'file' => 'The :attribute must be less than :value kilobytes.', 70 | 'string' => 'The :attribute must be less than :value characters.', 71 | 'array' => 'The :attribute must have less than :value items.', 72 | ], 73 | 'lte' => [ 74 | 'numeric' => 'The :attribute must be less than or equal :value.', 75 | 'file' => 'The :attribute must be less than or equal :value kilobytes.', 76 | 'string' => 'The :attribute must be less than or equal :value characters.', 77 | 'array' => 'The :attribute must not have more than :value items.', 78 | ], 79 | 'max' => [ 80 | 'numeric' => 'The :attribute may not be greater than :max.', 81 | 'file' => 'The :attribute may not be greater than :max kilobytes.', 82 | 'string' => 'The :attribute may not be greater than :max characters.', 83 | 'array' => 'The :attribute may not have more than :max items.', 84 | ], 85 | 'mimes' => 'The :attribute must be a file of type: :values.', 86 | 'mimetypes' => 'The :attribute must be a file of type: :values.', 87 | 'min' => [ 88 | 'numeric' => 'The :attribute must be at least :min.', 89 | 'file' => 'The :attribute must be at least :min kilobytes.', 90 | 'string' => 'The :attribute must be at least :min characters.', 91 | 'array' => 'The :attribute must have at least :min items.', 92 | ], 93 | 'not_in' => 'The selected :attribute is invalid.', 94 | 'not_regex' => 'The :attribute format is invalid.', 95 | 'numeric' => 'The :attribute must be a number.', 96 | 'password' => 'The password is incorrect.', 97 | 'present' => 'The :attribute field must be present.', 98 | 'regex' => 'The :attribute format is invalid.', 99 | 'required' => 'The :attribute field is required.', 100 | 'required_if' => 'The :attribute field is required when :other is :value.', 101 | 'required_unless' => 'The :attribute field is required unless :other is in :values.', 102 | 'required_with' => 'The :attribute field is required when :values is present.', 103 | 'required_with_all' => 'The :attribute field is required when :values are present.', 104 | 'required_without' => 'The :attribute field is required when :values is not present.', 105 | 'required_without_all' => 'The :attribute field is required when none of :values are present.', 106 | 'same' => 'The :attribute and :other must match.', 107 | 'size' => [ 108 | 'numeric' => 'The :attribute must be :size.', 109 | 'file' => 'The :attribute must be :size kilobytes.', 110 | 'string' => 'The :attribute must be :size characters.', 111 | 'array' => 'The :attribute must contain :size items.', 112 | ], 113 | 'starts_with' => 'The :attribute must start with one of the following: :values.', 114 | 'string' => 'The :attribute must be a string.', 115 | 'timezone' => 'The :attribute must be a valid zone.', 116 | 'unique' => 'The :attribute has already been taken.', 117 | 'uploaded' => 'The :attribute failed to upload.', 118 | 'url' => 'The :attribute format is invalid.', 119 | 'uuid' => 'The :attribute must be a valid UUID.', 120 | 121 | /* 122 | |-------------------------------------------------------------------------- 123 | | Custom Validation Language Lines 124 | |-------------------------------------------------------------------------- 125 | | 126 | | Here you may specify custom validation messages for attributes using the 127 | | convention "attribute.rule" to name the lines. This makes it quick to 128 | | specify a specific custom language line for a given attribute rule. 129 | | 130 | */ 131 | 132 | 'custom' => [ 133 | 'attribute-name' => [ 134 | 'rule-name' => 'custom-message', 135 | ], 136 | ], 137 | 138 | /* 139 | |-------------------------------------------------------------------------- 140 | | Custom Validation Attributes 141 | |-------------------------------------------------------------------------- 142 | | 143 | | The following language lines are used to swap our attribute placeholder 144 | | with something more reader friendly such as "E-Mail Address" instead 145 | | of "email". This simply helps us make our message more expressive. 146 | | 147 | */ 148 | 149 | 'attributes' => [], 150 | 151 | ]; 152 | -------------------------------------------------------------------------------- /resources/sass/app.scss: -------------------------------------------------------------------------------- 1 | // 2 | -------------------------------------------------------------------------------- /resources/views/welcome.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Laravel 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 23 | 24 | 25 | 26 | 27 | 28 | Scraper 29 | 30 | 31 | {{-- TODO Commented out for NSFW --}} 32 | 36 | 37 | 41 | 42 | 43 | 44 | 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /routes/api.php: -------------------------------------------------------------------------------- 1 | get('/user', function (Request $request) { 18 | return $request->user(); 19 | }); 20 | -------------------------------------------------------------------------------- /routes/channels.php: -------------------------------------------------------------------------------- 1 | id === (int) $id; 18 | }); 19 | -------------------------------------------------------------------------------- /routes/console.php: -------------------------------------------------------------------------------- 1 | comment(Inspiring::quote()); 19 | })->describe('Display an inspiring quote'); 20 | -------------------------------------------------------------------------------- /routes/web.php: -------------------------------------------------------------------------------- 1 | 8 | */ 9 | 10 | $uri = urldecode( 11 | parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) 12 | ); 13 | 14 | // This file allows us to emulate Apache's "mod_rewrite" functionality from the 15 | // built-in PHP web server. This provides a convenient way to test a Laravel 16 | // application without having installed a "real" web server software here. 17 | if ($uri !== '/' && file_exists(__DIR__.'/public'.$uri)) { 18 | return false; 19 | } 20 | 21 | require_once __DIR__.'/public/index.php'; 22 | -------------------------------------------------------------------------------- /storage/app/public/logos/fullporner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ed36080666/site_scraper/01f43bf3425703f4983b06cc568bfb9e2e7278a7/storage/app/public/logos/fullporner.png -------------------------------------------------------------------------------- /storage/app/public/logos/goodporn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ed36080666/site_scraper/01f43bf3425703f4983b06cc568bfb9e2e7278a7/storage/app/public/logos/goodporn.png -------------------------------------------------------------------------------- /storage/app/public/logos/hqporner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ed36080666/site_scraper/01f43bf3425703f4983b06cc568bfb9e2e7278a7/storage/app/public/logos/hqporner.png -------------------------------------------------------------------------------- /storage/app/public/logos/pichunter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ed36080666/site_scraper/01f43bf3425703f4983b06cc568bfb9e2e7278a7/storage/app/public/logos/pichunter.png -------------------------------------------------------------------------------- /storage/app/public/logos/pornhub.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ed36080666/site_scraper/01f43bf3425703f4983b06cc568bfb9e2e7278a7/storage/app/public/logos/pornhub.png -------------------------------------------------------------------------------- /storage/app/public/logos/pornktube.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ed36080666/site_scraper/01f43bf3425703f4983b06cc568bfb9e2e7278a7/storage/app/public/logos/pornktube.png -------------------------------------------------------------------------------- /storage/app/public/logos/pornpics.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ed36080666/site_scraper/01f43bf3425703f4983b06cc568bfb9e2e7278a7/storage/app/public/logos/pornpics.png -------------------------------------------------------------------------------- /storage/app/public/logos/porntrex.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ed36080666/site_scraper/01f43bf3425703f4983b06cc568bfb9e2e7278a7/storage/app/public/logos/porntrex.png -------------------------------------------------------------------------------- /storage/app/public/logos/pornwild.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ed36080666/site_scraper/01f43bf3425703f4983b06cc568bfb9e2e7278a7/storage/app/public/logos/pornwild.png -------------------------------------------------------------------------------- /storage/app/public/logos/whoreshub.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ed36080666/site_scraper/01f43bf3425703f4983b06cc568bfb9e2e7278a7/storage/app/public/logos/whoreshub.png -------------------------------------------------------------------------------- /storage/app/public/logos/youjizz.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ed36080666/site_scraper/01f43bf3425703f4983b06cc568bfb9e2e7278a7/storage/app/public/logos/youjizz.png -------------------------------------------------------------------------------- /storage/framework/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | */ 3 | !.gitignore 4 | 5 | -------------------------------------------------------------------------------- /storage/framework/sessions/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | */ 3 | !.gitignore 4 | 5 | -------------------------------------------------------------------------------- /storage/framework/views/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | */ 3 | !.gitignore 4 | 5 | -------------------------------------------------------------------------------- /storage/logs/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | */ 3 | !.gitignore 4 | 5 | -------------------------------------------------------------------------------- /tests/Browser/ExampleTest.php: -------------------------------------------------------------------------------- 1 | browse(function (Browser $browser) { 18 | $browser->visit('https://www.porntrex.com/video/146608/anya-ivy-rub-my-tennis-jock'); 19 | $flash = $browser->script("return window.flashvars;"); // this returns array 20 | dd($flash); 21 | // ->assertSee('Scraper'); 22 | }); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /tests/Browser/Pages/HomePage.php: -------------------------------------------------------------------------------- 1 | '#selector', 39 | ]; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /tests/Browser/Pages/Page.php: -------------------------------------------------------------------------------- 1 | '#selector', 18 | ]; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /tests/Browser/console/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /tests/Browser/screenshots/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /tests/CreatesApplication.php: -------------------------------------------------------------------------------- 1 | make(Kernel::class)->bootstrap(); 19 | 20 | return $app; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /tests/DuskTestCase.php: -------------------------------------------------------------------------------- 1 | addArguments(collect([ 35 | '--window-size=1920,1080', 36 | ])->unless($this->hasHeadlessDisabled(), function ($items) { 37 | return $items->merge([ 38 | '--disable-gpu', 39 | '--headless', 40 | // '--log-level=3', // Add this line 41 | // '--silent' // Add this line 42 | ]); 43 | })->all()); 44 | 45 | return RemoteWebDriver::create( 46 | $_ENV['DUSK_DRIVER_URL'] ?? 'http://localhost:9515', 47 | DesiredCapabilities::chrome()->setCapability( 48 | ChromeOptions::CAPABILITY, $options 49 | ) 50 | ); 51 | } 52 | 53 | /** 54 | * Determine whether the Dusk command has disabled headless mode. 55 | * 56 | * @return bool 57 | */ 58 | protected function hasHeadlessDisabled() 59 | { 60 | return isset($_SERVER['DUSK_HEADLESS_DISABLED']) || 61 | isset($_ENV['DUSK_HEADLESS_DISABLED']); 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /tests/Feature/ExampleTest.php: -------------------------------------------------------------------------------- 1 | get('google.com'); 18 | 19 | dd($response); 20 | 21 | $response->assertStatus(200); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /tests/TestCase.php: -------------------------------------------------------------------------------- 1 | assertTrue(true); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /webpack.mix.js: -------------------------------------------------------------------------------- 1 | const mix = require('laravel-mix'); 2 | 3 | /* 4 | |-------------------------------------------------------------------------- 5 | | Mix Asset Management 6 | |-------------------------------------------------------------------------- 7 | | 8 | | Mix provides a clean, fluent API for defining some Webpack build steps 9 | | for your Laravel application. By default, we are compiling the Sass 10 | | file for the application as well as bundling up all the JS files. 11 | | 12 | */ 13 | 14 | mix.js('resources/js/app.js', 'public/js') 15 | .sass('resources/sass/app.scss', 'public/css'); 16 | --------------------------------------------------------------------------------