mika-cn/maoxian-web-clipper

能不能收藏刚高清的图片?

Treaver1987 opened this issue · 4 comments

收藏网页时,下载网页中的图片实际上是低分辨率的缩略图

更高清的图片需要点击图片后手动保存

有没有可能直接下载高清的图片?

可以的,請使用『毛線助手』功能,請看這裏

你需要針對要裁剪的網頁,編寫一個『自定義 plan』。你需要懂得 JSON 和 CSS,這是如何編寫 Plan 的文檔。

如果你不懂 JSON 和 CSS,請給出你要裁剪的網頁的網址,也許我能幫上忙。

我从 Plan 文件夹里下载了 Zhihu.json
把里面的内容复制进了「自定义计划」然后保存
好像没效果
知乎回答里的图片有些是 picx.zhimg.com 开头的
有些是 pica.zhimg.com 开头的
我也不懂代码
只好麻烦你了
https://www.zhihu.com/question/634644415/answer/3372004334

看了下,圖片的原圖網址保存在 data-original 屬性上,所以把 zhihu.json 裏面的 data-actualsrc 改成 data-original 就行。

如下:

[
  {
    "name": "知乎专栏",
    "pattern": "https://zhuanlan.zhihu.com/p/**",
    "version": 20240502,
    "contributors": [
      "Mika"
    ],
    "actions": [
      {
        "hide": [
          "figure > noscript",
          ".GifPlayer-icon",
          ".GifPlayer > .GifPlayer-gif2mp4",
          ".PostIndex-Contributions",
          ".Recommendations-Main",
          ".CommentsV2-footer-wrapper",
          ".CommentTopbar .Topbar-options",
          ".ColumnPageHeader-Wrapper"
        ]
      },
      {
        "chAttr": {
          "type": "split2list.remove",
          "pick": ".RichContent-actions",
          "attr": "class",
          "value": [
            "Sticky",
            "is-fixed",
            "is-bottom"
          ]
        }
      },
      {
        "chAttr": {
          "type": "assign.from.self-attr",
          "pick": "figure img",
          "attr": "src",
          "tAttr": "data-original"
        }
      },
      {
        "chAttr": {
          "type": "replace.last-match",
          "pick": ".GifPlayer img",
          "attr": "src",
          "subStr": ".jpg",
          "newStr": ".gif"
        }
      }
    ],
    "tags": [
      "knowledge",
      "share"
    ]
  },
  {
    "name": "知乎回答",
    "pattern": "https://www.zhihu.com/question/*/answer/*",
    "version": 20240502,
    "contributors": [
      "Mika"
    ],
    "actions": [
      {
        "hide": [
          ".QuestionHeader-footer-main",
          ".Card.ViewAll",
          ".Question-mainColumnLogin",
          ".Topbar-options",
          ".List-header",
          ".ContentItem-expandButton",
          ".ContentItem-action.ContentItem-rightButton",
          ".GifPlayer-icon",
          ".GifPlayer > .GifPlayer-gif2mp4",
          ".CommentsV2-footer-wrapper"
        ]
      },
      {
        "chAttr": {
          "type": "split2list.remove",
          "pick": ".ContentItem .RichContent",
          "attr": "class",
          "value": [
            "is-collapsed"
          ]
        }
      },
      {
        "chAttr": {
          "type": "split2list.remove",
          "pick": ".ContentItem-actions",
          "attr": "class",
          "value": [
            "Sticky",
            "is-fixed",
            "is-bottom"
          ]
        }
      },
      {
        "chAttr": {
          "type": "assign.from.self-attr",
          "pick": "figure img",
          "attr": "src",
          "tAttr": "data-original"
        }
      },
      {
        "chAttr": {
          "type": "replace.last-match",
          "pick": ".GifPlayer img",
          "attr": "src",
          "subStr": ".jpg",
          "newStr": ".gif"
        }
      }
    ],
    "tags": [
      "QA",
      "answer",
      "share",
      "discuss"
    ]
  },
  {
    "name": "知乎问题",
    "pattern": "https://www.zhihu.com/question/*",
    "version": 20240502,
    "contributors": [
      "Mika"
    ],
    "actions": [
      {
        "hide": [
          ".QuestionHeader-footer-main",
          ".AnswersNavWrapper .List-header",
          ".ContentItem-expandButton",
          ".ContentItem-action.ContentItem-rightButton",
          ".GifPlayer-icon",
          ".GifPlayer > .GifPlayer-gif2mp4",
          ".CommentsV2-footer-wrapper",
          ".Question-sideColumn"
        ]
      },
      {
        "chAttr": {
          "type": "split2list.remove",
          "pick": ".ContentItem .RichContent",
          "attr": "class",
          "value": [
            "is-collapsed"
          ]
        }
      },
      {
        "chAttr": {
          "type": "split2list.remove",
          "pick": ".ContentItem-actions",
          "attr": "class",
          "value": [
            "Sticky",
            "is-fixed",
            "is-bottom"
          ],
          "sep": " "
        }
      },
      {
        "chAttr": {
          "type": "assign.from.self-attr",
          "pick": "figure img",
          "attr": "src",
          "tAttr": "data-original"
        }
      },
      {
        "chAttr": {
          "type": "replace.last-match",
          "pick": ".GifPlayer img",
          "attr": "src",
          "subStr": ".jpg",
          "newStr": ".gif"
        }
      }
    ],
    "tags": [
      "QA",
      "question",
      "share",
      "discuss"
    ]
  },
  {
    "name": "zhihu video",
    "pattern": "https://video.zhihu.com/video/*",
    "version": 20240502,
    "actions": [
      {
        "hideSibling": "X||//video/.."
      }
    ]
  }
]

能用了,谢谢