python - iTunes Com Interface The track is not modifiable -
i add file itunes through com interface , write in comment, when writing comments occurs error -
com_error: (-2147352567, '\xce\xf8\xe8\xe1\xea\xe0.', (0, none, u'the track not modifiable.', none, 0, -1610350077), none)
code:
def addfile(playlist, filepath, comment): iituserplaylist = win32com.client.castto(playlist, 'iituserplaylist') resultadd = iituserplaylist.addfile(filepath) if resultadd == none: return false #bad filepath while resultadd.inprogress == true: #wait adding files print("adding file") number in range(1, resultadd.tracks.count + 1): currenttrack = resultadd.tracks.item(number) if currenttrack.kind == 1: currenttrack = comment #add comment track return true
i think problem @ time itunes handles track, because when restart script error may not occur. of all, i'm doing wrong test on it:
while resultadd.inprogress == true: #wait adding files print("adding file")
but did not find in documentation of other ways.
sorry, bad speak @ english.
i'm pretty sure file read-only.
source : got same problem
Comments
Post a Comment