cecobask / imdb-trakt-sync

Automatic sync from IMDb to Trakt (watchlist, lists, ratings and history) using GitHub actions.
MIT License
97 stars 229 forks source link

The sync fails if we have a list with special characters in the name. #22

Closed rfarkv closed 11 months ago

rfarkv commented 11 months ago

I have a list named "Cabeça" and i had to remove the "ç" from the name in order to successful sync the list.

cecobask commented 11 months ago

Hi @rfarkv, thank you for reporting this issue. I investigated and it turns out that the problem stems from IMDb itself. The syncer determines what the name of an IMDb list is by extracting data from the Content-Disposition header. When I created an IMDb list with the name Cabeça, this is the value I received in the IMDb response:

Content-Disposition: attachment; filename="Cabe�a.csv"

In conclusion, if IMDb doesn't send correctly formatted values within this header, the syncer has no way of knowing what the correct list name is. To correctly set the value of this header, IMDb needs to encode the value in UTF-8 format. I doubt IMDb will change that detail anytime soon, if at all. The solution for now is to not use list names that contain special characters 👍