{"action":"created","issue":{"url":"https://api.github.com/repos/ngovil21/Plex-Cleaner/issues/4","labels_url":"https://api.github.com/repos/ngovil21/Plex-Cleaner/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/ngovil21/Plex-Cleaner/issues/4/comments","events_url":"https://api.github.com/repos/ngovil21/Plex-Cleaner/issues/4/events","html_url":"https://github.com/ngovil21/Plex-Cleaner/issues/4","id":117273133,"number":4,"title":"Unable to define SectionList using name of Plex library","user":{"login":"randybruder","id":6447487,"avatar_url":"https://avatars.githubusercontent.com/u/6447487?v=3","gravatar_id":"","url":"https://api.github.com/users/randybruder","html_url":"https://github.com/randybruder","followers_url":"https://api.github.com/users/randybruder/followers","following_url":"https://api.github.com/users/randybruder/following{/other_user}","gists_url":"https://api.github.com/users/randybruder/gists{/gist_id}","starred_url":"https://api.github.com/users/randybruder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/randybruder/subscriptions","organizations_url":"https://api.github.com/users/randybruder/orgs","repos_url":"https://api.github.com/users/randybruder/repos","events_url":"https://api.github.com/users/randybruder/events{/privacy}","received_events_url":"https://api.github.com/users/randybruder/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-17T03:09:58Z","updated_at":"2015-11-20T00:00:43Z","closed_at":"2015-11-20T00:00:43Z","body":"In the configuration for `SectionList`, I wanted to target only my Plex library `TV Shows (To Watch)`, so I set it to:\r\n```python\r\nSectionList = [\"TV Shows (To Watch)\"]  # Sections to clean. If empty all sections will be looked at\r\n```\r\n\r\nWhen running the script, it errors and doesn't run. Here's a snippet of the output:\r\n```\r\nHost: http://127.0.0.1\r\nPort: 32400\r\nSection List Mode: User-defined\r\nOperating on user-defined sections: TV Shows (To Watch)\r\nHTTP Error 400: Bad Request\r\nHTTP Error 400: Bad Request\r\nHTTP Error 400: Bad Request\r\nHTTP Error 400: Bad Request\r\nHTTP Error 400: Bad Request\r\nHTTP Error 400: Bad Request\r\nFailed to load Section TV Shows (To Watch). Skipping...\r\n```\r\n\r\nAfter a bit of tinkering, I found that by going to `http://127.0.0.1:32400/library/sections` on my Plex server, in the returned XML file finding the library, and noting the `key` attribute. Here's a screenshot:\r\n\r\n![Screenshot of the XML file](http://i.imgur.com/lte2Q5c.png)\r\n\r\nI used that value instead:\r\n\r\n```python\r\nSectionList = [1]  # Sections to clean. If empty all sections will be looked at\r\n```\r\n\r\nand the script runs successfully. Here's a snippet of the output:\r\n\r\n```\r\nHost: http://127.0.0.1\r\nPort: 32400\r\nSection List Mode: User-defined\r\nOperating on user-defined sections: 1\r\n\r\n--------- Section 1: TV Shows (To Watch) -----------------------------------\r\n```\r\n\r\nIf this is the case (if you're required to use the `key` attribute rather than the name of the library), it should be documented in the project readme. Or, if I'm doing something wrong, let me know the proper way to define `SectionList`.\r\n\r\nThanks for making a great Python script!"},"comment":{"url":"https://api.github.com/repos/ngovil21/Plex-Cleaner/issues/comments/158238473","html_url":"https://github.com/ngovil21/Plex-Cleaner/issues/4#issuecomment-158238473","issue_url":"https://api.github.com/repos/ngovil21/Plex-Cleaner/issues/4","id":158238473,"user":{"login":"ngovil21","id":9146812,"avatar_url":"https://avatars.githubusercontent.com/u/9146812?v=3","gravatar_id":"","url":"https://api.github.com/users/ngovil21","html_url":"https://github.com/ngovil21","followers_url":"https://api.github.com/users/ngovil21/followers","following_url":"https://api.github.com/users/ngovil21/following{/other_user}","gists_url":"https://api.github.com/users/ngovil21/gists{/gist_id}","starred_url":"https://api.github.com/users/ngovil21/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ngovil21/subscriptions","organizations_url":"https://api.github.com/users/ngovil21/orgs","repos_url":"https://api.github.com/users/ngovil21/repos","events_url":"https://api.github.com/users/ngovil21/events{/privacy}","received_events_url":"https://api.github.com/users/ngovil21/received_events","type":"User","site_admin":false},"created_at":"2015-11-20T00:00:43Z","updated_at":"2015-11-20T00:00:43Z","body":"Ya it's set to run by key, that's more for convenience in the script because the url uses the key. I'll add it to the documentation and look into adding sections by title."}}