{"action":"created","issue":{"url":"https://api.github.com/repos/learningit/plugin.video.cbc/issues/1","labels_url":"https://api.github.com/repos/learningit/plugin.video.cbc/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/learningit/plugin.video.cbc/issues/1/comments","events_url":"https://api.github.com/repos/learningit/plugin.video.cbc/issues/1/events","html_url":"https://github.com/learningit/plugin.video.cbc/issues/1","id":69134258,"number":1,"title":"IndexError in a[\"entries\"][0][\"media$content\"][0][\"plfile$downloadUrl\"]","user":{"login":"brianjmurrell","id":559317,"avatar_url":"https://avatars.githubusercontent.com/u/559317?v=3","gravatar_id":"","url":"https://api.github.com/users/brianjmurrell","html_url":"https://github.com/brianjmurrell","followers_url":"https://api.github.com/users/brianjmurrell/followers","following_url":"https://api.github.com/users/brianjmurrell/following{/other_user}","gists_url":"https://api.github.com/users/brianjmurrell/gists{/gist_id}","starred_url":"https://api.github.com/users/brianjmurrell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brianjmurrell/subscriptions","organizations_url":"https://api.github.com/users/brianjmurrell/orgs","repos_url":"https://api.github.com/users/brianjmurrell/repos","events_url":"https://api.github.com/users/brianjmurrell/events{/privacy}","received_events_url":"https://api.github.com/users/brianjmurrell/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-04-17T12:59:40Z","updated_at":"2015-04-17T17:05:27Z","closed_at":null,"body":"Hi,\r\n\r\nI am using your plugin -- great work BTW -- and I got this error:\r\n\r\n```\r\nTraceback (most recent call last):\r\n...\r\n  File \"/home/mythtv/.kodi/addons/plugin.video.cbc/default.py\", line 212, in getLink\r\n    u = a[\"entries\"][0][\"media$content\"][0][\"plfile$downloadUrl\"]\r\nIndexError: list index out of range\r\n```\r\n\r\nPresumably it means that the data that is returned in the ```getLink()``` is incomplete or bad in some way.\r\n\r\nWhen this happens, it would be most interesting to see the contents of ```a``` don't you think?\r\n\r\nI am not a Kodi [plugin] developer so I'm not sure what the best way to go about doing that.  Perhaps your ```log``` function is the best way.  But I am also not sure the correct way to inform Kodi about the failure rather than the successful case of using ```xbmcplugin.setResolvedUrl```\r\n\r\nSomething like:\r\n\r\n```\r\ntry:\r\n    u = a[\"entries\"][0][\"media$content\"][0][\"plfile$downloadUrl\"]\r\nexcept IndexError:\r\n    log(\"got an index error trying to get a[\\\"entries\\\"][0][\\\"media$content\\\"][0][\\\"plfile$downloadUrl\\\"] out of %s\" % a)\r\n    # inform Kodi and get out of here\r\n\r\n```\r\n\r\nin ```getLink()``` rather than just the:\r\n\r\n```\r\nu = a[\"entries\"][0][\"media$content\"][0][\"plfile$downloadUrl\"]\r\n```\r\n\r\nperhaps?  Sorry about the format above rather than a patch.  I'm not working in a git repo and am just hacking up the live file as I go."},"comment":{"url":"https://api.github.com/repos/learningit/plugin.video.cbc/issues/comments/94028287","html_url":"https://github.com/learningit/plugin.video.cbc/issues/1#issuecomment-94028287","issue_url":"https://api.github.com/repos/learningit/plugin.video.cbc/issues/1","id":94028287,"user":{"login":"learningit","id":5394972,"avatar_url":"https://avatars.githubusercontent.com/u/5394972?v=3","gravatar_id":"","url":"https://api.github.com/users/learningit","html_url":"https://github.com/learningit","followers_url":"https://api.github.com/users/learningit/followers","following_url":"https://api.github.com/users/learningit/following{/other_user}","gists_url":"https://api.github.com/users/learningit/gists{/gist_id}","starred_url":"https://api.github.com/users/learningit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/learningit/subscriptions","organizations_url":"https://api.github.com/users/learningit/orgs","repos_url":"https://api.github.com/users/learningit/repos","events_url":"https://api.github.com/users/learningit/events{/privacy}","received_events_url":"https://api.github.com/users/learningit/received_events","type":"User","site_admin":false},"created_at":"2015-04-17T17:05:27Z","updated_at":"2015-04-17T17:05:27Z","body":"I'm not going to spend a lot of time on this - you're clearly doing things with script for which it wasn't intended. It would be nice if you could tell me what particular choice was giving you an error so I could look into it."}}