1

我正在制作一个将播放列表从 Spotify 复制到 Google Music 的程序。

此时,我正在测试是否可以使用我的 Spotify 曲目列表从 Google 音乐中成功获取歌曲 ID

这是带有曲目信息的 Spotify 列表的代码:

playlist = sp.user_playlist_tracks(dest_username, playlist_id=dest_playlist)

for index in playlist['items']:
    track = "{} - {}".format(index['track']['artists'][0]['name'], index['track']['name'])
    playlist_tracks.append(track)

我采用此代码并像这样使用它:

for song in playlist:
    track = api.search(song)
    spotify_grab.uprint("{}: {} - {}".format(
        song,
        track['song_hits'][0]['track']['title'],
        track['song_hits'][0]['track']['nid']))

这是输出的一个小片段(前 3 行和下 2 行是它应该看起来的样子):

Percival Schuttenbach - The Musty Scent Of Fresh Pâté: The Musty Scent Of Fresh Pâté - kcyfimgawyryn7bvumoqupawsu
Paradox Interactive - Learn to Spell Again (Are You a Wizard?) [feat. Oskar Clase]: Learn to Spell Again (Are You a Wizard?) [feat. Oskar Clase] - jarz5xyjizoyyvfinzg7tenoye
Paradox Interactive - Interdependence Celebration (feat. Oskar Clase): Interdependence Celebration (feat. Oskar Clase) - u6hf2ybtscs4j73ruxxcl6t6wm
--- Logging error ---
Traceback (most recent call last):
  File "C:\Python35\lib\logging\__init__.py", line 982, in emit
stream.write(msg)
  File "C:\Python35\lib\encodings\cp1252.py", line 19, in encode
    return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\u0308' in position 11199: character maps to <undefined>
Call stack:
  File ".\gmusic_playlist.py", line 15, in <module>
    track = api.search(song)
  File "C:\Python35\lib\site-packages\gmusicapi\clients\mobileclient.py", line 1820, in search
    res = self._make_call(mobileclient.Search, query, max_results)
  File "C:\Python35\lib\site-packages\gmusicapi\clients\shared.py", line 84, in _make_call
    return protocol.perform(self.session, self.validate, *args, **kwargs)
  File "C:\Python35\lib\site-packages\gmusicapi\protocol\shared.py", line 243, in perform
    log.debug(cls.filter_response(parsed_response))
Message: {'kind': 'sj#searchresponse', 'entries': [{'type': '3', 'album': {'albumArtist': 'Atli Örvarsson', 'albumId': 'Bxflgjbdswpxqr5zv7rmj6gr2iu', 'kind': 'sj#album', 'artist': 'Atli Örvarsson', 'artistId': ['Am7zbqal6la6kfowfa4vynsnsm4'], 'name': 'Rams (Original Moti
on Picture Soundtrack)', 'explicitType': '2', 'albumArtRef': 'http://lh3.googleusercontent.com/LmHSOcQKdeTkMESZvTDh6bcfGc1-QnnVH3qebsLymk_bhr_rUZ9WKudPHBcXLMQKm0kN07HwWw', 'year': 2015}}, {'track': {'trackNumber': 1, 'genre': 'Soundtracks', 'explicitType': '2', 'kind': '
sj#track', 'title': 'Rams', 'year': 2015, 'discNumber': 1, 'albumId': 'xflgjbdswpxqr5zv7rmj6gr2iu', 'album': 'Rams (Original Motion Picture Soundtrack)', 'trackAvailableForPurchase': True, 'artist': 'Atli Örvarsson', 'durationMillis': '74000', 'trackType': '7', 'estimate
dSize': '2968582', 'artistId': ['m7zbqal6la6kfowfa4vynsnsm4'], 'albumArtRef': [{'autogen': False, 'url': 'http://lh3.googleusercontent.com/LmHSOcQKdeTkMESZvTDh6bcfGc1-QnnVH3qebsLymk_bhr_rUZ9WKudPHBcXLMQKm0kN07HwWw', 'kind': 'sj#imageRef', 'aspectRatio': '1'}], 'composer'
: '', 'storeId': 'Tdkm4svcawhuylqg7kinnwql6qu', 'nid': 'dkm4svcawhuylqg7kinnwql6qu', 'albumArtist': 'Atli Örvarsson', 'albumAvailableForPurchase': True, 'trackAvailableForSubscription': True}, 'type': '1'}, {'track': {'trackNumber': 13, 'genre': 'Soundtracks', 'explicitT
ype': '2', 'kind': 'sj#track', 'title': 'Lundarbrekka', 'year': 2015, 'discNumber': 1, 'albumId': 'xflgjbdswpxqr5zv7rmj6gr2iu', 'album': 'Rams (Original Motion Picture Soundtrack)', 'trackAvailableForPurchase': True, 'artist': 'Atli Örvarsson', 'durationMillis': '319000'
, 'trackType': '7', 'estimatedSize': '12778084', 'artistId': ['m7zbqal6la6kfowfa4vynsnsm4'], 'albumArtRef': [{'autogen': False, 'url': 'http://lh3.googleusercontent.com/LmHSOcQKdeTkMESZvTDh6bcfGc1-QnnVH3qebsLymk_bhr_rUZ9WKudPHBcXLMQKm0kN07HwWw', 'kind': 'sj#imageRef', 'a
spectRatio': '1'}], 'composer': '', 'storeId': 'Ty2oyhvfxrdjq2y2choybh63tke', 'nid': 'y2oyhvfxrdjq2y2choybh63tke', 'albumArtist': 'Atli Örvarsson', 'albumAvailableForPurchase': True, 'trackAvailableForSubscription': True}, 'type': '1'}, {'track': {'trackNumber': 5, 'genr
e': 'Soundtracks', 'explicitType': '2', 'kind': 'sj#track', 'title': 'Winter', 'year': 2015, 'discNumber': 1, 'albumId': 'xflgjbdswpxqr5zv7rmj6gr2iu', 'album': 'Rams (Original Motion Picture Soundtrack)', 'trackAvailableForPurchase': True, 'artist': 'Atli Örvarsson', 'du
rationMillis': '85000', 'trackType': '7', 'estimatedSize': '3435651', 'artistId': ['m7zbqal6la6kfowfa4vynsnsm4'], 'albumArtRef': [{'autogen': False, 'url': 'http://lh3.googleusercontent.com/LmHSOcQKdeTkMESZvTDh6bcfGc1-QnnVH3qebsLymk_bhr_rUZ9WKudPHBcXLMQKm0kN07HwWw', 'kin
d': 'sj#imageRef', 'aspectRatio': '1'}], 'composer': '', 'storeId': 'Tsutkse5gawpxpzheh7xyymtyfa', 'nid': 'sutkse5gawpxpzheh7xyymtyfa', 'albumArtist': 'Atli Örvarsson', 'albumAvailableForPurchase': True, 'trackAvailableForSubscription': True}, 'type': '1'}, {'track': {'t
rackNumber': 12, 'genre': 'Soundtracks', 'explicitType': '2', 'kind': 'sj#track', 'title': 'In the Valley', 'year': 2015, 'discNumber': 1, 'albumId': 'xflgjbdswpxqr5zv7rmj6gr2iu', 'album': 'Rams (Original Motion Picture Soundtrack)', 'trackAvailableForPurchase': True, 'a
rtist': 'Atli Örvarsson', 'durationMillis': '125000', 'trackType': '7', 'estimatedSize': '5027031', 'artistId': ['m7zbqal6la6kfowfa4vynsnsm4'], 'albumArtRef': [{'autogen': False, 'url': 'http://lh3.googleusercontent.com/LmHSOcQKdeTkMESZvTDh6bcfGc1-QnnVH3qebsLymk_bhr_rUZ9
WKudPHBcXLMQKm0kN07HwWw', 'kind': 'sj#imageRef', 'aspectRatio': '1'}], 'composer': '', 'storeId': 'Tj5fukrlbgsi2eolcuge4yfpamq', 'nid': 'j5fukrlbgsi2eolcuge4yfpamq', 'albumArtist': 'Atli Örvarsson', 'albumAvailableForPurchase': True, 'trackAvailableForSubscription': True
}, 'type': '1'}, {'track': {'trackNumber': 7, 'genre': 'Soundtracks', 'explicitType': '2', 'kind': 'sj#track', 'title': 'Into the Highlands', 'year': 2015, 'discNumber': 1, 'albumId': 'xflgjbdswpxqr5zv7rmj6gr2iu', 'album': 'Rams (Original Motion Picture Soundtrack)', 'tr
ackAvailableForPurchase': True, 'artist': 'Atli Örvarsson', 'durationMillis': '177000', 'trackType': '7', 'estimatedSize': '7090704', 'artistId': ['m7zbqal6la6kfowfa4vynsnsm4'], 'albumArtRef': [{'autogen': False, 'url': 'http://lh3.googleusercontent.com/LmHSOcQKdeTkMESZv
TDh6bcfGc1-QnnVH3qebsLymk_bhr_rUZ9WKudPHBcXLMQKm0kN07HwWw', 'kind': 'sj#imageRef', 'aspectRatio': '1'}], 'composer': '', 'storeId': 'Tfqegjc5g2epphzkxr5qlinycxi', 'nid': 'fqegjc5g2epphzkxr5qlinycxi', 'albumArtist': 'Atli Örvarsson', 'albumAvailableForPurchase': True, 'tr
ackAvailableForSubscription': True}, 'type': '1'}, {'track': {'trackNumber': 6, 'genre': 'Soundtracks', 'explicitType': '2', 'kind': 'sj#track', 'title': "They're Coming", 'year': 2015, 'discNumber': 1, 'albumId': 'xflgjbdswpxqr5zv7rmj6gr2iu', 'album': 'Rams (Original Mo
tion Picture Soundtrack)', 'trackAvailableForPurchase': True, 'artist': 'Atli Örvarsson', 'durationMillis': '64000', 'trackType': '7', 'estimatedSize': '2587194', 'artistId': ['m7zbqal6la6kfowfa4vynsnsm4'], 'albumArtRef': [{'autogen': False, 'url': 'http://lh3.googleuser
content.com/LmHSOcQKdeTkMESZvTDh6bcfGc1-QnnVH3qebsLymk_bhr_rUZ9WKudPHBcXLMQKm0kN07HwWw', 'kind': 'sj#imageRef', 'aspectRatio': '1'}], 'composer': '', 'storeId': 'T3jm7dn6f6vnxjkgb2svxbm2haq', 'nid': '3jm7dn6f6vnxjkgb2svxbm2haq', 'albumArtist': 'Atli Örvarsson', 'albumAva
ilableForPurchase': True, 'trackAvailableForSubscription': True}, 'type': '1'}, {'track': {'trackNumber': 3, 'genre': 'Soundtracks', 'explicitType': '2', 'kind': 'sj#track', 'title': 'Preparing for Winter', 'year': 2015, 'discNumber': 1, 'albumId': 'xflgjbdswpxqr5zv7rmj6
gr2iu', 'album': 'Rams (Original Motion Picture Soundtrack)', 'trackAvailableForPurchase': True, 'artist': 'Atli Örvarsson', 'durationMillis': '63000', 'trackType': '7', 'estimatedSize': '2527635', 'artistId': ['m7zbqal6la6kfowfa4vynsnsm4'], 'albumArtRef': [{'autogen': F
alse, 'url': 'http://lh3.googleusercontent.com/LmHSOcQKdeTkMESZvTDh6bcfGc1-QnnVH3qebsLymk_bhr_rUZ9WKudPHBcXLMQKm0kN07HwWw', 'kind': 'sj#imageRef', 'aspectRatio': '1'}], 'composer': '', 'storeId': 'Tvvf34svffv5v4tlyl357mt7dmu', 'nid': 'vvf34svffv5v4tlyl357mt7dmu', 'albumA
rtist': 'Atli Örvarsson', 'albumAvailableForPurchase': True, 'trackAvailableForSubscription': True}, 'type': '1'}, {'track': {'trackNumber': 11, 'genre': 'Soundtracks', 'explicitType': '2', 'kind': 'sj#track', 'title': 'The Ancestors', 'year': 2015, 'discNumber': 1, 'alb
umId': 'xflgjbdswpxqr5zv7rmj6gr2iu', 'album': 'Rams (Original Motion Picture Soundtrack)', 'trackAvailableForPurchase': True, 'artist': 'Atli Örvarsson', 'durationMillis': '136000', 'trackType': '7', 'estimatedSize': '5450214', 'artistId': ['m7zbqal6la6kfowfa4vynsnsm4'],
 'albumArtRef': [{'autogen': False, 'url': 'http://lh3.googleusercontent.com/LmHSOcQKdeTkMESZvTDh6bcfGc1-QnnVH3qebsLymk_bhr_rUZ9WKudPHBcXLMQKm0kN07HwWw', 'kind': 'sj#imageRef', 'aspectRatio': '1'}], 'composer': '', 'storeId': 'Txnykwkclsaqj7nzuenzom4vila', 'nid': 'xnykwk
clsaqj7nzuenzom4vila', 'albumArtist': 'Atli Örvarsson', 'albumAvailableForPurchase': True, 'trackAvailableForSubscription': True}, 'type': '1'}, {'track': {'trackNumber': 8, 'genre': 'Soundtracks', 'explicitType': '2', 'kind': 'sj#track', 'title': 'After the Storm', 'yea
r': 2015, 'discNumber': 1, 'albumId': 'xflgjbdswpxqr5zv7rmj6gr2iu', 'album': 'Rams (Original Motion Picture Soundtrack)', 'trackAvailableForPurchase': True, 'artist': 'Atli Örvarsson', 'durationMillis': '207000', 'trackType': '7', 'estimatedSize': '8297561', 'artistId':
['m7zbqal6la6kfowfa4vynsnsm4'], 'albumArtRef': [{'autogen': False, 'url': 'http://lh3.googleusercontent.com/LmHSOcQKdeTkMESZvTDh6bcfGc1-QnnVH3qebsLymk_bhr_rUZ9WKudPHBcXLMQKm0kN07HwWw', 'kind': 'sj#imageRef', 'aspectRatio': '1'}], 'composer': '', 'storeId': 'Tzjdyjc62wczj
kzo46mmcb73smy', 'nid': 'zjdyjc62wczjkzo46mmcb73smy', 'albumArtist': 'Atli Örvarsson', 'albumAvailableForPurchase': True, 'trackAvailableForSubscription': True}, 'type': '1'}, {'track': {'trackNumber': 2, 'genre': 'Soundtracks', 'explicitType': '2', 'kind': 'sj#track', '
title': 'Scrapie', 'year': 2015, 'discNumber': 1, 'albumId': 'xflgjbdswpxqr5zv7rmj6gr2iu', 'album': 'Rams (Original Motion Picture Soundtrack)', 'trackAvailableForPurchase': True, 'artist': 'Atli Örvarsson', 'durationMillis': '113000', 'trackType': '7', 'estimatedSize':
'4547423', 'artistId': ['m7zbqal6la6kfowfa4vynsnsm4'], 'albumArtRef': [{'autogen': False, 'url': 'http://lh3.googleusercontent.com/LmHSOcQKdeTkMESZvTDh6bcfGc1-QnnVH3qebsLymk_bhr_rUZ9WKudPHBcXLMQKm0kN07HwWw', 'kind': 'sj#imageRef', 'aspectRatio': '1'}], 'composer': '', 's
toreId': 'Tx4gas4jl4pq3jyyr5x3qakki5u', 'nid': 'x4gas4jl4pq3jyyr5x3qakki5u', 'albumArtist': 'Atli Örvarsson', 'albumAvailableForPurchase': True, 'trackAvailableForSubscription': True}, 'type': '1'}, {'track': {'trackNumber': 10, 'genre': 'Soundtracks', 'explicitType': '2
', 'kind': 'sj#track', 'title': 'Heart and Soul', 'year': 2015, 'discNumber': 1, 'albumId': 'xflgjbdswpxqr5zv7rmj6gr2iu', 'album': 'Rams (Original Motion Picture Soundtrack)', 'trackAvailableForPurchase': True, 'artist': 'Atli Örvarsson', 'durationMillis': '290000', 'tra
ckType': '7', 'estimatedSize': '11621382', 'artistId': ['m7zbqal6la6kfowfa4vynsnsm4'], 'albumArtRef': [{'autogen': False, 'url': 'http://lh3.googleusercontent.com/LmHSOcQKdeTkMESZvTDh6bcfGc1-QnnVH3qebsLymk_bhr_rUZ9WKudPHBcXLMQKm0kN07HwWw', 'kind': 'sj#imageRef', 'aspectR
atio': '1'}], 'composer': '', 'storeId': 'Tga7pl4s764egqwg3vrhckdsh4q', 'nid': 'ga7pl4s764egqwg3vrhckdsh4q', 'albumArtist': 'Atli Örvarsson', 'albumAvailableForPurchase': True, 'trackAvailableForSubscription': True}, 'type': '1'}, {'artist': {'artistId': 'Am7zbqal6la6kfo
wfa4vynsnsm4', 'kind': 'sj#artist', 'artistArtRefs': [{'autogen': True, 'url': 'http://lh3.googleusercontent.com/pw6hoFj5psntu1QfqHqT9PO3C1rP23njLpfAfRhzeJNxzm7ppU3i3a6itfK3nNPJgbt3pFWj', 'kind': 'sj#imageRef', 'aspectRatio': '2'}, {'autogen': True, 'url': 'http://lh3.go
ogleusercontent.com/MZbRTSy7APEXST5Z51oE8QdnOhybSXA_ZegK-Vl8N4OlDROPsAnWnKRlauBMUK2QoyU0JPPVBQ', 'kind': 'sj#imageRef', 'aspectRatio': '1'}], 'name': 'Atli Örvarsson', 'artist_bio_attribution': {'source_title': 'Wikipedia', 'license_url': 'http://creativecommons.org/lice
nses/by-sa/4.0/legalcode', 'license_title': 'Creative Commons Attribution CC-BY-SA 4.0', 'kind': 'sj#attribution', 'source_url': 'https://en.wikipedia.org/wiki/Atli_%C3%96rvarsson'}, 'artistArtRef': 'http://lh3.googleusercontent.com/pw6hoFj5psntu1QfqHqT9PO3C1rP23njLpfAfR
hzeJNxzm7ppU3i3a6itfK3nNPJgbt3pFWj'}, 'type': '2'}, {'score': 109.20641326904297, 'type': '8', 'youtube_video': {'thumbnails': [{'url': 'https://i.ytimg.com/vi/87FbMLbnP9I/mqdefault.jpg', 'width': 320, 'height': 180}], 'id': '87FbMLbnP9I', 'kind': 'sj#video', 'title': 'R
ams Soundtrack Preview - Atli Ovarsson (Official Video)'}}, {'score': 19.9341983795166, 'type': '8', 'youtube_video': {'thumbnails': [{'url': 'https://i.ytimg.com/vi/zBLU8S8mN64/mqdefault.jpg', 'width': 320, 'height': 180}], 'id': 'zBLU8S8mN64', 'kind': 'sj#video', 'titl
e': '22D Artist // Atli O\u0308rvarsson on Accordion'}}, {'score': 1.0901192426681519, 'type': '8', 'youtube_video': {'thumbnails': [{'url': 'https://i.ytimg.com/vi/PvRHz3mKjUU/mqdefault.jpg', 'width': 320, 'height': 180}], 'id': 'PvRHz3mKjUU', 'kind': 'sj#video', 'title
': '\xd3lafur Arnalds - Öldurót ft. SinfoniaNord, Atli Örvarsson'}}, {'score': 0.515877902507782, 'type': '8', 'youtube_video': {'thumbnails': [{'url': 'https://i.ytimg.com/vi/xhQK2nFUBAE/mqdefault.jpg', 'width': 320, 'height': 180}], 'id': 'xhQK2nFUBAE', 'kind': 'sj#vid
eo', 'title': 'Atli Örvarsson - Highlands'}}, {'score': 0.11960092931985855, 'type': '8', 'youtube_video': {'thumbnails': [{'url': 'https://i.ytimg.com/vi/PAsZdJx1tHg/mqdefault.jpg', 'width': 320, 'height': 180}], 'id': 'PAsZdJx1tHg', 'kind': 'sj#video', 'title': 'Atli Ö
rvarsson - Crusades  "Season of the Witch"'}}, {'score': 0.11471596360206604, 'type': '8', 'youtube_video': {'thumbnails': [{'url': 'https://i.ytimg.com/vi/jBl0-zYIcEI/mqdefault.jpg', 'width': 320, 'height': 180}], 'id': 'jBl0-zYIcEI', 'kind': 'sj#video', 'title': 'Atli
Örvarsson - Briarwood'}}, {'score': 0.11233605444431305, 'type': '8', 'youtube_video': {'thumbnails': [{'url': 'https://i.ytimg.com/vi/fT9I--dwl5w/mqdefault.jpg', 'width': 320, 'height': 180}], 'id': 'fT9I--dwl5w', 'kind': 'sj#video', 'title': 'Chicago Fire (Atli Örvarss
on Tina Guo) - Krakow Film Music Festival - Live 2015'}}, {'score': 0.09995080530643463, 'type': '8', 'youtube_video': {'thumbnails': [{'url': 'https://i.ytimg.com/vi/onM-WzTDPVY/mqdefault.jpg', 'width': 320, 'height': 180}], 'id': 'onM-WzTDPVY', 'kind': 'sj#video', 'tit
le': 'Atli Orvarsson - Conclusion (Extended Version)'}}, {'score': 0.07834100723266602, 'type': '8', 'youtube_video': {'thumbnails': [{'url': 'https://i.ytimg.com/vi/EMwcm9EqcXo/mqdefault.jpg', 'width': 320, 'height': 180}], 'id': 'EMwcm9EqcXo', 'kind': 'sj#video', 'titl
e': 'Atli Örvarsson - Searching'}}, {'score': 0.07781243324279785, 'type': '8', 'youtube_video': {'thumbnails': [{'url': 'https://i.ytimg.com/vi/wjM9tuRhf4k/mqdefault.jpg', 'width': 320, 'height': 180}], 'id': 'wjM9tuRhf4k', 'kind': 'sj#video', 'title': 'Atli Örvarsson -
 Final Battle'}}, {'score': 0.048450957983732224, 'type': '8', 'youtube_video': {'thumbnails': [{'url': 'https://i.ytimg.com/vi/koo_pl0vrmE/mqdefault.jpg', 'width': 320, 'height': 180}], 'id': 'koo_pl0vrmE', 'kind': 'sj#video', 'title': '2.- Business Is Good - Atli Örvar
sson'}}, {'score': 0.04581398889422417, 'type': '8', 'youtube_video': {'thumbnails': [{'url': 'https://i.ytimg.com/vi/LlUtiHZNhTI/mqdefault.jpg', 'width': 320, 'height': 180}], 'id': 'LlUtiHZNhTI', 'kind': 'sj#video', 'title': 'Atli Orvarsson - (Soundtrack) Película "La
4 fase"'}}, {'score': 0.03195260092616081, 'type': '8', 'youtube_video': {'thumbnails': [{'url': 'https://i.ytimg.com/vi/M7ocnnuuKKE/mqdefault.jpg', 'width': 320, 'height': 180}], 'id': 'M7ocnnuuKKE', 'kind': 'sj#video', 'title': '4.- Lost Children Crying, Vol. 2 - Atli
Örvarsson'}}, {'score': 0.031056392937898636, 'type': '8', 'youtube_video': {'thumbnails': [{'url': 'https://i.ytimg.com/vi/kAR7FqgdKrw/mqdefault.jpg', 'width': 320, 'height': 180}], 'id': 'kAR7FqgdKrw', 'kind': 'sj#video', 'title': '13.- The Fairy Tale - Atli Örvarsson'
}}, {'score': 0.028218025341629982, 'type': '8', 'youtube_video': {'thumbnails': [{'url': 'https://i.ytimg.com/vi/SvD25dGX3ak/mqdefault.jpg', 'width': 320, 'height': 180}], 'id': 'SvD25dGX3ak', 'kind': 'sj#video', 'title': "10.- Burn 'Em All - Atli Örvarsson"}}, {'score'
: 0.02664978615939617, 'type': '8', 'youtube_video': {'thumbnails': [{'url': 'https://i.ytimg.com/vi/mIReCIzAGX4/mqdefault.jpg', 'width': 320, 'height': 180}], 'id': 'mIReCIzAGX4', 'kind': 'sj#video', 'title': '14.- Augsburg Burns (Digital Bonus\xa0Track) - Atli Örvarsso
n'}}, {'score': 0.02585049718618393, 'type': '8', 'youtube_video': {'thumbnails': [{'url': 'https://i.ytimg.com/vi/wx22voOvzRE/mqdefault.jpg', 'width': 320, 'height': 180}], 'id': 'wx22voOvzRE', 'kind': 'sj#video', 'title': "9.- Don't Eat the Candy - Atli Örvarsson"}}, {
'score': 0.024787019938230515, 'type': '8', 'youtube_video': {'thumbnails': [{'url': 'https://i.ytimg.com/vi/dnFX_ORxysw/mqdefault.jpg', 'width': 320, 'height': 180}], 'id': 'dnFX_ORxysw', 'kind': 'sj#video', 'title': 'Vantage Point Soundtrack 04 Run Enrique Run'}}, {'sc
ore': 0.02460380643606186, 'type': '8', 'youtube_video': {'thumbnails': [{'url': 'https://i.ytimg.com/vi/2GgwC29raVE/mqdefault.jpg', 'width': 320, 'height': 180}], 'id': '2GgwC29raVE', 'kind': 'sj#video', 'title': '3.- Trolls Serve Witches - Atli Örvarsson'}}, {'score':
0.022486591711640358, 'type': '8', 'youtube_video': {'thumbnails': [{'url': 'https://i.ytimg.com/vi/j4kUtUPglEI/mqdefault.jpg', 'width': 320, 'height': 180}], 'id': 'j4kUtUPglEI', 'kind': 'sj#video', 'title': '7.- This Place Could Use a Bit of Color - Atli Örvarsson'}},
{'station': {'skipEventHistory': [], 'seed': {'artistId': 'Am7zbqal6la6kfowfa4vynsnsm4', 'kind': 'sj#radioSeed', 'seedType': '3'}, 'imageUrls': [{'autogen': True, 'url': 'http://lh3.googleusercontent.com/pw6hoFj5psntu1QfqHqT9PO3C1rP23njLpfAfRhzeJNxzm    7ppU3i3a6itfK3nNPJgbt
3pFWj', 'kind': 'sj#imageRef', 'aspectRatio': '2'}, {'autogen': True, 'url': 'http://lh3.googleusercontent.com/MZbRTSy7APEXST5Z51oE8QdnOhybSXA_ZegK-Vl8N4OlDROPsAnWnKRlauBMUK2QoyU0JPPVBQ', 'kind': 'sj#imageRef', 'aspectRatio': '1'}], 'stationSeeds': [{'artistId': 'Am7zbqa
l6la6kfowfa4vynsnsm4', 'kind': 'sj#radioSeed', 'seedType': '3'}], 'compositeArtRefs': [{'url': 'http://lh3.googleusercontent.com/J8wLSXaWYlUgcz589M2K8MwUEjtohaTeTNM9IKd9lSzGeCzuOEhiJWkV', 'kind': 'sj#imageRef', 'aspectRatio': '2'}, {'url': 'http://lh3.googleusercontent.c
om/l0HPezFQ4M5YE1mEAq5Ia-ML9xZexH8WmcayuhvB85_PvsyCH_Q21H3TCQ', 'kind': 'sj#imageRef', 'aspectRatio': '1'}], 'name': 'Atli Örvarsson', 'kind': 'sj#radioStation'}, 'type': '6'}, {'station': {'skipEventHistory': [], 'seed': {'trackId': 'Tdkm4svcawhuylqg7kinnwql6qu', 'kind'
: 'sj#radioSeed', 'seedType': '2'}, 'imageUrls': [{'autogen': False, 'url': 'http://lh3.googleusercontent.com/LmHSOcQKdeTkMESZvTDh6bcfGc1-QnnVH3qebsLymk_bhr_rUZ9WKudPHBcXLMQKm0kN07HwWw', 'kind': 'sj#imageRef', 'aspectRatio': '1'}], 'stationSeeds': [{'trackId': 'Tdkm4svca
whuylqg7kinnwql6qu', 'kind': 'sj#radioSeed', 'seedType': '2'}], 'name': 'Rams', 'kind': 'sj#radioStation'}, 'type': '6'}, {'station': {'skipEventHistory': [], 'seed': {'trackId': 'Ty2oyhvfxrdjq2y2choybh63tke', 'kind': 'sj#radioSeed', 'seedType': '2'}, 'imageUrls': [{'aut
ogen': False, 'url': 'http://lh3.googleusercontent.com/LmHSOcQKdeTkMESZvTDh6bcfGc1-QnnVH3qebsLymk_bhr_rUZ9WKudPHBcXLMQKm0kN07HwWw', 'kind': 'sj#imageRef', 'aspectRatio': '1'}], 'stationSeeds': [{'trackId': 'Ty2oyhvfxrdjq2y2choybh63tke', 'kind': 'sj#radioSeed', 'seedType'
: '2'}], 'name': 'Lundarbrekka', 'kind': 'sj#radioStation'}, 'type': '6'}, {'station': {'skipEventHistory': [], 'seed': {'trackId': 'Tsutkse5gawpxpzheh7xyymtyfa', 'kind': 'sj#radioSeed', 'seedType': '2'}, 'imageUrls': [{'autogen': False, 'url': 'http://lh3.googleusercont
ent.com/LmHSOcQKdeTkMESZvTDh6bcfGc1-QnnVH3qebsLymk_bhr_rUZ9WKudPHBcXLMQKm0kN07HwWw', 'kind': 'sj#imageRef', 'aspectRatio': '1'}], 'stationSeeds': [{'trackId': 'Tsutkse5gawpxpzheh7xyymtyfa', 'kind': 'sj#radioSeed', 'seedType': '2'}], 'name': 'Winter', 'kind': 'sj#radioSta
tion'}, 'type': '6'}, {'station': {'skipEventHistory': [], 'seed': {'trackId': 'Tj5fukrlbgsi2eolcuge4yfpamq', 'kind': 'sj#radioSeed', 'seedType': '2'}, 'imageUrls': [{'autogen': False, 'url': 'http://lh3.googleusercontent.com/LmHSOcQKdeTkMESZvTDh6bcfGc1-QnnVH3qebsLymk_bh
r_rUZ9WKudPHBcXLMQKm0kN07HwWw', 'kind': 'sj#imageRef', 'aspectRatio': '1'}], 'stationSeeds': [{'trackId': 'Tj5fukrlbgsi2eolcuge4yfpamq', 'kind': 'sj#radioSeed', 'seedType': '2'}], 'name': 'In the Valley', 'kind': 'sj#radioStation'}, 'type': '6'}, {'station': {'skipEventH
istory': [], 'seed': {'trackId': 'Tfqegjc5g2epphzkxr5qlinycxi', 'kind': 'sj#radioSeed', 'seedType': '2'}, 'imageUrls': [{'autogen': False, 'url': 'http://lh3.googleusercontent.com/LmHSOcQKdeTkMESZvTDh6bcfGc1-QnnVH3qebsLymk_bhr_rUZ9WKudPHBcXLMQKm0kN07HwWw', 'kind': 'sj#im
ageRef', 'aspectRatio': '1'}], 'stationSeeds': [{'trackId': 'Tfqegjc5g2epphzkxr5qlinycxi', 'kind': 'sj#radioSeed', 'seedType': '2'}], 'name': 'Into the Highlands', 'kind': 'sj#radioStation'}, 'type': '6'}, {'station': {'skipEventHistory': [], 'seed': {'trackId': 'T3jm7dn
6f6vnxjkgb2svxbm2haq', 'kind': 'sj#radioSeed', 'seedType': '2'}, 'imageUrls': [{'autogen': False, 'url': 'http://lh3.googleusercontent.com/LmHSOcQKdeTkMESZvTDh6bcfGc1-QnnVH3qebsLymk_bhr_rUZ9WKudPHBcXLMQKm0kN07HwWw', 'kind': 'sj#imageRef', 'aspectRatio': '1'}], 'stationSe
eds': [{'trackId': 'T3jm7dn6f6vnxjkgb2svxbm2haq', 'kind': 'sj#radioSeed', 'seedType': '2'}], 'name': "They're Coming", 'kind': 'sj#radioStation'}, 'type': '6'}, {'station': {'skipEventHistory': [], 'seed': {'trackId': 'Tvvf34svffv5v4tlyl357mt7dmu', 'kind': 'sj#radioSeed'
, 'seedType': '2'}, 'imageUrls': [{'autogen': False, 'url': 'http://lh3.googleusercontent.com/LmHSOcQKdeTkMESZvTDh6bcfGc1-QnnVH3qebsLymk_bhr_rUZ9WKudPHBcXLMQKm0kN07HwWw', 'kind': 'sj#imageRef', 'aspectRatio': '1'}], 'stationSeeds': [{'trackId': 'Tvvf34svffv5v4tlyl357mt7d
mu', 'kind': 'sj#radioSeed', 'seedType': '2'}], 'name': 'Preparing for Winter', 'kind': 'sj#radioStation'}, 'type': '6'}], 'clusterOrder': ['5', '2', '3', '1', '7', '6', '4', '8', '9']}
Arguments: ()
Atli Örvarsson - Rams: Rams - dkm4svcawhuylqg7kinnwql6qu
Kevin MacLeod - Temple of the Manes: Temple of the Manes - qjjldkf4gdjqcpejtscc5adkha

因此,在这个混乱的错误块中的某个地方,Atli O\u0308rvarsson on Accordion很多歌曲都发生了类似的事情。我在 Spotify 方面遇到了类似的问题,但用我的 uprint 函数解决了它:

def uprint(*objects, sep=' ', end='\n', file=sys.stdout):
    enc = file.encoding
    if enc == 'UTF-8':
        print(*objects, sep=sep, end=end, file=file)
    else:
        f = lambda obj: str(obj).encode(enc, errors='backslashreplace').decode(enc)
        print(*map(f, objects), sep=sep, end=end, file=file)

我注意到的一件事是歌曲和 ID 仍在track. 所以我尝试捕捉错误,但没有奏效。

此外,即使track有这些信息,当我尝试创建和填充 Google Play 播放列表时,我也只能创建一个空的播放列表(标题正确,所以我可以这样做,这很好。)

4

0 回答 0