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

18x条目缺失cover img #16

Open
Rhilip opened this issue Jun 22, 2022 · 1 comment
Open

18x条目缺失cover img #16

Rhilip opened this issue Jun 22, 2022 · 1 comment

Comments

@Rhilip
Copy link

Rhilip commented Jun 22, 2022

如果用户的记录为非登录可见的18x条目时,img会被替换为 no_icon_subject.png。但实际对应bgm条目实际存在封面图

image

我看了代码,之前是走API 来获取,但是目前现在api同样不再返回对应图片信息

# The image is not shown to guest. Use API to get it
if large_image_url.startswith('/img/'):
item_id = item[1].split('/')[-1]
large_image_url = self.get_missed_image(item_id)

def get_missed_image (self, item_id):
bgm_api_prefix = 'http://api.bgm.tv'
item_url = bgm_api_prefix + '/subject/' + item_id
default_ret = '//bgm.tv/img/no_icon_subject.png'
response = self.session.get(item_url)
if response.status_code != 200:
logging.error('\nURL: %s\nStatus code: %s\nContent: %s\n', \
item_url, response.status_code, response.text)
return default_ret
res_json = json.loads(response.text)
if 'images' not in res_json or 'large' not in res_json['images']:
return default_ret
return res_json['images']['large'][5:]

image

能否考虑补充走 https://github.com/czy0729/Bangumi-Subject 项目获取?

@Shell32-Natsu
Copy link
Owner

https://github.com/czy0729/Bangumi-Subject 并没有覆盖所有条目。网页/api返回404是因为一些敏感条目只有登录用户才可以访问,目前似乎没有好的解决方法,可以增加一个开关隐藏掉这些条目。

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

2 participants