One Punch-Man RAW Manga / Webcomic Webhook Notification Service
- Introduction
- How to add my URL?
- How to Test My URL?
- How to Remove My URL?
- Fail to Receive Webhook Handling
- Download Chapters
- Documentation
- Dev Notes
A simple webhook service that notifies your URL whenever One Punch-Man Manga / Webcomic RAW chapter is updated.
- Simple and easy to use
- Fastest update notification
- Able to send multiple chapters in one request
- Able to detect revision/redraw chapters (manga only)
- Able to retry the notification if it fails to send to your endpoint
- Secured requests
- Discord Webhook support [NEW]
- Download Manga/Webcomic chapters [NEW]
Assuming you are familiar with webhook, just follow these simple steps:
- [IMPORTANT] Your URL should be able to receive POST requests and should reply with a random string which is put in the
opmkey
header everytime our server sends a request within 60 seconds. - Open this url.
- Add your URL.
- Save the generated key and URL in case you want to remove it later.
- Optional, add secret key to validate request signature, more on this below.
- Done, your URL should receive the POST request containing the event object and chapter object whenever new update arrives.
IMPORTANT NOTES:
- If the server fails to send a request to your endpoint, then the request will be resent at most 10 times at some interval.
- If you provide a secret key, please keep it saved somewhere else in your app (such as environment variable). There is no way to retrieve the secret key after subscription.
- If you want to reset your subscription key or secret key, you need to remove your URL first and start over the subscription.
- If you are having difficulties with the implementation, you should see and refer to our example below.
- [IMPORTANT] If your URL fails to receive the webhook from our server more than 10 times in a month, your URL will be removed and you should start over the subscription.
- Create Webhook in your Discord Server, please refer to Discord's tutorial for more information.
- Go to the form.
- Fill the form with previously created Discord Webhook URL, fill all required field and hit subscribe button.
- Save the generated key and URL in case you want to remove it later.
- Congratulations! Your channel will be notified whenever new chapter arrives.
- You are pretty much done, you can continue to test or remove sections.
NOTES:
- You can fill more than 1 role id.
- Chapter will be sent as an embed messages. Here are the examples.
Section below is for your own application, if you subscribed a discord webhook URL, you can ignore this section.
When the system finds a new chapter, it will fire POST request immediately to your URL. The content of the notification are:
- Headers
opmkey
: Random string unique for each Webhook Event. You should reply with this string for every requestsopm-signature-sha256
: HMAC SHA256 signature of the request body (signed with the secret value provided when subscribing)
- Body
Event Object
: Object with event update containing List of Chapter Object. More on this on documentation.- if your endpoint URL is Discord Webhook URL, this will be a Discord Webhook Message Object instead.
Securing webhook notification request is necessary to avoid your URL getting spoofed by unknown requests. You can use proved method to prove that the requests are coming from our server.
If you provide secret key when subscribing, our server will provide a opm-signature-sha256
header containing a signed request body using HMAC SHA256 with the provided secret key. More on how to do this is (kinda) explained in the example below.
Example below implements the previously explained validation. The validation are implemented in validate function as a middleware.
You can use this example as starter template.
Please refer to this repo or go ahead to Documentation Page
After registration completes, you can test your URL to see if it can receive the webhook correctly.
When you subscribed an URL, the website should save the subscription key for you in your browser.
You can go to Dashboard Page to test your URL, there should be three test options.
-
Will send a POST request containing Event Object with test event to your URL.
- If your URL is a Discord Webhook URL, this will send a GET request instead.
-
Will send a POST request containing Event Object with update event with latest Manga chapter to your URL.
- If your URL is a Discord Webhook URL, this will send a Discord Webhook Message Object with embeds instead.
-
Will send a POST request containing Event Object with update event with latest Webcomic chapter to your URL.
- If your URL is a Discord Webhook URL, this will send a Discord Webhook Message Object with embeds instead.
You can go to Dashboard Page to remove your URL.
Our server will resend the Webhook Event at most 10 tries at some interval. If your URL returns a 200 code with invalid response (it should be a random string in the opmkey
header), the request will be considered as a fail request. Please keep in mind if your URL fails to receive the Webhook more than 10 times in a month, your URL will be removed.
You can go to Download Page to download Manga/Webcomic Chapters.
Your endpoint will receive event object when first time added to system and receiving new updates.
- type
String
: Object type (test / update). - source
String
: Update source (null / manga / webcomic). - chapters
List of Chapter Object
: List of new chapter based on the source in ascending order.
note: type "test" and source "null" are only sent when first added to the system
{
"type": (String),
"source": (String),
"chapters": (List of Chapter Object)
}
{
"type": "test",
"source": null,
"chapters": []
}
{
"type": "update",
"source": "manga",
"chapters": [
{
"id": "3269754496479987879",
"chapter": "153",
"revision": true,
"redraw": true,
"thumbnail": "https://some.image/url.jpg",
"timestamp": 1630602000000,
"url": "https://tonarinoyj.jp/episode/3269754496479987879",
"totalPages": 17,
"downloadURL": "https://opmupdater.herokuapp.com/download#/manga/3269754496479987879"
}
]
}
Containing data from new chapter.
- id
String
: Chapter id based on the source. - chapter
String
: Chapter number based on the source (TonariNYJ/ONE's Site). - revision
Boolean
: Indicates chapter revision. - redraw
Boolean
: An alias for revision field. - thumbnail
String
: Chapter thumbnail URL. - timestamp
Long
: Chapter timestamp. - url
String
: Chapter URL. - totalPages
Number
: Chapter total pages. - downloadURL
String
: Chapter download URL.
{
"id": (String),
"chapter": (String),
"revision": (Boolean),
"redraw": (Boolean),
"thumbnail": (String),
"timestamp": (Long),
"url": (String),
"totalPages": (Number),
"downloadURL": (String)
}
{
"type": "update",
"source": "manga",
"chapters": [
{
"id": "3269754496479987879",
"chapter": "153",
"revision": true,
"redraw": true,
"thumbnail": "https://cdn-scissors.gigaviewer.com/image/scale/41085ae138d61ce997a5a2ec37b571f3100c2191/enlarge=0;height=450;no_unsharpmask=1;quality=90;version=1;width=320/https%3A%2F%2Fcdn-img.tonarinoyj.jp%2Fpublic%2Fepisode-thumbnail%2F3269754496479987879-24fb75cee700fb5ea50c4465b5b3e0f4%3F1630667893",
"timestamp": 1630602000000,
"url": "https://tonarinoyj.jp/episode/3269754496479987879",
"totalPages": 17,
"downloadURL": "https://opmupdater.herokuapp.com/download#/manga/3269754496479987879"
}
]
}