I’ve been into ASMR and doujin voice works since… well, I don’t remember exactly when. High prices naturally drive me to search the vast internet, which led me to this site. However, the site only shows full content to logged-in users, and registration is almost never open except at random intervals. This made me curious.
So, I decided to run a program on my server to monitor if registration is open and notify me when it is.
GitHub: yexca/hvdb
Goal
Monitor whether registration is open and send a notification via Telegram if it is.
Detecting Registration
According to a reply in a thread on Reimu Plaza, when registration is open, a “register” link appears below the login button.
The simplest approach is to scrape the page and check for the presence of that word.
Bot Configuration
To use Telegram notifications, you need to register a bot.
Message
https://t.me/BotFather
and send the /newbot command. Follow the steps to create your bot.
Send a hello to your newly created bot.
Then visit the following URL (replace TOKEN with your actual token):
| |
You will get a JSON response. Find the id field; this is your chat_id.
Reference: Using Telegram Bot for Push Notifications
Python
Using Python is the easiest way (I didn’t bother looking into other languages).
I’m using the Requests library for scraping and
pyTelegramBotAPI
for notifications.
I won’t over-explain the logic; here is the code (do not name this file http.py or requests.py).
| |
References:
Solution for “AttributeError: partially initialized module ‘requests’ has no attribute ‘get’”
requests - Liao Xuefeng’s Official Website
Python time sleep() method - Runoob
Dockerizing
File structure:
| |
Dockerfile:
| |
Run the build command in the same directory:
| |
Moving to Server
On Windows:
| |
Wait for the packaging to finish, then copy it to the server:
| |
Once copied, run on the server:
| |
Reference: docker load error: Error processing tar file(exit status 1): archive/tar: invalid tar header