Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

latest version - unexpected token (1:47) #683

Closed
4 tasks done
honzawashere opened this issue Jul 9, 2024 · 15 comments
Closed
4 tasks done

latest version - unexpected token (1:47) #683

honzawashere opened this issue Jul 9, 2024 · 15 comments
Labels
bug Something isn't working

Comments

@honzawashere
Copy link

Steps to reproduce

  1. use getInfo() function with platform "WEB" or "YTMUSIC"
  2. you'll get the error

Failure Logs

SyntaxError: Unexpected token (1:47)
    at pp$4.raise (node_modules\acorn\dist\acorn.js:3586:15)
    at pp$9.unexpected (node_modules\acorn\dist\acorn.js:772:10)
    at pp$9.semicolon (node_modules\acorn\dist\acorn.js:749:68)
    at pp$8.parseVarStatement (node_modules\acorn\dist\acorn.js:1192:10)
    at pp$8.parseStatement (node_modules\acorn\dist\acorn.js:927:19)
    at pp$8.parseBlock (node_modules\acorn\dist\acorn.js:1260:23)
    at pp$5.parseFunctionBody (node_modules\acorn\dist\acorn.js:3404:24)
    at pp$8.parseFunction (node_modules\acorn\dist\acorn.js:1382:10)
    at pp$8.parseFunctionStatement (node_modules\acorn\dist\acorn.js:1076:17)
    at pp$8.parseStatement (node_modules\acorn\dist\acorn.js:915:19) {
  pos: 47,
  loc: Position { line: 1, column: 47 },
  raisedAt: 56
}

Expected behavior

I expected my node.js express server to return the info as an response

Current behavior

instead of getting info, i'm getting an error

Version

Default

Anything else?

i don't know, i've already provided enough information for this issue. if the code is needed, i can also provide if you ask for it.

Checklist

  • I am running the latest version.
  • I checked the documentation and found no answer.
  • I have searched the existing issues and made sure this is not a duplicate.
  • I have provided sufficient information.
@honzawashere honzawashere added the bug Something isn't working label Jul 9, 2024
@honzawashere
Copy link
Author

*not with platform, but with client "WEB" or "YTMUSIC"

@1162064779
Copy link

Same problem,changing the client to ANDROID solved this. The problem with the web client may be caused by ytdlp issues.

@retrouser955
Copy link

Same problem here!

@phobu
Copy link

phobu commented Jul 10, 2024

got the same issue :(

@rahmangans
Copy link

same issue :( please helpp

@PikachuEXE
Copy link

Please only comment if you have additional info to avoid spam notifications
Put reaction on OP to signal that you have the same issue
Thx

@honzawashere
Copy link
Author

honzawashere commented Jul 10, 2024

Same problem,changing the client to ANDROID solved this. The problem with the web client may be caused by ytdlp issues.

That's actually really cool. Switched to "ANDROID" and everything works completely normal! Also "YTMUSIC_ANDROID" is working for me.

@PikachuEXE
Copy link

In FreeTube we have to remove previous player cache entry
But only applicable to those passing cache when using Innertube.create
Might be applicable to your case

https://github.com/FreeTubeApp/FreeTube/pull/5384/files#diff-f4ca67281c6be819c2166841d7631ffd5316d4c3a3b40e01a512c4113a537b2c

@rizer234
Copy link

rizer234 commented Jul 13, 2024

Update package version to latest(v10.1.0). this bug has been resolved.

@binbard
Copy link

binbard commented Jul 14, 2024

@rizer234 not working, already on latest vesion (v10.1.0).

file:///D:/doe/dev/my/ytd/node_modules/jintr/dist/main.js:53
throw new JinterError(e.message);
^
JinterError: Unexpected token (1:47)
at Jinter.evaluate (file:///D:/doe/my/ytd/node_modules/jintr/dist/main.js:53:19)
at Object.evaluate [as eval] (file:///D:/doe/my/ytd/node_modules/youtubei.js/dist/src/platform/jsruntime/jinter.js:10:28)
at Player.decipher (file:///D:/doe/my/ytd/node_modules/youtubei.js/dist/src/core/Player.js:77:38)
at Format.decipher (file:///D:/doe/my/ytd/node_modules/youtubei.js/dist/src/parser/classes/misc/Format.js:126:23)
at Module. (file:///D:/doe/my/ytd/node_modules/youtubei.js/dist/src/utils/FormatUtils.js:14:35)
at Generator.next ()
at D:\doe\try\my\ytd\node_modules\tslib\tslib.js:169:75
at new Promise ()
at __awaiter (D:\doe\my\ytd\node_modules\tslib\tslib.js:165:16)
at Module.download (file:///D:/doe/my/ytd/node_modules/youtubei.js/dist/src/utils/FormatUtils.js:5:12)
Node.js v20.15.0

while running download example given in readme

@honzawashere
Copy link
Author

Update package version to latest(v10.1.0). this bug has been resolved.

the bug is not resolved yet, and for some reason I am also getting another error now when trying to run the same function with ANDROID client now...

Error: Request to https://www.youtube.com/youtubei/v1/player?prettyPrint=false&alt=json failed with status 404

@binbard
Copy link

binbard commented Jul 14, 2024

@honzawashere Same problem of 404 i get with some clients including ANDROID

@honzawashere
Copy link
Author

honzawashere commented Jul 14, 2024

@honzawashere Same problem of 404 i get with some clients including ANDROID

according to some sources, YouTube itself changed some scripts of their app and that's probably why we're receiving the unexpected token error. but about the 404 error, i don't really know what's causing it. in my case i'm logged in to account on my session and maybe that's also causing something but i'm assuming right now something changed with youtube's API, because after trying multiple clients i wasn't able to get it working!

InnertubeError: Request to https://www.youtube.com/youtubei/v1/next?prettyPrint=false&alt=json failed with status 404
at HTTPClient. (node_modules\youtubei.js\bundle\node.cjs:2081:13)
at Generator.next ()
at fulfilled (node_modules\tslib\tslib.js:166:62)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
info: '{\n' +
' "error": {\n' +
' "code": 404,\n' +
' "message": "Requested entity was not found.",\n' +
' "errors": [\n' +
' {\n' +
' "message": "Requested entity was not found.",\n' +
' "domain": "global",\n' +
' "reason": "notFound"\n' +
' }\n' +
' ],\n' +
' "status": "NOT_FOUND"\n' +
' }\n' +
'}\n',
date: 2024-07-14T10:31:11.568Z,
version: '10.1.0'
}

also it's weird to see that it's trying to use "/next" when getting info from video imho. but let's hope it gets quickly fixed.

EDIT: this was my bad, i actually forgot to set UniversalCache to be persistent. i fixed it with iOS client

@absidue
Copy link
Collaborator

absidue commented Jul 14, 2024

@binbard If you have the cache setup, make sure you clear the cache after upgrading.

@honzawashere
Copy link
Author

honzawashere commented Jul 14, 2024

@binbard If you have the cache setup, make sure you clear the cache after upgrading.

yeah, after cleaning the cache and setting up everything again, the android and ios somehow started working for me.

@LuanRT LuanRT closed this as completed Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

10 participants