Skip to content

Commit

Permalink
Revert to Yarn for package management (#2247)
Browse files Browse the repository at this point in the history
* Revert to Yarn for package management

* ?

* update yarn.lock

* Fix type
  • Loading branch information
Brainicism authored Oct 25, 2024
1 parent 1953094 commit 812b844
Show file tree
Hide file tree
Showing 10 changed files with 1,511 additions and 10,612 deletions.
3 changes: 1 addition & 2 deletions .devcontainer/post_create_command.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
# yarn install --frozen-lockfile;
npm ci --force
yarn install --frozen-lockfile;
4 changes: 1 addition & 3 deletions .github/workflows/gci-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,7 @@ jobs:
- name: Install protobuf compiler
run: sudo apt install -y protobuf-compiler
- name: Install dependencies
run: |
# yarn install --frozen-lockfile
npm ci --force
run: yarn install --frozen-lockfile
- name: Acquire youtube session tokens
if: ${{ env.MOCK_AUDIO != 'true' }}
run: mkdir data && bash src/scripts/session-generator.sh data/ bgutil
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/gci-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,7 @@ jobs:
- name: Install protobuf compiler
run: sudo apt install -y protobuf-compiler
- name: Install node dependencies
run: |
# yarn install --frozen-lockfile
npm ci --force
run: yarn install --frozen-lockfile
- name: Prettier
run: npm run prettier-ci
- name: npm run lint
Expand Down
5 changes: 2 additions & 3 deletions docker/kmq/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@ RUN apt-get update && apt-get install -y git \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /app
COPY yarn.lock package.json package-lock.json ./
COPY yarn.lock package.json ./
RUN yarn global add [email protected]
# RUN yarn install --frozen-lockfile
RUN npm ci --force
RUN yarn install --frozen-lockfile
COPY start.sh tsconfig.json ./
COPY i18n/ i18n/
COPY sql_dumps/daisuki/bootstrap.sql sql_dumps/daisuki/bootstrap.sql
Expand Down
8,826 changes: 0 additions & 8,826 deletions package-lock.json

This file was deleted.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"fastify": "^4.28.1",
"fluent-ffmpeg": "^2.1.3",
"googleapis": "^142.0.0",
"googlevideo": "github:LuanRT/googlevideo",
"googlevideo": "^1.1.0",
"i18next": "^23.14.0",
"i18next-fs-backend": "^2.3.2",
"jsdom": "^24.1.1",
Expand Down
2 changes: 1 addition & 1 deletion src/structures/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export default abstract class Session {
};

/** Timer function used to for /timer command */
private guessTimeoutFunc: NodeJS.Timer | undefined;
private guessTimeoutFunc: NodeJS.Timeout | undefined;

constructor(
guildPreference: GuildPreference,
Expand Down
19 changes: 11 additions & 8 deletions src/youtube_onesie_provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,11 @@ export default class YoutubeOnesieProvider {
},
];

const onesieRequest = Protos.OnesieRequest.encode({
const onesieRequest = Protos.OnesiePlayerRequest.encode({
url: "https://youtubei.googleapis.com/youtubei/v1/player?key=AIzaSyDCU8hByM-4DrUqRUYnGn-3llEO78bcxq8",
headers,
body: JSON.stringify(playerRequestJson),
field4: false,
proxiedByTrustedBandaid: true,
field6: false,
}).finish();

Expand All @@ -156,10 +156,11 @@ export default class YoutubeOnesieProvider {
onesieRequest,
);

const body = Protos.OnesieInnertubeRequest.encode({
encryptedRequest: {
const body = Protos.OnesieRequest.encode({
urls: [],
playerRequest: {
encryptedClientKey,
encryptedOnesieRequest: encrypted,
encryptedOnesiePlayerRequest: encrypted,
enableCompression: false,
hmac,
iv,
Expand All @@ -185,6 +186,7 @@ export default class YoutubeOnesieProvider {
innertube.session.context.client.clientVersion,
},
},
bufferedRanges: [],
onesieUstreamerConfig,
}).finish();

Expand Down Expand Up @@ -294,12 +296,13 @@ export default class YoutubeOnesieProvider {
);

const onesieResponse =
Protos.OnesieInnertubeResponse.decode(decryptedData);
Protos.OnesiePlayerResponse.decode(decryptedData);

if (onesieResponse.proxyStatus !== 1)
if (onesieResponse.onesieProxyStatus !== 1)
throw new Error("Proxy status not OK");

if (onesieResponse.status !== 200) throw new Error("Status not OK");
if (onesieResponse.httpStatus !== 200)
throw new Error("Status not OK");

const playerResponse = {
success: true,
Expand Down
3 changes: 1 addition & 2 deletions start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ then
npm run clean
echo "Installing dependencies..."
rm -rf node_modules/
# yarn install --frozen-lockfile
npm ci --force
yarn install --frozen-lockfile
git log -n 1 --pretty=format:"%H" > ../version
fi
rebuild
Expand Down
Loading

0 comments on commit 812b844

Please sign in to comment.