{"action":"created","comment":{"url":"https://api.github.com/repos/beaufour/flickr-download/pulls/comments/245290533","pull_request_review_id":189356498,"id":245290533,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0NTI5MDUzMw==","diff_hunk":"@@ -317,6 +317,25 @@ def serialize_json(obj):\n     return ret\n \n \n+def get_photo_sizes(photo):\n+    pSize = {}\n+    for attempt in range(1, 5):\n+        try:\n+            pSize = photo.getSizes()\n+        except FlickrError as ex:\n+            logging.warning(\"Flickr error getting photo size: {}, \"\n+                            \"attempt: #{}, \"\n+                            \"attempts left: {}\".format(str(ex), attempt, (5 - attempt)))\n+            time.sleep(1)\n+            if attempt >= 5:\n+                raise\n+            else:\n+                continue\n+        else:\n+            break\n+    return pSize","path":"flickr_download/flick_download.py","position":38,"original_position":38,"commit_id":"b35195d397c76c6a611077e80e4b45b5d444c5d0","original_commit_id":"b35195d397c76c6a611077e80e4b45b5d444c5d0","user":{"login":"beaufour","id":239545,"node_id":"MDQ6VXNlcjIzOTU0NQ==","avatar_url":"https://avatars1.githubusercontent.com/u/239545?v=4","gravatar_id":"","url":"https://api.github.com/users/beaufour","html_url":"https://github.com/beaufour","followers_url":"https://api.github.com/users/beaufour/followers","following_url":"https://api.github.com/users/beaufour/following{/other_user}","gists_url":"https://api.github.com/users/beaufour/gists{/gist_id}","starred_url":"https://api.github.com/users/beaufour/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beaufour/subscriptions","organizations_url":"https://api.github.com/users/beaufour/orgs","repos_url":"https://api.github.com/users/beaufour/repos","events_url":"https://api.github.com/users/beaufour/events{/privacy}","received_events_url":"https://api.github.com/users/beaufour/received_events","type":"User","site_admin":false},"body":"when the above `else`+`break` is removed, this will never get hit, so remove it","created_at":"2019-01-04T12:55:23Z","updated_at":"2019-01-04T12:55:58Z","html_url":"https://github.com/beaufour/flickr-download/pull/51#discussion_r245290533","pull_request_url":"https://api.github.com/repos/beaufour/flickr-download/pulls/51","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/beaufour/flickr-download/pulls/comments/245290533"},"html":{"href":"https://github.com/beaufour/flickr-download/pull/51#discussion_r245290533"},"pull_request":{"href":"https://api.github.com/repos/beaufour/flickr-download/pulls/51"}}},"pull_request":{"url":"https://api.github.com/repos/beaufour/flickr-download/pulls/51","id":241646758,"node_id":"MDExOlB1bGxSZXF1ZXN0MjQxNjQ2NzU4","html_url":"https://github.com/beaufour/flickr-download/pull/51","diff_url":"https://github.com/beaufour/flickr-download/pull/51.diff","patch_url":"https://github.com/beaufour/flickr-download/pull/51.patch","issue_url":"https://api.github.com/repos/beaufour/flickr-download/issues/51","number":51,"state":"open","locked":false,"title":"Add retry logic for a photo.getSizes()","user":{"login":"kdsnice","id":4728336,"node_id":"MDQ6VXNlcjQ3MjgzMzY=","avatar_url":"https://avatars0.githubusercontent.com/u/4728336?v=4","gravatar_id":"","url":"https://api.github.com/users/kdsnice","html_url":"https://github.com/kdsnice","followers_url":"https://api.github.com/users/kdsnice/followers","following_url":"https://api.github.com/users/kdsnice/following{/other_user}","gists_url":"https://api.github.com/users/kdsnice/gists{/gist_id}","starred_url":"https://api.github.com/users/kdsnice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kdsnice/subscriptions","organizations_url":"https://api.github.com/users/kdsnice/orgs","repos_url":"https://api.github.com/users/kdsnice/repos","events_url":"https://api.github.com/users/kdsnice/events{/privacy}","received_events_url":"https://api.github.com/users/kdsnice/received_events","type":"User","site_admin":false},"body":"First of all thanks for this tool  - it saved a ton of my time!\r\n\r\nWhile downloading all photos (option `-p`) I several time had to start from scratch because of this error: \r\n```\r\nflickr_api.flickrerrors.FlickrError: <html>\r\n<head><title>502 Bad Gateway</title></head>\r\n<body bgcolor=\"white\">\r\n<center><h1>502 Bad Gateway</h1></center>\r\n<hr><center>nginx/1.7.6</center>\r\n```\r\nwhich was happening on `photo.getSizes()` call.\r\nThis PR is adding a retry logic to the call above.","created_at":"2019-01-01T19:02:22Z","updated_at":"2019-01-04T12:55:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7c29757e4e61c5dfe31fd4a5e3720fe3f55975af","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/beaufour/flickr-download/pulls/51/commits","review_comments_url":"https://api.github.com/repos/beaufour/flickr-download/pulls/51/comments","review_comment_url":"https://api.github.com/repos/beaufour/flickr-download/pulls/comments{/number}","comments_url":"https://api.github.com/repos/beaufour/flickr-download/issues/51/comments","statuses_url":"https://api.github.com/repos/beaufour/flickr-download/statuses/b35195d397c76c6a611077e80e4b45b5d444c5d0","head":{"label":"kdsnice:master","ref":"master","sha":"b35195d397c76c6a611077e80e4b45b5d444c5d0","user":{"login":"kdsnice","id":4728336,"node_id":"MDQ6VXNlcjQ3MjgzMzY=","avatar_url":"https://avatars0.githubusercontent.com/u/4728336?v=4","gravatar_id":"","url":"https://api.github.com/users/kdsnice","html_url":"https://github.com/kdsnice","followers_url":"https://api.github.com/users/kdsnice/followers","following_url":"https://api.github.com/users/kdsnice/following{/other_user}","gists_url":"https://api.github.com/users/kdsnice/gists{/gist_id}","starred_url":"https://api.github.com/users/kdsnice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kdsnice/subscriptions","organizations_url":"https://api.github.com/users/kdsnice/orgs","repos_url":"https://api.github.com/users/kdsnice/repos","events_url":"https://api.github.com/users/kdsnice/events{/privacy}","received_events_url":"https://api.github.com/users/kdsnice/received_events","type":"User","site_admin":false},"repo":{"id":163718975,"node_id":"MDEwOlJlcG9zaXRvcnkxNjM3MTg5NzU=","name":"flickr-download","full_name":"kdsnice/flickr-download","private":false,"owner":{"login":"kdsnice","id":4728336,"node_id":"MDQ6VXNlcjQ3MjgzMzY=","avatar_url":"https://avatars0.githubusercontent.com/u/4728336?v=4","gravatar_id":"","url":"https://api.github.com/users/kdsnice","html_url":"https://github.com/kdsnice","followers_url":"https://api.github.com/users/kdsnice/followers","following_url":"https://api.github.com/users/kdsnice/following{/other_user}","gists_url":"https://api.github.com/users/kdsnice/gists{/gist_id}","starred_url":"https://api.github.com/users/kdsnice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kdsnice/subscriptions","organizations_url":"https://api.github.com/users/kdsnice/orgs","repos_url":"https://api.github.com/users/kdsnice/repos","events_url":"https://api.github.com/users/kdsnice/events{/privacy}","received_events_url":"https://api.github.com/users/kdsnice/received_events","type":"User","site_admin":false},"html_url":"https://github.com/kdsnice/flickr-download","description":"Simple script to download sets and photos from Flickr","fork":true,"url":"https://api.github.com/repos/kdsnice/flickr-download","forks_url":"https://api.github.com/repos/kdsnice/flickr-download/forks","keys_url":"https://api.github.com/repos/kdsnice/flickr-download/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kdsnice/flickr-download/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kdsnice/flickr-download/teams","hooks_url":"https://api.github.com/repos/kdsnice/flickr-download/hooks","issue_events_url":"https://api.github.com/repos/kdsnice/flickr-download/issues/events{/number}","events_url":"https://api.github.com/repos/kdsnice/flickr-download/events","assignees_url":"https://api.github.com/repos/kdsnice/flickr-download/assignees{/user}","branches_url":"https://api.github.com/repos/kdsnice/flickr-download/branches{/branch}","tags_url":"https://api.github.com/repos/kdsnice/flickr-download/tags","blobs_url":"https://api.github.com/repos/kdsnice/flickr-download/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kdsnice/flickr-download/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kdsnice/flickr-download/git/refs{/sha}","trees_url":"https://api.github.com/repos/kdsnice/flickr-download/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kdsnice/flickr-download/statuses/{sha}","languages_url":"https://api.github.com/repos/kdsnice/flickr-download/languages","stargazers_url":"https://api.github.com/repos/kdsnice/flickr-download/stargazers","contributors_url":"https://api.github.com/repos/kdsnice/flickr-download/contributors","subscribers_url":"https://api.github.com/repos/kdsnice/flickr-download/subscribers","subscription_url":"https://api.github.com/repos/kdsnice/flickr-download/subscription","commits_url":"https://api.github.com/repos/kdsnice/flickr-download/commits{/sha}","git_commits_url":"https://api.github.com/repos/kdsnice/flickr-download/git/commits{/sha}","comments_url":"https://api.github.com/repos/kdsnice/flickr-download/comments{/number}","issue_comment_url":"https://api.github.com/repos/kdsnice/flickr-download/issues/comments{/number}","contents_url":"https://api.github.com/repos/kdsnice/flickr-download/contents/{+path}","compare_url":"https://api.github.com/repos/kdsnice/flickr-download/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kdsnice/flickr-download/merges","archive_url":"https://api.github.com/repos/kdsnice/flickr-download/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kdsnice/flickr-download/downloads","issues_url":"https://api.github.com/repos/kdsnice/flickr-download/issues{/number}","pulls_url":"https://api.github.com/repos/kdsnice/flickr-download/pulls{/number}","milestones_url":"https://api.github.com/repos/kdsnice/flickr-download/milestones{/number}","notifications_url":"https://api.github.com/repos/kdsnice/flickr-download/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kdsnice/flickr-download/labels{/name}","releases_url":"https://api.github.com/repos/kdsnice/flickr-download/releases{/id}","deployments_url":"https://api.github.com/repos/kdsnice/flickr-download/deployments","created_at":"2019-01-01T06:58:30Z","updated_at":"2019-01-01T19:56:31Z","pushed_at":"2019-01-01T19:56:30Z","git_url":"git://github.com/kdsnice/flickr-download.git","ssh_url":"git@github.com:kdsnice/flickr-download.git","clone_url":"https://github.com/kdsnice/flickr-download.git","svn_url":"https://github.com/kdsnice/flickr-download","homepage":"","size":79,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"beaufour:master","ref":"master","sha":"ec3d7412e0542db63359bb9155cbffe6691b173b","user":{"login":"beaufour","id":239545,"node_id":"MDQ6VXNlcjIzOTU0NQ==","avatar_url":"https://avatars1.githubusercontent.com/u/239545?v=4","gravatar_id":"","url":"https://api.github.com/users/beaufour","html_url":"https://github.com/beaufour","followers_url":"https://api.github.com/users/beaufour/followers","following_url":"https://api.github.com/users/beaufour/following{/other_user}","gists_url":"https://api.github.com/users/beaufour/gists{/gist_id}","starred_url":"https://api.github.com/users/beaufour/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beaufour/subscriptions","organizations_url":"https://api.github.com/users/beaufour/orgs","repos_url":"https://api.github.com/users/beaufour/repos","events_url":"https://api.github.com/users/beaufour/events{/privacy}","received_events_url":"https://api.github.com/users/beaufour/received_events","type":"User","site_admin":false},"repo":{"id":7306647,"node_id":"MDEwOlJlcG9zaXRvcnk3MzA2NjQ3","name":"flickr-download","full_name":"beaufour/flickr-download","private":false,"owner":{"login":"beaufour","id":239545,"node_id":"MDQ6VXNlcjIzOTU0NQ==","avatar_url":"https://avatars1.githubusercontent.com/u/239545?v=4","gravatar_id":"","url":"https://api.github.com/users/beaufour","html_url":"https://github.com/beaufour","followers_url":"https://api.github.com/users/beaufour/followers","following_url":"https://api.github.com/users/beaufour/following{/other_user}","gists_url":"https://api.github.com/users/beaufour/gists{/gist_id}","starred_url":"https://api.github.com/users/beaufour/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beaufour/subscriptions","organizations_url":"https://api.github.com/users/beaufour/orgs","repos_url":"https://api.github.com/users/beaufour/repos","events_url":"https://api.github.com/users/beaufour/events{/privacy}","received_events_url":"https://api.github.com/users/beaufour/received_events","type":"User","site_admin":false},"html_url":"https://github.com/beaufour/flickr-download","description":"Simple script to download sets and photos from Flickr","fork":false,"url":"https://api.github.com/repos/beaufour/flickr-download","forks_url":"https://api.github.com/repos/beaufour/flickr-download/forks","keys_url":"https://api.github.com/repos/beaufour/flickr-download/keys{/key_id}","collaborators_url":"https://api.github.com/repos/beaufour/flickr-download/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/beaufour/flickr-download/teams","hooks_url":"https://api.github.com/repos/beaufour/flickr-download/hooks","issue_events_url":"https://api.github.com/repos/beaufour/flickr-download/issues/events{/number}","events_url":"https://api.github.com/repos/beaufour/flickr-download/events","assignees_url":"https://api.github.com/repos/beaufour/flickr-download/assignees{/user}","branches_url":"https://api.github.com/repos/beaufour/flickr-download/branches{/branch}","tags_url":"https://api.github.com/repos/beaufour/flickr-download/tags","blobs_url":"https://api.github.com/repos/beaufour/flickr-download/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/beaufour/flickr-download/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/beaufour/flickr-download/git/refs{/sha}","trees_url":"https://api.github.com/repos/beaufour/flickr-download/git/trees{/sha}","statuses_url":"https://api.github.com/repos/beaufour/flickr-download/statuses/{sha}","languages_url":"https://api.github.com/repos/beaufour/flickr-download/languages","stargazers_url":"https://api.github.com/repos/beaufour/flickr-download/stargazers","contributors_url":"https://api.github.com/repos/beaufour/flickr-download/contributors","subscribers_url":"https://api.github.com/repos/beaufour/flickr-download/subscribers","subscription_url":"https://api.github.com/repos/beaufour/flickr-download/subscription","commits_url":"https://api.github.com/repos/beaufour/flickr-download/commits{/sha}","git_commits_url":"https://api.github.com/repos/beaufour/flickr-download/git/commits{/sha}","comments_url":"https://api.github.com/repos/beaufour/flickr-download/comments{/number}","issue_comment_url":"https://api.github.com/repos/beaufour/flickr-download/issues/comments{/number}","contents_url":"https://api.github.com/repos/beaufour/flickr-download/contents/{+path}","compare_url":"https://api.github.com/repos/beaufour/flickr-download/compare/{base}...{head}","merges_url":"https://api.github.com/repos/beaufour/flickr-download/merges","archive_url":"https://api.github.com/repos/beaufour/flickr-download/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/beaufour/flickr-download/downloads","issues_url":"https://api.github.com/repos/beaufour/flickr-download/issues{/number}","pulls_url":"https://api.github.com/repos/beaufour/flickr-download/pulls{/number}","milestones_url":"https://api.github.com/repos/beaufour/flickr-download/milestones{/number}","notifications_url":"https://api.github.com/repos/beaufour/flickr-download/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/beaufour/flickr-download/labels{/name}","releases_url":"https://api.github.com/repos/beaufour/flickr-download/releases{/id}","deployments_url":"https://api.github.com/repos/beaufour/flickr-download/deployments","created_at":"2012-12-24T11:59:28Z","updated_at":"2019-01-02T16:51:20Z","pushed_at":"2019-01-01T19:56:31Z","git_url":"git://github.com/beaufour/flickr-download.git","ssh_url":"git@github.com:beaufour/flickr-download.git","clone_url":"https://github.com/beaufour/flickr-download.git","svn_url":"https://github.com/beaufour/flickr-download","homepage":"","size":77,"stargazers_count":126,"watchers_count":126,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":47,"mirror_url":null,"archived":false,"open_issues_count":9,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":47,"open_issues":9,"watchers":126,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/beaufour/flickr-download/pulls/51"},"html":{"href":"https://github.com/beaufour/flickr-download/pull/51"},"issue":{"href":"https://api.github.com/repos/beaufour/flickr-download/issues/51"},"comments":{"href":"https://api.github.com/repos/beaufour/flickr-download/issues/51/comments"},"review_comments":{"href":"https://api.github.com/repos/beaufour/flickr-download/pulls/51/comments"},"review_comment":{"href":"https://api.github.com/repos/beaufour/flickr-download/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/beaufour/flickr-download/pulls/51/commits"},"statuses":{"href":"https://api.github.com/repos/beaufour/flickr-download/statuses/b35195d397c76c6a611077e80e4b45b5d444c5d0"}},"author_association":"NONE"}}
{"actor":{"display_login":"beaufour"}}