{"action":"created","comment":{"url":"https://api.github.com/repos/pymedusa/Medusa/pulls/comments/166884614","pull_request_review_id":95016033,"id":166884614,"diff_hunk":"@@ -0,0 +1,174 @@\n+# coding=utf-8\n+\n+\"\"\"Provider code for TorrentDay.\"\"\"\n+\n+from __future__ import unicode_literals\n+\n+import logging\n+import re\n+from medusa import tv\n+from medusa.helper.common import convert_size\n+from medusa.logger.adapters.style import BraceAdapter\n+from medusa.providers.torrent.torrent_provider import TorrentProvider\n+from requests.compat import urljoin\n+\n+log = BraceAdapter(logging.getLogger(__name__))\n+log.logger.addHandler(logging.NullHandler())\n+\n+\n+class TorrentDayProvider(TorrentProvider):\n+    \"\"\"TorrentDay Torrent provider.\"\"\"\n+\n+    def __init__(self):\n+        \"\"\"Initialize the class.\"\"\"\n+        super(TorrentDayProvider, self).__init__('TorrentDay')\n+\n+        # URLs\n+        self.url = 'https://www.torrentday.com'\n+        self.urls = {\n+            'login': urljoin(self.url, '/torrents/'),\n+            'search': urljoin(self.url, '/t.json'),\n+            'download': urljoin(self.url, '/download.php/')\n+        }\n+\n+        # Proper Strings\n+\n+        # Miscellaneous Options\n+        self.freeleech = False\n+        self.enable_cookies = True\n+        self.cookies = ''\n+        self.required_cookies = ('uid', 'pass')\n+\n+        # TV/480p - 24\n+        # TV/Bluray - 32\n+        # TV/DVD-R - 31\n+        # TV/DVD-Rip - 33\n+        # TV/Mobile - 46\n+        # TV/Packs - 14\n+        # TV/SD/x264 - 26\n+        # TV/x264 - 7\n+        # TV/x265 - 34\n+        # TV/XviD - 2\n+\n+        self.categories = {\n+            'Season': {'14': 1},\n+            'Episode': {'2': 1, '26': 1, '7': 1, '24': 1, '34': 1},\n+            'RSS': {'2': 1, '26': 1, '7': 1, '24': 1, '34': 1, '14': 1}\n+        }\n+\n+        # Torrent Stats\n+        self.minseed = None\n+        self.minleech = None\n+\n+        # Cache\n+        self.cache = tv.Cache(self, min_time=10)  # Only poll IPTorrents every 10 minutes max\n+\n+    def search(self, search_strings, age=0, ep_obj=None, **kwargs):\n+        \"\"\"\n+        Search a provider and parse the results.\n+\n+        :param search_strings: A dict with mode (key) and the search value (value)\n+        :param age: Not used\n+        :param ep_obj: Not used\n+        :returns: A list of search results (structure)\n+        \"\"\"\n+        results = []\n+        if not self.login():\n+            return results\n+\n+        for mode in search_strings:\n+            log.debug('Search mode: {0}', mode)\n+\n+            for search_string in search_strings[mode]:\n+                if mode != 'RSS':\n+                    log.debug('Search string: {search}',\n+                              {'search': search_string})\n+\n+                search_string = '+'.join(search_string.split())\n+\n+                params = dict({'q': search_string}, **self.categories[mode])\n+\n+                if self.freeleech:\n+                    params.update({'free': 'on'})","path":"medusa/providers/torrent/json/torrentday.py","position":92,"original_position":92,"commit_id":"72ec697189bb92f93e9eb445de341622463be89f","original_commit_id":"f52bcc43342a2c0f7168b92d7f8449fa50e8f345","user":{"login":"p0psicles","id":1331394,"avatar_url":"https://avatars2.githubusercontent.com/u/1331394?v=4","gravatar_id":"","url":"https://api.github.com/users/p0psicles","html_url":"https://github.com/p0psicles","followers_url":"https://api.github.com/users/p0psicles/followers","following_url":"https://api.github.com/users/p0psicles/following{/other_user}","gists_url":"https://api.github.com/users/p0psicles/gists{/gist_id}","starred_url":"https://api.github.com/users/p0psicles/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/p0psicles/subscriptions","organizations_url":"https://api.github.com/users/p0psicles/orgs","repos_url":"https://api.github.com/users/p0psicles/repos","events_url":"https://api.github.com/users/p0psicles/events{/privacy}","received_events_url":"https://api.github.com/users/p0psicles/received_events","type":"User","site_admin":false},"body":"I'm not sure if this still has any effect?","created_at":"2018-02-08T10:09:05Z","updated_at":"2018-02-08T10:09:05Z","html_url":"https://github.com/pymedusa/Medusa/pull/3727#discussion_r166884614","pull_request_url":"https://api.github.com/repos/pymedusa/Medusa/pulls/3727","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/pymedusa/Medusa/pulls/comments/166884614"},"html":{"href":"https://github.com/pymedusa/Medusa/pull/3727#discussion_r166884614"},"pull_request":{"href":"https://api.github.com/repos/pymedusa/Medusa/pulls/3727"}}},"pull_request":{"url":"https://api.github.com/repos/pymedusa/Medusa/pulls/3727","id":167925482,"html_url":"https://github.com/pymedusa/Medusa/pull/3727","diff_url":"https://github.com/pymedusa/Medusa/pull/3727.diff","patch_url":"https://github.com/pymedusa/Medusa/pull/3727.patch","issue_url":"https://api.github.com/repos/pymedusa/Medusa/issues/3727","number":3727,"state":"open","locked":false,"title":"Torrentday: Switched back to the new rest api.","user":{"login":"p0psicles","id":1331394,"avatar_url":"https://avatars2.githubusercontent.com/u/1331394?v=4","gravatar_id":"","url":"https://api.github.com/users/p0psicles","html_url":"https://github.com/p0psicles","followers_url":"https://api.github.com/users/p0psicles/followers","following_url":"https://api.github.com/users/p0psicles/following{/other_user}","gists_url":"https://api.github.com/users/p0psicles/gists{/gist_id}","starred_url":"https://api.github.com/users/p0psicles/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/p0psicles/subscriptions","organizations_url":"https://api.github.com/users/p0psicles/orgs","repos_url":"https://api.github.com/users/p0psicles/repos","events_url":"https://api.github.com/users/p0psicles/events{/privacy}","received_events_url":"https://api.github.com/users/p0psicles/received_events","type":"User","site_admin":false},"body":"- [x] PR is based on the DEVELOP branch\r\n- [x] Don't send big changes all at once. Split up big PRs into multiple smaller PRs that are easier to manage and review\r\n- [x] Read the [contribution guide](https://github.com/pymedusa/Medusa/blob/master/.github/CONTRIBUTING.md)\r\n","created_at":"2018-02-08T10:02:48Z","updated_at":"2018-02-08T10:09:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"186179fd9e8d57a962f3afcbabb7893f10caa8da","assignee":null,"assignees":[],"requested_reviewers":[{"login":"duramato","id":10121067,"avatar_url":"https://avatars0.githubusercontent.com/u/10121067?v=4","gravatar_id":"","url":"https://api.github.com/users/duramato","html_url":"https://github.com/duramato","followers_url":"https://api.github.com/users/duramato/followers","following_url":"https://api.github.com/users/duramato/following{/other_user}","gists_url":"https://api.github.com/users/duramato/gists{/gist_id}","starred_url":"https://api.github.com/users/duramato/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/duramato/subscriptions","organizations_url":"https://api.github.com/users/duramato/orgs","repos_url":"https://api.github.com/users/duramato/repos","events_url":"https://api.github.com/users/duramato/events{/privacy}","received_events_url":"https://api.github.com/users/duramato/received_events","type":"User","site_admin":false}],"requested_teams":[],"milestone":null,"commits_url":"https://api.github.com/repos/pymedusa/Medusa/pulls/3727/commits","review_comments_url":"https://api.github.com/repos/pymedusa/Medusa/pulls/3727/comments","review_comment_url":"https://api.github.com/repos/pymedusa/Medusa/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pymedusa/Medusa/issues/3727/comments","statuses_url":"https://api.github.com/repos/pymedusa/Medusa/statuses/72ec697189bb92f93e9eb445de341622463be89f","head":{"label":"pymedusa:feature/torrentday-back-to-rest-api","ref":"feature/torrentday-back-to-rest-api","sha":"72ec697189bb92f93e9eb445de341622463be89f","user":{"login":"pymedusa","id":16712498,"avatar_url":"https://avatars1.githubusercontent.com/u/16712498?v=4","gravatar_id":"","url":"https://api.github.com/users/pymedusa","html_url":"https://github.com/pymedusa","followers_url":"https://api.github.com/users/pymedusa/followers","following_url":"https://api.github.com/users/pymedusa/following{/other_user}","gists_url":"https://api.github.com/users/pymedusa/gists{/gist_id}","starred_url":"https://api.github.com/users/pymedusa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pymedusa/subscriptions","organizations_url":"https://api.github.com/users/pymedusa/orgs","repos_url":"https://api.github.com/users/pymedusa/repos","events_url":"https://api.github.com/users/pymedusa/events{/privacy}","received_events_url":"https://api.github.com/users/pymedusa/received_events","type":"Organization","site_admin":false},"repo":{"id":52334681,"name":"Medusa","full_name":"pymedusa/Medusa","owner":{"login":"pymedusa","id":16712498,"avatar_url":"https://avatars1.githubusercontent.com/u/16712498?v=4","gravatar_id":"","url":"https://api.github.com/users/pymedusa","html_url":"https://github.com/pymedusa","followers_url":"https://api.github.com/users/pymedusa/followers","following_url":"https://api.github.com/users/pymedusa/following{/other_user}","gists_url":"https://api.github.com/users/pymedusa/gists{/gist_id}","starred_url":"https://api.github.com/users/pymedusa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pymedusa/subscriptions","organizations_url":"https://api.github.com/users/pymedusa/orgs","repos_url":"https://api.github.com/users/pymedusa/repos","events_url":"https://api.github.com/users/pymedusa/events{/privacy}","received_events_url":"https://api.github.com/users/pymedusa/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pymedusa/Medusa","description":"Now with the most wanted feature: **Manual Search**. You can choose what to download! IRC: #pymedusa","fork":false,"url":"https://api.github.com/repos/pymedusa/Medusa","forks_url":"https://api.github.com/repos/pymedusa/Medusa/forks","keys_url":"https://api.github.com/repos/pymedusa/Medusa/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pymedusa/Medusa/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pymedusa/Medusa/teams","hooks_url":"https://api.github.com/repos/pymedusa/Medusa/hooks","issue_events_url":"https://api.github.com/repos/pymedusa/Medusa/issues/events{/number}","events_url":"https://api.github.com/repos/pymedusa/Medusa/events","assignees_url":"https://api.github.com/repos/pymedusa/Medusa/assignees{/user}","branches_url":"https://api.github.com/repos/pymedusa/Medusa/branches{/branch}","tags_url":"https://api.github.com/repos/pymedusa/Medusa/tags","blobs_url":"https://api.github.com/repos/pymedusa/Medusa/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pymedusa/Medusa/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pymedusa/Medusa/git/refs{/sha}","trees_url":"https://api.github.com/repos/pymedusa/Medusa/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pymedusa/Medusa/statuses/{sha}","languages_url":"https://api.github.com/repos/pymedusa/Medusa/languages","stargazers_url":"https://api.github.com/repos/pymedusa/Medusa/stargazers","contributors_url":"https://api.github.com/repos/pymedusa/Medusa/contributors","subscribers_url":"https://api.github.com/repos/pymedusa/Medusa/subscribers","subscription_url":"https://api.github.com/repos/pymedusa/Medusa/subscription","commits_url":"https://api.github.com/repos/pymedusa/Medusa/commits{/sha}","git_commits_url":"https://api.github.com/repos/pymedusa/Medusa/git/commits{/sha}","comments_url":"https://api.github.com/repos/pymedusa/Medusa/comments{/number}","issue_comment_url":"https://api.github.com/repos/pymedusa/Medusa/issues/comments{/number}","contents_url":"https://api.github.com/repos/pymedusa/Medusa/contents/{+path}","compare_url":"https://api.github.com/repos/pymedusa/Medusa/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pymedusa/Medusa/merges","archive_url":"https://api.github.com/repos/pymedusa/Medusa/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pymedusa/Medusa/downloads","issues_url":"https://api.github.com/repos/pymedusa/Medusa/issues{/number}","pulls_url":"https://api.github.com/repos/pymedusa/Medusa/pulls{/number}","milestones_url":"https://api.github.com/repos/pymedusa/Medusa/milestones{/number}","notifications_url":"https://api.github.com/repos/pymedusa/Medusa/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pymedusa/Medusa/labels{/name}","releases_url":"https://api.github.com/repos/pymedusa/Medusa/releases{/id}","deployments_url":"https://api.github.com/repos/pymedusa/Medusa/deployments","created_at":"2016-02-23T06:02:11Z","updated_at":"2018-02-06T13:37:12Z","pushed_at":"2018-02-08T10:08:24Z","git_url":"git://github.com/pymedusa/Medusa.git","ssh_url":"git@github.com:pymedusa/Medusa.git","clone_url":"https://github.com/pymedusa/Medusa.git","svn_url":"https://github.com/pymedusa/Medusa","homepage":"","size":95836,"stargazers_count":250,"watchers_count":250,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":53,"mirror_url":null,"archived":false,"open_issues_count":150,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0"},"forks":53,"open_issues":150,"watchers":250,"default_branch":"master"}},"base":{"label":"pymedusa:develop","ref":"develop","sha":"30e65ec4b77b570db293836e91206c5ff5aa57b7","user":{"login":"pymedusa","id":16712498,"avatar_url":"https://avatars1.githubusercontent.com/u/16712498?v=4","gravatar_id":"","url":"https://api.github.com/users/pymedusa","html_url":"https://github.com/pymedusa","followers_url":"https://api.github.com/users/pymedusa/followers","following_url":"https://api.github.com/users/pymedusa/following{/other_user}","gists_url":"https://api.github.com/users/pymedusa/gists{/gist_id}","starred_url":"https://api.github.com/users/pymedusa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pymedusa/subscriptions","organizations_url":"https://api.github.com/users/pymedusa/orgs","repos_url":"https://api.github.com/users/pymedusa/repos","events_url":"https://api.github.com/users/pymedusa/events{/privacy}","received_events_url":"https://api.github.com/users/pymedusa/received_events","type":"Organization","site_admin":false},"repo":{"id":52334681,"name":"Medusa","full_name":"pymedusa/Medusa","owner":{"login":"pymedusa","id":16712498,"avatar_url":"https://avatars1.githubusercontent.com/u/16712498?v=4","gravatar_id":"","url":"https://api.github.com/users/pymedusa","html_url":"https://github.com/pymedusa","followers_url":"https://api.github.com/users/pymedusa/followers","following_url":"https://api.github.com/users/pymedusa/following{/other_user}","gists_url":"https://api.github.com/users/pymedusa/gists{/gist_id}","starred_url":"https://api.github.com/users/pymedusa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pymedusa/subscriptions","organizations_url":"https://api.github.com/users/pymedusa/orgs","repos_url":"https://api.github.com/users/pymedusa/repos","events_url":"https://api.github.com/users/pymedusa/events{/privacy}","received_events_url":"https://api.github.com/users/pymedusa/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pymedusa/Medusa","description":"Now with the most wanted feature: **Manual Search**. You can choose what to download! IRC: #pymedusa","fork":false,"url":"https://api.github.com/repos/pymedusa/Medusa","forks_url":"https://api.github.com/repos/pymedusa/Medusa/forks","keys_url":"https://api.github.com/repos/pymedusa/Medusa/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pymedusa/Medusa/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pymedusa/Medusa/teams","hooks_url":"https://api.github.com/repos/pymedusa/Medusa/hooks","issue_events_url":"https://api.github.com/repos/pymedusa/Medusa/issues/events{/number}","events_url":"https://api.github.com/repos/pymedusa/Medusa/events","assignees_url":"https://api.github.com/repos/pymedusa/Medusa/assignees{/user}","branches_url":"https://api.github.com/repos/pymedusa/Medusa/branches{/branch}","tags_url":"https://api.github.com/repos/pymedusa/Medusa/tags","blobs_url":"https://api.github.com/repos/pymedusa/Medusa/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pymedusa/Medusa/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pymedusa/Medusa/git/refs{/sha}","trees_url":"https://api.github.com/repos/pymedusa/Medusa/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pymedusa/Medusa/statuses/{sha}","languages_url":"https://api.github.com/repos/pymedusa/Medusa/languages","stargazers_url":"https://api.github.com/repos/pymedusa/Medusa/stargazers","contributors_url":"https://api.github.com/repos/pymedusa/Medusa/contributors","subscribers_url":"https://api.github.com/repos/pymedusa/Medusa/subscribers","subscription_url":"https://api.github.com/repos/pymedusa/Medusa/subscription","commits_url":"https://api.github.com/repos/pymedusa/Medusa/commits{/sha}","git_commits_url":"https://api.github.com/repos/pymedusa/Medusa/git/commits{/sha}","comments_url":"https://api.github.com/repos/pymedusa/Medusa/comments{/number}","issue_comment_url":"https://api.github.com/repos/pymedusa/Medusa/issues/comments{/number}","contents_url":"https://api.github.com/repos/pymedusa/Medusa/contents/{+path}","compare_url":"https://api.github.com/repos/pymedusa/Medusa/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pymedusa/Medusa/merges","archive_url":"https://api.github.com/repos/pymedusa/Medusa/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pymedusa/Medusa/downloads","issues_url":"https://api.github.com/repos/pymedusa/Medusa/issues{/number}","pulls_url":"https://api.github.com/repos/pymedusa/Medusa/pulls{/number}","milestones_url":"https://api.github.com/repos/pymedusa/Medusa/milestones{/number}","notifications_url":"https://api.github.com/repos/pymedusa/Medusa/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pymedusa/Medusa/labels{/name}","releases_url":"https://api.github.com/repos/pymedusa/Medusa/releases{/id}","deployments_url":"https://api.github.com/repos/pymedusa/Medusa/deployments","created_at":"2016-02-23T06:02:11Z","updated_at":"2018-02-06T13:37:12Z","pushed_at":"2018-02-08T10:08:24Z","git_url":"git://github.com/pymedusa/Medusa.git","ssh_url":"git@github.com:pymedusa/Medusa.git","clone_url":"https://github.com/pymedusa/Medusa.git","svn_url":"https://github.com/pymedusa/Medusa","homepage":"","size":95836,"stargazers_count":250,"watchers_count":250,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":53,"mirror_url":null,"archived":false,"open_issues_count":150,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0"},"forks":53,"open_issues":150,"watchers":250,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pymedusa/Medusa/pulls/3727"},"html":{"href":"https://github.com/pymedusa/Medusa/pull/3727"},"issue":{"href":"https://api.github.com/repos/pymedusa/Medusa/issues/3727"},"comments":{"href":"https://api.github.com/repos/pymedusa/Medusa/issues/3727/comments"},"review_comments":{"href":"https://api.github.com/repos/pymedusa/Medusa/pulls/3727/comments"},"review_comment":{"href":"https://api.github.com/repos/pymedusa/Medusa/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pymedusa/Medusa/pulls/3727/commits"},"statuses":{"href":"https://api.github.com/repos/pymedusa/Medusa/statuses/72ec697189bb92f93e9eb445de341622463be89f"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"p0psicles"}}