[Bug]: Can't play content added from RSS feed such as podcast from soundcloud CORS issue? #1620

Open
opened 2024-01-10 17:41:40 +00:00 by t3nk3y · 22 comments
t3nk3y commented 2024-01-10 17:41:40 +00:00 (Migrated from github.com)

Preflight Checklist

  • I use the latest version of YouTube Music (Application).
  • I have searched the issue tracker for a bug report that matches the one I want to file, without success.
  • I understand that th-ch/youtube-music has NO affiliation with Google or YouTube

YouTube Music (Application) Version

3.2.2

Are you using the portable version of the YouTube Music Application?

  • I use the portable version of the YouTube Music Application.

What operating system are you using?

Other Linux

Operating System Version

Garuda Linux 6.7.0-AMD-znver2 (64-bit), KDE Plasma 5.27.10

What arch are you using?

x64

Last Known Working YouTube Music (Application) version

No response

Reproduction steps

  1. Open a track from an RSS/external audio source.
  2. Press play, it won't work.
    To add an RSS source:
  3. Go to Library
  4. Click Podcasts (chip below Library tab in header)
  5. Click Add podcast
  6. Choose Add RSS feed
  7. Enter a podcast RSS feed URL, such as: https://feeds.soundcloud.com/playlists/soundcloud:playlists:432476748/sounds.rss

Expected Behavior

External track plays from YT music.

Actual Behavior

External resource shows a 403 error, followed by an info message stating that the audio outputs all 0's due to CORS access restrictions. (This doesn't happen in Chrome or Firefox), and I assume is due to a client side CORS restriction.

image

GET https://cf-media.sndcdn.com/Aebn75mGDwqR?Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiKjovL2NmLW1lZGlhLnNuZGNkbi5jb20vQWVibjc1bUdEd3FSKiIsIkNvbmRpdGlvbiI6eyJEYXRlTGVzc1RoYW4iOnsiQVdTOkVwb2NoVGltZSI6MTcwNDkwNjE3M319fV19&Signature=M3d7fvyrYxgQvG5sqDRdYSQMBjoqLr2eRcaikvnsP4U3njypIQKblosfnoGkDysOEFrt-cYfzVbPlxjzKhArZ5dGpRfzYqDI4O3hK2kQOl9611kLw8z7vvnuZ0viCebAm7pN4h2LLeWKDGo5agNfLxv0C3ytkcty4biqu8KiQU2~Eo5aDBYkWyVNXCP3PSjGciMC4LesfbcQiL~lUzfeKGOXD1Q0BN3nMSZG-Gkk8WSYM12vXtCjTip-~aNGPbLc4Okntvi~1H0JmDyIhyOPZRCDmuUopp3vVYfTZJ7mjxYcjJ9VAYg3v5EZQxd7UGTHp4ybjHBYRiL8mGf54SRSOg__&Key-Pair-Id=APKAI6TU7MMXM5DG6EPQ 403 (Forbidden)
MediaElementAudioSource       /watch?v=OikBtHRKIRY&list=PLIxxqUUjNJMDW_5X-zjMxGBKbcS9p_08s:1 
outputs zeroes due to CORS access restrictions for https://www.podtrac.com/pts/redirect.mp3/feeds.soundcloud.com/stream/887295340-lemme-listen-the-ensigns-log-podcast-episode-066-just-a-little-empathy.mp3

Enabled plugins

  1. Discord Rich Presence
  2. Exponential Volume
  3. In-App Menu
  4. Navigation
  5. Shortcuts (& MPRIS)
  6. Video Toggle

Additional Information

No response

### Preflight Checklist - [X] I use the latest version of YouTube Music (Application). - [X] I have searched the [issue tracker](https://github.com/th-ch/youtube-music/issues) for a bug report that matches the one I want to file, without success. - [X] I understand that **th-ch/youtube-music has NO affiliation with Google or YouTube** ### YouTube Music (Application) Version 3.2.2 ### Are you using the portable version of the YouTube Music Application? - [ ] I use the portable version of the YouTube Music Application. ### What operating system are you using? Other Linux ### Operating System Version Garuda Linux 6.7.0-AMD-znver2 (64-bit), KDE Plasma 5.27.10 ### What arch are you using? x64 ### Last Known Working YouTube Music (Application) version _No response_ ### Reproduction steps 1. Open a track from an RSS/external audio source. 2. Press play, it won't work. To add an RSS source: 1. Go to Library 2. Click Podcasts (chip below Library tab in header) 3. Click Add podcast 4. Choose Add RSS feed 5. Enter a podcast RSS feed URL, such as: https://feeds.soundcloud.com/playlists/soundcloud:playlists:432476748/sounds.rss ### Expected Behavior External track plays from YT music. ### Actual Behavior External resource shows a 403 error, followed by an info message stating that the audio outputs all 0's due to CORS access restrictions. (This doesn't happen in Chrome or Firefox), and I assume is due to a client side CORS restriction. ![image](https://github.com/th-ch/youtube-music/assets/26716328/c5df8273-415c-43cc-91fc-099c7c0b1d8d) ``` GET https://cf-media.sndcdn.com/Aebn75mGDwqR?Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiKjovL2NmLW1lZGlhLnNuZGNkbi5jb20vQWVibjc1bUdEd3FSKiIsIkNvbmRpdGlvbiI6eyJEYXRlTGVzc1RoYW4iOnsiQVdTOkVwb2NoVGltZSI6MTcwNDkwNjE3M319fV19&Signature=M3d7fvyrYxgQvG5sqDRdYSQMBjoqLr2eRcaikvnsP4U3njypIQKblosfnoGkDysOEFrt-cYfzVbPlxjzKhArZ5dGpRfzYqDI4O3hK2kQOl9611kLw8z7vvnuZ0viCebAm7pN4h2LLeWKDGo5agNfLxv0C3ytkcty4biqu8KiQU2~Eo5aDBYkWyVNXCP3PSjGciMC4LesfbcQiL~lUzfeKGOXD1Q0BN3nMSZG-Gkk8WSYM12vXtCjTip-~aNGPbLc4Okntvi~1H0JmDyIhyOPZRCDmuUopp3vVYfTZJ7mjxYcjJ9VAYg3v5EZQxd7UGTHp4ybjHBYRiL8mGf54SRSOg__&Key-Pair-Id=APKAI6TU7MMXM5DG6EPQ 403 (Forbidden) ``` ``` MediaElementAudioSource /watch?v=OikBtHRKIRY&list=PLIxxqUUjNJMDW_5X-zjMxGBKbcS9p_08s:1 outputs zeroes due to CORS access restrictions for https://www.podtrac.com/pts/redirect.mp3/feeds.soundcloud.com/stream/887295340-lemme-listen-the-ensigns-log-podcast-episode-066-just-a-little-empathy.mp3 ``` ### Enabled plugins 1. Discord Rich Presence 2. Exponential Volume 3. In-App Menu 4. Navigation 5. Shortcuts (& MPRIS) 6. Video Toggle ### Additional Information _No response_
JellyBrick commented 2024-02-18 01:35:41 +00:00 (Migrated from github.com)

I can reproduce this issue, but I can't figure out why - maybe it's a bug in Electron?

I can reproduce this issue, but I can't figure out why - maybe it's a bug in Electron?
JonUleis commented 2024-03-28 00:07:00 +00:00 (Migrated from github.com)

Would be great if we could listen to podcasts in the app now that Google Podcasts is folding into YTM. On macOS in this app, podcasts visually appear to be playing (the time/duration advances each second, play icon switches to pause) but no audio is heard.

Would be great if we could listen to podcasts in the app now that Google Podcasts is folding into YTM. On macOS in this app, podcasts visually appear to be playing (the time/duration advances each second, play icon switches to pause) but no audio is heard.
Proulxs commented 2024-05-02 17:55:28 +00:00 (Migrated from github.com)

Issue still present on v3.3.6 portable for me. Youtube made me move my podcast today since they are shutting down but Youtube Music app doesn't work to play them. No issue on music.youtube website so doesn't seem to be on their side.

Issue still present on v3.3.6 portable for me. Youtube made me move my podcast today since they are shutting down but Youtube Music app doesn't work to play them. No issue on music.youtube website so doesn't seem to be on their side.
Insane-Owl commented 2024-06-15 06:27:23 +00:00 (Migrated from github.com)

same Issue on v3.3.12

same Issue on v3.3.12
MulverineX commented 2024-07-15 02:11:08 +00:00 (Migrated from github.com)

This is probably an issue with the CSP headers being received from YouTube, the app needs a way to remove these or disable CSP entirely.

This is probably an issue with the CSP headers being received from YouTube, the app needs a way to remove these or disable CSP entirely.
MulverineX commented 2024-07-15 02:14:46 +00:00 (Migrated from github.com)
https://github.com/electron/electron/issues/19775#issuecomment-1001643667
Insane-Owl commented 2024-08-28 00:58:20 +00:00 (Migrated from github.com)

Any updates on this Issue?

Any updates on this Issue?
Lordmau5 commented 2024-10-13 18:52:22 +00:00 (Migrated from github.com)

Just moved my Spotify library over to YT Music and found out about this app

Sadly also running into this issue with 3.6.0 :(


Edit:
Just added this line into the index.ts file and ran it from the console using pnpm dev and it started playing the podcast without any issues
https://github.com/electron/electron/issues/19775#issuecomment-834649057

(specifically after this line to have it neatly organized with the NODE_OPTIONS setting)
0fcbe38837/src/index.ts (L75)

I've also tried listening to other songs and so far I've not encountered any issues

Just moved my Spotify library over to YT Music and found out about this app Sadly also running into this issue with 3.6.0 :( ___ Edit: Just added this line into the `index.ts` file and ran it from the console using `pnpm dev` and it started playing the podcast without any issues https://github.com/electron/electron/issues/19775#issuecomment-834649057 (specifically after this line to have it neatly organized with the `NODE_OPTIONS` setting) https://github.com/th-ch/youtube-music/blob/0fcbe38837f37413429ed36878ab3f8207e4e9cc/src/index.ts#L75 I've also tried listening to other songs and so far I've not encountered any issues
JellyBrick commented 2024-10-13 19:05:34 +00:00 (Migrated from github.com)

fixed at 77bfe8e218

Thanks to @MulverineX and @Lordmau5!

fixed at https://github.com/th-ch/youtube-music/commit/77bfe8e218ce606f6b78ae194fbd40321fbd7ce5 Thanks to @MulverineX and @Lordmau5!
Lordmau5 commented 2024-10-13 19:08:21 +00:00 (Migrated from github.com)

The protocol approach seems like the more elegant way - very happy to hear that it was an easy fix

Didn't mention it before but thank you and the team for making a nice, extensible wrapper around the YT Music app! 😁

The protocol approach seems like the more elegant way - very happy to hear that it was an easy fix Didn't mention it before but thank you and the team for making a nice, extensible wrapper around the YT Music app! 😁
JellyBrick commented 2024-12-18 03:01:40 +00:00 (Migrated from github.com)

@Lordmau5 Still reproducible this issue after 3.6.2?

@Lordmau5 Still reproducible this issue after 3.6.2?
Lordmau5 commented 2024-12-18 10:59:23 +00:00 (Migrated from github.com)

I am getting this error now when trying to play back a podcast added via RSS and while it looks like it's playing, there is no sound outputting

MediaElementAudioSource outputs zeroes due to CORS access restrictions for https://pdst.fm/e/mgln.ai/e/135/chrt.fm/track/8E527/verifi.podscribe.com/rss/p/swap.fm/track/i7NUCPwi3tJP053nG6mP/traffic.megaphone.fm/STU8887385542.mp3?updated=1733727613

The podcast / RSS feed in question:
https://feeds.megaphone.fm/trashtaste

And yes, I just updated to 3.6.2 (was still on 3.6.1) - still happening on that unfortunately (or rather, happening again?)

I am getting this error now when trying to play back a podcast added via RSS and while it looks like it's playing, there is no sound outputting ``` MediaElementAudioSource outputs zeroes due to CORS access restrictions for https://pdst.fm/e/mgln.ai/e/135/chrt.fm/track/8E527/verifi.podscribe.com/rss/p/swap.fm/track/i7NUCPwi3tJP053nG6mP/traffic.megaphone.fm/STU8887385542.mp3?updated=1733727613 ``` The podcast / RSS feed in question: https://feeds.megaphone.fm/trashtaste And yes, I just updated to 3.6.2 (was still on 3.6.1) - still happening on that unfortunately (or rather, happening again?)
Owner

In my synced-lyrics PR I had to fix CORS because the current fix was not working for me, maybe that also fixes this issue?

https://github.com/ArjixWasTaken/youtube-music/blob/synced-lyrics/src/index.ts#L901-L916

betterSession.webRequest.onHeadersReceived((details, callback) => {
    details.responseHeaders ??= {};

    // prettier-ignore
    if (new URL(details.url).protocol === 'https:') {
      // Remove the content security policy
      delete details.responseHeaders['content-security-policy-report-only'];
      delete details.responseHeaders['content-security-policy'];

      // Only allow cross-origin requests from music.youtube.com
      delete details.responseHeaders['access-control-allow-origin'];
      details.responseHeaders['access-control-allow-origin'] = ['https://music.youtube.com'];
    }

    callback({ cancel: false, responseHeaders: details.responseHeaders });
  });
In my synced-lyrics PR I had to fix CORS because the current fix was not working for me, maybe that also fixes this issue? https://github.com/ArjixWasTaken/youtube-music/blob/synced-lyrics/src/index.ts#L901-L916 ```typescript betterSession.webRequest.onHeadersReceived((details, callback) => { details.responseHeaders ??= {}; // prettier-ignore if (new URL(details.url).protocol === 'https:') { // Remove the content security policy delete details.responseHeaders['content-security-policy-report-only']; delete details.responseHeaders['content-security-policy']; // Only allow cross-origin requests from music.youtube.com delete details.responseHeaders['access-control-allow-origin']; details.responseHeaders['access-control-allow-origin'] = ['https://music.youtube.com']; } callback({ cancel: false, responseHeaders: details.responseHeaders }); }); ```
Lordmau5 commented 2024-12-18 17:20:06 +00:00 (Migrated from github.com)

In my synced-lyrics PR I had to fix CORS because the current fix was not working for me, maybe that also fixes this issue?

ArjixWasTaken/youtube-music@synced-lyrics/src/index.ts#L901-L916

betterSession.webRequest.onHeadersReceived((details, callback) => {
    details.responseHeaders ??= {};

    // prettier-ignore
    if (new URL(details.url).protocol === 'https:') {
      // Remove the content security policy
      delete details.responseHeaders['content-security-policy-report-only'];
      delete details.responseHeaders['content-security-policy'];

      // Only allow cross-origin requests from music.youtube.com
      delete details.responseHeaders['access-control-allow-origin'];
      details.responseHeaders['access-control-allow-origin'] = ['https://music.youtube.com'];
    }

    callback({ cancel: false, responseHeaders: details.responseHeaders });
  });

Tried with this code in the master branch, unfortunately still getting the same error and no audio

> In my synced-lyrics PR I had to fix CORS because the current fix was not working for me, maybe that also fixes this issue? > > [ArjixWasTaken/youtube-music@`synced-lyrics`/src/index.ts#L901-L916](https://github.com/ArjixWasTaken/youtube-music/blob/synced-lyrics/src/index.ts#L901-L916) > > ```ts > betterSession.webRequest.onHeadersReceived((details, callback) => { > details.responseHeaders ??= {}; > > // prettier-ignore > if (new URL(details.url).protocol === 'https:') { > // Remove the content security policy > delete details.responseHeaders['content-security-policy-report-only']; > delete details.responseHeaders['content-security-policy']; > > // Only allow cross-origin requests from music.youtube.com > delete details.responseHeaders['access-control-allow-origin']; > details.responseHeaders['access-control-allow-origin'] = ['https://music.youtube.com']; > } > > callback({ cancel: false, responseHeaders: details.responseHeaders }); > }); > ``` Tried with this code in the master branch, unfortunately still getting the same error and no audio
JellyBrick commented 2024-12-25 01:23:41 +00:00 (Migrated from github.com)

fixed by 533b96d1f6

fixed by https://github.com/th-ch/youtube-music/commit/533b96d1f6f2254027b4a0e7ba9187f2e34e3ced
Lordmau5 commented 2024-12-25 11:06:08 +00:00 (Migrated from github.com)

Not sure why it was closed when I said it wasn't fixed.

It still doesn't play with 3.7.0 and throws this error in the console:

MediaElementAudioSource outputs zeroes due to CORS access restrictions for https://pdst.fm/e/mgln.ai/e/135/chrt.fm/track/8E527/verifi.podscribe.com/rss/p/swap.fm/track/i7NUCPwi3tJP053nG6mP/traffic.megaphone.fm/STU8887385542.mp3?updated=1733727613
Not sure why it was closed when I said it wasn't fixed. It still doesn't play with 3.7.0 and throws this error in the console: ``` MediaElementAudioSource outputs zeroes due to CORS access restrictions for https://pdst.fm/e/mgln.ai/e/135/chrt.fm/track/8E527/verifi.podscribe.com/rss/p/swap.fm/track/i7NUCPwi3tJP053nG6mP/traffic.megaphone.fm/STU8887385542.mp3?updated=1733727613 ```
JellyBrick commented 2024-12-25 11:45:27 +00:00 (Migrated from github.com)

Not sure why it was closed when I said it wasn't fixed.

I can't reproduce this issue when testing with this link (https://feeds.soundcloud.com/playlists/soundcloud:playlists:432476748/sounds.rss)

> Not sure why it was closed when I said it wasn't fixed. I can't reproduce this issue when testing with this link (https://feeds.soundcloud.com/playlists/soundcloud:playlists:432476748/sounds.rss)
Lordmau5 commented 2024-12-25 12:23:35 +00:00 (Migrated from github.com)

Can you try with this one I linked further up?

https://feeds.megaphone.fm/trashtaste

Can you try with this one I linked further up? https://feeds.megaphone.fm/trashtaste
Proulxs commented 2025-01-08 13:53:00 +00:00 (Migrated from github.com)

Still not working in version 3.7.1.0. I am using portable and trying to listen to BBC podcast or any of the MSNBC ones. I don't see where I can find the link to share within the app.
Podcast added from within the app by "Add a podcast" then find the podcast I want will work fine.
My podcasts were added "from a RSS feed" automatically by Google when I asked them to move my podcasts from the old Podcast app to youtube Music. I tried to find some of them on youtube music without much success.

Right now the msnbc ones refuse to even try to play. But BBC do and show these 2 errors in console:
GET https://i1.ytimg.com/vi/QMGuBJJ0EQ0/mqdefault.jpg 404 (Not Found)
watch?v=Bc7er_kdCuE:1 MediaElementAudioSource outputs zeroes due to CORS access restrictions for https://dl.iono.fm/epi/prov_4/epi_1516150_medium.m4a?p=rss

Both link change each different stream but the errors are the same.

Still not working in version 3.7.1.0. I am using portable and trying to listen to BBC podcast or any of the MSNBC ones. I don't see where I can find the link to share within the app. Podcast added from within the app by "Add a podcast" then find the podcast I want will work fine. My podcasts were added "from a RSS feed" automatically by Google when I asked them to move my podcasts from the old Podcast app to youtube Music. I tried to find some of them on youtube music without much success. Right now the msnbc ones refuse to even try to play. But BBC do and show these 2 errors in console: GET https://i1.ytimg.com/vi/QMGuBJJ0EQ0/mqdefault.jpg 404 (Not Found) watch?v=Bc7er_kdCuE:1 MediaElementAudioSource outputs zeroes due to CORS access restrictions for https://dl.iono.fm/epi/prov_4/epi_1516150_medium.m4a?p=rss Both link change each different stream but the errors are the same.
schwarztrinker commented 2025-02-16 08:51:22 +00:00 (Migrated from github.com)

I also experience this bug referring to a CORS problem - will append the error and link URL for further solution of the bug. Maybe that helps:

> GET https://i1.ytimg.com/vi/zDfiCCrj3DM/mqdefault.jpg 404 (Not Found)
> MediaElementAudioSource outputs zeroes due to CORS access restrictions for https://audio.podigee-cdn.net/1787514-m-0152304ae149b18838c77ff948b56b00.mp3?source=feed
I also experience this bug referring to a CORS problem - will append the error and link URL for further solution of the bug. Maybe that helps: ``` > GET https://i1.ytimg.com/vi/zDfiCCrj3DM/mqdefault.jpg 404 (Not Found) > MediaElementAudioSource outputs zeroes due to CORS access restrictions for https://audio.podigee-cdn.net/1787514-m-0152304ae149b18838c77ff948b56b00.mp3?source=feed ```
aldo-alcantar commented 2025-08-26 21:50:51 +00:00 (Migrated from github.com)

Justo confirm this issue is still present on 3.10.0.0

Justo confirm this issue is still present on 3.10.0.0
JellyBrick commented 2025-09-06 04:37:50 +00:00 (Migrated from github.com)

Caused by this code..

26fa1f85b2/src/renderer.ts (L308-L311)

I have no idea how to fix it.

Caused by this code.. https://github.com/th-ch/youtube-music/blob/26fa1f85b2774bf4badb593659290defe4cc26ef/src/renderer.ts#L308-L311 I have no idea how to fix it.
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: YTMD/youtube-music#1620
No description provided.