Skip to content

Commit

Permalink
Revert to Yarn for package management
Browse files Browse the repository at this point in the history
  • Loading branch information
Brainicism committed Oct 25, 2024
1 parent e7c4791 commit 25c8655
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 9,462 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;
3 changes: 1 addition & 2 deletions .github/workflows/gci-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,7 @@ jobs:
run: sudo apt install -y protobuf-compiler
- name: Install dependencies
run: |
# yarn install --frozen-lockfile
npm ci --force
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
3 changes: 1 addition & 2 deletions .github/workflows/gci-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ jobs:
run: sudo apt install -y protobuf-compiler
- name: Install node dependencies
run: |
# yarn install --frozen-lockfile
npm ci --force
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 node-gyp@10.2.0
# 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
9,439 changes: 0 additions & 9,439 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
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
7 changes: 4 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2584,9 +2584,10 @@ googleapis@^142.0.0:
google-auth-library "^9.0.0"
googleapis-common "^7.0.0"

"googlevideo@github:LuanRT/googlevideo":
version "1.0.0"
resolved "git+ssh://git@github.com/LuanRT/googlevideo.git#eb9311e482da9dd0f39f9e3ff1434fef80cc454c"
googlevideo@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/googlevideo/-/googlevideo-1.1.0.tgz#9918b9b0a10a5a37feebfd44d17870baac7c5904"
integrity sha512-tYX8z62UoZEooDOfePOUko4weGC+LxmfZFoihxQLGV7SINP7R14LIHMXKPWUfAm3l7DhDF7iT/TxdJsCbkOE1A==
dependencies:
"@bufbuild/protobuf" "^2.0.0"

Expand Down

0 comments on commit 25c8655

Please sign in to comment.