tomer8007 / spotify-web-ads-remover

Simple extension to remove audio ads on Spotify web player
GNU General Public License v3.0
204 stars 21 forks source link

Stops playing after around 8 to 9 songs. #18

Closed maRci002 closed 7 months ago

maRci002 commented 7 months ago

First of all, let me congratulate you on this beautiful extension; I really like it. Unfortunately, in the last 7 days, the song stops playing when it ends.

I have attached the log with timestamps:

12:30:49.532 vendor~web-player.e155b8c7.js:1 SpotiAds: Refreshing access token.
12:42:01.201 vendor~web-player.e155b8c7.js:1 SpotifyAdRemover: Encountered ad in spotify:ad:1YcCwSlU9EQ9qOs18W1tk5
12:42:01.209 vendor~web-player.e155b8c7.js:1 SpotifyAdRemover: Encountered ad in spotify:ad:02jsqoU8qNdS2HL5yj2Y4W
12:42:01.487 vendor~web-player.e155b8c7.js:1 SpotifyAdRemover: Encountered ad in spotify:ad:4HIAwkvyYP6R2vXLdMBSKD
12:42:01.512 vendor~web-player.e155b8c7.js:1 SpotifyAdRemover: Encountered ad in spotify:ad:6nGTQMu9SCCkvS03oBaCIn
12:42:02.655 vendor~web-player.e155b8c7.js:1 SpotifyAdRemover: Encountered ad in spotify:ad:02jsqoU8qNdS2HL5yj2Y4W
12:42:31.630 vendor~web-player.e155b8c7.js:1 SpotifyAdRemover: Encountered ad in spotify:ad:02jsqoU8qNdS2HL5yj2Y4W
12:45:52.730 vendor~web-player.e155b8c7.js:1 SpotifyAdRemover: Encountered ad in spotify:ad:02jsqoU8qNdS2HL5yj2Y4W
12:45:52.730 vendor~web-player.e155b8c7.js:1 SpotifyAdRemover: Removed ad at spotify:ad:02jsqoU8qNdS2HL5yj2Y4W
12:45:52.731 vendor~web-player.e155b8c7.js:1 TypeError: Cannot set properties of null (setting 'innerText')
    at showToast (ads_removal.js:458:24)
    at onAdRemoved (ads_removal.js:423:13)
    at manipulateStateMachine (ads_removal.js:250:17)
    at ads_removal.js:130:43
    at async Promise.all (index 3)
push.61866.R @ vendor~web-player.e155b8c7.js:1
12:45:52.737 vendor~web-player.e155b8c7.js:1 SpotifyAdRemover: Encountered ad in spotify:ad:02jsqoU8qNdS2HL5yj2Y4W
12:45:52.740 vendor~web-player.e155b8c7.js:1 SpotifyAdRemover: Encountered ad in spotify:ad:02jsqoU8qNdS2HL5yj2Y4W
12:45:52.740 vendor~web-player.e155b8c7.js:1 SpotifyAdRemover: Removed ad at spotify:ad:02jsqoU8qNdS2HL5yj2Y4W
12:45:52.740 vendor~web-player.e155b8c7.js:1 SpotifyAdRemover: Removed ad at spotify:track:15og0pCEcTFWEXOFKdcJlU
12:45:52.745 vendor~web-player.e155b8c7.js:1 TypeError: Cannot set properties of null (setting 'innerText')
    at showToast (ads_removal.js:458:24)
    at onAdRemoved (ads_removal.js:423:13)
    at manipulateStateMachine (ads_removal.js:250:17)
    at ads_removal.js:130:43
    at async Promise.all (index 3)
push.61866.R @ vendor~web-player.e155b8c7.js:1
12:45:52.904 vendor~web-player.e155b8c7.js:1 SpotifyAdRemover: Encountered ad in spotify:ad:02jsqoU8qNdS2HL5yj2Y4W
12:45:52.904 vendor~web-player.e155b8c7.js:1 SpotifyAdRemover: Removed ad at spotify:ad:02jsqoU8qNdS2HL5yj2Y4W
12:45:52.904 vendor~web-player.e155b8c7.js:1 SpotifyAdRemover: Removed ad at spotify:track:15og0pCEcTFWEXOFKdcJlU
12:45:52.916 vendor~web-player.e155b8c7.js:1 SpotifyAdRemover: Encountered ad in spotify:ad:02jsqoU8qNdS2HL5yj2Y4W
12:45:52.917 vendor~web-player.e155b8c7.js:1 SpotifyAdRemover: Removed ad at spotify:ad:02jsqoU8qNdS2HL5yj2Y4W
12:45:52.917 vendor~web-player.e155b8c7.js:1 SpotifyAdRemover: Removed ad at spotify:track:15og0pCEcTFWEXOFKdcJlU
12:45:54.219 vendor~web-player.e155b8c7.js:1 SpotifyAdRemover: Removed ad at spotify:track:15og0pCEcTFWEXOFKdcJlU
12:46:23.271 vendor~web-player.e155b8c7.js:1 SpotifyAdRemover: Removed ad at spotify:track:15og0pCEcTFWEXOFKdcJlU
12:49:01.343 vendor~web-player.e155b8c7.js:1 SpotifyAdRemover: Removed ad at spotify:track:15og0pCEcTFWEXOFKdcJlU
12:49:05.451 gew1-spclient.spotify.com/gabo-receiver-service/v3/events:1 

       Failed to load resource: the server responded with a status of 401 ()
12:55:49.939 vendor~web-player.e155b8c7.js:1 SpotifyAdRemover: Encountered ad in spotify:ad:35f2qPYeKaluZUIcdzh8RB
12:55:49.952 vendor~web-player.e155b8c7.js:1 SpotifyAdRemover: Encountered ad in spotify:ad:0YnVxysyFWaESsjda4Wlp0
12:55:49.976 spclient.wg.spotify.com/track-playback/v1/devices/d157425cad197710a23dfd937fc29acf1853138c/state:1 

       Failed to load resource: the server responded with a status of 401 ()
12:55:49.976 vendor~web-player.e155b8c7.js:1 SpotiAds: Refreshing access token.
12:55:49.985 spclient.wg.spotify.com/track-playback/v1/devices/d157425cad197710a23dfd937fc29acf1853138c/state:1 

       Failed to load resource: the server responded with a status of 401 ()
12:55:49.985 vendor~web-player.e155b8c7.js:1 SpotiAds: Refreshing access token.
12:55:50.092 vendor~web-player.e155b8c7.js:1 SpotifyAdRemover: Encountered ad in spotify:ad:1T2wui09NIob9b1gpQhFR6
12:55:50.120 vendor~web-player.e155b8c7.js:1 SpotifyAdRemover: Encountered ad in spotify:ad:2Jq3f1nU76twYcSobIHOft
12:55:50.125 spclient.wg.spotify.com/track-playback/v1/devices/d157425cad197710a23dfd937fc29acf1853138c/state:1 

       Failed to load resource: the server responded with a status of 401 ()
12:55:50.125 vendor~web-player.e155b8c7.js:1 SpotiAds: Refreshing access token.
12:55:50.160 spclient.wg.spotify.com/track-playback/v1/devices/d157425cad197710a23dfd937fc29acf1853138c/state:1 

       Failed to load resource: the server responded with a status of 401 ()
12:55:50.160 vendor~web-player.e155b8c7.js:1 SpotiAds: Refreshing access token.
12:55:51.239 vendor~web-player.e155b8c7.js:1 SpotifyAdRemover: Encountered ad in spotify:ad:0YnVxysyFWaESsjda4Wlp0
12:56:20.243 vendor~web-player.e155b8c7.js:1 SpotifyAdRemover: Encountered ad in spotify:ad:0YnVxysyFWaESsjda4Wlp0
12:59:44.498 vendor~web-player.e155b8c7.js:1 SpotifyAdRemover: Encountered ad in spotify:ad:0YnVxysyFWaESsjda4Wlp0
12:59:44.514 vendor~web-player.e155b8c7.js:1 SpotifyAdRemover: Encountered ad in spotify:ad:5N9DxnEp3jsDQLBwujThhR
12:59:44.515 vendor~web-player.e155b8c7.js:1 SpotifyAdRemover: Encountered ad in spotify:ad:5N9DxnEp3jsDQLBwujThhR
12:59:44.628 vendor~web-player.e155b8c7.js:1 SpotifyAdRemover: Encountered ad in spotify:ad:5N9DxnEp3jsDQLBwujThhR
12:59:44.637 vendor~web-player.e155b8c7.js:1 SpotifyAdRemover: Encountered ad in spotify:ad:0YnVxysyFWaESsjda4Wlp0
12:59:44.637 vendor~web-player.e155b8c7.js:1 SpotifyAdRemover: Removed ad at spotify:ad:0YnVxysyFWaESsjda4Wlp0
12:59:44.638 vendor~web-player.e155b8c7.js:1 TypeError: Cannot set properties of null (setting 'innerText')
    at showToast (ads_removal.js:458:24)
    at onAdRemoved (ads_removal.js:423:13)
    at manipulateStateMachine (ads_removal.js:250:17)
    at async ads_removal.js:130:37
    at async Promise.all (index 3)
push.61866.R @ vendor~web-player.e155b8c7.js:1
12:59:44.662 vendor~web-player.e155b8c7.js:1 SpotifyAdRemover: Encountered ad in spotify:ad:0YnVxysyFWaESsjda4Wlp0
12:59:44.662 vendor~web-player.e155b8c7.js:1 SpotifyAdRemover: Removed ad at spotify:ad:0YnVxysyFWaESsjda4Wlp0
12:59:44.662 vendor~web-player.e155b8c7.js:1 SpotifyAdRemover: Removed ad at spotify:track:5Hp4xFihdOE2dmDzxWcBFb
12:59:44.662 vendor~web-player.e155b8c7.js:1 TypeError: Cannot set properties of null (setting 'innerText')
    at showToast (ads_removal.js:458:24)
    at onAdRemoved (ads_removal.js:423:13)
    at manipulateStateMachine (ads_removal.js:250:17)
    at async ads_removal.js:130:37
    at async Promise.all (index 3)
push.61866.R @ vendor~web-player.e155b8c7.js:1
12:59:44.761 vendor~web-player.e155b8c7.js:1 SpotifyAdRemover: Encountered ad in spotify:ad:0YnVxysyFWaESsjda4Wlp0
12:59:44.761 vendor~web-player.e155b8c7.js:1 SpotifyAdRemover: Removed ad at spotify:ad:0YnVxysyFWaESsjda4Wlp0
12:59:44.761 vendor~web-player.e155b8c7.js:1 SpotifyAdRemover: Removed ad at spotify:track:5Hp4xFihdOE2dmDzxWcBFb
12:59:45.924 vendor~web-player.e155b8c7.js:1 SpotifyAdRemover: Encountered ad in spotify:ad:5N9DxnEp3jsDQLBwujThhR
12:59:45.924 vendor~web-player.e155b8c7.js:1 SpotifyAdRemover: Removed ad at spotify:ad:5N9DxnEp3jsDQLBwujThhR
12:59:45.924 vendor~web-player.e155b8c7.js:1 TypeError: Cannot set properties of null (setting 'innerText')
    at showToast (ads_removal.js:458:24)
    at onAdRemoved (ads_removal.js:423:13)
    at manipulateStateMachine (ads_removal.js:250:17)
    at ads_removal.js:130:43
    at async Promise.all (index 3)
push.61866.R @ vendor~web-player.e155b8c7.js:1
13:00:14.910 vendor~web-player.e155b8c7.js:1 SpotifyAdRemover: Encountered ad in spotify:ad:5N9DxnEp3jsDQLBwujThhR
13:00:14.910 vendor~web-player.e155b8c7.js:1 SpotifyAdRemover: Removed ad at spotify:ad:5N9DxnEp3jsDQLBwujThhR
13:00:14.910 vendor~web-player.e155b8c7.js:1 SpotifyAdRemover: Removed ad at spotify:track:5Hp4xFihdOE2dmDzxWcBFb
tomer8007 commented 7 months ago

Thank you. At least the TypeError: Cannot set properties of null (setting 'innerText') is due to Spotify new UI changes. I fixed it in ebb598e240965a3e8f770f3cb34eb7a2ad16e85e.

maRci002 commented 7 months ago

Nice, maybe it will fix my issue. Now, I am waiting a bit for the next song to stop; then, I will try interacting with the UI to see if it throws any useful errors.

maRci002 commented 7 months ago

Thank you. At least the TypeError: Cannot set properties of null (setting 'innerText') is due to Spotify new UI changes. I fixed it in ebb598e.

It seems everything is working as expected, so I'm going to close this issue.

Now, I've noticed only a possibly unnecessary refreshing of the access token. I haven't seen the codebase, but the ongoing refresh request promise could be cached to avoid multiple refreshes. However, this doesn't always happen.

vendor~web-player.e155b8c7.js:1 SpotifyAdRemover: Encountered ad in spotify:ad:0hZs5SIAAZdJ5fS35QU5oi
23:19:19.563 spclient.wg.spotify.com/track-playback/v1/devices/96c350e875760ccdd0492ef47546f67d3e4471fd/state:1 

       Failed to load resource: the server responded with a status of 401 ()
23:19:19.564 vendor~web-player.e155b8c7.js:1 SpotiAds: Refreshing access token.
23:19:19.576 spclient.wg.spotify.com/track-playback/v1/devices/96c350e875760ccdd0492ef47546f67d3e4471fd/state:1 

       Failed to load resource: the server responded with a status of 401 ()
23:19:19.577 vendor~web-player.e155b8c7.js:1 SpotiAds: Refreshing access token.
23:19:19.718 vendor~web-player.e155b8c7.js:1 SpotifyAdRemover: Encountered ad in spotify:ad:1ZRqz1JsFX1ZLtziESXBaX
23:19:19.733 vendor~web-player.e155b8c7.js:1 SpotifyAdRemover: Encountered ad in spotify:ad:412OJatMeBOVw5CBQh8HCn
23:19:19.754 spclient.wg.spotify.com/track-playback/v1/devices/96c350e875760ccdd0492ef47546f67d3e4471fd/state:1 

       Failed to load resource: the server responded with a status of 401 ()
23:19:19.755 vendor~web-player.e155b8c7.js:1 SpotiAds: Refreshing access token.
23:19:19.767 spclient.wg.spotify.com/track-playback/v1/devices/96c350e875760ccdd0492ef47546f67d3e4471fd/state:1 

       Failed to load resource: the server responded with a status of 401 ()
23:19:19.768 vendor~web-player.e155b8c7.js:1 SpotiAds: Refreshing access token.
23:19:20.631 vendor~web-player.e155b8c7.js:1 SpotifyAdRemover: Encountered ad in spotify:ad:0hZs5SIAAZdJ5fS35QU5oi
23:19:49.614 vendor~web-player.e155b8c7.js:1 SpotifyAdRemover: Encountered ad in spotify:ad:0hZs5SIAAZdJ5fS35QU5oi