{"action":"created","comment":{"url":"https://api.github.com/repos/Diaoul/subliminal/pulls/comments/23890243","id":23890243,"diff_hunk":"@@ -6,12 +6,34 @@\n import operator\n import babelfish\n import pkg_resources\n+from os.path import basename\n from .exceptions import ProviderNotAvailable, InvalidSubtitle\n from .subtitle import get_subtitle_path\n-\n+from socket import error as socket_error\n+from random import randint\n \n logger = logging.getLogger(__name__)\n \n+# Agent List\n+AGENT_LIST = (\n+    'Mozilla/5.0 (Windows NT 6.3; rv:36.0) Gecko/20100101 Firefox/36.0',\n+    'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36',\n+    'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2227.1 Safari/537.36',\n+    'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10; rv:33.0) Gecko/20100101 Firefox/33.0',\n+    'Mozilla/5.0 (X11; Linux i586; rv:31.0) Gecko/20100101 Firefox/31.0',\n+    'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20130401 Firefox/31.0',\n+    'Mozilla/5.0 (Windows NT 5.1; rv:31.0) Gecko/20100101 Firefox/31.0',\n+    'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2227.0 Safari/537.36',\n+    'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2227.0 Safari/537.36',\n+    'Mozilla/5.0 (compatible, MSIE 11, Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko',\n+    'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0)',\n+    'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.75.14 (KHTML, like Gecko) Version/7.0.3 Safari/7046A194A',\n+    'Mozilla/5.0 (iPad; CPU OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A5355d Safari/8536.25',\n+)\n+\n+# Returns a random agent to use from the list above\n+RANDOM_USER_AGENT = AGENT_LIST[randint(0, len(AGENT_LIST)-1)]","path":"subliminal/api.py","position":31,"original_position":31,"commit_id":"1b7291e45c6f9b5404a743e222cd6d3739168dc0","original_commit_id":"1b7291e45c6f9b5404a743e222cd6d3739168dc0","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":"This is set at import time, better randomize at runtime","created_at":"2015-01-31T16:53:36Z","updated_at":"2015-01-31T16:53:36Z","html_url":"https://github.com/Diaoul/subliminal/pull/404#discussion_r23890243","pull_request_url":"https://api.github.com/repos/Diaoul/subliminal/pulls/404","_links":{"self":{"href":"https://api.github.com/repos/Diaoul/subliminal/pulls/comments/23890243"},"html":{"href":"https://github.com/Diaoul/subliminal/pull/404#discussion_r23890243"},"pull_request":{"href":"https://api.github.com/repos/Diaoul/subliminal/pulls/404"}}},"pull_request":{"url":"https://api.github.com/repos/Diaoul/subliminal/pulls/404","id":21436604,"html_url":"https://github.com/Diaoul/subliminal/pull/404","diff_url":"https://github.com/Diaoul/subliminal/pull/404.diff","patch_url":"https://github.com/Diaoul/subliminal/pull/404.patch","issue_url":"https://api.github.com/repos/Diaoul/subliminal/issues/404","number":404,"state":"open","locked":false,"title":"0.7.x","user":{"login":"caronc","id":850374,"avatar_url":"https://avatars.githubusercontent.com/u/850374?v=3","gravatar_id":"","url":"https://api.github.com/users/caronc","html_url":"https://github.com/caronc","followers_url":"https://api.github.com/users/caronc/followers","following_url":"https://api.github.com/users/caronc/following{/other_user}","gists_url":"https://api.github.com/users/caronc/gists{/gist_id}","starred_url":"https://api.github.com/users/caronc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caronc/subscriptions","organizations_url":"https://api.github.com/users/caronc/orgs","repos_url":"https://api.github.com/users/caronc/repos","events_url":"https://api.github.com/users/caronc/events{/privacy}","received_events_url":"https://api.github.com/users/caronc/received_events","type":"User","site_admin":false},"body":"I've been [maintaining a plugin](https://github.com/caronc/nzbget-subliminal) ([forum](http://nzbget.net/forum/viewtopic.php?f=8&t=1422&sid=9cc9c3414699137f3058f570caadfe10)) to your fantastic subtitle fetcher you've written. The  [plugin](https://github.com/caronc/nzbget-subliminal) is for [NZBGet](http://nzbget.net) (a [UseNet](http://en.wikipedia.org/wiki/Usenet) solution). You can [see this blog if interested](http://nuxref.com/2014/07/15/a-usenet-solution-centos-6/). I'm only utilizing the 0.7.x branch, but have added some stability to it along with back porting older code so that it works with people running older versions of python (v2.6+) (like myself). The backporting specifically addresses [an old ticket closed](https://github.com/Diaoul/subliminal/issues/334). I adapted to the podnapsi's new page layout and added a few other minor features. I just thought I should share my changes back!\r\n\r\nJust added support for quotes which should fix [issue 378](https://github.com/Diaoul/subliminal/issues/378) and [issue 412](https://github.com/Diaoul/subliminal/issues/412) for you.","created_at":"2014-09-18T14:24:09Z","updated_at":"2015-01-31T16:53:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"34dd6aed417bfc14efea4f9f5539263c0b1f08a8","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Diaoul/subliminal/pulls/404/commits","review_comments_url":"https://api.github.com/repos/Diaoul/subliminal/pulls/404/comments","review_comment_url":"https://api.github.com/repos/Diaoul/subliminal/pulls/comments/{number}","comments_url":"https://api.github.com/repos/Diaoul/subliminal/issues/404/comments","statuses_url":"https://api.github.com/repos/Diaoul/subliminal/statuses/1b7291e45c6f9b5404a743e222cd6d3739168dc0","head":{"label":"caronc:0.7.x","ref":"0.7.x","sha":"1b7291e45c6f9b5404a743e222cd6d3739168dc0","user":{"login":"caronc","id":850374,"avatar_url":"https://avatars.githubusercontent.com/u/850374?v=3","gravatar_id":"","url":"https://api.github.com/users/caronc","html_url":"https://github.com/caronc","followers_url":"https://api.github.com/users/caronc/followers","following_url":"https://api.github.com/users/caronc/following{/other_user}","gists_url":"https://api.github.com/users/caronc/gists{/gist_id}","starred_url":"https://api.github.com/users/caronc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caronc/subscriptions","organizations_url":"https://api.github.com/users/caronc/orgs","repos_url":"https://api.github.com/users/caronc/repos","events_url":"https://api.github.com/users/caronc/events{/privacy}","received_events_url":"https://api.github.com/users/caronc/received_events","type":"User","site_admin":false},"repo":{"id":24188306,"name":"subliminal","full_name":"caronc/subliminal","owner":{"login":"caronc","id":850374,"avatar_url":"https://avatars.githubusercontent.com/u/850374?v=3","gravatar_id":"","url":"https://api.github.com/users/caronc","html_url":"https://github.com/caronc","followers_url":"https://api.github.com/users/caronc/followers","following_url":"https://api.github.com/users/caronc/following{/other_user}","gists_url":"https://api.github.com/users/caronc/gists{/gist_id}","starred_url":"https://api.github.com/users/caronc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caronc/subscriptions","organizations_url":"https://api.github.com/users/caronc/orgs","repos_url":"https://api.github.com/users/caronc/repos","events_url":"https://api.github.com/users/caronc/events{/privacy}","received_events_url":"https://api.github.com/users/caronc/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/caronc/subliminal","description":"Subliminal - Subtitles, faster than your thoughts","fork":true,"url":"https://api.github.com/repos/caronc/subliminal","forks_url":"https://api.github.com/repos/caronc/subliminal/forks","keys_url":"https://api.github.com/repos/caronc/subliminal/keys{/key_id}","collaborators_url":"https://api.github.com/repos/caronc/subliminal/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/caronc/subliminal/teams","hooks_url":"https://api.github.com/repos/caronc/subliminal/hooks","issue_events_url":"https://api.github.com/repos/caronc/subliminal/issues/events{/number}","events_url":"https://api.github.com/repos/caronc/subliminal/events","assignees_url":"https://api.github.com/repos/caronc/subliminal/assignees{/user}","branches_url":"https://api.github.com/repos/caronc/subliminal/branches{/branch}","tags_url":"https://api.github.com/repos/caronc/subliminal/tags","blobs_url":"https://api.github.com/repos/caronc/subliminal/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/caronc/subliminal/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/caronc/subliminal/git/refs{/sha}","trees_url":"https://api.github.com/repos/caronc/subliminal/git/trees{/sha}","statuses_url":"https://api.github.com/repos/caronc/subliminal/statuses/{sha}","languages_url":"https://api.github.com/repos/caronc/subliminal/languages","stargazers_url":"https://api.github.com/repos/caronc/subliminal/stargazers","contributors_url":"https://api.github.com/repos/caronc/subliminal/contributors","subscribers_url":"https://api.github.com/repos/caronc/subliminal/subscribers","subscription_url":"https://api.github.com/repos/caronc/subliminal/subscription","commits_url":"https://api.github.com/repos/caronc/subliminal/commits{/sha}","git_commits_url":"https://api.github.com/repos/caronc/subliminal/git/commits{/sha}","comments_url":"https://api.github.com/repos/caronc/subliminal/comments{/number}","issue_comment_url":"https://api.github.com/repos/caronc/subliminal/issues/comments/{number}","contents_url":"https://api.github.com/repos/caronc/subliminal/contents/{+path}","compare_url":"https://api.github.com/repos/caronc/subliminal/compare/{base}...{head}","merges_url":"https://api.github.com/repos/caronc/subliminal/merges","archive_url":"https://api.github.com/repos/caronc/subliminal/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/caronc/subliminal/downloads","issues_url":"https://api.github.com/repos/caronc/subliminal/issues{/number}","pulls_url":"https://api.github.com/repos/caronc/subliminal/pulls{/number}","milestones_url":"https://api.github.com/repos/caronc/subliminal/milestones{/number}","notifications_url":"https://api.github.com/repos/caronc/subliminal/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/caronc/subliminal/labels{/name}","releases_url":"https://api.github.com/repos/caronc/subliminal/releases{/id}","created_at":"2014-09-18T13:02:04Z","updated_at":"2015-01-30T07:02:35Z","pushed_at":"2015-01-30T21:38:48Z","git_url":"git://github.com/caronc/subliminal.git","ssh_url":"git@github.com:caronc/subliminal.git","clone_url":"https://github.com/caronc/subliminal.git","svn_url":"https://github.com/caronc/subliminal","homepage":"http://subliminal.readthedocs.org","size":1350,"stargazers_count":1,"watchers_count":1,"language":null,"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":1,"default_branch":"master"}},"base":{"label":"Diaoul:0.7.x","ref":"0.7.x","sha":"a6abc268a5351158b711594303f91889f1ad507c","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-01-31T16:52:00Z","pushed_at":"2015-01-31T16:52:00Z","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":2648,"stargazers_count":584,"watchers_count":584,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":151,"mirror_url":null,"open_issues_count":75,"forks":151,"open_issues":75,"watchers":584,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Diaoul/subliminal/pulls/404"},"html":{"href":"https://github.com/Diaoul/subliminal/pull/404"},"issue":{"href":"https://api.github.com/repos/Diaoul/subliminal/issues/404"},"comments":{"href":"https://api.github.com/repos/Diaoul/subliminal/issues/404/comments"},"review_comments":{"href":"https://api.github.com/repos/Diaoul/subliminal/pulls/404/comments"},"review_comment":{"href":"https://api.github.com/repos/Diaoul/subliminal/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/Diaoul/subliminal/pulls/404/commits"},"statuses":{"href":"https://api.github.com/repos/Diaoul/subliminal/statuses/1b7291e45c6f9b5404a743e222cd6d3739168dc0"}}}}