-
Notifications
You must be signed in to change notification settings - Fork 407
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
Batch upload strategy for "book mode" pixiv manga #2608
Comments
Maybe it's better to just use the Pixiv web api to get this data. |
Perhaps, I'm not familiar with web api. How does one access it? |
There's a dedicated wrapper for it here: https://github.com/r888888888/danbooru/blob/master/app/logical/pixiv_api_client.rb Using it is kinda iffy because it's not officially documented or supported. But it returns a lot of useful data without having to scrape any HTML. |
deployed the change to testbooru |
Seems to work just fine for both old and new styles. |
Pixiv seems to have a new mode for displaying manga pages, with a reader much like one on comic.pixiv.net, but thankfully with less obsessive protection. It's possible to grab the links to the individual pages, they're embedded into
<script>
elements inside<head>
, regexp for those should be pretty simple.The bad thing is URL is exactly the same for regular manga mode and "book" mode, so it'll be necessary to find some kind of marker inside the page itself.
Example:
http://www.pixiv.net/member_illust.php?mode=manga&illust_id=57045668
In the html code, there'll be multiple elements like this (linebreaks added for clarity):
We need to find code starting with
pixiv.context.originalImages[NN] =
, then get the text unil next semicolon and remove the unnecessary escaping.The text was updated successfully, but these errors were encountered: