snobu / destreamer

Save Microsoft Stream videos for offline enjoyment.
MIT License
2.36k stars 440 forks source link

401/404 error codes, even if the videos are available #277

Closed carminoski closed 3 years ago

carminoski commented 3 years ago

Hello, it's a couple of days I am getting errors like this (see verbose down below). The videos are available on Microsoft stream and I can access the manually. I don't understand what has changed , it always worked without problems.

[VERBOSE] Using ffmpeg version 4.2.4-1ubuntu0.1 Copyright (c) 2000-2020 the FFmpeg developers

Access token still good for 51 minutes.

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

Parsing input file

[WARNING] Line 10 is empty, skipping..

[VERBOSE] List of GUIDs and corresponding output directory 
    https://web.microsoftstream.com/video/653f27e6-924b-4700-9b87-cafd224f35b5 => videos 
    https://web.microsoftstream.com/video/c0e75495-c62f-40ec-bdcf-cbb5473b8642 => videos 
    https://web.microsoftstream.com/video/62c02302-77c1-4b1d-a785-5b3d54e375b9 => videos 
    https://web.microsoftstream.com/video/e470dacd-15d7-4805-b2a3-db012689816d => videos 
    https://web.microsoftstream.com/video/d9f70b50-8fd5-4bdd-8532-c9b2f78fe16a => videos 
    https://web.microsoftstream.com/video/133bf16e-f5f9-46d0-933a-3142b6fd7b69 => videos 
    https://web.microsoftstream.com/video/2d4616b8-1fa2-4cae-90f2-1ec430085a8a => videos 
    https://web.microsoftstream.com/video/4fc4d953-894f-40af-acab-6b89c15e877d => videos 
    https://web.microsoftstream.com/video/a6f93806-0d67-448b-8ba5-004f0c2bc791 => videos 

Fetching videos info... 

[WARNING] Got HTTP code 404. Retrying request...

[VERBOSE] Here is the error message: 
 '[object Object]

[ERROR] Error: Request failed with status code 404
    at createError (/home/carmine/destreamer-UniPi/node_modules/axios/lib/core/createError.js:16:15)
    at settle (/home/carmine/destreamer-UniPi/node_modules/axios/lib/core/settle.js:17:12)
    at IncomingMessage.handleStreamEnd (/home/carmine/destreamer-UniPi/node_modules/axios/lib/adapters/http.js:236:11)
    at IncomingMessage.emit (events.js:203:15)
    at endReadableNT (_stream_readable.js:1145:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)
carminoski commented 3 years ago
Using ffmpeg version 4.2.4-1ubuntu0.1 Copyright (c) 2000-2020 the FFmpeg developers

Video URLs:
[ 'list.txt' ]

Access token still good for 3 minutes.

Video GUIDs:
[ 'c0e75495-c62f-40ec-bdcf-cbb5473b8642',
  '62c02302-77c1-4b1d-a785-5b3d54e375b9',
  'e470dacd-15d7-4805-b2a3-db012689816d',
  'd9f70b50-8fd5-4bdd-8532-c9b2f78fe16a',
  '133bf16e-f5f9-46d0-933a-3142b6fd7b69',
  '2d4616b8-1fa2-4cae-90f2-1ec430085a8a',
  '4fc4d953-894f-40af-acab-6b89c15e877d',
  'a6f93806-0d67-448b-8ba5-004f0c2bc791' ]
Fetching metadata...
Got HTTP 404. Retrying request...
{ Error: Request failed with status code 404

...

Unhandled error!
Timeout or fatal error, please check your downloads directory and try again 
mitchelmaxwel commented 3 years ago

Strange. Very nice piece of work. I am following regardless

frashersam commented 3 years ago

hello, I also have the same problem. it happen when I try to download a Microsoft group or text file. The only way i can download is link by link.

sub

carminoski commented 3 years ago

I tried installing the "original" destreamer instead of the forked destreamer-unipi and I am getting the same error message. I used a text file, now I will try to pass directly the links one by one

image

carminoski commented 3 years ago

maybe something has changed in the authentication procedure

image

carminoski commented 3 years ago

now it is making the same thing even with a single video link

snobu commented 3 years ago

Fixed the verbose logging and got this:

[WARNING] Got HTTP code 400. Retrying request...

[VERBOSE] Here is the error message:
{
  error: {
    code: 'BadRequest',
    message: 'The requested $top value is too large. The maximum supported value is 100.'
  }
}

So there's pagination now added to to the API, i added a dirty workaround, only the first 100 videos will be downloaded for a group.

Fix is now applied to both master (destreamer 2.0) and aria2c_forRealNow (3.0).

You'll need to git pull to merge changes then npm run build.

carminoski commented 3 years ago

now it seems to work with single video links, but unfortunately not with a text file list In any case, you did a good job !

snobu commented 3 years ago

Not sure what would be different about a text file as input, do you get the exact same error message as before when using file input?

'The requested $top value is too large. The maximum supported value is 100.'