[GH-ISSUE #357] Albums added to library do not show in library on the web app #285

Closed
opened 2026-02-27 22:08:59 +03:00 by kerem · 5 comments
Owner

Originally created by @dominicmarshall34 on GitHub (Mar 2, 2023).
Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/357

Hello

I came accross your API while I was looking at a solution to automate adding all my local music collection to youtube music. (I dont want to upload the files i want to add the albums to my YT music library). Basically syncing.

I have written a script which parses my local music collection and then searches YT music. Finds the album and then tries to add it to library.

I dont receive an error message but for some reason it does not show in my YT library.

The script is:
`
import os
import sys
import time
from ytmusicapi import YTMusic

rootdir = "../../../Desktop/Music"

for root, subdirs, files in os.walk(rootdir):
print("Get Artist and Album from dir list")
pathRemoval = root.replace("../../../Desktop/Music", "")
rawData = pathRemoval.split("/")

if len(rawData) > 2:
    yt = YTMusic('headers_auth.json')
    path = f'{rawData[1]} {rawData[2]}'
    print(path)
    search_results = yt.search(path)
    for item in search_results:
        if 'album' in item.keys():
            album = yt.get_album(item['album']['id'])
            if 'feedbackTokens' in album['tracks'][2]:
                response = yt.edit_song_library_status(
                    album['tracks'][2]['feedbackTokens']['add'])
            break
    time.sleep(3)

`

The response i get is:
{'responseContext': {'serviceTrackingParams': [{'service': 'CSI', 'params': [{'key': 'SubmitMusicLibraryEditFeedback_rid', 'value': '0x8797d7d5f67bdd78'}, {'key': 'c', 'value': 'WEB_REMIX'}, {'key': 'cver', 'value': '1.20230302.01.00'}, {'key': 'yt_li', 'value': '1'}]}, {'service': 'GFEEDBACK', 'params': [{'key': 'e', 'value': '1714252,23804281,23880830,23880833,23918597,23946420,23966208,23983296,23998056,24004644,24007246,24034168,24036948,24077241,24080738,24120820,24135310,24140247,24162919,24164186,24169501,24181174,24187043,24187377,24197450,24211178,24219713,24240253,24241069,24241378,24248092,24255165,24255543,24255545,24262346,24263796,24268142,24281897,24283015,24288043,24288664,24290971,24390675,24391539,24392526,24404640,24406361,24407191,24415864,24415866,24416290,24426636,24428818,24429094,24439360,24439483,24446868,24449516,24450367,24451032,24453129,24456382,24457339,24458203,24458237,24458317,24458324,24458329,24458839,24465097,24466371,24466460,24466622,24466859,24468348,24468724,24469243,24470280,24472694,24477512,24478150,24479964,24481213,24481771,24482434,24482843,24484079,24484161,24486982,39323074'}, {'key': 'logged_in', 'value': '1'}]}, {'service': 'ECATCHER', 'params': [{'key': 'client.fexp', 'value': '24469243,24283015,24479964,24429094,24481771,24135310,24007246,24406361,24211178,24162919,24404640,24004644,24263796,24187043,24164186,24255165,24481213,24458237,23998056,24426636,24241069,24415866,24241378,24197450,24458203,24262346,24248092,1714252,24468724,24482434,24453129,23880833,24468348,24466371,24458329,24466859,24451032,24486982,24036948,24457339,23918597,24077241,24240253,24255543,24466460,24181174,24439360,24034168,23946420,24478150,24219713,23804281,24428818,24439483,24281897,24446868,24458839,24290971,24080738,24415864,24484161,24465097,24169501,24449516,23880830,24470280,24392526,24482843,24472694,24187377,24477512,24120820,24268142,24484079,24391539,24288664,24407191,24450367,39323074,24390675,24466622,23983296,24140247,23966208,24456382,24416290,24458317,24458324,24288043,24255545'}, {'key': 'client.name', 'value': 'WEB_REMIX'}, {'key': 'client.version', 'value': '1.20000101'}]}]}, 'feedbackResponses': [{'isProcessed': True}], 'actions': [{'clickTrackingParams': 'CAAQ09sGIhMIx5Haxoe9_QIVlO7mCh0Yeg_D', 'addToToastAction': {'item': {'notificationActionRenderer': {'responseText': {'runs': [{'text': 'Added to library'}]}, 'trackingParams': 'CAEQuWoiEwjHkdrGh739AhWU7uYKHRh6D8M='}}}}]}

Any information on this would be really helpful!

Kind Regards
Dom

P.S. This API is awesome!

Originally created by @dominicmarshall34 on GitHub (Mar 2, 2023). Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/357 Hello I came accross your API while I was looking at a solution to automate adding all my local music collection to youtube music. (I dont want to upload the files i want to add the albums to my YT music library). Basically syncing. I have written a script which parses my local music collection and then searches YT music. Finds the album and then tries to add it to library. I dont receive an error message but for some reason it does not show in my YT library. The script is: ` import os import sys import time from ytmusicapi import YTMusic rootdir = "../../../Desktop/Music" for root, subdirs, files in os.walk(rootdir): print("Get Artist and Album from dir list") pathRemoval = root.replace("../../../Desktop/Music", "") rawData = pathRemoval.split("/") if len(rawData) > 2: yt = YTMusic('headers_auth.json') path = f'{rawData[1]} {rawData[2]}' print(path) search_results = yt.search(path) for item in search_results: if 'album' in item.keys(): album = yt.get_album(item['album']['id']) if 'feedbackTokens' in album['tracks'][2]: response = yt.edit_song_library_status( album['tracks'][2]['feedbackTokens']['add']) break time.sleep(3) ` The response i get is: `{'responseContext': {'serviceTrackingParams': [{'service': 'CSI', 'params': [{'key': 'SubmitMusicLibraryEditFeedback_rid', 'value': '0x8797d7d5f67bdd78'}, {'key': 'c', 'value': 'WEB_REMIX'}, {'key': 'cver', 'value': '1.20230302.01.00'}, {'key': 'yt_li', 'value': '1'}]}, {'service': 'GFEEDBACK', 'params': [{'key': 'e', 'value': '1714252,23804281,23880830,23880833,23918597,23946420,23966208,23983296,23998056,24004644,24007246,24034168,24036948,24077241,24080738,24120820,24135310,24140247,24162919,24164186,24169501,24181174,24187043,24187377,24197450,24211178,24219713,24240253,24241069,24241378,24248092,24255165,24255543,24255545,24262346,24263796,24268142,24281897,24283015,24288043,24288664,24290971,24390675,24391539,24392526,24404640,24406361,24407191,24415864,24415866,24416290,24426636,24428818,24429094,24439360,24439483,24446868,24449516,24450367,24451032,24453129,24456382,24457339,24458203,24458237,24458317,24458324,24458329,24458839,24465097,24466371,24466460,24466622,24466859,24468348,24468724,24469243,24470280,24472694,24477512,24478150,24479964,24481213,24481771,24482434,24482843,24484079,24484161,24486982,39323074'}, {'key': 'logged_in', 'value': '1'}]}, {'service': 'ECATCHER', 'params': [{'key': 'client.fexp', 'value': '24469243,24283015,24479964,24429094,24481771,24135310,24007246,24406361,24211178,24162919,24404640,24004644,24263796,24187043,24164186,24255165,24481213,24458237,23998056,24426636,24241069,24415866,24241378,24197450,24458203,24262346,24248092,1714252,24468724,24482434,24453129,23880833,24468348,24466371,24458329,24466859,24451032,24486982,24036948,24457339,23918597,24077241,24240253,24255543,24466460,24181174,24439360,24034168,23946420,24478150,24219713,23804281,24428818,24439483,24281897,24446868,24458839,24290971,24080738,24415864,24484161,24465097,24169501,24449516,23880830,24470280,24392526,24482843,24472694,24187377,24477512,24120820,24268142,24484079,24391539,24288664,24407191,24450367,39323074,24390675,24466622,23983296,24140247,23966208,24456382,24416290,24458317,24458324,24288043,24255545'}, {'key': 'client.name', 'value': 'WEB_REMIX'}, {'key': 'client.version', 'value': '1.20000101'}]}]}, 'feedbackResponses': [{'isProcessed': True}], 'actions': [{'clickTrackingParams': 'CAAQ09sGIhMIx5Haxoe9_QIVlO7mCh0Yeg_D', 'addToToastAction': {'item': {'notificationActionRenderer': {'responseText': {'runs': [{'text': 'Added to library'}]}, 'trackingParams': 'CAEQuWoiEwjHkdrGh739AhWU7uYKHRh6D8M='}}}}]}` Any information on this would be really helpful! Kind Regards Dom P.S. This API is awesome!
kerem closed this issue 2026-02-27 22:08:59 +03:00
Author
Owner

@sigma67 commented on GitHub (Mar 2, 2023):

That's just the success message, which means it worked. If it still hasn't showed up, double check if you have multiple accounts and if it was added to a different account.

<!-- gh-comment-id:1451664833 --> @sigma67 commented on GitHub (Mar 2, 2023): That's just the success message, which means it worked. If it still hasn't showed up, double check if you have multiple accounts and if it was added to a different account.
Author
Owner

@dominicmarshall34 commented on GitHub (Mar 2, 2023):

Thanks for getting back to me so quick.

I only have 1 youtube premium subscription but i just checked any other account i have. Nothing in there. I authenticated with the right account I know that for sure. I can see the search history from the API in my you tube music search bar so i know its searching.

The strange thing is its showing that adding is successful when its not appearing. I have tried clearing cache as well

<!-- gh-comment-id:1451678141 --> @dominicmarshall34 commented on GitHub (Mar 2, 2023): Thanks for getting back to me so quick. I only have 1 youtube premium subscription but i just checked any other account i have. Nothing in there. I authenticated with the right account I know that for sure. I can see the search history from the API in my you tube music search bar so i know its searching. The strange thing is its showing that adding is successful when its not appearing. I have tried clearing cache as well
Author
Owner

@dominicmarshall34 commented on GitHub (Mar 2, 2023):

Interestingly enough I just created a second script which subscribes to artists and this works as expected! but the add to library function is still not behaving.

<!-- gh-comment-id:1451699139 --> @dominicmarshall34 commented on GitHub (Mar 2, 2023): Interestingly enough I just created a second script which subscribes to artists and this works as expected! but the add to library function is still not behaving.
Author
Owner

@dominicmarshall34 commented on GitHub (Mar 2, 2023):

I realised I was trying to add an album. not a song

<!-- gh-comment-id:1451740310 --> @dominicmarshall34 commented on GitHub (Mar 2, 2023): I realised I was trying to add an album. not a song
Author
Owner

@sigma67 commented on GitHub (Mar 2, 2023):

Glad you found the issue. Have fun!

<!-- gh-comment-id:1451755008 --> @sigma67 commented on GitHub (Mar 2, 2023): Glad you found the issue. Have fun!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
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
starred/ytmusicapi#285
No description provided.