{"action":"created","comment":{"url":"https://api.github.com/repos/Diaoul/subliminal/pulls/comments/35480740","id":35480740,"diff_hunk":"@@ -95,13 +95,19 @@ def get_matches(self, video, hearing_impaired=False):\n class OpenSubtitlesProvider(Provider):\n     languages = {Language.fromopensubtitles(l) for l in language_converters['opensubtitles'].codes}\n \n-    def __init__(self):\n+    def __init__(self, username=None, password=None):\n         self.server = ServerProxy('https://api.opensubtitles.org/xml-rpc', TimeoutSafeTransport(10))\n+        if username and not password or not username and password:\n+            raise ConfigurationError('Username and password must be specified')\n+        # None values not allowed for logging in, so replace it by ''\n+        self.username = username if username else ''\n+        self.password = password if password else ''","path":"subliminal/providers/opensubtitles.py","position":20,"original_position":20,"commit_id":"a902784f79a37e105dcebd273ed7a5cc611f1759","original_commit_id":"a902784f79a37e105dcebd273ed7a5cc611f1759","user":{"login":"Diaoul","id":319220,"avatar_url":"https://avatars.githubusercontent.com/u/319220?v=3","gravatar_id":"","url":"https://api.github.com/users/Diaoul","html_url":"https://github.com/Diaoul","followers_url":"https://api.github.com/users/Diaoul/followers","following_url":"https://api.github.com/users/Diaoul/following{/other_user}","gists_url":"https://api.github.com/users/Diaoul/gists{/gist_id}","starred_url":"https://api.github.com/users/Diaoul/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Diaoul/subscriptions","organizations_url":"https://api.github.com/users/Diaoul/orgs","repos_url":"https://api.github.com/users/Diaoul/repos","events_url":"https://api.github.com/users/Diaoul/events{/privacy}","received_events_url":"https://api.github.com/users/Diaoul/received_events","type":"User","site_admin":false},"body":"`self.x = x or ''` is more pythonic","created_at":"2015-07-25T07:15:19Z","updated_at":"2015-07-25T07:15:19Z","html_url":"https://github.com/Diaoul/subliminal/pull/452#discussion_r35480740","pull_request_url":"https://api.github.com/repos/Diaoul/subliminal/pulls/452","_links":{"self":{"href":"https://api.github.com/repos/Diaoul/subliminal/pulls/comments/35480740"},"html":{"href":"https://github.com/Diaoul/subliminal/pull/452#discussion_r35480740"},"pull_request":{"href":"https://api.github.com/repos/Diaoul/subliminal/pulls/452"}}},"pull_request":{"url":"https://api.github.com/repos/Diaoul/subliminal/pulls/452","id":35161483,"html_url":"https://github.com/Diaoul/subliminal/pull/452","diff_url":"https://github.com/Diaoul/subliminal/pull/452.diff","patch_url":"https://github.com/Diaoul/subliminal/pull/452.patch","issue_url":"https://api.github.com/repos/Diaoul/subliminal/issues/452","number":452,"state":"open","locked":false,"title":"Add support for opensubitles login","user":{"login":"h3llrais3r","id":1945295,"avatar_url":"https://avatars.githubusercontent.com/u/1945295?v=3","gravatar_id":"","url":"https://api.github.com/users/h3llrais3r","html_url":"https://github.com/h3llrais3r","followers_url":"https://api.github.com/users/h3llrais3r/followers","following_url":"https://api.github.com/users/h3llrais3r/following{/other_user}","gists_url":"https://api.github.com/users/h3llrais3r/gists{/gist_id}","starred_url":"https://api.github.com/users/h3llrais3r/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/h3llrais3r/subscriptions","organizations_url":"https://api.github.com/users/h3llrais3r/orgs","repos_url":"https://api.github.com/users/h3llrais3r/repos","events_url":"https://api.github.com/users/h3llrais3r/events{/privacy}","received_events_url":"https://api.github.com/users/h3llrais3r/received_events","type":"User","site_admin":false},"body":"Make it possible to specify your own username and password for downloading from opensubtitles.","created_at":"2015-05-11T19:40:38Z","updated_at":"2015-07-25T07:15:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4bdf19e855cafb064aa5bc1d60bb3a3d1a8ca76e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Diaoul/subliminal/pulls/452/commits","review_comments_url":"https://api.github.com/repos/Diaoul/subliminal/pulls/452/comments","review_comment_url":"https://api.github.com/repos/Diaoul/subliminal/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Diaoul/subliminal/issues/452/comments","statuses_url":"https://api.github.com/repos/Diaoul/subliminal/statuses/a902784f79a37e105dcebd273ed7a5cc611f1759","head":{"label":"h3llrais3r:opensubtitles-login","ref":"opensubtitles-login","sha":"a902784f79a37e105dcebd273ed7a5cc611f1759","user":{"login":"h3llrais3r","id":1945295,"avatar_url":"https://avatars.githubusercontent.com/u/1945295?v=3","gravatar_id":"","url":"https://api.github.com/users/h3llrais3r","html_url":"https://github.com/h3llrais3r","followers_url":"https://api.github.com/users/h3llrais3r/followers","following_url":"https://api.github.com/users/h3llrais3r/following{/other_user}","gists_url":"https://api.github.com/users/h3llrais3r/gists{/gist_id}","starred_url":"https://api.github.com/users/h3llrais3r/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/h3llrais3r/subscriptions","organizations_url":"https://api.github.com/users/h3llrais3r/orgs","repos_url":"https://api.github.com/users/h3llrais3r/repos","events_url":"https://api.github.com/users/h3llrais3r/events{/privacy}","received_events_url":"https://api.github.com/users/h3llrais3r/received_events","type":"User","site_admin":false},"repo":{"id":16383268,"name":"subliminal","full_name":"h3llrais3r/subliminal","owner":{"login":"h3llrais3r","id":1945295,"avatar_url":"https://avatars.githubusercontent.com/u/1945295?v=3","gravatar_id":"","url":"https://api.github.com/users/h3llrais3r","html_url":"https://github.com/h3llrais3r","followers_url":"https://api.github.com/users/h3llrais3r/followers","following_url":"https://api.github.com/users/h3llrais3r/following{/other_user}","gists_url":"https://api.github.com/users/h3llrais3r/gists{/gist_id}","starred_url":"https://api.github.com/users/h3llrais3r/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/h3llrais3r/subscriptions","organizations_url":"https://api.github.com/users/h3llrais3r/orgs","repos_url":"https://api.github.com/users/h3llrais3r/repos","events_url":"https://api.github.com/users/h3llrais3r/events{/privacy}","received_events_url":"https://api.github.com/users/h3llrais3r/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/h3llrais3r/subliminal","description":"Subliminal - Subtitles, faster than your thoughts","fork":true,"url":"https://api.github.com/repos/h3llrais3r/subliminal","forks_url":"https://api.github.com/repos/h3llrais3r/subliminal/forks","keys_url":"https://api.github.com/repos/h3llrais3r/subliminal/keys{/key_id}","collaborators_url":"https://api.github.com/repos/h3llrais3r/subliminal/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/h3llrais3r/subliminal/teams","hooks_url":"https://api.github.com/repos/h3llrais3r/subliminal/hooks","issue_events_url":"https://api.github.com/repos/h3llrais3r/subliminal/issues/events{/number}","events_url":"https://api.github.com/repos/h3llrais3r/subliminal/events","assignees_url":"https://api.github.com/repos/h3llrais3r/subliminal/assignees{/user}","branches_url":"https://api.github.com/repos/h3llrais3r/subliminal/branches{/branch}","tags_url":"https://api.github.com/repos/h3llrais3r/subliminal/tags","blobs_url":"https://api.github.com/repos/h3llrais3r/subliminal/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/h3llrais3r/subliminal/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/h3llrais3r/subliminal/git/refs{/sha}","trees_url":"https://api.github.com/repos/h3llrais3r/subliminal/git/trees{/sha}","statuses_url":"https://api.github.com/repos/h3llrais3r/subliminal/statuses/{sha}","languages_url":"https://api.github.com/repos/h3llrais3r/subliminal/languages","stargazers_url":"https://api.github.com/repos/h3llrais3r/subliminal/stargazers","contributors_url":"https://api.github.com/repos/h3llrais3r/subliminal/contributors","subscribers_url":"https://api.github.com/repos/h3llrais3r/subliminal/subscribers","subscription_url":"https://api.github.com/repos/h3llrais3r/subliminal/subscription","commits_url":"https://api.github.com/repos/h3llrais3r/subliminal/commits{/sha}","git_commits_url":"https://api.github.com/repos/h3llrais3r/subliminal/git/commits{/sha}","comments_url":"https://api.github.com/repos/h3llrais3r/subliminal/comments{/number}","issue_comment_url":"https://api.github.com/repos/h3llrais3r/subliminal/issues/comments{/number}","contents_url":"https://api.github.com/repos/h3llrais3r/subliminal/contents/{+path}","compare_url":"https://api.github.com/repos/h3llrais3r/subliminal/compare/{base}...{head}","merges_url":"https://api.github.com/repos/h3llrais3r/subliminal/merges","archive_url":"https://api.github.com/repos/h3llrais3r/subliminal/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/h3llrais3r/subliminal/downloads","issues_url":"https://api.github.com/repos/h3llrais3r/subliminal/issues{/number}","pulls_url":"https://api.github.com/repos/h3llrais3r/subliminal/pulls{/number}","milestones_url":"https://api.github.com/repos/h3llrais3r/subliminal/milestones{/number}","notifications_url":"https://api.github.com/repos/h3llrais3r/subliminal/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/h3llrais3r/subliminal/labels{/name}","releases_url":"https://api.github.com/repos/h3llrais3r/subliminal/releases{/id}","created_at":"2014-01-30T16:43:26Z","updated_at":"2015-02-03T19:05:38Z","pushed_at":"2015-07-24T22:14:51Z","git_url":"git://github.com/h3llrais3r/subliminal.git","ssh_url":"git@github.com:h3llrais3r/subliminal.git","clone_url":"https://github.com/h3llrais3r/subliminal.git","svn_url":"https://github.com/h3llrais3r/subliminal","homepage":"http://subliminal.readthedocs.org","size":2652,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Diaoul:master","ref":"master","sha":"e0788be5af94a136e2c875ffcef3ce7d88108626","user":{"login":"Diaoul","id":319220,"avatar_url":"https://avatars.githubusercontent.com/u/319220?v=3","gravatar_id":"","url":"https://api.github.com/users/Diaoul","html_url":"https://github.com/Diaoul","followers_url":"https://api.github.com/users/Diaoul/followers","following_url":"https://api.github.com/users/Diaoul/following{/other_user}","gists_url":"https://api.github.com/users/Diaoul/gists{/gist_id}","starred_url":"https://api.github.com/users/Diaoul/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Diaoul/subscriptions","organizations_url":"https://api.github.com/users/Diaoul/orgs","repos_url":"https://api.github.com/users/Diaoul/repos","events_url":"https://api.github.com/users/Diaoul/events{/privacy}","received_events_url":"https://api.github.com/users/Diaoul/received_events","type":"User","site_admin":false},"repo":{"id":1998014,"name":"subliminal","full_name":"Diaoul/subliminal","owner":{"login":"Diaoul","id":319220,"avatar_url":"https://avatars.githubusercontent.com/u/319220?v=3","gravatar_id":"","url":"https://api.github.com/users/Diaoul","html_url":"https://github.com/Diaoul","followers_url":"https://api.github.com/users/Diaoul/followers","following_url":"https://api.github.com/users/Diaoul/following{/other_user}","gists_url":"https://api.github.com/users/Diaoul/gists{/gist_id}","starred_url":"https://api.github.com/users/Diaoul/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Diaoul/subscriptions","organizations_url":"https://api.github.com/users/Diaoul/orgs","repos_url":"https://api.github.com/users/Diaoul/repos","events_url":"https://api.github.com/users/Diaoul/events{/privacy}","received_events_url":"https://api.github.com/users/Diaoul/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Diaoul/subliminal","description":"Subliminal - Subtitles, faster than your thoughts","fork":false,"url":"https://api.github.com/repos/Diaoul/subliminal","forks_url":"https://api.github.com/repos/Diaoul/subliminal/forks","keys_url":"https://api.github.com/repos/Diaoul/subliminal/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Diaoul/subliminal/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Diaoul/subliminal/teams","hooks_url":"https://api.github.com/repos/Diaoul/subliminal/hooks","issue_events_url":"https://api.github.com/repos/Diaoul/subliminal/issues/events{/number}","events_url":"https://api.github.com/repos/Diaoul/subliminal/events","assignees_url":"https://api.github.com/repos/Diaoul/subliminal/assignees{/user}","branches_url":"https://api.github.com/repos/Diaoul/subliminal/branches{/branch}","tags_url":"https://api.github.com/repos/Diaoul/subliminal/tags","blobs_url":"https://api.github.com/repos/Diaoul/subliminal/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Diaoul/subliminal/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Diaoul/subliminal/git/refs{/sha}","trees_url":"https://api.github.com/repos/Diaoul/subliminal/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Diaoul/subliminal/statuses/{sha}","languages_url":"https://api.github.com/repos/Diaoul/subliminal/languages","stargazers_url":"https://api.github.com/repos/Diaoul/subliminal/stargazers","contributors_url":"https://api.github.com/repos/Diaoul/subliminal/contributors","subscribers_url":"https://api.github.com/repos/Diaoul/subliminal/subscribers","subscription_url":"https://api.github.com/repos/Diaoul/subliminal/subscription","commits_url":"https://api.github.com/repos/Diaoul/subliminal/commits{/sha}","git_commits_url":"https://api.github.com/repos/Diaoul/subliminal/git/commits{/sha}","comments_url":"https://api.github.com/repos/Diaoul/subliminal/comments{/number}","issue_comment_url":"https://api.github.com/repos/Diaoul/subliminal/issues/comments{/number}","contents_url":"https://api.github.com/repos/Diaoul/subliminal/contents/{+path}","compare_url":"https://api.github.com/repos/Diaoul/subliminal/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Diaoul/subliminal/merges","archive_url":"https://api.github.com/repos/Diaoul/subliminal/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Diaoul/subliminal/downloads","issues_url":"https://api.github.com/repos/Diaoul/subliminal/issues{/number}","pulls_url":"https://api.github.com/repos/Diaoul/subliminal/pulls{/number}","milestones_url":"https://api.github.com/repos/Diaoul/subliminal/milestones{/number}","notifications_url":"https://api.github.com/repos/Diaoul/subliminal/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Diaoul/subliminal/labels{/name}","releases_url":"https://api.github.com/repos/Diaoul/subliminal/releases{/id}","created_at":"2011-07-05T00:24:23Z","updated_at":"2015-07-23T14:37:57Z","pushed_at":"2015-07-24T22:14:51Z","git_url":"git://github.com/Diaoul/subliminal.git","ssh_url":"git@github.com:Diaoul/subliminal.git","clone_url":"https://github.com/Diaoul/subliminal.git","svn_url":"https://github.com/Diaoul/subliminal","homepage":"http://subliminal.readthedocs.org","size":3427,"stargazers_count":707,"watchers_count":707,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":168,"mirror_url":null,"open_issues_count":25,"forks":168,"open_issues":25,"watchers":707,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Diaoul/subliminal/pulls/452"},"html":{"href":"https://github.com/Diaoul/subliminal/pull/452"},"issue":{"href":"https://api.github.com/repos/Diaoul/subliminal/issues/452"},"comments":{"href":"https://api.github.com/repos/Diaoul/subliminal/issues/452/comments"},"review_comments":{"href":"https://api.github.com/repos/Diaoul/subliminal/pulls/452/comments"},"review_comment":{"href":"https://api.github.com/repos/Diaoul/subliminal/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Diaoul/subliminal/pulls/452/commits"},"statuses":{"href":"https://api.github.com/repos/Diaoul/subliminal/statuses/a902784f79a37e105dcebd273ed7a5cc611f1759"}}}}