Merge branch 'current' into newgrounds-support

This commit is contained in:
hyperdefined 2024-07-31 23:51:28 -04:00 committed by GitHub
commit 258a94a715
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 12 additions and 8 deletions

View File

@ -48,10 +48,10 @@ jobs:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and push Docker image - name: Build and push Docker image
uses: docker/build-push-action@v5 uses: docker/build-push-action@v6
with: with:
context: . context: .
platforms: linux/amd64,linux/arm64,linux/arm/v7 platforms: linux/amd64
push: true push: true
tags: ${{ steps.meta.outputs.tags }} tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }} labels: ${{ steps.meta.outputs.labels }}

6
package-lock.json generated
View File

@ -24,7 +24,7 @@
"set-cookie-parser": "2.6.0", "set-cookie-parser": "2.6.0",
"undici": "^5.19.1", "undici": "^5.19.1",
"url-pattern": "1.0.3", "url-pattern": "1.0.3",
"youtubei.js": "^10.2.0" "youtubei.js": "git://github.com/LuanRT/YouTube.js.git#04369be620e452ab3c4b2d14991fc55773995137"
}, },
"engines": { "engines": {
"node": ">=18" "node": ">=18"
@ -1124,8 +1124,8 @@
}, },
"node_modules/youtubei.js": { "node_modules/youtubei.js": {
"version": "10.2.0", "version": "10.2.0",
"resolved": "https://registry.npmjs.org/youtubei.js/-/youtubei.js-10.2.0.tgz", "resolved": "git+ssh://git@github.com/LuanRT/YouTube.js.git#04369be620e452ab3c4b2d14991fc55773995137",
"integrity": "sha512-JLKW9AHQ1qrTwBbre1aDkH8UJFmNcc4+kOSaVou5jSY7AzfFPFJK0yvX6afnLst0UVC9wfXHrLiNx93sutVErA==", "integrity": "sha512-rFjkH7A8ZvQRmCCxIj/AfWHIkEZTQI5N2VN2Oag77oEHF3HYKMNwQkHPVSDNR/qy61cJVvEoP5Azuk0GK7+VFQ==",
"funding": [ "funding": [
"https://github.com/sponsors/LuanRT" "https://github.com/sponsors/LuanRT"
], ],

View File

@ -40,7 +40,7 @@
"set-cookie-parser": "2.6.0", "set-cookie-parser": "2.6.0",
"undici": "^5.19.1", "undici": "^5.19.1",
"url-pattern": "1.0.3", "url-pattern": "1.0.3",
"youtubei.js": "^10.2.0" "youtubei.js": "git://github.com/LuanRT/YouTube.js.git#04369be620e452ab3c4b2d14991fc55773995137"
}, },
"optionalDependencies": { "optionalDependencies": {
"freebind": "^0.2.2" "freebind": "^0.2.2"

View File

@ -160,6 +160,7 @@
"ErrorYTAgeRestrict": "this youtube video is age-restricted, so i can't see it. try another one!", "ErrorYTAgeRestrict": "this youtube video is age-restricted, so i can't see it. try another one!",
"ErrorYTLogin": "couldn't get this youtube video because it requires an account to view.\n\nthis limitation is done by google to seemingly stop scraping, affecting all 3rd party tools and even their own clients.\n\ntry again, but if issue persists, {ContactLink}.", "ErrorYTLogin": "couldn't get this youtube video because it requires an account to view.\n\nthis limitation is done by google to seemingly stop scraping, affecting all 3rd party tools and even their own clients.\n\ntry again, but if issue persists, {ContactLink}.",
"ErrorYTRateLimit": "i got rate limited by youtube. try again in a few seconds, but if issue persists, {ContactLink}.", "ErrorYTRateLimit": "i got rate limited by youtube. try again in a few seconds, but if issue persists, {ContactLink}.",
"ErrorInvalidAcceptHeader": "invalid accept header" "ErrorInvalidAcceptHeader": "invalid accept header",
"ErrorYoutubeDecipher": "youtube updated its decipher algorithm, so i can't get the video info. try again, but if it still doesn't work, please <a class=\"text-backdrop link\" href=\"{repo}\" target=\"_blank\">create an issue on github</a>."
} }
} }

View File

@ -50,7 +50,9 @@ const transformSessionData = (cookie) => {
const cloneInnertube = async (customFetch) => { const cloneInnertube = async (customFetch) => {
const innertube = await ytBase; const innertube = await ytBase;
if (innertube instanceof Error) { if (innertube instanceof Error) {
throw innertube; if (innertube?.message?.endsWith("decipher algorithm")) {
return { error: "ErrorYoutubeDecipher" }
} else throw innertube;
} }
const session = new Session( const session = new Session(
@ -101,6 +103,7 @@ export default async function(o) {
dispatcher: o.dispatcher dispatcher: o.dispatcher
}) })
); );
if (yt.error) return yt;
const quality = o.quality === "max" ? "9000" : o.quality; const quality = o.quality === "max" ? "9000" : o.quality;