miraclx / freyr-js

A tool for downloading songs from music streaming services like Spotify and Apple Music.
https://git.io/freyr-js
Apache License 2.0
1.6k stars 103 forks source link

Constantly get "Request failed with status code 403" #681

Open poweronoff opened 4 months ago

poweronoff commented 4 months ago

I run freyr on mac in the version v0.10.3.

Since a few weeks, I get the following error message:

...
[•] Identifying service...[Apple Music]
 [•] Checking authentication...[authenticated]
 Detected [track]
.......
....
| ➤ Collating sources...
    |  ➤ [•] YouTube Music...[success, found 1 source]
    | ➤ Awaiting audiofeeds...[done]
    | [✓] Got album art
Failed to get raw media stream [An error occurred while collecting and parsing information from the URL: Request failed with status code 403]
...

It seems that one of the services responses with 403 (unauthorised), but I have no idea which of them and if there are any credentials needed.

Panic1811 commented 4 months ago

Having same issue

miguelmllr commented 4 months ago

Same issue here

miraclx commented 4 months ago

Interesting, I'll block out some time to look into this as I'm unfortunately unable to reproduce it.

From those partial logs, it looks like we can access YouTube Music

|  ➤ [•] YouTube Music...[success, found 1 source]

and YouTube just fine

| ➤ Awaiting audiofeeds...[done]

So It's downloading the track from the URL sourced from YouTube that fails, which is a manual implementation.

Can any of you provide any tracks I can test with?

I just tried spotify:track:6aLsBnxshrEmFAmoPu57d6 and it seemed to work:

$ freyr spotify:track:6aLsBnxshrEmFAmoPu57d6 --no-net-check
    ____
   / __/_______  __  _______
  / /_/ ___/ _ \/ / / / ___/
 / __/ /  /  __/ /_/ / /
/_/ /_/   \___/\__, /_/
              /____/ v0.10.3

freyr - (c) Miraculous Owonubi <omiraculous@gmail.com>
------------------------------------------------------
Checking directory permissions...[done]
[spotify:track:6aLsBnxshrEmFAmoPu57d6]
 [•] Identifying service...[Spotify]
 [•] Checking authentication...[unauthenticated]
 [Spotify Login]
  [•] Logging in...[done]
 Detected [track]
 Obtaining track metadata...[done]
  ➤ Title: American Sun
  ➤ Album: American Sun
  ➤ Artist: Fire From The Gods
  ➤ Year: 2019
  ➤ Playtime: 03:38
 [•] Collating...
 • [03 American Sun]
    | ➤ Collating sources...
    |  ➤ [•] YouTube Music...[success, found 5 sources]
    | ➤ Awaiting audiofeeds...[done]
    | [✓] Got album art
    | [✓] Got raw track file
    | [•] Post Processing...
 [•] Download Complete
 [•] Embedding Metadata...
  • [✓] 03 American Sun
[•] Collation Complete
============ Stats ============
 [•] Runtime: [16.3s]
 [•] Total queries: [01]
 [•] Total tracks: [01]
     » Skipped: [00]
     ✓ Passed:  [01]
     ✕ Failed:  [00]
 [•] Output directory: [.]
 [•] Total Output size: 8.94 MB
 [•] Total Network Usage: 3.72 MB
     ♫ Media: 3.53 MB
     ➤ Album Art: 187.11 KB
 [•] Output bitrate: 320k
===============================
miraclx commented 4 months ago

as I'm unfortunately unable to reproduce it.

Hold that thought, I just tried the track reported in #680 and that failed

$ freyr https://music.apple.com/us/album/im-sorry-im-not-sorry-ep/1491795443
    ____
   / __/_______  __  _______
  / /_/ ___/ _ \/ / / / ___/
 / __/ /  /  __/ /_/ / /
/_/ /_/   \___/\__, /_/
              /____/ v0.10.3

freyr - (c) Miraculous Owonubi <omiraculous@gmail.com>
------------------------------------------------------
Checking directory permissions...[done]
[https://music.apple.com/us/album/im-sorry-im-not-sorry-ep/1491795443]
 [•] Identifying service...[Apple Music]
 [•] Checking authentication...[unauthenticated]
 [Apple Music Login]
  [•] Logging in...[done]
 Detected [album]
 Obtaining album metadata...[done]
  ➤ Album Name: I'm Sorry, I'm Not Sorry
  ➤ Artist: Sody
  ➤ Tracks: 4
  ➤ Type: Album
  ➤ Year: 2020
  ➤ Genres: Singer/Songwriter, Music
 [•] Collating [I'm Sorry, I'm Not Sorry]...
  [•] Inquiring tracks...[done]
   • [01 What We Had]
      | ➤ Collating sources...
      |  ➤ [•] YouTube Music...[success, found 3 sources]
      | ➤ Awaiting audiofeeds...[done]
      | [✓] Got album art
      | [✕] Failed to get raw media stream [An error occurred while collecting and parsing information from the URL: Request failed with status code 403]
   • [02 Reason To Stay]
      | ➤ Collating sources...
      |  ➤ [•] YouTube Music...[success, found 4 sources]
      | ➤ Awaiting audiofeeds...[done]
      | [✓] Got album art
      | [✕] Failed to get raw media stream [An error occurred while collecting and parsing information from the URL: Request failed with status code 403]
   • [03 Nothing Ever Changes]
      | ➤ Collating sources...
      |  ➤ [•] YouTube Music...[success, found 1 source]
      | ➤ Awaiting audiofeeds...[done]
      | [✓] Got album art
      | [✕] Failed to get raw media stream [An error occurred while collecting and parsing information from the URL: Request failed with status code 403]
   • [04 Love's a Waste]
      | ➤ Collating sources...
      |  ➤ [•] YouTube Music...[success, found 2 sources]
      | ➤ Awaiting audiofeeds...[done]
      | [✓] Got album art
      | [✕] Failed to get raw media stream [An error occurred while collecting and parsing information from the URL: Request failed with status code 403]
 [•] Download Complete
 [•] Embedding Metadata...
  • [✕] 01 What We Had [apple_music:track:1491795452] (failed: Error downloading raw audio [An error occurred while collecting and parsing information from the URL: Request failed with status code 403])
  • [✕] 02 Reason To Stay [apple_music:track:1491795455] (failed: Error downloading raw audio [An error occurred while collecting and parsing information from the URL: Request failed with status code 403])
  • [✕] 03 Nothing Ever Changes [apple_music:track:1491795607] (failed: Error downloading raw audio [An error occurred while collecting and parsing information from the URL: Request failed with status code 403])
  • [✕] 04 Love's a Waste [apple_music:track:1491795614] (failed: Error downloading raw audio [An error occurred while collecting and parsing information from the URL: Request failed with status code 403])
[•] Collation Complete
============ Stats ============
 [•] Runtime: [19.1s]
 [•] Total queries: [01]
 [•] Total tracks: [04]
     » Skipped: [00]
     ✓ Passed:  [00]
     ✕ Failed:  [04]
 [•] Output directory: [.]
 [•] Total Output size: 0.00 B
 [•] Total Network Usage: 0.00 B
     ♫ Media: 0.00 B
     ➤ Album Art: 0.00 B
 [•] Output bitrate: 320k
===============================

looking into it

miraclx commented 4 months ago

It looks like this is due to YouTube changing its client source extractor behavior, of which youtube-dl has been updated to match.

The fix here is to reinstall freyr, which will pull the latest version of youtube-dl.

And if you have a local clone of freyr, all you have to do is:

$ cd freyr-js
$ npm uninstall youtube-dl-exec --no-save && npm install
poweronoff commented 3 months ago

Reinstallation of the youtube-dl-exec helped. Thanks, mate @miraclx

tobeehh commented 3 months ago

same issue in the docker version, unfortunately.

casrhub commented 3 months ago

Awesome, reinstallation worked for me, thanks for explaining the problem @miraclx

dannykorpan commented 3 months ago

same issue in the docker version, unfortunately.

Use the image freyrcli/freyrjs-git:master instead.

puff-dayo commented 1 week ago

Use the image freyrcli/freyrjs-git:master instead.

Thanks, that fixed it for me.