{"action":"created","comment":{"url":"https://api.github.com/repos/cenkalti/putio.py/pulls/comments/53081430","id":53081430,"diff_hunk":"@@ -9,6 +9,15 @@\n import requests\n import iso8601\n \n+KB = 1024\n+MB = 1024 * KB\n+\n+# Downloads are broken up into ranges of this size\n+RANGE_SIZE = 10 * MB","path":"putio.py","position":8,"original_position":8,"commit_id":"8ab4d13bbbe374440a7f8c3e9f485c52df6a91da","original_commit_id":"8ab4d13bbbe374440a7f8c3e9f485c52df6a91da","user":{"login":"cenkalti","id":661618,"avatar_url":"https://avatars.githubusercontent.com/u/661618?v=3","gravatar_id":"","url":"https://api.github.com/users/cenkalti","html_url":"https://github.com/cenkalti","followers_url":"https://api.github.com/users/cenkalti/followers","following_url":"https://api.github.com/users/cenkalti/following{/other_user}","gists_url":"https://api.github.com/users/cenkalti/gists{/gist_id}","starred_url":"https://api.github.com/users/cenkalti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cenkalti/subscriptions","organizations_url":"https://api.github.com/users/cenkalti/orgs","repos_url":"https://api.github.com/users/cenkalti/repos","events_url":"https://api.github.com/users/cenkalti/events{/privacy}","received_events_url":"https://api.github.com/users/cenkalti/received_events","type":"User","site_admin":false},"body":"Why do we need to make range requests of fixed 10M size? Can't we just continue from where we left of?\r\n```\r\nRange: bytes=12345-\r\n```","created_at":"2016-02-16T21:27:40Z","updated_at":"2016-02-16T21:27:40Z","html_url":"https://github.com/cenkalti/putio.py/pull/13#discussion_r53081430","pull_request_url":"https://api.github.com/repos/cenkalti/putio.py/pulls/13","_links":{"self":{"href":"https://api.github.com/repos/cenkalti/putio.py/pulls/comments/53081430"},"html":{"href":"https://github.com/cenkalti/putio.py/pull/13#discussion_r53081430"},"pull_request":{"href":"https://api.github.com/repos/cenkalti/putio.py/pulls/13"}}},"pull_request":{"url":"https://api.github.com/repos/cenkalti/putio.py/pulls/13","id":57182589,"html_url":"https://github.com/cenkalti/putio.py/pull/13","diff_url":"https://github.com/cenkalti/putio.py/pull/13.diff","patch_url":"https://github.com/cenkalti/putio.py/pull/13.patch","issue_url":"https://api.github.com/repos/cenkalti/putio.py/issues/13","number":13,"state":"open","locked":false,"title":"Add transfers cancel and use resume for file downloads","user":{"login":"datashaman","id":59514,"avatar_url":"https://avatars.githubusercontent.com/u/59514?v=3","gravatar_id":"","url":"https://api.github.com/users/datashaman","html_url":"https://github.com/datashaman","followers_url":"https://api.github.com/users/datashaman/followers","following_url":"https://api.github.com/users/datashaman/following{/other_user}","gists_url":"https://api.github.com/users/datashaman/gists{/gist_id}","starred_url":"https://api.github.com/users/datashaman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/datashaman/subscriptions","organizations_url":"https://api.github.com/users/datashaman/orgs","repos_url":"https://api.github.com/users/datashaman/repos","events_url":"https://api.github.com/users/datashaman/events{/privacy}","received_events_url":"https://api.github.com/users/datashaman/received_events","type":"User","site_admin":false},"body":"File downloads now use ranged, chunked transfers. If a download fails partway through, the next time download method is called, it will resume from where it left off. The remote file is only deleted if the local file size matches the remote file size.\r\n\r\nDownloads are flushed in broad ranges of 10MB by default, and each range is written in chunks of 8KB. Alter these depending on your network speed and reliability.\r\n\r\nBoth sizes are added as parameters to the download method.\r\n\r\nI also added a transfers cancel API call, it was missing.","created_at":"2016-01-26T08:42:01Z","updated_at":"2016-02-16T21:27:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5d76c6bc9f468193a90390c88662df0a672c3698","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/cenkalti/putio.py/pulls/13/commits","review_comments_url":"https://api.github.com/repos/cenkalti/putio.py/pulls/13/comments","review_comment_url":"https://api.github.com/repos/cenkalti/putio.py/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cenkalti/putio.py/issues/13/comments","statuses_url":"https://api.github.com/repos/cenkalti/putio.py/statuses/8ab4d13bbbe374440a7f8c3e9f485c52df6a91da","head":{"label":"datashaman:master","ref":"master","sha":"8ab4d13bbbe374440a7f8c3e9f485c52df6a91da","user":{"login":"datashaman","id":59514,"avatar_url":"https://avatars.githubusercontent.com/u/59514?v=3","gravatar_id":"","url":"https://api.github.com/users/datashaman","html_url":"https://github.com/datashaman","followers_url":"https://api.github.com/users/datashaman/followers","following_url":"https://api.github.com/users/datashaman/following{/other_user}","gists_url":"https://api.github.com/users/datashaman/gists{/gist_id}","starred_url":"https://api.github.com/users/datashaman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/datashaman/subscriptions","organizations_url":"https://api.github.com/users/datashaman/orgs","repos_url":"https://api.github.com/users/datashaman/repos","events_url":"https://api.github.com/users/datashaman/events{/privacy}","received_events_url":"https://api.github.com/users/datashaman/received_events","type":"User","site_admin":false},"repo":{"id":48549082,"name":"putio.py","full_name":"datashaman/putio.py","owner":{"login":"datashaman","id":59514,"avatar_url":"https://avatars.githubusercontent.com/u/59514?v=3","gravatar_id":"","url":"https://api.github.com/users/datashaman","html_url":"https://github.com/datashaman","followers_url":"https://api.github.com/users/datashaman/followers","following_url":"https://api.github.com/users/datashaman/following{/other_user}","gists_url":"https://api.github.com/users/datashaman/gists{/gist_id}","starred_url":"https://api.github.com/users/datashaman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/datashaman/subscriptions","organizations_url":"https://api.github.com/users/datashaman/orgs","repos_url":"https://api.github.com/users/datashaman/repos","events_url":"https://api.github.com/users/datashaman/events{/privacy}","received_events_url":"https://api.github.com/users/datashaman/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/datashaman/putio.py","description":"A python wrapper for put.io APIv2","fork":true,"url":"https://api.github.com/repos/datashaman/putio.py","forks_url":"https://api.github.com/repos/datashaman/putio.py/forks","keys_url":"https://api.github.com/repos/datashaman/putio.py/keys{/key_id}","collaborators_url":"https://api.github.com/repos/datashaman/putio.py/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/datashaman/putio.py/teams","hooks_url":"https://api.github.com/repos/datashaman/putio.py/hooks","issue_events_url":"https://api.github.com/repos/datashaman/putio.py/issues/events{/number}","events_url":"https://api.github.com/repos/datashaman/putio.py/events","assignees_url":"https://api.github.com/repos/datashaman/putio.py/assignees{/user}","branches_url":"https://api.github.com/repos/datashaman/putio.py/branches{/branch}","tags_url":"https://api.github.com/repos/datashaman/putio.py/tags","blobs_url":"https://api.github.com/repos/datashaman/putio.py/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/datashaman/putio.py/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/datashaman/putio.py/git/refs{/sha}","trees_url":"https://api.github.com/repos/datashaman/putio.py/git/trees{/sha}","statuses_url":"https://api.github.com/repos/datashaman/putio.py/statuses/{sha}","languages_url":"https://api.github.com/repos/datashaman/putio.py/languages","stargazers_url":"https://api.github.com/repos/datashaman/putio.py/stargazers","contributors_url":"https://api.github.com/repos/datashaman/putio.py/contributors","subscribers_url":"https://api.github.com/repos/datashaman/putio.py/subscribers","subscription_url":"https://api.github.com/repos/datashaman/putio.py/subscription","commits_url":"https://api.github.com/repos/datashaman/putio.py/commits{/sha}","git_commits_url":"https://api.github.com/repos/datashaman/putio.py/git/commits{/sha}","comments_url":"https://api.github.com/repos/datashaman/putio.py/comments{/number}","issue_comment_url":"https://api.github.com/repos/datashaman/putio.py/issues/comments{/number}","contents_url":"https://api.github.com/repos/datashaman/putio.py/contents/{+path}","compare_url":"https://api.github.com/repos/datashaman/putio.py/compare/{base}...{head}","merges_url":"https://api.github.com/repos/datashaman/putio.py/merges","archive_url":"https://api.github.com/repos/datashaman/putio.py/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/datashaman/putio.py/downloads","issues_url":"https://api.github.com/repos/datashaman/putio.py/issues{/number}","pulls_url":"https://api.github.com/repos/datashaman/putio.py/pulls{/number}","milestones_url":"https://api.github.com/repos/datashaman/putio.py/milestones{/number}","notifications_url":"https://api.github.com/repos/datashaman/putio.py/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/datashaman/putio.py/labels{/name}","releases_url":"https://api.github.com/repos/datashaman/putio.py/releases{/id}","deployments_url":"https://api.github.com/repos/datashaman/putio.py/deployments","created_at":"2015-12-24T16:01:14Z","updated_at":"2016-02-14T05:56:53Z","pushed_at":"2016-02-16T05:53:37Z","git_url":"git://github.com/datashaman/putio.py.git","ssh_url":"git@github.com:datashaman/putio.py.git","clone_url":"https://github.com/datashaman/putio.py.git","svn_url":"https://github.com/datashaman/putio.py","homepage":"http://put.io","size":40,"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":"cenkalti:master","ref":"master","sha":"2b0c8619ff6e39ed7402e4868250ef39dee6890c","user":{"login":"cenkalti","id":661618,"avatar_url":"https://avatars.githubusercontent.com/u/661618?v=3","gravatar_id":"","url":"https://api.github.com/users/cenkalti","html_url":"https://github.com/cenkalti","followers_url":"https://api.github.com/users/cenkalti/followers","following_url":"https://api.github.com/users/cenkalti/following{/other_user}","gists_url":"https://api.github.com/users/cenkalti/gists{/gist_id}","starred_url":"https://api.github.com/users/cenkalti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cenkalti/subscriptions","organizations_url":"https://api.github.com/users/cenkalti/orgs","repos_url":"https://api.github.com/users/cenkalti/repos","events_url":"https://api.github.com/users/cenkalti/events{/privacy}","received_events_url":"https://api.github.com/users/cenkalti/received_events","type":"User","site_admin":false},"repo":{"id":3208919,"name":"putio.py","full_name":"cenkalti/putio.py","owner":{"login":"cenkalti","id":661618,"avatar_url":"https://avatars.githubusercontent.com/u/661618?v=3","gravatar_id":"","url":"https://api.github.com/users/cenkalti","html_url":"https://github.com/cenkalti","followers_url":"https://api.github.com/users/cenkalti/followers","following_url":"https://api.github.com/users/cenkalti/following{/other_user}","gists_url":"https://api.github.com/users/cenkalti/gists{/gist_id}","starred_url":"https://api.github.com/users/cenkalti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cenkalti/subscriptions","organizations_url":"https://api.github.com/users/cenkalti/orgs","repos_url":"https://api.github.com/users/cenkalti/repos","events_url":"https://api.github.com/users/cenkalti/events{/privacy}","received_events_url":"https://api.github.com/users/cenkalti/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cenkalti/putio.py","description":"A python wrapper for put.io APIv2","fork":false,"url":"https://api.github.com/repos/cenkalti/putio.py","forks_url":"https://api.github.com/repos/cenkalti/putio.py/forks","keys_url":"https://api.github.com/repos/cenkalti/putio.py/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cenkalti/putio.py/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cenkalti/putio.py/teams","hooks_url":"https://api.github.com/repos/cenkalti/putio.py/hooks","issue_events_url":"https://api.github.com/repos/cenkalti/putio.py/issues/events{/number}","events_url":"https://api.github.com/repos/cenkalti/putio.py/events","assignees_url":"https://api.github.com/repos/cenkalti/putio.py/assignees{/user}","branches_url":"https://api.github.com/repos/cenkalti/putio.py/branches{/branch}","tags_url":"https://api.github.com/repos/cenkalti/putio.py/tags","blobs_url":"https://api.github.com/repos/cenkalti/putio.py/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cenkalti/putio.py/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cenkalti/putio.py/git/refs{/sha}","trees_url":"https://api.github.com/repos/cenkalti/putio.py/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cenkalti/putio.py/statuses/{sha}","languages_url":"https://api.github.com/repos/cenkalti/putio.py/languages","stargazers_url":"https://api.github.com/repos/cenkalti/putio.py/stargazers","contributors_url":"https://api.github.com/repos/cenkalti/putio.py/contributors","subscribers_url":"https://api.github.com/repos/cenkalti/putio.py/subscribers","subscription_url":"https://api.github.com/repos/cenkalti/putio.py/subscription","commits_url":"https://api.github.com/repos/cenkalti/putio.py/commits{/sha}","git_commits_url":"https://api.github.com/repos/cenkalti/putio.py/git/commits{/sha}","comments_url":"https://api.github.com/repos/cenkalti/putio.py/comments{/number}","issue_comment_url":"https://api.github.com/repos/cenkalti/putio.py/issues/comments{/number}","contents_url":"https://api.github.com/repos/cenkalti/putio.py/contents/{+path}","compare_url":"https://api.github.com/repos/cenkalti/putio.py/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cenkalti/putio.py/merges","archive_url":"https://api.github.com/repos/cenkalti/putio.py/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cenkalti/putio.py/downloads","issues_url":"https://api.github.com/repos/cenkalti/putio.py/issues{/number}","pulls_url":"https://api.github.com/repos/cenkalti/putio.py/pulls{/number}","milestones_url":"https://api.github.com/repos/cenkalti/putio.py/milestones{/number}","notifications_url":"https://api.github.com/repos/cenkalti/putio.py/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cenkalti/putio.py/labels{/name}","releases_url":"https://api.github.com/repos/cenkalti/putio.py/releases{/id}","deployments_url":"https://api.github.com/repos/cenkalti/putio.py/deployments","created_at":"2012-01-18T13:49:54Z","updated_at":"2015-10-17T17:15:13Z","pushed_at":"2016-02-16T05:53:38Z","git_url":"git://github.com/cenkalti/putio.py.git","ssh_url":"git@github.com:cenkalti/putio.py.git","clone_url":"https://github.com/cenkalti/putio.py.git","svn_url":"https://github.com/cenkalti/putio.py","homepage":"http://put.io","size":34,"stargazers_count":27,"watchers_count":27,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":20,"mirror_url":null,"open_issues_count":1,"forks":20,"open_issues":1,"watchers":27,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cenkalti/putio.py/pulls/13"},"html":{"href":"https://github.com/cenkalti/putio.py/pull/13"},"issue":{"href":"https://api.github.com/repos/cenkalti/putio.py/issues/13"},"comments":{"href":"https://api.github.com/repos/cenkalti/putio.py/issues/13/comments"},"review_comments":{"href":"https://api.github.com/repos/cenkalti/putio.py/pulls/13/comments"},"review_comment":{"href":"https://api.github.com/repos/cenkalti/putio.py/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cenkalti/putio.py/pulls/13/commits"},"statuses":{"href":"https://api.github.com/repos/cenkalti/putio.py/statuses/8ab4d13bbbe374440a7f8c3e9f485c52df6a91da"}}}}