Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

功能使用九:解决stackoverflow.com网站下imgur站点的图片不显示问题 #126

Open
jingjingxyk opened this issue Nov 27, 2022 · 0 comments

Comments

@jingjingxyk
Copy link
Contributor

jingjingxyk commented Nov 27, 2022

缘由:是因为了我看了这个帖子和帖子评论,为了解决帖子里的问题,才搜到的解决办法,同时还包括下载浏览器扩展,还有想看看人家扩展是怎么写的!

办法来源参考: 图片镜像缓存服务—防盗链图片、imgur 等国内无法访问图片的解决方案

依据上述解决办法,简单加工改造写了4种解决办法(也就是4条规则)

说明: 办法仅供参考,自己用自己配置即可 (参考自定义规则)

规则1:

{
    "id": 1,
    "priority": 200,
    "action": {
      "type": "redirect",
      "redirect": {
        "regexSubstitution": "https://images.weserv.nl/?url=\\1"
      }
    },
    "condition": {
      "regexFilter": "(.*?)",
      "requestDomains": ["imgur.com"],
      "initiatorDomains": ["stackoverflow.com"],
      "resourceTypes": [
        "main_frame",
        "sub_frame",
        "stylesheet",
        "script",
        "image",
        "font",
        "object",
        "xmlhttprequest",
        "ping",
        "csp_report",
        "media",
        "websocket",
        "webtransport",
        "webbundle",
        "other"
      ]
    }
  }

规则2

[
    {
        "id": 2,
        "priority": 100,
        "action": {
          "type": "redirect",
          "redirect": {
            "regexSubstitution": "https://img.noobzone.ru/getimg.php?url=\\2"
          }
        },
        "condition": {
          "regexFilter": "(http[s]{0,1}://)(.*?)",
          "requestDomains": ["imgur.com"],
          "initiatorDomains": ["stackoverflow.com"],
          "resourceTypes": [
            "main_frame",
            "sub_frame",
            "stylesheet",
            "script",
            "image",
            "font",
            "object",
            "xmlhttprequest",
            "ping",
            "csp_report",
            "media",
            "websocket",
            "webtransport",
            "webbundle",
            "other"
          ]
        }
      },
      {
        "id": 3,
        "priority": 100,
        "action": {
          "type": "modifyHeaders",
          "requestHeaders": [
            {
              "header": "referer",
              "operation": "remove"
            }
          ]
        },
        "condition": {
          "urlFilter": "img.noobzone.ru/getimg.php",
          "requestDomains": ["img.noobzone.ru"],
          "initiatorDomains": ["stackoverflow.com"],
          "resourceTypes": [
            "main_frame",
            "sub_frame",
            "stylesheet",
            "script",
            "image",
            "font",
            "object",
            "xmlhttprequest",
            "ping",
            "csp_report",
            "media",
            "websocket",
            "webtransport",
            "webbundle",
            "other"
          ]
        }
      }
]

规则3

{
    "id": 4,
    "priority": 100,
    "action": {
      "type": "redirect",
      "redirect": {
        "regexSubstitution": "https://pic1.xuehuaimg.com/proxy/\\2"
      }
    },
    "condition": {
      "regexFilter": "(http[s]{0,1}://)(.*?)",
      "requestDomains": ["imgur.com"],
      "initiatorDomains": ["stackoverflow.com"],
      "resourceTypes": [
        "main_frame",
        "sub_frame",
        "stylesheet",
        "script",
        "image",
        "font",
        "object",
        "xmlhttprequest",
        "ping",
        "csp_report",
        "media",
        "websocket",
        "webtransport",
        "webbundle",
        "other"
      ]
    }
  }

规则4

{
    "id": 5,
    "priority": 100,
    "action": {
      "type": "redirect",
      "redirect": {
        "regexSubstitution": "https://search.pstatic.net/common?src=\\1"
      }
    },
    "condition": {
      "regexFilter": "(.*?)",
      "requestDomains": ["imgur.com"],
      "initiatorDomains": ["stackoverflow.com"],
      "resourceTypes": [
        "main_frame",
        "sub_frame",
        "stylesheet",
        "script",
        "image",
        "font",
        "object",
        "xmlhttprequest",
        "ping",
        "csp_report",
        "media",
        "websocket",
        "webtransport",
        "webbundle",
        "other"
      ]
    }
  }

以上规则全在这里

@jingjingxyk jingjingxyk changed the title 临时解决stackoverflow.com网站下imgur 图片显示问题 解决stackoverflow.com网站下imgur 图片显示问题 Dec 29, 2022
@jingjingxyk jingjingxyk changed the title 解决stackoverflow.com网站下imgur 图片显示问题 解决stackoverflow.com网站下imgur 图片显示问题办法 Dec 29, 2022
@jingjingxyk jingjingxyk changed the title 解决stackoverflow.com网站下imgur 图片显示问题办法 stackoverflow.com网站下imgur 图片显示问题的解决办法参考 Dec 29, 2022
@jingjingxyk jingjingxyk changed the title stackoverflow.com网站下imgur 图片显示问题的解决办法参考 功能使用九:解决stackoverflow.com网站下imgur站点的图片不显示问题 Jan 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant