diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index baeb91795..338cdef29 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -183,14 +183,14 @@ importers: server: dependencies: '@fastify/cookie': - specifier: 10.0.1 - version: 10.0.1 + specifier: 9.4.0 + version: 9.4.0 '@fastify/helmet': specifier: 12.0.1 version: 12.0.1 '@fastify/multipart': - specifier: 9.0.1 - version: 9.0.1 + specifier: 8.3.0 + version: 8.3.0 '@fastify/static': specifier: 7.0.4 version: 7.0.4 @@ -1250,24 +1250,18 @@ packages: resolution: {integrity: sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA==} engines: {node: '>=14'} - '@fastify/busboy@3.0.0': - resolution: {integrity: sha512-83rnH2nCvclWaPQQKvkJ2pdOjG4TZyEVuFDnlOF6KP08lDaaceVyw/W63mDuafQT+MKHCvXIPpE5uYWeM0rT4w==} - - '@fastify/cookie@10.0.1': - resolution: {integrity: sha512-NV/wbCUv4ETJ5KM1KMu0fLx0nSCm9idIxwg66NZnNbfPQH3rdbx6k0qRs5uy0y+MhBgvDudYRA30KlK659chyw==} + '@fastify/cookie@9.4.0': + resolution: {integrity: sha512-Th+pt3kEkh4MQD/Q2q1bMuJIB5NX/D5SwSpOKu3G/tjoGbwfpurIMJsWSPS0SJJ4eyjtmQ8OipDQspf8RbUOlg==} '@fastify/cors@9.0.1': resolution: {integrity: sha512-YY9Ho3ovI+QHIL2hW+9X4XqQjXLjJqsU+sMV/xFsxZkE8p3GNnYVFpoOxF7SsP5ZL76gwvbo3V9L+FIekBGU4Q==} - '@fastify/deepmerge@2.0.0': - resolution: {integrity: sha512-fsaybTGDyQ5KpPsplQqb9yKdCf2x/pbNpMNk8Tvp3rRz7lVcupKysH4b2ELMN2P4Hak1+UqTYdTj/u4FNV2p0g==} + '@fastify/deepmerge@1.3.0': + resolution: {integrity: sha512-J8TOSBq3SoZbDhM9+R/u77hP93gz/rajSA+K2kGyijPpORPWUXHUpTaleoj+92As0S9uPRP7Oi8IqMf0u+ro6A==} '@fastify/error@3.4.1': resolution: {integrity: sha512-wWSvph+29GR783IhmvdwWnN4bUxTD01Vm5Xad4i7i1VuAOItLvbPAb69sb0IQ2N57yprvhNIwAP5B6xfKTmjmQ==} - '@fastify/error@4.0.0': - resolution: {integrity: sha512-OO/SA8As24JtT1usTUTKgGH7uLvhfwZPwlptRi2Dp5P4KKmJI3gvsZ8MIHnNwDs4sLf/aai5LzTyl66xr7qMxA==} - '@fastify/fast-json-stringify-compiler@4.3.0': resolution: {integrity: sha512-aZAXGYo6m22Fk1zZzEUKBvut/CIIQe/BapEORnxiD5Qr0kPHqqI69NtEMCme74h+at72sPhbkb4ZrLd1W3KRLA==} @@ -1283,8 +1277,8 @@ packages: '@fastify/middie@8.3.3': resolution: {integrity: sha512-+WHavMQr9CNTZoy2cjoDxoWp76kZ3JKjAtZj5sXNlxX5XBzHig0TeCPfPc+1+NQmliXtndT3PFwAjrQHE/6wnQ==} - '@fastify/multipart@9.0.1': - resolution: {integrity: sha512-vt2gOCw/O4EwpN4KlLVJxth4iQlDf7T5ggw2Db2C+UbO2WJBG7y0jEBvu/HT6JIW/lBYaqrrUy9MmTpCKgXEpw==} + '@fastify/multipart@8.3.0': + resolution: {integrity: sha512-A8h80TTyqUzaMVH0Cr9Qcm6RxSkVqmhK/MVBYHYeRRSUbUYv08WecjWKSlG2aSnD4aGI841pVxAjC+G1GafUeQ==} '@fastify/send@2.1.0': resolution: {integrity: sha512-yNYiY6sDkexoJR0D8IDy3aRP3+L4wdqCpvx5WP+VtEU58sn7USmKynBzDQex5X42Zzvw2gNzzYgP90UfWShLFA==} @@ -6423,9 +6417,6 @@ packages: secure-json-parse@2.7.0: resolution: {integrity: sha512-6aU+Rwsezw7VR8/nyvKTx8QpWH9FrcYiXXlqC4z5d5XQBDRqtbfsRjnwGyqbi3gddNtWHuEk9OANUotL26qKUw==} - secure-json-parse@3.0.0: - resolution: {integrity: sha512-YO+gVWyp97H+nCG/qdC8X819iKx5g+BpnO9nYT4uFq4uyI0rSxwtx5qD9rGfScg7FGLYu/YBf8uOtwQKv+gq8g==} - semver-regex@4.0.5: resolution: {integrity: sha512-hunMQrEy1T6Jr2uEVjrAIqjwWcQTgOAcIM52C8MY1EZSD3DDNft04XzvYKPqjED65bNVVko0YI38nYeEHCX3yw==} engines: {node: '>=12'} @@ -6641,6 +6632,10 @@ packages: std-env@3.7.0: resolution: {integrity: sha512-JPbdCEQLj1w5GilpiHAx3qJvFndqybBysA3qUOnznweH4QbNYUsW/ea8QzSrnh0vNsezMMw5bcVool8lM0gwzg==} + stream-wormhole@1.1.0: + resolution: {integrity: sha512-gHFfL3px0Kctd6Po0M8TzEvt3De/xu6cnRrjlfYNhwbhLPLwigI2t1nc6jrzNuaYg5C4YF78PPFuQPzRiqn9ew==} + engines: {node: '>=4.0.0'} + streamx@2.18.0: resolution: {integrity: sha512-LLUC1TWdjVdn1weXGcSxyTR3T4+acB6tVGXT95y0nGbca4t4o/ng1wKAGTljm9VicuCVLvRlqFYXYy5GwgM7sQ==} @@ -8378,24 +8373,20 @@ snapshots: '@fastify/busboy@2.1.1': {} - '@fastify/busboy@3.0.0': {} - - '@fastify/cookie@10.0.1': + '@fastify/cookie@9.4.0': dependencies: cookie-signature: 1.2.1 - fastify-plugin: 5.0.1 + fastify-plugin: 4.5.1 '@fastify/cors@9.0.1': dependencies: fastify-plugin: 4.5.1 mnemonist: 0.39.6 - '@fastify/deepmerge@2.0.0': {} + '@fastify/deepmerge@1.3.0': {} '@fastify/error@3.4.1': {} - '@fastify/error@4.0.0': {} - '@fastify/fast-json-stringify-compiler@4.3.0': dependencies: fast-json-stringify: 5.16.1 @@ -8421,13 +8412,14 @@ snapshots: path-to-regexp: 6.3.0 reusify: 1.0.4 - '@fastify/multipart@9.0.1': + '@fastify/multipart@8.3.0': dependencies: - '@fastify/busboy': 3.0.0 - '@fastify/deepmerge': 2.0.0 - '@fastify/error': 4.0.0 - fastify-plugin: 5.0.1 - secure-json-parse: 3.0.0 + '@fastify/busboy': 2.1.1 + '@fastify/deepmerge': 1.3.0 + '@fastify/error': 3.4.1 + fastify-plugin: 4.5.1 + secure-json-parse: 2.7.0 + stream-wormhole: 1.1.0 '@fastify/send@2.1.0': dependencies: @@ -14520,8 +14512,6 @@ snapshots: secure-json-parse@2.7.0: {} - secure-json-parse@3.0.0: {} - semver-regex@4.0.5: {} semver-truncate@3.0.0: @@ -14761,6 +14751,8 @@ snapshots: std-env@3.7.0: {} + stream-wormhole@1.1.0: {} + streamx@2.18.0: dependencies: fast-fifo: 1.3.2 diff --git a/server/package.json b/server/package.json index 464099317..03e9898f1 100644 --- a/server/package.json +++ b/server/package.json @@ -17,9 +17,9 @@ "server": "dist/server" }, "dependencies": { - "@fastify/cookie": "10.0.1", + "@fastify/cookie": "9.4.0", "@fastify/helmet": "12.0.1", - "@fastify/multipart": "9.0.1", + "@fastify/multipart": "8.3.0", "@fastify/static": "7.0.4", "@fastify/swagger": "9.1.0", "@nestjs/bull": "10.2.1", diff --git a/server/src/core/comments/comments.service.ts b/server/src/core/comments/comments.service.ts index e3d810a5e..6a8276658 100644 --- a/server/src/core/comments/comments.service.ts +++ b/server/src/core/comments/comments.service.ts @@ -6,8 +6,6 @@ import { VTCommentsResponseDto } from 'server/mapper/converter/comments/vt-comme import { toVTCommentsResponseDto } from 'server/mapper/converter/comments/vt-comments.converter'; import { YTNodes } from 'youtubei.js'; -import { GetCommentsSectionParams } from 'youtubei.js/dist/protos/generated/misc/params.js'; -import { u8ToBase64 } from 'youtubei.js/dist/src/utils/Utils'; @Injectable() export class CommentsService { async getComments( @@ -32,6 +30,14 @@ export class CommentsService { parse: true }; } else { + const GetCommentsSectionParams = await import( + 'youtubei.js/dist/protos/generated/misc/params.js' + ).then(el => el.GetCommentsSectionParams); + + const u8ToBase64 = await import('youtubei.js/dist/src/utils/Utils.js').then( + el => el.u8ToBase64 + ); + const writer = GetCommentsSectionParams.encode({ ctx: { videoId diff --git a/server/src/core/search/search.service.ts b/server/src/core/search/search.service.ts index a9b43acd3..354497dd7 100644 --- a/server/src/core/search/search.service.ts +++ b/server/src/core/search/search.service.ts @@ -3,8 +3,7 @@ import { innertubeClient } from 'server/common/innertube/innertube'; import { toVTSearchResultDto } from 'server/mapper/converter/search/vt-search-result.converter'; import { VTSearchDto } from 'server/mapper/dto/search/vt-search.dto'; import { Endpoints, Parser, YTNodes } from 'youtubei.js'; -import { SearchFilter, SearchFilter_Filters_Duration, SearchFilter_Filters_SearchType, SearchFilter_Filters_UploadDate, SearchFilter_SortBy } from 'youtubei.js/dist/protos/generated/misc/params'; -import { u8ToBase64 } from 'youtubei.js/dist/src/utils/Utils'; +import type { SearchFilter } from 'youtubei.js/dist/protos/generated/misc/params'; import { SearchFiltersDto } from './dto/search-filters.dto'; import { SearchQueryDto } from './dto/search-query.dto'; @@ -32,6 +31,13 @@ export class SearchService { let searchFilters; if (searchQuery.filters) { const filters = searchQuery.filters; + const { + SearchFilter_SortBy, + SearchFilter_Filters_UploadDate, + SearchFilter_Filters_SearchType, + SearchFilter_Filters_Duration, + SearchFilter + } = await import('youtubei.js/dist/protos/generated/misc/params'); const search_filter: SearchFilter = {}; search_filter.filters = {}; @@ -104,6 +110,10 @@ export class SearchService { } } + const u8ToBase64 = await import('youtubei.js/dist/src/utils/Utils.js').then( + el => el.u8ToBase64 + ); + searchFilters = encodeURIComponent(u8ToBase64(SearchFilter.encode(search_filter).finish())); }