How to handle Spotify API fetching different track IDs over time?

I am currently working on a project that stores files as Spotify playlists. I coincidentally already had a playlist with almost exactly the right amount of tracks, so I used Spotify to fetch all 8192 (2^13) track IDs and made a lookup dictionary between each track ID and a corresponding 13bit string of binary. My program reads the binary and adds the corresponding track IDs to a playlist to write the file to the playlist, and to read the file from the playlist I fetch all the IDs from the playlist and uses the lookup dictionary to convert it back to binary.

The problem I am having: even though I am using the original IDs to add the tracks to the playlists, for a few tracks, Spotify is now fetching a different ID. This is causing errors because the new ID that is being fetched is not in the lookup dict.

For example, one of the track IDs in my dictionary is ‘1lIkht1mUGFKnDQss3Qk6K’ but when I try to read a file from a playlist that had that ID added to is, spotipy fetches ‘7jokkQ2OZEjngxvDbRzWPs’. Both open.spotify.com/track/1lIkht1mUGFKnDQss3Qk6K and https://open.spotify.com/track/7jokkQ2OZEjngxvDbRzWPs lead to the same song, but if you click to the album from each page, one says single and one says EP even though the one labeled single still has all the songs from the EP. They are obviously different songs, but somehow adding the old ID adds the new ID version of the track, or fetching the ID from the old ID version of the track actually fetches the new ID.

Manually fixing these changed IDs is a lot of work, since you have to locate the ID, and it is essentially a game of whack a mole.

The only solution I can think of is excepting the error during the read process and if the error comes up, do some sort of recalibration process where I add all the IDs to a temporary playlist, then fetch them all again and update the dictionary as necessary, but that would take forever as the API is limited to 100 tracks per request, so that is 160 API requests. This takes exponentially more time and API requests once I eventually implement more track IDs to increase the information density

Is there a better way to handle the situation?

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật