{"action":"created","issue":{"url":"https://api.github.com/repos/tknorris/tknorris-beta-repo/issues/67","repository_url":"https://api.github.com/repos/tknorris/tknorris-beta-repo","labels_url":"https://api.github.com/repos/tknorris/tknorris-beta-repo/issues/67/labels{/name}","comments_url":"https://api.github.com/repos/tknorris/tknorris-beta-repo/issues/67/comments","events_url":"https://api.github.com/repos/tknorris/tknorris-beta-repo/issues/67/events","html_url":"https://github.com/tknorris/tknorris-beta-repo/issues/67","id":213900427,"number":67,"title":"Error while attempting to auto play a souece","user":{"login":"zofer1","id":6930947,"avatar_url":"https://avatars1.githubusercontent.com/u/6930947?v=3","gravatar_id":"","url":"https://api.github.com/users/zofer1","html_url":"https://github.com/zofer1","followers_url":"https://api.github.com/users/zofer1/followers","following_url":"https://api.github.com/users/zofer1/following{/other_user}","gists_url":"https://api.github.com/users/zofer1/gists{/gist_id}","starred_url":"https://api.github.com/users/zofer1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zofer1/subscriptions","organizations_url":"https://api.github.com/users/zofer1/orgs","repos_url":"https://api.github.com/users/zofer1/repos","events_url":"https://api.github.com/users/zofer1/events{/privacy}","received_events_url":"https://api.github.com/users/zofer1/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2017-03-13T21:18:44Z","updated_at":"2017-03-16T21:09:08Z","closed_at":null,"body":"This is the error I get:\r\n`23:01:56 T:1292932160   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--\r\n                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!\r\n                                            Error Type: <type 'exceptions.UnicodeDecodeError'>\r\n                                            Error Contents: 'ascii' codec can't decode byte 0xd7 in position 3: ordinal not in range\r\n(128)\r\n                                            Traceback (most recent call last):\r\n                                              File \"/storage/.kodi/addons/plugin.video.salts/default.py\", line 2769, in <module>\r\n                                                sys.exit(main())\r\n                                              File \"/storage/.kodi/addons/plugin.video.salts/default.py\", line 2760, in main\r\n                                                url_dispatcher.dispatch(mode, queries)\r\n                                              File \"/storage/.kodi/addons/script.module.tknorris.shared/lib/url_dispatcher.py\", line\r\n 97, in dispatch\r\n                                                self.func_registry[mode](*args, **kwargs)\r\n                                              File \"/storage/.kodi/addons/plugin.video.salts/default.py\", line 1310, in get_sources\r\n                                                auto_play_sources(hosters, video_type, trakt_id, season, episode)\r\n                                              File \"/storage/.kodi/addons/plugin.video.salts/default.py\", line 1534, in auto_play_so\r\nurces\r\n                                                current = i18n('trying_source') % (item['quality'], item['host'], item['class'].get_\r\nname())\r\n                                            UnicodeDecodeError: 'ascii' codec can't decode byte 0xd7 in position 3: ordinal not in r\r\nange(128)\r\n                                            -->End of Python script error report<--\r\n2`\r\n\r\nThe fix I have for this:\r\nUsing this:\r\n            try:\r\n                current = i18n('trying_source') % (item['quality'], item['host'], item['class'].get_name())\r\n            except UnicodeDecodeError:\r\n                current = i18n('trying_source') % (item['quality'], item['host'].encode(\"utf-8\"), item['class'].get_name())\r\n\r\n\r\nand this:\r\n            try:\r\n                prev = i18n('failed_source') % (item['quality'], item['host'], item['class'].get_name())\r\n            except UnicodeDecodeError:\r\n                prev = i18n('failed_source') % (item['quality'], item['host'].encode(\"utf-8\"), item['class'].get_name())\r\n\r\nThe host name comes as ascii or unicode and cannot tell when is what. There may be a more elegant solution, but this works for me."},"comment":{"url":"https://api.github.com/repos/tknorris/tknorris-beta-repo/issues/comments/287191647","html_url":"https://github.com/tknorris/tknorris-beta-repo/issues/67#issuecomment-287191647","issue_url":"https://api.github.com/repos/tknorris/tknorris-beta-repo/issues/67","id":287191647,"user":{"login":"zofer1","id":6930947,"avatar_url":"https://avatars1.githubusercontent.com/u/6930947?v=3","gravatar_id":"","url":"https://api.github.com/users/zofer1","html_url":"https://github.com/zofer1","followers_url":"https://api.github.com/users/zofer1/followers","following_url":"https://api.github.com/users/zofer1/following{/other_user}","gists_url":"https://api.github.com/users/zofer1/gists{/gist_id}","starred_url":"https://api.github.com/users/zofer1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zofer1/subscriptions","organizations_url":"https://api.github.com/users/zofer1/orgs","repos_url":"https://api.github.com/users/zofer1/repos","events_url":"https://api.github.com/users/zofer1/events{/privacy}","received_events_url":"https://api.github.com/users/zofer1/received_events","type":"User","site_admin":false},"created_at":"2017-03-16T21:09:08Z","updated_at":"2017-03-16T21:09:08Z","body":"I was trying to play Arrow, season 2 episode 19, but it happens frequently."}}
{"actor":{"display_login":"zofer1"}}