{"action":"created","comment":{"url":"https://api.github.com/repos/Rock--lee/music-score-fetcher/pulls/comments/238133686","pull_request_review_id":180600942,"id":238133686,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzODEzMzY4Ng==","diff_hunk":"@@ -0,0 +1,39 @@\n+# -*- coding: utf-8 -*-\n+\n+# Define your item pipelines here\n+#\n+# Don't forget to add your pipeline to the ITEM_PIPELINES setting\n+# See: https://doc.scrapy.org/en/latest/topics/item-pipeline.html\n+import os\n+import requests\n+from my_crawler.settings import IMAGES_STORE\n+\n+\n+class MyCrawlerPipeline(object):\n+    # 主站连接 用来拼接url\n+    base_site = \"http://www.ccguitar.cn/\"\n+\n+    def process_item(self, item, spider):\n+        header = {\n+            'USER-Agent': 'User-Agent:Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36',\n+            'Cookie': 'b963ef2d97e050aaf90fd5fab8e78633',\n+            # 需要查看图片的cookie信息，否则下载的图片无法查看\n+        }\n+\n+        folder_name = '{}'.format(item['title'])\n+        folder_name = folder_name.strip()\n+        folder_name = folder_name.strip(\">>\")\n+        folder_name = folder_name.rstrip(\"\\\\\")\n+\n+        for img_url, name in zip(item['src'], item['alt']):\n+            dir_path = '{}//{}'.format(IMAGES_STORE, folder_name)\n+            if not os.path.exists(dir_path) and len(item['src']) != 0:","path":"my_crawler/my_crawler/pipelines.py","position":31,"original_position":30,"commit_id":"ff920210f51285e9a8082c3b4ee018c255fa84bc","original_commit_id":"248a6d6803e8f7152791488e8d80ca605f1c9802","user":{"login":"IMBlues","id":4225292,"node_id":"MDQ6VXNlcjQyMjUyOTI=","avatar_url":"https://avatars3.githubusercontent.com/u/4225292?v=4","gravatar_id":"","url":"https://api.github.com/users/IMBlues","html_url":"https://github.com/IMBlues","followers_url":"https://api.github.com/users/IMBlues/followers","following_url":"https://api.github.com/users/IMBlues/following{/other_user}","gists_url":"https://api.github.com/users/IMBlues/gists{/gist_id}","starred_url":"https://api.github.com/users/IMBlues/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IMBlues/subscriptions","organizations_url":"https://api.github.com/users/IMBlues/orgs","repos_url":"https://api.github.com/users/IMBlues/repos","events_url":"https://api.github.com/users/IMBlues/events{/privacy}","received_events_url":"https://api.github.com/users/IMBlues/received_events","type":"User","site_admin":false},"body":"不可能，如果`item['src']`的长度为空，那么就是 False (Python 里 False 就是 0)","created_at":"2018-12-03T02:58:01Z","updated_at":"2018-12-03T02:58:02Z","html_url":"https://github.com/Rock--lee/music-score-fetcher/pull/2#discussion_r238133686","pull_request_url":"https://api.github.com/repos/Rock--lee/music-score-fetcher/pulls/2","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/Rock--lee/music-score-fetcher/pulls/comments/238133686"},"html":{"href":"https://github.com/Rock--lee/music-score-fetcher/pull/2#discussion_r238133686"},"pull_request":{"href":"https://api.github.com/repos/Rock--lee/music-score-fetcher/pulls/2"}},"in_reply_to_id":236108457},"pull_request":{"url":"https://api.github.com/repos/Rock--lee/music-score-fetcher/pulls/2","id":233422549,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMzNDIyNTQ5","html_url":"https://github.com/Rock--lee/music-score-fetcher/pull/2","diff_url":"https://github.com/Rock--lee/music-score-fetcher/pull/2.diff","patch_url":"https://github.com/Rock--lee/music-score-fetcher/pull/2.patch","issue_url":"https://api.github.com/repos/Rock--lee/music-score-fetcher/issues/2","number":2,"state":"open","locked":false,"title":"Demo","user":{"login":"Rock--lee","id":7807916,"node_id":"MDQ6VXNlcjc4MDc5MTY=","avatar_url":"https://avatars3.githubusercontent.com/u/7807916?v=4","gravatar_id":"","url":"https://api.github.com/users/Rock--lee","html_url":"https://github.com/Rock--lee","followers_url":"https://api.github.com/users/Rock--lee/followers","following_url":"https://api.github.com/users/Rock--lee/following{/other_user}","gists_url":"https://api.github.com/users/Rock--lee/gists{/gist_id}","starred_url":"https://api.github.com/users/Rock--lee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Rock--lee/subscriptions","organizations_url":"https://api.github.com/users/Rock--lee/orgs","repos_url":"https://api.github.com/users/Rock--lee/repos","events_url":"https://api.github.com/users/Rock--lee/events{/privacy}","received_events_url":"https://api.github.com/users/Rock--lee/received_events","type":"User","site_admin":false},"body":"经测试可用的单个网站的谱子爬取，将文件保存在本地。","created_at":"2018-11-26T02:31:43Z","updated_at":"2018-12-03T02:58:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6043d3620b84a9a57b294b1636c45136c762e067","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Rock--lee/music-score-fetcher/pulls/2/commits","review_comments_url":"https://api.github.com/repos/Rock--lee/music-score-fetcher/pulls/2/comments","review_comment_url":"https://api.github.com/repos/Rock--lee/music-score-fetcher/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Rock--lee/music-score-fetcher/issues/2/comments","statuses_url":"https://api.github.com/repos/Rock--lee/music-score-fetcher/statuses/ff920210f51285e9a8082c3b4ee018c255fa84bc","head":{"label":"Rock--lee:demo","ref":"demo","sha":"ff920210f51285e9a8082c3b4ee018c255fa84bc","user":{"login":"Rock--lee","id":7807916,"node_id":"MDQ6VXNlcjc4MDc5MTY=","avatar_url":"https://avatars3.githubusercontent.com/u/7807916?v=4","gravatar_id":"","url":"https://api.github.com/users/Rock--lee","html_url":"https://github.com/Rock--lee","followers_url":"https://api.github.com/users/Rock--lee/followers","following_url":"https://api.github.com/users/Rock--lee/following{/other_user}","gists_url":"https://api.github.com/users/Rock--lee/gists{/gist_id}","starred_url":"https://api.github.com/users/Rock--lee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Rock--lee/subscriptions","organizations_url":"https://api.github.com/users/Rock--lee/orgs","repos_url":"https://api.github.com/users/Rock--lee/repos","events_url":"https://api.github.com/users/Rock--lee/events{/privacy}","received_events_url":"https://api.github.com/users/Rock--lee/received_events","type":"User","site_admin":false},"repo":{"id":158104431,"node_id":"MDEwOlJlcG9zaXRvcnkxNTgxMDQ0MzE=","name":"music-score-fetcher","full_name":"Rock--lee/music-score-fetcher","private":false,"owner":{"login":"Rock--lee","id":7807916,"node_id":"MDQ6VXNlcjc4MDc5MTY=","avatar_url":"https://avatars3.githubusercontent.com/u/7807916?v=4","gravatar_id":"","url":"https://api.github.com/users/Rock--lee","html_url":"https://github.com/Rock--lee","followers_url":"https://api.github.com/users/Rock--lee/followers","following_url":"https://api.github.com/users/Rock--lee/following{/other_user}","gists_url":"https://api.github.com/users/Rock--lee/gists{/gist_id}","starred_url":"https://api.github.com/users/Rock--lee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Rock--lee/subscriptions","organizations_url":"https://api.github.com/users/Rock--lee/orgs","repos_url":"https://api.github.com/users/Rock--lee/repos","events_url":"https://api.github.com/users/Rock--lee/events{/privacy}","received_events_url":"https://api.github.com/users/Rock--lee/received_events","type":"User","site_admin":false},"html_url":"https://github.com/Rock--lee/music-score-fetcher","description":"A tool to search music score from Internet via web Crawler","fork":false,"url":"https://api.github.com/repos/Rock--lee/music-score-fetcher","forks_url":"https://api.github.com/repos/Rock--lee/music-score-fetcher/forks","keys_url":"https://api.github.com/repos/Rock--lee/music-score-fetcher/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Rock--lee/music-score-fetcher/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Rock--lee/music-score-fetcher/teams","hooks_url":"https://api.github.com/repos/Rock--lee/music-score-fetcher/hooks","issue_events_url":"https://api.github.com/repos/Rock--lee/music-score-fetcher/issues/events{/number}","events_url":"https://api.github.com/repos/Rock--lee/music-score-fetcher/events","assignees_url":"https://api.github.com/repos/Rock--lee/music-score-fetcher/assignees{/user}","branches_url":"https://api.github.com/repos/Rock--lee/music-score-fetcher/branches{/branch}","tags_url":"https://api.github.com/repos/Rock--lee/music-score-fetcher/tags","blobs_url":"https://api.github.com/repos/Rock--lee/music-score-fetcher/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Rock--lee/music-score-fetcher/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Rock--lee/music-score-fetcher/git/refs{/sha}","trees_url":"https://api.github.com/repos/Rock--lee/music-score-fetcher/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Rock--lee/music-score-fetcher/statuses/{sha}","languages_url":"https://api.github.com/repos/Rock--lee/music-score-fetcher/languages","stargazers_url":"https://api.github.com/repos/Rock--lee/music-score-fetcher/stargazers","contributors_url":"https://api.github.com/repos/Rock--lee/music-score-fetcher/contributors","subscribers_url":"https://api.github.com/repos/Rock--lee/music-score-fetcher/subscribers","subscription_url":"https://api.github.com/repos/Rock--lee/music-score-fetcher/subscription","commits_url":"https://api.github.com/repos/Rock--lee/music-score-fetcher/commits{/sha}","git_commits_url":"https://api.github.com/repos/Rock--lee/music-score-fetcher/git/commits{/sha}","comments_url":"https://api.github.com/repos/Rock--lee/music-score-fetcher/comments{/number}","issue_comment_url":"https://api.github.com/repos/Rock--lee/music-score-fetcher/issues/comments{/number}","contents_url":"https://api.github.com/repos/Rock--lee/music-score-fetcher/contents/{+path}","compare_url":"https://api.github.com/repos/Rock--lee/music-score-fetcher/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Rock--lee/music-score-fetcher/merges","archive_url":"https://api.github.com/repos/Rock--lee/music-score-fetcher/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Rock--lee/music-score-fetcher/downloads","issues_url":"https://api.github.com/repos/Rock--lee/music-score-fetcher/issues{/number}","pulls_url":"https://api.github.com/repos/Rock--lee/music-score-fetcher/pulls{/number}","milestones_url":"https://api.github.com/repos/Rock--lee/music-score-fetcher/milestones{/number}","notifications_url":"https://api.github.com/repos/Rock--lee/music-score-fetcher/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Rock--lee/music-score-fetcher/labels{/name}","releases_url":"https://api.github.com/repos/Rock--lee/music-score-fetcher/releases{/id}","deployments_url":"https://api.github.com/repos/Rock--lee/music-score-fetcher/deployments","created_at":"2018-11-18T16:37:41Z","updated_at":"2018-11-18T16:37:43Z","pushed_at":"2018-11-27T18:21:35Z","git_url":"git://github.com/Rock--lee/music-score-fetcher.git","ssh_url":"git@github.com:Rock--lee/music-score-fetcher.git","clone_url":"https://github.com/Rock--lee/music-score-fetcher.git","svn_url":"https://github.com/Rock--lee/music-score-fetcher","homepage":null,"size":21,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":2,"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":2,"watchers":0,"default_branch":"master"}},"base":{"label":"Rock--lee:master","ref":"master","sha":"fca15f33fa55b98b7c390848ffe923ea620ae175","user":{"login":"Rock--lee","id":7807916,"node_id":"MDQ6VXNlcjc4MDc5MTY=","avatar_url":"https://avatars3.githubusercontent.com/u/7807916?v=4","gravatar_id":"","url":"https://api.github.com/users/Rock--lee","html_url":"https://github.com/Rock--lee","followers_url":"https://api.github.com/users/Rock--lee/followers","following_url":"https://api.github.com/users/Rock--lee/following{/other_user}","gists_url":"https://api.github.com/users/Rock--lee/gists{/gist_id}","starred_url":"https://api.github.com/users/Rock--lee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Rock--lee/subscriptions","organizations_url":"https://api.github.com/users/Rock--lee/orgs","repos_url":"https://api.github.com/users/Rock--lee/repos","events_url":"https://api.github.com/users/Rock--lee/events{/privacy}","received_events_url":"https://api.github.com/users/Rock--lee/received_events","type":"User","site_admin":false},"repo":{"id":158104431,"node_id":"MDEwOlJlcG9zaXRvcnkxNTgxMDQ0MzE=","name":"music-score-fetcher","full_name":"Rock--lee/music-score-fetcher","private":false,"owner":{"login":"Rock--lee","id":7807916,"node_id":"MDQ6VXNlcjc4MDc5MTY=","avatar_url":"https://avatars3.githubusercontent.com/u/7807916?v=4","gravatar_id":"","url":"https://api.github.com/users/Rock--lee","html_url":"https://github.com/Rock--lee","followers_url":"https://api.github.com/users/Rock--lee/followers","following_url":"https://api.github.com/users/Rock--lee/following{/other_user}","gists_url":"https://api.github.com/users/Rock--lee/gists{/gist_id}","starred_url":"https://api.github.com/users/Rock--lee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Rock--lee/subscriptions","organizations_url":"https://api.github.com/users/Rock--lee/orgs","repos_url":"https://api.github.com/users/Rock--lee/repos","events_url":"https://api.github.com/users/Rock--lee/events{/privacy}","received_events_url":"https://api.github.com/users/Rock--lee/received_events","type":"User","site_admin":false},"html_url":"https://github.com/Rock--lee/music-score-fetcher","description":"A tool to search music score from Internet via web Crawler","fork":false,"url":"https://api.github.com/repos/Rock--lee/music-score-fetcher","forks_url":"https://api.github.com/repos/Rock--lee/music-score-fetcher/forks","keys_url":"https://api.github.com/repos/Rock--lee/music-score-fetcher/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Rock--lee/music-score-fetcher/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Rock--lee/music-score-fetcher/teams","hooks_url":"https://api.github.com/repos/Rock--lee/music-score-fetcher/hooks","issue_events_url":"https://api.github.com/repos/Rock--lee/music-score-fetcher/issues/events{/number}","events_url":"https://api.github.com/repos/Rock--lee/music-score-fetcher/events","assignees_url":"https://api.github.com/repos/Rock--lee/music-score-fetcher/assignees{/user}","branches_url":"https://api.github.com/repos/Rock--lee/music-score-fetcher/branches{/branch}","tags_url":"https://api.github.com/repos/Rock--lee/music-score-fetcher/tags","blobs_url":"https://api.github.com/repos/Rock--lee/music-score-fetcher/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Rock--lee/music-score-fetcher/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Rock--lee/music-score-fetcher/git/refs{/sha}","trees_url":"https://api.github.com/repos/Rock--lee/music-score-fetcher/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Rock--lee/music-score-fetcher/statuses/{sha}","languages_url":"https://api.github.com/repos/Rock--lee/music-score-fetcher/languages","stargazers_url":"https://api.github.com/repos/Rock--lee/music-score-fetcher/stargazers","contributors_url":"https://api.github.com/repos/Rock--lee/music-score-fetcher/contributors","subscribers_url":"https://api.github.com/repos/Rock--lee/music-score-fetcher/subscribers","subscription_url":"https://api.github.com/repos/Rock--lee/music-score-fetcher/subscription","commits_url":"https://api.github.com/repos/Rock--lee/music-score-fetcher/commits{/sha}","git_commits_url":"https://api.github.com/repos/Rock--lee/music-score-fetcher/git/commits{/sha}","comments_url":"https://api.github.com/repos/Rock--lee/music-score-fetcher/comments{/number}","issue_comment_url":"https://api.github.com/repos/Rock--lee/music-score-fetcher/issues/comments{/number}","contents_url":"https://api.github.com/repos/Rock--lee/music-score-fetcher/contents/{+path}","compare_url":"https://api.github.com/repos/Rock--lee/music-score-fetcher/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Rock--lee/music-score-fetcher/merges","archive_url":"https://api.github.com/repos/Rock--lee/music-score-fetcher/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Rock--lee/music-score-fetcher/downloads","issues_url":"https://api.github.com/repos/Rock--lee/music-score-fetcher/issues{/number}","pulls_url":"https://api.github.com/repos/Rock--lee/music-score-fetcher/pulls{/number}","milestones_url":"https://api.github.com/repos/Rock--lee/music-score-fetcher/milestones{/number}","notifications_url":"https://api.github.com/repos/Rock--lee/music-score-fetcher/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Rock--lee/music-score-fetcher/labels{/name}","releases_url":"https://api.github.com/repos/Rock--lee/music-score-fetcher/releases{/id}","deployments_url":"https://api.github.com/repos/Rock--lee/music-score-fetcher/deployments","created_at":"2018-11-18T16:37:41Z","updated_at":"2018-11-18T16:37:43Z","pushed_at":"2018-11-27T18:21:35Z","git_url":"git://github.com/Rock--lee/music-score-fetcher.git","ssh_url":"git@github.com:Rock--lee/music-score-fetcher.git","clone_url":"https://github.com/Rock--lee/music-score-fetcher.git","svn_url":"https://github.com/Rock--lee/music-score-fetcher","homepage":null,"size":21,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":2,"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":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Rock--lee/music-score-fetcher/pulls/2"},"html":{"href":"https://github.com/Rock--lee/music-score-fetcher/pull/2"},"issue":{"href":"https://api.github.com/repos/Rock--lee/music-score-fetcher/issues/2"},"comments":{"href":"https://api.github.com/repos/Rock--lee/music-score-fetcher/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/Rock--lee/music-score-fetcher/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/Rock--lee/music-score-fetcher/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Rock--lee/music-score-fetcher/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/Rock--lee/music-score-fetcher/statuses/ff920210f51285e9a8082c3b4ee018c255fa84bc"}},"author_association":"OWNER"}}
{"actor":{"display_login":"IMBlues"}}