Warning

⚠️ NSFW 警告:本篇文章可能包含暴力,性描写等仅供 18 岁以上阅览的内容。

Why

我很喜欢色情内容,但如果把它和其他订阅源放在一起,我一定不会再花时间琢磨别人的博客了,加上本人自制力差,容易被性暗示唤起性欲,所以对我来说,色情内容需要做隔离。

那为什么不用 RSSHub,还要自己用 Python 写规则呢?

  1. 定制化:我需要对拉去下来的源做附加的逻辑,比如过滤器,预览图替换,防盗链 (todo)
  2. 版权:RSShub 已经算是一个知名的项目了,且对一些版权性 PR 持保守态度,树大招风,我觉得你一定懂。
  3. 周期:开发周期会被 RSShub 上游卡着,或者我本地需要部署一个 RSShub 实例,比较麻烦,加上本身菜,就当练手了。

当然,这个项目不可能盈利,仅仅是继 个人博客 后,出于兴趣探索的再一款 jekyll 博客。

有非常多局限,如内容排版,目录导航,视觉设计等等,还有非常多待改进的地方

How

Vercel host via https://hentai.bgzo.cc

Source via: https://github.com/bGZo/hentai

What

Features

  1. Fetch RSS feeds and keep the latest resource daily
  2. Persist feeds in repo and support API with following (http://rss.bgzo.cc) with json
NameRouteDescriptionMethodNote
Feed/feeds/${tag_name_with_hyphen_and_lower}RSS feed, return xmlGET${tag_name_with_slash_and_lower} is the url string handle by lower() and hyphen(-).
For example, we have a DLsite Game Ranking.xml file in server, then the correct full url address will be http://rss.bgzo.cc/feeds/alsite-game-ranking.xml;
Contents/archives/${year}/${month}/${day}.jsonContents, return JSON responseGETNOTE: The timezone of response is GMT, format it whatever you want

Todos

Wontfix

防盗链

一些网站本身开启了防盗链,如: 灵梦御所。除非单独构建应用,或是添加请求头 Referer: https://blog.reimu.net,否则在一般的浏览器,是无法绕过的。

比如以下图片,你无法把它嵌入到你的博客,却能正常通过鼠标右键新建标签页打开浏览。

https://img.reimu.net/uploads/2023/06/6499957d1a902.png

How to deal with the content only show for the user login?

So the way RSS is bankruptcy, how does you request content using common method? How do you recognize the different websites? There are too much details.

Considered the risk of copyright, I should not build any mirror site for business content.

Alternatives

Tech Stack tech-debt

PY 开始提醒强制使用 VENV

    If you wish to install a non-Debian-packaged Python package,
    create a virtual environment using python3 -m venv path/to/venv.
    Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
    sure you have python3-full installed.
    
    If you wish to install a non-Debian packaged Python application,
    it may be easiest to use pipx install xyz, which will manage a
    virtual environment for you. Make sure you have pipx installed.
    
    See /usr/share/doc/python3.12/README.venv for more information.

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.

Solution

Pycharm 开启虚拟环境:

Settings > Project: > Python Interpreter > Add Interpreter > Select Virtualenv, via: https://www.jetbrains.com/help/pycharm/creating-virtual-environment.html#python_create_virtual_env