From 63080b70f96cc9dc03075f11d4535bce882f4294 Mon Sep 17 00:00:00 2001 From: Daniel Haller Date: Tue, 23 Apr 2024 00:27:24 +0200 Subject: [PATCH] adn first full download support (adn subs to ass converter missing) --- components/ADN/ListEpisodes.ts | 18 + components/ADN/Types.ts | 75 +++ pages/addanime.vue | 199 +++++-- pages/index.vue | 29 +- src/api/db/database.ts | 5 +- src/api/routes/adn/adn.service.ts | 625 +++++++++------------- src/api/routes/service/service.service.ts | 121 ++++- src/api/services/subs.ts | 58 ++ src/api/types/adn.ts | 176 ++++-- 9 files changed, 823 insertions(+), 483 deletions(-) diff --git a/components/ADN/ListEpisodes.ts b/components/ADN/ListEpisodes.ts index e69de29..feef9af 100644 --- a/components/ADN/ListEpisodes.ts +++ b/components/ADN/ListEpisodes.ts @@ -0,0 +1,18 @@ +import type { ADNEpisodes, ADNEpisodesFetch } from './Types' + +export async function getEpisodesWithShowIdADN(id: number) { + const { data, error } = await useFetch(`https://gw.api.animationdigitalnetwork.fr/video/show/${id}?offset=0&limit=-1&order=asc`, { + method: 'GET', + headers: { + "x-target-distribution": "de", + }, + }) + + if (error.value || !data.value) { + console.log(error.value) + alert(error.value) + return + } + + return data.value.videos +} diff --git a/components/ADN/Types.ts b/components/ADN/Types.ts index 6c28a0c..3b4630f 100644 --- a/components/ADN/Types.ts +++ b/components/ADN/Types.ts @@ -7,3 +7,78 @@ export interface ADNSearchFetch { episodeCount: number }> } + +export interface ADNEpisodesFetch { + videos: Array +} + +export interface ADNEpisode { + id: number, + title: string, + name: string, + number: string, + shortNumber: string, + season: string, + reference: string, + type: string, + order: number, + image: string, + image2x: string, + summary: string, + releaseDate: string, + duration: number, + url: string, + urlPath: string, + embeddedUrl: string, + languages: Array, + qualities: Array, + rating: number, + ratingsCount: number, + commentsCount: number, + available: boolean, + download: boolean, + free: boolean, + freeWithAds: boolean, + show: { + id: number, + title: string, + type: string, + originalTitle: string, + shortTitle: string, + reference: string, + age: string, + languages: Array, + summary: string, + image: string, + image2x: string, + imageHorizontal: string, + imageHorizontal2x: string, + url: string, + urlPath: string, + episodeCount: number, + genres: Array, + copyright: string, + rating: number, + ratingsCount: number, + commentsCount: number, + qualities: Array, + simulcast: boolean, + free: boolean, + available: boolean, + download: boolean, + basedOn: string, + tagline: Array, + firstReleaseYear: string, + productionStudio: string, + countryOfOrigin: string, + productionTeam: Array<{ + role: string, + name: string, + }>, + nextVideoReleaseDate: string, + indexable: boolean + } + indexable: boolean +} + +export interface ADNEpisodes extends Array {} \ No newline at end of file diff --git a/pages/addanime.vue b/pages/addanime.vue index 9054bb7..a006da1 100644 --- a/pages/addanime.vue +++ b/pages/addanime.vue @@ -3,7 +3,7 @@
-
+
+ ADN downloader is still in beta and can only download ADN Germany +
+
-
+
-
+
- +
- +
-
+
-
+
+ + +
+ +
Loading
+
+
+
+ + +
+ +
Loading
+
+
Dubs: {{ selectedDubs.map((t) => t.name).join(', ') }} @@ -156,7 +188,7 @@
-
+
Subs: {{ selectedSubs.length !== 0 ? selectedSubs.map((t) => t.name).join(', ') : 'No Subs selected' }} @@ -175,7 +207,7 @@
-
+
@@ -197,6 +229,13 @@
+
+ +