itube-specs 0.0.291 → 0.0.292
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/composables/use-fetch-playlists-by-niche.ts +4 -2
- package/composables/use-fetch-playlists-get-videos-by-id.ts +4 -2
- package/composables/use-fetch-related-searches.ts +4 -2
- package/composables/use-fetch-related-videos.ts +4 -2
- package/composables/use-fetch-top-chips-models.ts +6 -3
- package/composables/use-fetch-top-models.ts +4 -2
- package/composables/use-fetch-top-random-categories.ts +4 -2
- package/composables/use-fetch-top-random-full.ts +3 -1
- package/composables/use-fetch-video-referer-phrases.ts +33 -32
- package/composables/use-fetch-video.ts +4 -2
- package/composables/use-fetch-videos-by-categories.ts +4 -2
- package/composables/use-fetch-videos-by-channel.ts +30 -28
- package/composables/use-fetch-videos-by-model.ts +30 -28
- package/composables/use-fetch-videos-by-tag.ts +4 -2
- package/composables/use-fetch-videos-search-by-niche.ts +4 -2
- package/package.json +1 -1
|
@@ -7,11 +7,13 @@ export const useFetchPlaylistsByNiche = async (apiMethod: (...args: any[]) => Pr
|
|
|
7
7
|
const route = useRoute();
|
|
8
8
|
const { locale } = useI18n();
|
|
9
9
|
const lang = locale.value as ELanguage;
|
|
10
|
+
const key = EAsyncData.GetPlaylistsByNiche;
|
|
11
|
+
const stateKey = computed(() => `data-${key}-${JSON.stringify(route.query)}-${lang}`);
|
|
10
12
|
|
|
11
13
|
const { data, status, error } = await useAsyncData<PaginatedResponse<IPlaylistCard>>(
|
|
12
|
-
|
|
14
|
+
key,
|
|
13
15
|
() => useApiFetcher<PaginatedResponse<IPlaylistCard>>(
|
|
14
|
-
|
|
16
|
+
stateKey.value,
|
|
15
17
|
apiMethod,
|
|
16
18
|
{
|
|
17
19
|
page: Number(route.query[ 'page' ]) || 1,
|
|
@@ -9,11 +9,13 @@ export const useFetchPlaylistsGetVideosById = (
|
|
|
9
9
|
const PER_PAGE = 48;
|
|
10
10
|
const route = useRoute();
|
|
11
11
|
const id = computed(() => String(route.params[ 'id' ]));
|
|
12
|
+
const key = EAsyncData.GetPlaylistsVideo;
|
|
13
|
+
const stateKey = computed(() => `data-${key}-${JSON.stringify(route.query)}-${id.value}`);
|
|
12
14
|
|
|
13
15
|
const { data, status, error } = useAsyncData<PaginatedResponse<IVideoCard>>(
|
|
14
|
-
|
|
16
|
+
key,
|
|
15
17
|
() => useApiFetcher<PaginatedResponse<IVideoCard>>(
|
|
16
|
-
|
|
18
|
+
stateKey.value,
|
|
17
19
|
apiMethod,
|
|
18
20
|
id.value,
|
|
19
21
|
isListPage ? {
|
|
@@ -3,11 +3,13 @@ import { ELanguage } from '../runtime';
|
|
|
3
3
|
|
|
4
4
|
export const useFetchRelatedSearch = (apiMethod: (...args: any[]) => Promise<Array<string>>) => {
|
|
5
5
|
const lang = useI18n().locale.value as ELanguage;
|
|
6
|
+
const key = EAsyncData.RelatedSearch;
|
|
7
|
+
const stateKey = computed(() => `data-${key}-${lang}`);
|
|
6
8
|
|
|
7
9
|
const { data, status, error } = useAsyncData<Array<string>>(
|
|
8
|
-
|
|
10
|
+
key,
|
|
9
11
|
() => useApiFetcher<Array<string>>(
|
|
10
|
-
|
|
12
|
+
stateKey.value,
|
|
11
13
|
apiMethod,
|
|
12
14
|
lang,
|
|
13
15
|
)(),
|
|
@@ -10,6 +10,8 @@ export const useFetchRelatedVideos = async (
|
|
|
10
10
|
const route = useRoute();
|
|
11
11
|
const PER_PAGE = 14;
|
|
12
12
|
const slug = useSlug();
|
|
13
|
+
const key = EAsyncData.RelatedVideos;
|
|
14
|
+
const stateKey = computed(() => `data-${key}-${slug.value}-${JSON.stringify(route.query)}-${lang}`);
|
|
13
15
|
|
|
14
16
|
// const routeName = route.name;
|
|
15
17
|
// const paths = ['playlists-id-slug', 'videos-slug'];
|
|
@@ -19,9 +21,9 @@ export const useFetchRelatedVideos = async (
|
|
|
19
21
|
// }
|
|
20
22
|
|
|
21
23
|
const { data, status, error } = await useAsyncData<PaginatedResponse<IVideoCard>>(
|
|
22
|
-
|
|
24
|
+
key,
|
|
23
25
|
() => useApiFetcher<PaginatedResponse<IVideoCard>>(
|
|
24
|
-
|
|
26
|
+
stateKey.value,
|
|
25
27
|
apiMethod,
|
|
26
28
|
{
|
|
27
29
|
page: Number(route.query[ 'page' ]) || 1,
|
|
@@ -3,15 +3,18 @@ import type { IModelTag } from '../types';
|
|
|
3
3
|
|
|
4
4
|
export const useFetchTopChipsModels = (apiMethod: (...args: any[]) => Promise<IModelTag[]>, cacheId: string) => {
|
|
5
5
|
const { locale } = useI18n();
|
|
6
|
+
const lang = locale.value as ELanguage;
|
|
7
|
+
const key = EAsyncData.TopChipsModels;
|
|
8
|
+
const stateKey = computed(() => `data-${key}-${cacheId}-${lang}`);
|
|
6
9
|
|
|
7
10
|
const { data: topChipsModels, refresh, status } = useAsyncData<IModelTag[]>(
|
|
8
|
-
|
|
11
|
+
stateKey.value,
|
|
9
12
|
() => useApiFetcher<IModelTag[]>(
|
|
10
|
-
|
|
13
|
+
stateKey.value,
|
|
11
14
|
apiMethod,
|
|
12
15
|
20,
|
|
13
16
|
0,
|
|
14
|
-
|
|
17
|
+
lang,
|
|
15
18
|
cacheId,
|
|
16
19
|
)(),
|
|
17
20
|
);
|
|
@@ -4,11 +4,13 @@ import type { IModelCard, PaginatedResponse } from '../types';
|
|
|
4
4
|
export const useFetchTopModels = (apiMethod: (...args: any[]) => Promise<PaginatedResponse<IModelCard>>, limit: number, eName: EAsyncData | string, cacheId: string) => {
|
|
5
5
|
const { locale } = useI18n();
|
|
6
6
|
const lang = locale.value as ELanguage;
|
|
7
|
+
const key = eName;
|
|
8
|
+
const stateKey = computed(() => `data-${key}-${cacheId}-${lang}`);
|
|
7
9
|
|
|
8
10
|
const { data, status, refresh } = useAsyncData(
|
|
9
|
-
|
|
11
|
+
stateKey.value,
|
|
10
12
|
() => useApiFetcher<PaginatedResponse<IModelCard>>(
|
|
11
|
-
|
|
13
|
+
stateKey.value,
|
|
12
14
|
apiMethod,
|
|
13
15
|
limit,
|
|
14
16
|
0,
|
|
@@ -4,11 +4,13 @@ import type { IChipsItem } from '../types';
|
|
|
4
4
|
export const useFetchTopRandomCategories = (apiMethod: (...args: any[]) => Promise<Array<IChipsItem>>, cacheId: string) => {
|
|
5
5
|
const { locale } = useI18n();
|
|
6
6
|
const lang = locale.value as ELanguage;
|
|
7
|
+
const key = EAsyncData.CategoriesTopRandom;
|
|
8
|
+
const stateKey = computed(() => `data-${key}-${cacheId}-${lang}`);
|
|
7
9
|
|
|
8
10
|
const { data: topRandomCategories, refresh, error } = useAsyncData<Array<IChipsItem>>(
|
|
9
|
-
|
|
11
|
+
stateKey.value,
|
|
10
12
|
() => useApiFetcher<Array<IChipsItem>>(
|
|
11
|
-
|
|
13
|
+
stateKey.value,
|
|
12
14
|
apiMethod,
|
|
13
15
|
lang,
|
|
14
16
|
cacheId
|
|
@@ -6,11 +6,13 @@ export const useFetchTopRandomFull = async (
|
|
|
6
6
|
) => {
|
|
7
7
|
const { locale } = useI18n();
|
|
8
8
|
const lang = locale.value as ELanguage;
|
|
9
|
+
const key = EAsyncData.CategoriesTopRandomFull;
|
|
10
|
+
const stateKey = computed(() => `data-${key}-${lang}`);
|
|
9
11
|
|
|
10
12
|
const { data, status, error } = await useAsyncData<Array<ICategoryCard>>(
|
|
11
13
|
EAsyncData.CategoriesTopRandomFull,
|
|
12
14
|
() => useApiFetcher<Array<ICategoryCard>>(
|
|
13
|
-
|
|
15
|
+
stateKey.value,
|
|
14
16
|
apiMethod,
|
|
15
17
|
lang,
|
|
16
18
|
)(),
|
|
@@ -1,41 +1,42 @@
|
|
|
1
|
-
import { useRoute } from 'vue-router';
|
|
2
1
|
import { EAsyncData, ELanguage } from '../runtime';
|
|
3
2
|
|
|
4
3
|
export const useFetchVideoRefererPhrases = (
|
|
5
4
|
apiMethod: (...args: any[]) => Promise<string[]>) => {
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
const { locale } = useI18n();
|
|
6
|
+
const lang = locale.value as ELanguage;
|
|
8
7
|
const slug = useSlug();
|
|
8
|
+
const key = EAsyncData.RefererPhrases;
|
|
9
|
+
const stateKey = computed(() => `data-${key}-${slug.value}-${lang}`);
|
|
9
10
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
11
|
+
const { data, status, error } = useAsyncData<string[]>(
|
|
12
|
+
key,
|
|
13
|
+
() => useApiFetcher<string[]>(
|
|
14
|
+
stateKey.value,
|
|
15
|
+
apiMethod,
|
|
16
|
+
lang,
|
|
17
|
+
slug.value,
|
|
18
|
+
undefined
|
|
19
|
+
)(),
|
|
20
|
+
);
|
|
20
21
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
22
|
+
// async function fetchData() {
|
|
23
|
+
// try {
|
|
24
|
+
// const { $features } = useNuxtApp();
|
|
25
|
+
// const slug = convertString().fromSlug(String(route.params['slug'])) || '';
|
|
26
|
+
//
|
|
27
|
+
// if ($features.FetchByUrlEnabled) {
|
|
28
|
+
// return await VideosApiService.refererPhrasesByUrl(lang, slug, undefined);
|
|
29
|
+
// } else {
|
|
30
|
+
// return await VideosApiService.refererPhrasesById(lang, slug, undefined);
|
|
31
|
+
// }
|
|
32
|
+
// } catch (err) {
|
|
33
|
+
// throw createError({
|
|
34
|
+
// statusCode: 500,
|
|
35
|
+
// statusMessage: 'Error fetching video data',
|
|
36
|
+
// message: err instanceof Error ? err.message : 'An unknown error occurred',
|
|
37
|
+
// });
|
|
38
|
+
// }
|
|
39
|
+
// }
|
|
39
40
|
|
|
40
|
-
|
|
41
|
+
return { data, status, error };
|
|
41
42
|
};
|
|
@@ -8,6 +8,8 @@ export const useFetchVideo = async (
|
|
|
8
8
|
const { locale } = useI18n();
|
|
9
9
|
const lang = locale.value as ELanguage;
|
|
10
10
|
const slug = useSlug();
|
|
11
|
+
const key = EAsyncData.Video;
|
|
12
|
+
const stateKey = computed(() => `data-${key}-${slug.value}-${lang}`);
|
|
11
13
|
let headers = {} as HeadersInit & { 'User-Agent': string };
|
|
12
14
|
|
|
13
15
|
/* Проверка - если сср, то прокидываем беку заголовки пользователя, чтобы не сработал антихотлинк */
|
|
@@ -19,9 +21,9 @@ export const useFetchVideo = async (
|
|
|
19
21
|
}
|
|
20
22
|
|
|
21
23
|
const { data, status, error } = await useAsyncData<IVideoData>(
|
|
22
|
-
|
|
24
|
+
key,
|
|
23
25
|
() => useApiFetcher<IVideoData>(
|
|
24
|
-
|
|
26
|
+
stateKey.value,
|
|
25
27
|
apiMethod,
|
|
26
28
|
lang,
|
|
27
29
|
slug.value,
|
|
@@ -9,12 +9,14 @@ export const useFetchVideosByCategories = async (
|
|
|
9
9
|
const route = useRoute();
|
|
10
10
|
const lang = useI18n().locale.value as ELanguage;
|
|
11
11
|
const slug = useSlug();
|
|
12
|
+
const key = EAsyncData.VideosByCategory;
|
|
13
|
+
const stateKey = computed(() => `data-${key}-${slug.value}-${JSON.stringify(route.query)}-${lang}`);
|
|
12
14
|
const filters = computed(() => useGetVideosFilterRequest(route, selectDurationItems, selectAddedItems));
|
|
13
15
|
|
|
14
16
|
const { data, status, error } = await useAsyncData<PaginatedResponse<IVideoCard>>(
|
|
15
|
-
|
|
17
|
+
key,
|
|
16
18
|
() => useApiFetcher<PaginatedResponse<IVideoCard>>(
|
|
17
|
-
|
|
19
|
+
stateKey.value,
|
|
18
20
|
apiMethod,
|
|
19
21
|
lang,
|
|
20
22
|
{
|
|
@@ -4,37 +4,39 @@ import { selectAddedItems, selectDurationItems, sortItemsDefault } from '../lib'
|
|
|
4
4
|
import { useRoute } from 'vue-router';
|
|
5
5
|
|
|
6
6
|
export const useFetchVideosByChannel = async (apiMethod: (...args: any[]) => Promise<PaginatedResponse<IVideoCard>>) => {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
const route = useRoute();
|
|
8
|
+
const { locale } = useI18n();
|
|
9
|
+
const lang = locale.value as ELanguage;
|
|
10
10
|
const slug = useSlug();
|
|
11
11
|
const filters = computed(() => useGetVideosFilterRequest(route, selectDurationItems, selectAddedItems));
|
|
12
|
+
const key = EAsyncData.VideosByChannel;
|
|
13
|
+
const stateKey = computed(() => `data-${key}-${slug.value}-${JSON.stringify(route.query)}-${lang}`);
|
|
12
14
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
const { data, status, error } = await useAsyncData<PaginatedResponse<IVideoCard>>(
|
|
16
|
+
key,
|
|
17
|
+
() => useApiFetcher<PaginatedResponse<IVideoCard>>(
|
|
18
|
+
stateKey.value,
|
|
19
|
+
apiMethod,
|
|
20
|
+
{
|
|
21
|
+
page: Number(route.query[ 'page' ]) || 1,
|
|
22
|
+
'per-page': 48,
|
|
23
|
+
},
|
|
24
|
+
filters.value,
|
|
25
|
+
slug.value,
|
|
26
|
+
lang,
|
|
27
|
+
getSelectedQuery(route, sortItemsDefault) || '-popularity'
|
|
28
|
+
)(),
|
|
18
29
|
{
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
() => {
|
|
30
|
-
if (route.query) {
|
|
31
|
-
const currentQuery = route.query;
|
|
32
|
-
return JSON.stringify(currentQuery);
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
],
|
|
36
|
-
}
|
|
37
|
-
);
|
|
30
|
+
watch: [
|
|
31
|
+
() => {
|
|
32
|
+
if (route.query) {
|
|
33
|
+
const currentQuery = route.query;
|
|
34
|
+
return JSON.stringify(currentQuery);
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
}
|
|
39
|
+
);
|
|
38
40
|
|
|
39
|
-
|
|
41
|
+
return { data, status, error };
|
|
40
42
|
};
|
|
@@ -4,37 +4,39 @@ import { selectAddedItems, selectDurationItems, sortItemsDefault } from '../lib'
|
|
|
4
4
|
import { useRoute } from 'vue-router';
|
|
5
5
|
|
|
6
6
|
export const useFetchVideosByModel = async (apiMethod: (...args: any[]) => Promise<PaginatedResponse<IVideoCard>>) => {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
const route = useRoute();
|
|
8
|
+
const { locale } = useI18n();
|
|
9
|
+
const lang = locale.value as ELanguage;
|
|
10
10
|
const slug = useSlug();
|
|
11
11
|
const filters = computed(() => useGetVideosFilterRequest(route, selectDurationItems, selectAddedItems));
|
|
12
|
+
const key = EAsyncData.ModelsVideos;
|
|
13
|
+
const stateKey = computed(() => `data-${key}-${slug.value}-${JSON.stringify(route.query)}-${lang}`);
|
|
12
14
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
const { data, status, error } = await useAsyncData<PaginatedResponse<IVideoCard>>(
|
|
16
|
+
key,
|
|
17
|
+
() => useApiFetcher<PaginatedResponse<IVideoCard>>(
|
|
18
|
+
stateKey.value,
|
|
19
|
+
apiMethod,
|
|
20
|
+
{
|
|
21
|
+
page: Number(route.query[ 'page' ]) || 1,
|
|
22
|
+
'per-page': 48,
|
|
23
|
+
},
|
|
24
|
+
filters.value,
|
|
25
|
+
slug.value,
|
|
26
|
+
lang,
|
|
27
|
+
getSelectedQuery(route, sortItemsDefault) || '-popularity'
|
|
28
|
+
)(),
|
|
18
29
|
{
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
() => {
|
|
30
|
-
if (route.query) {
|
|
31
|
-
const currentQuery = route.query;
|
|
32
|
-
return JSON.stringify(currentQuery);
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
],
|
|
36
|
-
}
|
|
37
|
-
);
|
|
30
|
+
watch: [
|
|
31
|
+
() => {
|
|
32
|
+
if (route.query) {
|
|
33
|
+
const currentQuery = route.query;
|
|
34
|
+
return JSON.stringify(currentQuery);
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
}
|
|
39
|
+
);
|
|
38
40
|
|
|
39
|
-
|
|
41
|
+
return { data, status, error };
|
|
40
42
|
};
|
|
@@ -9,11 +9,13 @@ export const useFetchVideosByTag = async (apiMethod: (...args: any[]) => Promise
|
|
|
9
9
|
const lang = locale.value as ELanguage;
|
|
10
10
|
const slug = useSlug();
|
|
11
11
|
const filters = computed(() => useGetVideosFilterRequest(route, selectDurationItems, selectAddedItems));
|
|
12
|
+
const key = EAsyncData.VideosByTag;
|
|
13
|
+
const stateKey = computed(() => `data-${key}-${slug.value}-${JSON.stringify(route.query)}-${lang}`);
|
|
12
14
|
|
|
13
15
|
const { data, status, error } = await useAsyncData<PaginatedResponse<IVideoCard>>(
|
|
14
|
-
|
|
16
|
+
key,
|
|
15
17
|
() => useApiFetcher<PaginatedResponse<IVideoCard>>(
|
|
16
|
-
|
|
18
|
+
stateKey.value,
|
|
17
19
|
apiMethod,
|
|
18
20
|
{
|
|
19
21
|
page: Number(route.query[ 'page' ]) || 1,
|
|
@@ -7,11 +7,13 @@ export const useFetchVideosSearchByNiche = async (apiMethod: (...args: any[]) =>
|
|
|
7
7
|
const lang = locale.value as ELanguage;
|
|
8
8
|
const route = useRoute();
|
|
9
9
|
const slug = useSlug();
|
|
10
|
+
const key = EAsyncData.VideosBySearch;
|
|
11
|
+
const stateKey = computed(() => `data-${key}-${slug.value}-${JSON.stringify(route.query)}-${lang}`);
|
|
10
12
|
|
|
11
13
|
const { data, status, error } = await useAsyncData<PaginatedResponse<IVideoCard>>(
|
|
12
|
-
|
|
14
|
+
key,
|
|
13
15
|
() => useApiFetcher<PaginatedResponse<IVideoCard>>(
|
|
14
|
-
|
|
16
|
+
stateKey.value,
|
|
15
17
|
apiMethod,
|
|
16
18
|
{
|
|
17
19
|
page: Number(route.query[ 'page' ]) || 1,
|