Skip to content

Python code to sort letterboxd lists and users's watched films.

License

Notifications You must be signed in to change notification settings

coencoensmeets/Letterboxd-sorter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation


Logo

Letterboxd sorter on colour

An awesome README template to jumpstart your projects!
Explore the docs »

View Demo · Report Bug · Request Feature

⚠️ Warning: This project has not been updated and tested for many years! ⚠️

About The Project

The last few months multiple lists became popular on Letterboxd in which the films were sorted by colour. An example: Arlo McLean's list 'color' Normally, sorting posters takes lots of time and multiple headaches. This code makes it easy. It sorts all the film a user has seen. It exports an .csv file that can be imported into letterboxd on the new list page .It also puts out an image of all the colours the code extracted from the poster. The last thing it exports is a plotly graph where all the colours are plotted by RGB value.

Updates

A new custom sorting method has been implemented: Using a K-means system to sort colours. This is an improvement over the old system. Colours are nw sorted into groups before begin sorted by value. List support has also been added. When running the script, the username can now be substituted for a lists url.

How to use / Example

In the following example my personal Letterboxd account will be used: (Consider a follow) coencoensmeets. The code has only been tested on a windows 10 machine. First install APIs

  1. API installation
pip install -r requirements.txt
  1. Run the script
python LB_colour.py D:\\Home\\Data coencoensmeets -LPmI

The running of the script has been built up in the following way:

python LB_colour.py **Prefered directory** **Username** -**Options**

Directory: If the prefered directory can not be found, the current directory will be used. Username: This is the letterboxd username (the same username as is in the link to a profile) Lists links are now also supported. Options: With the many exports, an option has been added to disable a few. If no options are profived, only a list will be added. The options can be changes by added the letters. The options available:

  1. L: This creates the letterboxd list with the posters sorted that can be imported.

  2. I: Creates the image with the extracted colours sorted.

  3. Pm: Creates the Plotly graph without lines.

  4. Pl: Creates the Plotly graph with lines.

  5. Check out the outputs The graph with lines:

Logo

The image with sorted colours:

Logo

Errors in sorting:

Unfortunately, there are some apparent errors. Colour is interpreted in the brain and is influenced by many factors. The first issue is getting one single RGB value from a poster. What colour is leading in the image? Secondly, sorting colours is an impossible job to get correct and certainly for a machine. Alan Zucconi wrote a great article about it. (https://www.alanzucconi.com/2015/09/30/colour-sorting/)

The workings:

Because of the limited acces to the Letterboxd API. The films are webscraped. Due to the limited information possible to gather from the films site, an algorithm was created to calculate a possible poster url. If this url does not exist a more time sensitive algorithm is used, that downloads a new site and extracts the poster url from that. After all the posters and films are collected. Each poster is evaluated with its main, dominant colour. These colours are later used to order the poster using a K-means sorting method. The colours are first sorted in groups and then those groups are then sorted by value, hue and saturation. After the lists are sorted the options are evaluated and the files are outputted as desired. If the data, of previous runs of the code, is in the directory that is being used, the list of films will only be updated. Within the code there are also options to not only update but start fresh. This option has to be activated in the code itself.

About

Python code to sort letterboxd lists and users's watched films.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages