{"action":"created","issue":{"url":"https://api.github.com/repos/SickRage/SickRage/issues/2462","repository_url":"https://api.github.com/repos/SickRage/SickRage","labels_url":"https://api.github.com/repos/SickRage/SickRage/issues/2462/labels{/name}","comments_url":"https://api.github.com/repos/SickRage/SickRage/issues/2462/comments","events_url":"https://api.github.com/repos/SickRage/SickRage/issues/2462/events","html_url":"https://github.com/SickRage/SickRage/issues/2462","id":182110764,"number":2462,"title":"Newpct provider retrieves non-Spanish episodes even when instructed not to do so","user":{"login":"gmiranda","id":551544,"avatar_url":"https://avatars.githubusercontent.com/u/551544?v=3","gravatar_id":"","url":"https://api.github.com/users/gmiranda","html_url":"https://github.com/gmiranda","followers_url":"https://api.github.com/users/gmiranda/followers","following_url":"https://api.github.com/users/gmiranda/following{/other_user}","gists_url":"https://api.github.com/users/gmiranda/gists{/gist_id}","starred_url":"https://api.github.com/users/gmiranda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gmiranda/subscriptions","organizations_url":"https://api.github.com/users/gmiranda/orgs","repos_url":"https://api.github.com/users/gmiranda/repos","events_url":"https://api.github.com/users/gmiranda/events{/privacy}","received_events_url":"https://api.github.com/users/gmiranda/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-10-10T20:44:39Z","updated_at":"2016-10-11T11:03:28Z","closed_at":"2016-10-11T11:03:28Z","body":"Branch/Commit: master/42f3cbe3e1ed9088b2845d481bdc3452146ccc98 \r\nOS: Ubuntu 16.04\r\nWhat you did: Configurer NewPCT as the torrent provider, selected the option to discard non-Spanish torrents and added a show.\r\nWhat happened: backlog search started and it added 2 episodes in English.\r\nWhat you expected: as this show is only available in English, I expect that no episode gets added.\r\nLogs:\r\n```\r\n2016-10-03 11:33:59 INFO     POSTPROCESSER :: PostProcessing Path: $HOME/Downloads/SickRage\r\n2016-10-03 11:33:55 INFO     SEARCHQUEUE-BACKLOG-296762 :: Downloading ShowName.-.Temporada.1.720p.HDTV.x264[Cap.102][V.O..Subt..Castellano]-NEWPCTVO from Newpct\r\n2016-10-03 11:33:55 INFO     SEARCHQUEUE-BACKLOG-296762 :: [Newpct] :: Quality of ShowName.-.Temporada.1.720p.HDTV.x264[Cap.102][V.O..Subt..Castellano]-NEWPCTVO is 720p HDTV\r\n2016-10-03 11:33:55 INFO     SEARCHQUEUE-BACKLOG-296762 :: [Newpct] :: Found result ShowName.-.Temporada.1.720p.HDTV.x264[Cap.102][V.O..Subt..Castellano]-NEWPCTVO at http://www.newpct.com/descargar-serievo/ShowName/capitulo-12/\r\n2016-10-03 11:33:54 INFO     SEARCHQUEUE-BACKLOG-296762 :: [Newpct] :: Performing episode search for ShowName\r\n2016-10-03 11:33:54 INFO     SEARCHQUEUE-BACKLOG-296762 :: Beginning backlog search for: [ShowName]\r\n```\r\nThe way the provider works when you enable the option to download Spanish only episodes is that it builds the query string setting the language to Spanish. That does not apply for non-spanish shows in Newpct, since they have their own category (\"Series V.O.\") and the language parameter is ignore for those.\r\n\r\nIn order to fix it, we could either search shows in SD quality and HDTV quality (which would involve querying twice if we just want Spanish torrents, or three times if we accept English torrents). Another way would be to simply compare the title string of the torrent, and if it's a non-Spanish episode, discard it (if the user wanted to). That would be easy:\r\n\r\n```diff\r\ndiff --git a/sickbeard/providers/newpct.py b/sickbeard/providers/newpct.py\r\nindex 5599b8e..9a1c782 100644\r\n--- a/sickbeard/providers/newpct.py\r\n+++ b/sickbeard/providers/newpct.py\r\n@@ -57,6 +57,11 @@ class newpctProvider(TorrentProvider):\r\n         # Only search if user conditions are true\r\n         lang_info = '' if not ep_obj or not ep_obj.show else ep_obj.show.lang\r\n\r\n+        # Non-spanish episodes have this string inside\r\n+        non_spa_token = '-NEWPCTVO'\r\n+\r\n+        # As we're seraching for all categories, that includes sd shows, 720p+ shows and non-Spanish shows\r\n+        # Setting the language parameter does nothing at all\r\n         search_params = {\r\n             'l': 'doSearch',\r\n             'q': '',\r\n@@ -114,6 +119,11 @@ class newpctProvider(TorrentProvider):\r\n                             if not all([title, download_url]):\r\n                                 continue\r\n\r\n+                            # If the title contains V.O.\r\n+                            if self.onlyspasearch and non_spa_token in title:\r\n+                                logger.log('Skipping non-spanish torrent: {0}'.format(title), logger.DEBUG)\r\n+                                continue\r\n+\r\n                             # Provider does not provide seeders/leechers\r\n                             seeders = 1\r\n                             leechers = 0\r\n```"},"comment":{"url":"https://api.github.com/repos/SickRage/SickRage/issues/comments/252882894","html_url":"https://github.com/SickRage/SickRage/issues/2462#issuecomment-252882894","issue_url":"https://api.github.com/repos/SickRage/SickRage/issues/2462","id":252882894,"user":{"login":"miigotu","id":390379,"avatar_url":"https://avatars.githubusercontent.com/u/390379?v=3","gravatar_id":"","url":"https://api.github.com/users/miigotu","html_url":"https://github.com/miigotu","followers_url":"https://api.github.com/users/miigotu/followers","following_url":"https://api.github.com/users/miigotu/following{/other_user}","gists_url":"https://api.github.com/users/miigotu/gists{/gist_id}","starred_url":"https://api.github.com/users/miigotu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/miigotu/subscriptions","organizations_url":"https://api.github.com/users/miigotu/orgs","repos_url":"https://api.github.com/users/miigotu/repos","events_url":"https://api.github.com/users/miigotu/events{/privacy}","received_events_url":"https://api.github.com/users/miigotu/received_events","type":"User","site_admin":false},"created_at":"2016-10-11T11:03:28Z","updated_at":"2016-10-11T11:03:28Z","body":"You have the `onlyspasearch` option confused. This option is not to skip torrents that are not spanish, it is to only use this provider for shows set as spanish in SR. If you dont want `-NEWPCTVO` or `V.O. Castellano` add them to the `Ignore Words`"}}
{"actor":{"display_login":"miigotu"}}