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

SyntaxError: Unexpected token # in JSON at position 0 -aria2 branch #450

Open
davide-butera opened this issue Jun 4, 2022 · 0 comments
Open

Comments

@davide-butera
Copy link

OS: WSL (with access token recycled from a windows instance)

Launch command used: /usr/bin/node ./build/src/destreamer.js -i [group link]
(the command works in the main branch)

Verbose log
[VERBOSE] Using ffmpeg version 4.4.1-3ubuntu5 Copyright (c) 2000-2021 the FFmpeg developers
[VERBOSE] Using aria2 version 1.36.0

Access token still good for 36 minutes.

[VERBOSE] Session and API info
         API Gateway URL: https://euno-1.api.microsoftstream.com/api/
         API Gateway version: 1.4-private

Parsing video/group urls
[ERROR] 27
[VERBOSE] List of videos and corresponding output directory
....
Downloading video info, this might take a while...
Trying to launch and connect to aria2c...

Connected to aria2 daemon!

Downloading video no.1

progress [░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░] 0%   0 MB/s   0s
[ERROR] Error while downloading, retrying...
[ERROR] Error while downloading, retrying...
[ERROR] Error while downloading, retrying...
[ERROR] undefined
[FATAL ERROR] Unhandled error or uncaught exception!

The node debugger gives an exception at

SyntaxError: Unexpected token # in JSON at position 0
  at JSON.parse (<anonymous>)
    at Object.transformResponse (/home/cacio/destreamer/node_modules/axios/lib/defaults.js:89:21)
    at transform (/home/cacio/destreamer/node_modules/axios/lib/core/transformData.js:18:15)
    at Object.forEach (/home/cacio/destreamer/node_modules/axios/lib/utils.js:245:10)
    at Object.transformData (/home/cacio/destreamer/node_modules/axios/lib/core/transformData.js:17:9)
    at onAdapterResolution (/home/cacio/destreamer/node_modules/axios/lib/core/dispatchRequest.js:57:35)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async downloadVideo (/home/cacio/destreamer/build/src/destreamer.js:163:27)
    at async main (/home/cacio/destreamer/build/src/destreamer.js:299:5)

the data it tries to transform is in src/destreamer.ts, at line 213
masterParser.push(await apiClient.callUrl(video.playbackUrl).then(res => res?.data));```` {status: 200, statusText: 'OK', headers: {…}, config: {…}, request: ClientRequest, …}data:#EXTM3U\r\n#EXT-X-VERSION:4\r\n#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="audio",NAME="aac_eng_2_128_1_1",LANGUAGE="eng",DEFAULT=YES,AUTOSELECT=YES,URI="https://euno-1....\r\n'``` (I don't know if the uri contains private information so I censored the rest
anyway, it expects a JSON but it starts with a #
)

@davide-butera davide-butera changed the title SyntaxError: Unexpected token # in JSON at position 0 SyntaxError: Unexpected token # in JSON at position 0 -aria2 branch Jun 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant