Open KawausoJyou opened 1 year ago
/weibo/user/:uid/:routeParams?
: No maintainer listed, possibly a v1 or misconfigured routeTo maintainers: if you are not willing to be disturbed, list your username in
scripts/workflow/test-issue/call-maintainer.js
. In this way, your username will be wrapped in an inline code block when tagged so you will not be notified.
如果有任何路由无法匹配,issue 将会被自动关闭。如果 issue 和路由无关,请使用 NOROUTE
关键词,或者留下评论。我们会重新审核。
If there is any route not found, the issue will be closed automatically. Please use NOROUTE
for a route-irrelevant issue or leave a comment if it is a mistake.
Inoreader?
Inoreader?
FreshRSS
It works fine on a new installation of FreshRSS
Screenshot
It works fine on a new installation of FreshRSS
What is your version of FreshRSS and RSS Hub? My FreshRSS version is 1.20.0, and my RSSHub version is https://github.com/DIYgod/RSSHub/commit/ed08cefe307ee4863e18c695abf347cad4b5c56c. Did Weibo add my IP to the blacklist?
For self-hosted instances, refer to #10874 for more available workarounds.
Screenshot
It works fine on a new installation of FreshRSS
What is your version of FreshRSS and RSS Hub? My FreshRSS version is 1.20.0, and my RSSHub version is ed08cef. Did Weibo add my IP to the blacklist?
FreshRSS 1.20.0. To be specific, it's https://hub.docker.com/r/linuxserver/freshrss RSS feed is fetched from the demo instance
For self-hosted instances, refer to #10874 for more available workarounds.
Sorry, I can't fully understand how to use "image_hotlink_template". Could you please explain it in detail?
For self-hosted instances, refer to #10874 for more available workarounds.
Sorry, I can't fully understand how to use "image_hotlink_template". Could you please explain it in detail?
Have you read the beginning of https://docs.rsshub.app/en/parameter.html?
For self-hosted instances, refer to #10874 for more available workarounds.
Sorry, I can't fully understand how to use "image_hotlink_template". Could you please explain it in detail?
Have you read the beginning of https://docs.rsshub.app/en/parameter.html?
I have already read the link you sent. I found that when the referer is empty, the picture cannot be displayed. When the referer is "weibo. com", the picture can be displayed normally. However, I don't know how to write "image_hotlink_template" to add a referer.
Ohh, I see. sinaimg.cn
has been upgraded, it bans requests from browsers without referer
set to https://weibo.com
. However, the limit is only applied when the request is from Mainland China. In other regions, zero referer
is permitted, that's why @TonyRL can load the pic.
If you deploy https://github.com/Rongronggg9/rsstt-img-relay on Cloudflare, a referer is unnecessary as Cloudflare has no edges in Mainland China.
If you deploy https://github.com/Rongronggg9/rsstt-img-relay on Cloudflare, a referer is unnecessary as Cloudflare has no edges in Mainland China.
Thank you very much for your patience. I have successfully deployed rsst-img-relay on Cloudflare and configured the "HOTLINK_TEMPLATE" variable. Now the image can be displayed normally.
I'm observing the same issue, and my IP is not within mainland China. Has weibo gone stricter on this?
https://zmingcx.com/sina-micro-album-address.html 参考这篇文章,应该是新浪为了防止图片外链被盗用,更改了外链地址吧!
https://zmingcx.com/sina-micro-album-address.html 参考这篇文章,应该是新浪为了防止图片外链被盗用,更改了外链地址吧!
感谢回复,请问如何将文章中的修改应用到RSSHub呢🥲
https://zmingcx.com/sina-micro-album-address.html 参考这篇文章,应该是新浪为了防止图片外链被盗用,更改了外链地址吧!
能用 👍🏻 @Rongronggg9 能否把这个整合到 weibo 的 router 里?
或者如果 HOTLINK_TEMPLATE 可以支持 regex 替换的话,那对于这类情况还挺有用的——只需要 replace 一下 subdomain 就好了。
If you deploy https://github.com/Rongronggg9/rsstt-img-relay on Cloudflare, a referer is unnecessary as Cloudflare has no edges in Mainland China.
Just tested it, not worked any more. :(
又挂了
有些能显示,有些裂图
If you deploy https://github.com/Rongronggg9/rsstt-img-relay on Cloudflare, a referer is unnecessary as Cloudflare has no edges in Mainland China.
这个方法也失效了
If you deploy https://github.com/Rongronggg9/rsstt-img-relay on Cloudflare, a referer is unnecessary as Cloudflare has no edges in Mainland China.
这个方法也失效了
https://github.com/DIYgod/RSSHub/issues/10874#issuecomment-1369647937
What are the new ways to solve this problem?
我不太懂反盗链/反反盗链,请问如果我用 chrome 网页访问 inoreader,用 no-referrer 的 userscript 有用吗?例子:
现在全部图片都裂了 右键Access Denied Reference # 一串数字
是不是可能应该 reopen 一下这个 issue,因为问题似乎依然存在,而这个 issue 是 Closed 的状态。微博可能是用的人比较多的路由,所以解决这个问题会帮助很多人。
是不是可能应该 reopen 一下这个 issue,因为问题似乎依然存在,而这个 issue 是 Closed 的状态。微博可能是用的人比较多的路由,所以解决这个问题会帮助很多人。
的确,是否能支持一下解决这个问题。
我测试使用rsshub默认参数启动 netnewswire的mac客户端可以打开微博图片。但是ios端不行。不知道原因在哪。
现在怎么解决吗微博图片问题
目前我用了一个 workaround,适用于电脑 chrome 浏览器浏览 inoreader。可以用插件,给图片加 referer。详情见下面帖子的 4 楼
https://www.v2ex.com/t/904989#;
移动端或者其他客户端有没有解决方式我也想知道。
依然无法工作,有时候右键新图标打开都不行,图片抬头wx1改成wx2就报错403
只能用这个插件,large改成original再调转一次可以看原图
https://greasyfork.org/en/scripts/2312-resize-image-on-open-image-in-new-tab
在iOS/iPadOS上的一个方法是使用支持mitm和rewrite的代理软件先对singimg.cn进行解密然后再添加header,在loon中可以这么写: 在mitm中添加域名.sinaimg.cn,然后在复写中使用如下正则表达式https://..sinaimg.cn/.*,接着添加referer即可
我提供一个代码段,结合image_hotlink_template
参数可以解决referer问题。需要依赖自建RSSHub和一段python程序。
原理是通过替换image_hotlink_template
替换中链接地址,由自定义python程序发起图片URL请求并返回给RSS阅读器。
假设下面python程序对外提供服务url为 http://my-image-proxy.com:8080/image
/weibo/user/:uid/:routeParams?
-> /weibo/user/:uid/:routeParams?image_hotlink_template=http://my-image-proxy.com:8080/image?url=${href_ue}%26referer=https://weibo.com
其中需要注意image_hotlink_template中对于
&
需要使用URL编码的%26
,否则后续的参数无法被rsshub解析到image_hotlink_template
。
from fastapi import FastAPI, Request
from fastapi.responses import StreamingResponse
import requests
import os
import urllib.parse
from cachetools import LRUCache, TTLCache
from typing import Any
import httpx
# 创建一个LRU缓存实例,例如:缓存100个最近使用的条目,并且每个条目在5分钟内有效
cache = TTLCache(maxsize=100, ttl=5 * 60)
app = FastAPI()
@app.get('/image')
async def proxy_request(request: Request):
query_string = request.url.query
# 解码原始查询字符串以正确处理转义的 &
query_params = urllib.parse.parse_qs(query_string)
url_param = query_params.get('url', [''])[0]
# 尝试从缓存中获取结果
cached_response = cache.get(url_param)
if cached_response is not None:
headers, content = cached_response
return StreamingResponse(iter([content]), status_code=200, headers=headers)
referer_env = os.environ.get('DEFAULT_REFERER', '')
referer_param = query_params.get('referer', [referer_env])[0]
print(f"Proxying request to URL: {url_param}")
print(f"Referer: {referer_param}")
user_agent_env = os.environ.get('USER_AGENT_HEADER')
if user_agent_env is None:
user_agent_header = request.headers.get('user-agent', '')
else:
user_agent_header = user_agent_env
proxy_uri = os.environ.get('PROXY_URI', None)
async with httpx.AsyncClient(proxy=proxy_uri) as client:
response = await client.get(url_param, headers={'referer': referer_param, 'user-agent': user_agent_header})
# 确保完整读取response.content
response_content = response.content
content_length = len(response_content)
headers = response.headers.copy()
headers['Content-Length'] = str(content_length) # 更新Content-Length为实际长度
# 只缓存HTTP状态码为200的响应
if response.status_code == 200:
cache[url_param] = (headers, response_content)
return StreamingResponse(
iter([response_content]),
status_code=response.status_code,
headers=headers,
)
if __name__ == '__main__':
import uvicorn
PORT = 8080
uvicorn.run(app, host='0.0.0.0', port=PORT)
requirements.txt
requests
fastapi
uvicorn
cachetools
httpx
@junfengP 这段程序也可以应用在multimedia_hotlink_template里吗
services: rsshub: ... environment: ... HOTLINK_TEMPLATE: 'https://image.baidu.com/search/down?url=$${href_ue}' HOTLINK_INCLUDE_PATHS: /weibo depends_on: In the process of deploying with Docker Compose, you can convert Weibo external links like this.
路由地址
完整路由地址
相关文档
https://docs.rsshub.app/social-media.html#wei-bo-bo-zhu
预期是什么?
正常显示图片
实际发生了什么?
图片无法正常显示,且图片链接显示403 Forbidden
部署
自建
部署相关信息
OS: Linux, Node: v12.22.12, Docker: v20.10.18
额外信息
这不是重复的 issue