first commit
This commit is contained in:
50
.gitignore
vendored
Normal file
50
.gitignore
vendored
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
# Use yarn.lock instead
|
||||||
|
package-lock.json
|
||||||
|
|
||||||
|
# Environment variables
|
||||||
|
#.env
|
||||||
|
|
||||||
|
# Logs
|
||||||
|
logs
|
||||||
|
*.log
|
||||||
|
npm-debug.log*
|
||||||
|
|
||||||
|
# Documentation
|
||||||
|
docs
|
||||||
|
|
||||||
|
# Runtime data
|
||||||
|
pids
|
||||||
|
*.pid
|
||||||
|
*.seed
|
||||||
|
|
||||||
|
# Directory for instrumented libs generated by jscoverage/JSCover
|
||||||
|
lib-cov
|
||||||
|
|
||||||
|
# Coverage directory used by tools like istanbul
|
||||||
|
coverage
|
||||||
|
|
||||||
|
# nyc test coverage
|
||||||
|
.nyc_output
|
||||||
|
|
||||||
|
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
|
||||||
|
.grunt
|
||||||
|
|
||||||
|
# node-waf configuration
|
||||||
|
.lock-wscript
|
||||||
|
|
||||||
|
# Compiled binary addons (http://nodejs.org/api/addons.html)
|
||||||
|
build/Release
|
||||||
|
|
||||||
|
# Dependency directories
|
||||||
|
node_modules
|
||||||
|
jspm_packages
|
||||||
|
|
||||||
|
# Optional npm cache directory
|
||||||
|
.npm
|
||||||
|
|
||||||
|
# Optional REPL history
|
||||||
|
.node_repl_history
|
||||||
|
|
||||||
|
[Uu]ploads/
|
||||||
|
dist/
|
||||||
|
.angular
|
||||||
27
README.md
Normal file
27
README.md
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
# Crawlflix
|
||||||
|
|
||||||
|
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 18.2.5.
|
||||||
|
|
||||||
|
## Development server
|
||||||
|
|
||||||
|
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The application will automatically reload if you change any of the source files.
|
||||||
|
|
||||||
|
## Code scaffolding
|
||||||
|
|
||||||
|
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
|
||||||
|
|
||||||
|
## Build
|
||||||
|
|
||||||
|
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory.
|
||||||
|
|
||||||
|
## Running unit tests
|
||||||
|
|
||||||
|
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
|
||||||
|
|
||||||
|
## Running end-to-end tests
|
||||||
|
|
||||||
|
Run `ng e2e` to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities.
|
||||||
|
|
||||||
|
## Further help
|
||||||
|
|
||||||
|
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page.
|
||||||
96
angular.json
Normal file
96
angular.json
Normal file
@@ -0,0 +1,96 @@
|
|||||||
|
{
|
||||||
|
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
|
||||||
|
"version": 1,
|
||||||
|
"newProjectRoot": "projects",
|
||||||
|
"projects": {
|
||||||
|
"crawlflix": {
|
||||||
|
"projectType": "application",
|
||||||
|
"schematics": {},
|
||||||
|
"root": "",
|
||||||
|
"sourceRoot": "src",
|
||||||
|
"prefix": "app",
|
||||||
|
"architect": {
|
||||||
|
"build": {
|
||||||
|
"builder": "@angular-devkit/build-angular:application",
|
||||||
|
"options": {
|
||||||
|
"outputPath": "dist/crawlflix",
|
||||||
|
"index": "src/index.html",
|
||||||
|
"browser": "src/main.ts",
|
||||||
|
"polyfills": [
|
||||||
|
"zone.js"
|
||||||
|
],
|
||||||
|
"tsConfig": "tsconfig.app.json",
|
||||||
|
"assets": [
|
||||||
|
{
|
||||||
|
"glob": "**/*",
|
||||||
|
"input": "public"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"styles": [
|
||||||
|
"src/styles.css"
|
||||||
|
],
|
||||||
|
"scripts": []
|
||||||
|
},
|
||||||
|
"configurations": {
|
||||||
|
"production": {
|
||||||
|
"budgets": [
|
||||||
|
{
|
||||||
|
"type": "initial",
|
||||||
|
"maximumWarning": "500kB",
|
||||||
|
"maximumError": "1MB"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "anyComponentStyle",
|
||||||
|
"maximumWarning": "2kB",
|
||||||
|
"maximumError": "4kB"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"outputHashing": "all"
|
||||||
|
},
|
||||||
|
"development": {
|
||||||
|
"optimization": false,
|
||||||
|
"extractLicenses": false,
|
||||||
|
"sourceMap": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"defaultConfiguration": "production"
|
||||||
|
},
|
||||||
|
"serve": {
|
||||||
|
"builder": "@angular-devkit/build-angular:dev-server",
|
||||||
|
"configurations": {
|
||||||
|
"production": {
|
||||||
|
"buildTarget": "crawlflix:build:production"
|
||||||
|
},
|
||||||
|
"development": {
|
||||||
|
"buildTarget": "crawlflix:build:development"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"defaultConfiguration": "development"
|
||||||
|
},
|
||||||
|
"extract-i18n": {
|
||||||
|
"builder": "@angular-devkit/build-angular:extract-i18n"
|
||||||
|
},
|
||||||
|
"test": {
|
||||||
|
"builder": "@angular-devkit/build-angular:karma",
|
||||||
|
"options": {
|
||||||
|
"polyfills": [
|
||||||
|
"zone.js",
|
||||||
|
"zone.js/testing"
|
||||||
|
],
|
||||||
|
"tsConfig": "tsconfig.spec.json",
|
||||||
|
"assets": [
|
||||||
|
{
|
||||||
|
"glob": "**/*",
|
||||||
|
"input": "public"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"styles": [
|
||||||
|
"src/styles.css"
|
||||||
|
],
|
||||||
|
"scripts": []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
41
package.json
Normal file
41
package.json
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
{
|
||||||
|
"name": "crawlflix",
|
||||||
|
"version": "0.0.0",
|
||||||
|
"scripts": {
|
||||||
|
"ng": "ng",
|
||||||
|
"start": "ng serve",
|
||||||
|
"build": "ng build",
|
||||||
|
"watch": "ng build --watch --configuration development",
|
||||||
|
"test": "ng test"
|
||||||
|
},
|
||||||
|
"private": true,
|
||||||
|
"dependencies": {
|
||||||
|
"@angular/animations": "^18.2.0",
|
||||||
|
"@angular/common": "^18.2.0",
|
||||||
|
"@angular/compiler": "^18.2.0",
|
||||||
|
"@angular/core": "^18.2.0",
|
||||||
|
"@angular/forms": "^18.2.0",
|
||||||
|
"@angular/platform-browser": "^18.2.0",
|
||||||
|
"@angular/platform-browser-dynamic": "^18.2.0",
|
||||||
|
"@angular/router": "^18.2.0",
|
||||||
|
"moment": "^2.30.1",
|
||||||
|
"ngx-moment": "^6.0.2",
|
||||||
|
"ngx-order-pipe": "^3.0.0",
|
||||||
|
"rxjs": "~7.8.0",
|
||||||
|
"tslib": "^2.3.0",
|
||||||
|
"zone.js": "~0.14.10"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@angular-devkit/build-angular": "^18.2.5",
|
||||||
|
"@angular/cli": "^18.2.5",
|
||||||
|
"@angular/compiler-cli": "^18.2.0",
|
||||||
|
"@types/jasmine": "~5.1.0",
|
||||||
|
"jasmine-core": "~5.2.0",
|
||||||
|
"karma": "~6.4.0",
|
||||||
|
"karma-chrome-launcher": "~3.2.0",
|
||||||
|
"karma-coverage": "~2.2.0",
|
||||||
|
"karma-jasmine": "~5.1.0",
|
||||||
|
"karma-jasmine-html-reporter": "~2.1.0",
|
||||||
|
"typescript": "~5.5.2"
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
public/favicon.ico
Normal file
BIN
public/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
0
src/app/app.component.css
Normal file
0
src/app/app.component.css
Normal file
100
src/app/app.component.html
Normal file
100
src/app/app.component.html
Normal file
@@ -0,0 +1,100 @@
|
|||||||
|
<div class="row mx-2">
|
||||||
|
<div class="col-12 col-lg-8 mt-4">
|
||||||
|
<div class="card shadow">
|
||||||
|
<div class="card-content p-3 text-center">
|
||||||
|
<h1 class="mb-6">CrawlFlix</h1>
|
||||||
|
<small>Paramount+ / Max HBO / Netflix / Disney+ / Amazon Prime / Canal+</small>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="card shadow mt-3">
|
||||||
|
<div class="card-content p-3">
|
||||||
|
<form [formGroup]="processingForm" (ngSubmit)="onSubmit()">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-6">
|
||||||
|
<label>MP4 Filename</label>
|
||||||
|
<input type="text" formControlName="mp4Filename" class="form-control" placeholder="ex: S01E01">
|
||||||
|
</div>
|
||||||
|
<div class="col-6">
|
||||||
|
<label>Wanted Resolution</label>
|
||||||
|
<select formControlName="wantedResolution" class="form-select">
|
||||||
|
<option value="4k">4K</option>
|
||||||
|
<option value="1080p" selected>1080p</option>
|
||||||
|
<option value="720p">720p</option>
|
||||||
|
<option value="480p">480p</option>
|
||||||
|
<option value="360p">360p</option>
|
||||||
|
<option value="240p">240p</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="flex flex-col mt-2">
|
||||||
|
<label>MPD URL</label>
|
||||||
|
<input type="text" formControlName="mpdUrl" class="form-control" placeholder="ex: https://....">
|
||||||
|
</div>
|
||||||
|
<div class="flex flex-col mt-2">
|
||||||
|
<label>Widevine L3 Decryption Keys (one per line, key:value)</label>
|
||||||
|
<textarea formControlName="keys" rows="4" class="form-control" placeholder="ex: ca2c28ab6c6a4e91935e12b6bb37a952:779afc2503a1ea7947b4747d24fbeb63"></textarea>
|
||||||
|
</div>
|
||||||
|
<button type="submit" [disabled]="!processingForm.valid" class="btn btn-primary float-end mt-2">Add to Queue</button>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<!-- <div *ngIf="jobId" class="mt-6">
|
||||||
|
<h2 class="text-xl font-semibold mb-2">Job Status</h2>
|
||||||
|
<p>Job ID: {{ jobId }}</p>
|
||||||
|
<p>Status: {{ jobStatus }}</p> ({{jobProgress}}%)
|
||||||
|
<div class="w-full bg-gray-200 rounded-full h-2.5 mt-2">
|
||||||
|
<div class="bg-blue-600 h-2.5 rounded-full" [style.width.%]="jobProgress"></div>
|
||||||
|
</div>
|
||||||
|
</div> -->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-12 col-lg-4 mt-4">
|
||||||
|
<div class="card shadow">
|
||||||
|
<div class="card-header">
|
||||||
|
Jobs Queue ({{jobs.length}})
|
||||||
|
</div>
|
||||||
|
<div class="card-content p-2" style="max-height: 90vh;overflow-y:scroll">
|
||||||
|
<div class="row" *ngIf="jobs.length === 0">
|
||||||
|
<div class="col-12 text-center py-3">
|
||||||
|
<i class="fa fa-circle-notch fa-spin fa-2x"></i>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div *ngFor="let job of jobs | orderBy: 'addedOn':true; let last = last" class="pb-2" [ngClass]="{'border-bottom mb-2': !last}">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-8 text-center border-right mb-2">
|
||||||
|
<b>{{job.data.mp4Filename}}</b><br>
|
||||||
|
</div>
|
||||||
|
<div class="col-4 text-center mb-2">
|
||||||
|
<i>{{job.data.wantedResolution || '1080p'}}</i>
|
||||||
|
</div>
|
||||||
|
<div class="col-6">
|
||||||
|
<p class="text-sm mb-1">Job ID: {{ job.id }}</p>
|
||||||
|
</div>
|
||||||
|
<div class="col-6 text-end">
|
||||||
|
<p class="text-sm mb-1">Status: {{ job.state }}</p>
|
||||||
|
</div>
|
||||||
|
<div class="col-6">
|
||||||
|
<p class="text-sm mb-1">Added {{ job.addedOn | amTimeAgo }}</p>
|
||||||
|
</div>
|
||||||
|
<div class="col-6 text-end">
|
||||||
|
<p class="text-sm mb-1">Finished {{ job.finishedOn | amTimeAgo }}</p>
|
||||||
|
</div>
|
||||||
|
<div class="col-12">
|
||||||
|
<p class="text-sm mb-1">Duration: {{ ((job.finishedOn - job.processedOn)/1000) | amDuration:'seconds' }}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="alert alert-danger mt-2" *ngIf="job.state === 'failed' && job.failedReason">
|
||||||
|
{{job.failedReason}}
|
||||||
|
</div>
|
||||||
|
<div class="alert alert-success mt-2 mb-4" *ngIf="job.state === 'completed' && job.returnValue?.message">
|
||||||
|
{{job.returnValue?.message}}<br>
|
||||||
|
<button *ngIf="job.returnValue.filePath && job.returnValue.fileName" [disabled]="job.isDownloading" class="btn btn-success btn-sm float-end" (click)="downloadFileFromAPI(job.returnValue.filePath, job.returnValue.fileName, job)"><i *ngIf="!job.isDownloading" class="fa fa-download me-2"></i><i *ngIf="job.isDownloading" class="fa fa-circle-notch fa-spin me-2"></i>Download</button>
|
||||||
|
</div>
|
||||||
|
<div class="progress" *ngIf="job.state !== 'failed'">
|
||||||
|
<div class="progress-bar" [ngClass]="{'bg-warning': job.state === 'waiting', 'bg-success': job.state === 'completed', 'bg-danger': job.state === 'failed'}" role="progressbar" [style.width.%]="job.progress" aria-valuemin="0" aria-valuemax="100">{{job.progress}}%</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
29
src/app/app.component.spec.ts
Normal file
29
src/app/app.component.spec.ts
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
import { TestBed } from '@angular/core/testing';
|
||||||
|
import { AppComponent } from './app.component';
|
||||||
|
|
||||||
|
describe('AppComponent', () => {
|
||||||
|
beforeEach(async () => {
|
||||||
|
await TestBed.configureTestingModule({
|
||||||
|
imports: [AppComponent],
|
||||||
|
}).compileComponents();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create the app', () => {
|
||||||
|
const fixture = TestBed.createComponent(AppComponent);
|
||||||
|
const app = fixture.componentInstance;
|
||||||
|
expect(app).toBeTruthy();
|
||||||
|
});
|
||||||
|
|
||||||
|
it(`should have the 'crawlflix' title`, () => {
|
||||||
|
const fixture = TestBed.createComponent(AppComponent);
|
||||||
|
const app = fixture.componentInstance;
|
||||||
|
expect(app.title).toEqual('crawlflix');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should render title', () => {
|
||||||
|
const fixture = TestBed.createComponent(AppComponent);
|
||||||
|
fixture.detectChanges();
|
||||||
|
const compiled = fixture.nativeElement as HTMLElement;
|
||||||
|
expect(compiled.querySelector('h1')?.textContent).toContain('Hello, crawlflix');
|
||||||
|
});
|
||||||
|
});
|
||||||
127
src/app/app.component.ts
Normal file
127
src/app/app.component.ts
Normal file
@@ -0,0 +1,127 @@
|
|||||||
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
import { CommonModule } from '@angular/common';
|
||||||
|
import { ReactiveFormsModule, FormBuilder, FormGroup, Validators } from '@angular/forms';
|
||||||
|
import { VideoProcessingService } from './video-processing.service';
|
||||||
|
import { MomentModule } from 'ngx-moment';
|
||||||
|
import { OrderModule } from 'ngx-order-pipe';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-root',
|
||||||
|
standalone: true,
|
||||||
|
imports: [CommonModule, ReactiveFormsModule, MomentModule, OrderModule],
|
||||||
|
templateUrl: './app.component.html',
|
||||||
|
styles: []
|
||||||
|
})
|
||||||
|
export class AppComponent implements OnInit {
|
||||||
|
processingForm: FormGroup;
|
||||||
|
jobId: string | null = null;
|
||||||
|
jobStatus: string | null = null;
|
||||||
|
jobProgress: number = 0;
|
||||||
|
jobs: Array<any> = [];
|
||||||
|
|
||||||
|
initForm() {
|
||||||
|
this.processingForm = this.fb.group({
|
||||||
|
mp4Filename: ['', Validators.required],
|
||||||
|
mpdUrl: ['', Validators.required],
|
||||||
|
keys: ['', Validators.required],
|
||||||
|
wantedResolution: ['1080p', Validators.required]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
constructor(private fb: FormBuilder,
|
||||||
|
private videoProcessingService: VideoProcessingService) {
|
||||||
|
this.processingForm = this.fb.group({
|
||||||
|
mp4Filename: ['', Validators.required],
|
||||||
|
mpdUrl: ['', Validators.required],
|
||||||
|
keys: ['', Validators.required],
|
||||||
|
wantedResolution: ['1080p', Validators.required]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
ngOnInit(): void {
|
||||||
|
this.startPollingJobsStatus();
|
||||||
|
}
|
||||||
|
|
||||||
|
downloadFileFromAPI(filePath: string, filename: string, job: any) {
|
||||||
|
job.isDownloading = true;
|
||||||
|
this.videoProcessingService.downloadFile(filePath).subscribe({
|
||||||
|
next: (response) => {
|
||||||
|
const blob = new Blob([response], { type: 'video/mp4' });
|
||||||
|
const url = window.URL.createObjectURL(blob);
|
||||||
|
const a = document.createElement('a');
|
||||||
|
a.href = url;
|
||||||
|
a.download = filename;
|
||||||
|
a.click();
|
||||||
|
window.URL.revokeObjectURL(url);
|
||||||
|
job.isDownloading = false;
|
||||||
|
},
|
||||||
|
error: (error) => {
|
||||||
|
console.error('Error downloading file:', error);
|
||||||
|
job.isDownloading = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
onSubmit() {
|
||||||
|
if (this.processingForm.valid) {
|
||||||
|
const formData = this.processingForm.value;
|
||||||
|
|
||||||
|
this.videoProcessingService.startProcess(Object.assign(formData, {
|
||||||
|
keys: this.parseKeys(formData.keys)
|
||||||
|
})).subscribe({
|
||||||
|
next: (response) => {
|
||||||
|
//this.jobId = response.jobId;
|
||||||
|
},
|
||||||
|
error: (error) => {
|
||||||
|
console.error('Error starting process:', error);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.initForm();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
parseKeys(keysString: string): { key: string, value: string }[] {
|
||||||
|
console.log('KS =', keysString);
|
||||||
|
return keysString.split('\n').map(line => line.trim())
|
||||||
|
.filter(line => line.includes(':'))
|
||||||
|
.map(line => {
|
||||||
|
const [key, value] = line.split(':').map(part => part.trim());
|
||||||
|
return { key, value };
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// startPollingJobsStatus() {
|
||||||
|
// const interval = setInterval(() => {
|
||||||
|
// this.videoProcessingService.getJobsStatus(this.jobId!).subscribe({
|
||||||
|
// next: (response) => {
|
||||||
|
// this.jobStatus = response.state;
|
||||||
|
// this.jobProgress = response.progress;
|
||||||
|
// if (['completed', 'failed'].includes(response.state)) {
|
||||||
|
// clearInterval(interval);
|
||||||
|
// }
|
||||||
|
// },
|
||||||
|
// error: (error) => {
|
||||||
|
// console.error('Error fetching job status:', error);
|
||||||
|
// clearInterval(interval);
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// }, 1000);
|
||||||
|
// }
|
||||||
|
|
||||||
|
startPollingJobsStatus() {
|
||||||
|
const interval = setInterval(() => {
|
||||||
|
this.videoProcessingService.getJobsStatus().subscribe({
|
||||||
|
next: (response) => {
|
||||||
|
this.jobs = response;
|
||||||
|
// if (['completed', 'failed'].includes(response.state)) {
|
||||||
|
// clearInterval(interval);
|
||||||
|
// }
|
||||||
|
},
|
||||||
|
error: (error) => {
|
||||||
|
console.error('Error fetching job status:', error);
|
||||||
|
//clearInterval(interval);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}, 1000);
|
||||||
|
}
|
||||||
|
}
|
||||||
16
src/app/app.config.ts
Normal file
16
src/app/app.config.ts
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
import { ApplicationConfig, provideZoneChangeDetection } from '@angular/core';
|
||||||
|
import { provideRouter } from '@angular/router';
|
||||||
|
import { provideHttpClient } from '@angular/common/http';
|
||||||
|
import { importProvidersFrom } from '@angular/core'; // Importe cette fonction
|
||||||
|
import { MomentModule } from 'ngx-moment';
|
||||||
|
|
||||||
|
import { routes } from './app.routes';
|
||||||
|
|
||||||
|
export const appConfig: ApplicationConfig = {
|
||||||
|
providers: [
|
||||||
|
provideZoneChangeDetection({ eventCoalescing: true }),
|
||||||
|
provideRouter(routes),
|
||||||
|
provideHttpClient(),
|
||||||
|
importProvidersFrom(MomentModule) // Utilise importProvidersFrom pour intégrer le module
|
||||||
|
]
|
||||||
|
};
|
||||||
3
src/app/app.routes.ts
Normal file
3
src/app/app.routes.ts
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
import { Routes } from '@angular/router';
|
||||||
|
|
||||||
|
export const routes: Routes = [];
|
||||||
24
src/app/video-processing.service.ts
Normal file
24
src/app/video-processing.service.ts
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { HttpClient } from '@angular/common/http';
|
||||||
|
import { Observable } from 'rxjs';
|
||||||
|
|
||||||
|
@Injectable({
|
||||||
|
providedIn: 'root'
|
||||||
|
})
|
||||||
|
export class VideoProcessingService {
|
||||||
|
private apiUrl = 'http://localhost:3000';
|
||||||
|
|
||||||
|
constructor(private http: HttpClient) { }
|
||||||
|
|
||||||
|
startProcess(data: any): Observable<{ jobId: string }> {
|
||||||
|
return this.http.post<{ jobId: string }>(`${this.apiUrl}/start-process`, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
getJobsStatus(): Observable<Array<any>> {
|
||||||
|
return this.http.get<Array<any>>(`${this.apiUrl}/jobs-status`);
|
||||||
|
}
|
||||||
|
|
||||||
|
downloadFile(filePath: string): Observable<Blob> {
|
||||||
|
return this.http.get(`${this.apiUrl}/download/${filePath}`, { responseType: 'blob' });
|
||||||
|
}
|
||||||
|
}
|
||||||
15
src/index.html
Normal file
15
src/index.html
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>Crawlflix</title>
|
||||||
|
<base href="/">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<link rel="icon" type="image/x-icon" href="favicon.ico">
|
||||||
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
|
||||||
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.6.0/css/all.min.css" integrity="sha512-Kc323vGBEqzTmouAECnVceyQqyqdsSiqLQISBL29aUW4U/M7pSPA/gEUZQqv1cwx4OnYxTxve5UMg5GT6L4JJg==" crossorigin="anonymous" referrerpolicy="no-referrer" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<app-root></app-root>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
6
src/main.ts
Normal file
6
src/main.ts
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
import { bootstrapApplication } from '@angular/platform-browser';
|
||||||
|
import { appConfig } from './app/app.config';
|
||||||
|
import { AppComponent } from './app/app.component';
|
||||||
|
|
||||||
|
bootstrapApplication(AppComponent, appConfig)
|
||||||
|
.catch((err) => console.error(err));
|
||||||
1
src/styles.css
Normal file
1
src/styles.css
Normal file
@@ -0,0 +1 @@
|
|||||||
|
/* You can add global styles to this file, and also import other style files */
|
||||||
15
tsconfig.app.json
Normal file
15
tsconfig.app.json
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
/* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
|
||||||
|
/* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
|
||||||
|
{
|
||||||
|
"extends": "./tsconfig.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"outDir": "./out-tsc/app",
|
||||||
|
"types": []
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"src/main.ts"
|
||||||
|
],
|
||||||
|
"include": [
|
||||||
|
"src/**/*.d.ts"
|
||||||
|
]
|
||||||
|
}
|
||||||
33
tsconfig.json
Normal file
33
tsconfig.json
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
/* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
|
||||||
|
/* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
|
||||||
|
{
|
||||||
|
"compileOnSave": false,
|
||||||
|
"compilerOptions": {
|
||||||
|
"outDir": "./dist/out-tsc",
|
||||||
|
"strict": true,
|
||||||
|
"noImplicitOverride": true,
|
||||||
|
"noPropertyAccessFromIndexSignature": true,
|
||||||
|
"noImplicitReturns": true,
|
||||||
|
"noFallthroughCasesInSwitch": true,
|
||||||
|
"skipLibCheck": true,
|
||||||
|
"isolatedModules": true,
|
||||||
|
"esModuleInterop": true,
|
||||||
|
"sourceMap": true,
|
||||||
|
"declaration": false,
|
||||||
|
"experimentalDecorators": true,
|
||||||
|
"moduleResolution": "bundler",
|
||||||
|
"importHelpers": true,
|
||||||
|
"target": "ES2022",
|
||||||
|
"module": "ES2022",
|
||||||
|
"lib": [
|
||||||
|
"ES2022",
|
||||||
|
"dom"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"angularCompilerOptions": {
|
||||||
|
"enableI18nLegacyMessageIdFormat": false,
|
||||||
|
"strictInjectionParameters": true,
|
||||||
|
"strictInputAccessModifiers": true,
|
||||||
|
"strictTemplates": true
|
||||||
|
}
|
||||||
|
}
|
||||||
15
tsconfig.spec.json
Normal file
15
tsconfig.spec.json
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
/* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
|
||||||
|
/* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
|
||||||
|
{
|
||||||
|
"extends": "./tsconfig.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"outDir": "./out-tsc/spec",
|
||||||
|
"types": [
|
||||||
|
"jasmine"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"include": [
|
||||||
|
"src/**/*.spec.ts",
|
||||||
|
"src/**/*.d.ts"
|
||||||
|
]
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user