{"action":"created","issue":{"url":"https://api.github.com/repos/Flexget/Flexget/issues/1180","repository_url":"https://api.github.com/repos/Flexget/Flexget","labels_url":"https://api.github.com/repos/Flexget/Flexget/issues/1180/labels{/name}","comments_url":"https://api.github.com/repos/Flexget/Flexget/issues/1180/comments","events_url":"https://api.github.com/repos/Flexget/Flexget/issues/1180/events","html_url":"https://github.com/Flexget/Flexget/issues/1180","id":154895992,"number":1180,"title":"IndexError: list index out of range (piratebay search)","user":{"login":"lostsubstance","id":16395907,"avatar_url":"https://avatars.githubusercontent.com/u/16395907?v=3","gravatar_id":"","url":"https://api.github.com/users/lostsubstance","html_url":"https://github.com/lostsubstance","followers_url":"https://api.github.com/users/lostsubstance/followers","following_url":"https://api.github.com/users/lostsubstance/following{/other_user}","gists_url":"https://api.github.com/users/lostsubstance/gists{/gist_id}","starred_url":"https://api.github.com/users/lostsubstance/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lostsubstance/subscriptions","organizations_url":"https://api.github.com/users/lostsubstance/orgs","repos_url":"https://api.github.com/users/lostsubstance/repos","events_url":"https://api.github.com/users/lostsubstance/events{/privacy}","received_events_url":"https://api.github.com/users/lostsubstance/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Flexget/Flexget/labels/Bug","name":"Bug","color":"eb6420"},{"url":"https://api.github.com/repos/Flexget/Flexget/labels/Pending%20information","name":"Pending information","color":"fef2c0"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2016-05-15T08:00:43Z","updated_at":"2016-05-16T06:03:53Z","closed_at":null,"body":"> flexget -V\r\n> 2.0.21\r\n\r\n```\r\n2016-05-15 00:00 CRITICAL task          get-movies      BUG: Unhandled error in plugin discover: list index out of range\r\nTraceback (most recent call last):\r\n  File \"c:\\python27\\lib\\site-packages\\flexget\\task.py\", line 442, in __run_plugin\r\n    return method(*args, **kwargs)\r\n  File \"c:\\python27\\lib\\site-packages\\flexget\\event.py\", line 23, in __call__\r\n    return self.func(*args, **kwargs)\r\n  File \"c:\\python27\\lib\\site-packages\\flexget\\plugins\\input\\discover.py\", line 272, in on_task_input\r\n    return self.execute_searches(config, entries, task)\r\n  File \"c:\\python27\\lib\\site-packages\\flexget\\plugins\\input\\discover.py\", line 143, in execute_searches\r\n    search_results = search.search(task=task, entry=entry, config=plugin_config)\r\n  File \"c:\\python27\\lib\\site-packages\\flexget\\plugin.py\", line 120, in wrapped_func\r\n    return func(*args, **kwargs)\r\n  File \"c:\\python27\\lib\\site-packages\\flexget\\plugins\\urlrewrite\\piratebay.py\", line 137, in search\r\n    entry['title'] = link.contents[0]\r\nIndexError: list index out of range\r\n```"},"comment":{"url":"https://api.github.com/repos/Flexget/Flexget/issues/comments/219355314","html_url":"https://github.com/Flexget/Flexget/issues/1180#issuecomment-219355314","issue_url":"https://api.github.com/repos/Flexget/Flexget/issues/1180","id":219355314,"user":{"login":"lostsubstance","id":16395907,"avatar_url":"https://avatars.githubusercontent.com/u/16395907?v=3","gravatar_id":"","url":"https://api.github.com/users/lostsubstance","html_url":"https://github.com/lostsubstance","followers_url":"https://api.github.com/users/lostsubstance/followers","following_url":"https://api.github.com/users/lostsubstance/following{/other_user}","gists_url":"https://api.github.com/users/lostsubstance/gists{/gist_id}","starred_url":"https://api.github.com/users/lostsubstance/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lostsubstance/subscriptions","organizations_url":"https://api.github.com/users/lostsubstance/orgs","repos_url":"https://api.github.com/users/lostsubstance/repos","events_url":"https://api.github.com/users/lostsubstance/events{/privacy}","received_events_url":"https://api.github.com/users/lostsubstance/received_events","type":"User","site_admin":false},"created_at":"2016-05-16T06:03:53Z","updated_at":"2016-05-16T06:03:53Z","body":"i wasn't suggesting a blanket try/catch. i was merely suggesting it be written defensively such that if the server (or a proxy) responded with malicious/bad/unknown data this plugin would handle logging an error and letting the task move on instead of crashing.\r\n\r\nI don't know what it was looking for at the time. As i said above, i believe this to be rare and has only occurred the one time so far. this isn't blocking me. i just submitted this as a courtesy for general improvement. if it happens again, ill try to gather more info."}}