JDownloader Community - Appwork GmbH
 

Reply
 
Thread Tools Display Modes
  #1  
Old 19.07.2016, 00:49
Chris0089's Avatar
Chris0089 Chris0089 is offline
Fibre Channel User
 
Join Date: Mar 2010
Location: San Diego
Posts: 127
Default nhentai support

sample links

**External links are only visible to Support Staff****External links are only visible to Support Staff**
**External links are only visible to Support Staff****External links are only visible to Support Staff**
**External links are only visible to Support Staff****External links are only visible to Support Staff**
**External links are only visible to Support Staff****External links are only visible to Support Staff**
**External links are only visible to Support Staff****External links are only visible to Support Staff**
Reply With Quote
  #2  
Old 19.07.2016, 10:25
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 72,936
Default

__________________
JD-Dev & Server-Admin
Reply With Quote
  #3  
Old 07.01.2017, 03:46
GGG KILLER GGG KILLER is offline
Modem User
 
Join Date: Dec 2016
Location: Earth
Posts: 2
Smile

Sorry to necropost but I was able to achieve support through the following method (mix between userscript and packagizer):

[Packagizer]
Rule:
[Conditions]
Name: nHentai Downloader
FileName: equals (\d+)\..+ (regex on)
FileType: is Image
SourceUrl(s): contains \/\/i\.nhentai\.net\/galleries\/\d+\/\d+\..+\?jdfn=([^,\n]+) (regex on)
File: is online
[Set]
PackageName: <jd:source:1>
[UserScript]
1. Generate the suffix through
1.1. Set the value to "?jdfn="
1.2. Append the value of <title> until the space before the "»" (which is the short name wihout all tags and etc.)
2. Retrieve all <a> elements with the "lazyload" class
3. Map each element to the value of it's "src" element
4. Map all to:
4.1. Prefix with the protocol (as all urls start with "//:" instead of "**External links are only visible to Support Staff** or "**External links are only visible to Support Staff**
4.2. Replace on value: "t.n" by "i.n"
4.3. Replace the regex /\/(\d+)t\./ by "$1." (removes the t from the file numbers/names)
4.4. Append the suffix generated in (1.)
5. Join the result of the array with "\n"
6. Sets the result of the join as the clipboard value

[JDownloader]
1. LinkGrabber notices the clipboard value
2. The packagizer rule organizes the images into a single package with the proper name

And if you just feel like reading code, here's the userscript source (javascript):
Code:
// ==UserScript==
// @name         nHentai Downloader JDownloader
// @description  Tool to download manga on nHentai.net with jDownloader 2.0
// @version      2.1.0
// @author       GGG KILLER
// @match        http://nhentai.net/g/*
// @match        https://nhentai.net/g/*
// @noframes
// @connect      self
// @run-at       document-idle
// @grant        GM_setClipboard
// ==/UserScript==

const $download = document.querySelector('#download');
$download.addEventListener( 'click', function ( e )
{
    e.preventDefault( );
    const suffix = '?jdfn=' + document.title.substring( 0, document.title.indexOf( '»' ) - 1 );

    GM_setClipboard( Array.from( document.querySelectorAll( '.lazyload' ) ).map ( function ( elem ) {
        return document.location.protocol + elem.getAttribute( 'data-src' ).replace( 't.n', 'i.n' ).replace( /\/(\d+)t\./, '/$1.' ) + suffix;
    } ).join( '\n' ) );
}, false );
If someone gave me a few pointers I believe I could create a plugin to do this, since I already have the logic for downloading pretty much done I just need to convert it to Java.

Last edited by GGG KILLER; 30.11.2017 at 23:08.
Reply With Quote
  #4  
Old 09.01.2017, 19:41
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 72,936
Default

Thanks, this will help to create native plugin support
I will create plugin and then you can see how it all works together and maybe add yourself some plugins then
__________________
JD-Dev & Server-Admin
Reply With Quote
  #5  
Old 10.01.2017, 20:36
GGG KILLER GGG KILLER is offline
Modem User
 
Join Date: Dec 2016
Location: Earth
Posts: 2
Post

Quote:
Originally Posted by Jiaz View Post
Thanks, this will help to create native plugin support
I will create plugin and then you can see how it all works together and maybe add yourself some plugins then
Also, if it doesn't makes the plugin harder to make, could you add filename padding? (e.g. "001.jpg", "010.jpg", "100.jpg", etc.) File name sorting doesn't takes integers into consideration and only sorts by the character ascii code such that it orders the pages as 1.jpg, 10.jpg, 11.jpg, ..., 2.jpg, 20.jpg, ... and that makes reading the downloaded comics/doujins hard (I even ended up making a program do pad all images filenames because of that ).

Thank you in advance for implementing the plugin
Reply With Quote
  #6  
Old 11.01.2017, 10:27
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 72,936
Default

filename padding is no big deal
__________________
JD-Dev & Server-Admin
Reply With Quote
  #7  
Old 14.01.2017, 01:53
raztoki's Avatar
raztoki raztoki is offline
English Supporter
 
Join Date: Apr 2010
Location: Australia
Posts: 17,389
Default

added basic support.

if you're interested in the source code GGG KILLER check out NhentaiNet

raztoki
__________________
raztoki @ jDownloader reporter/developer
http://svn.jdownloader.org/users/170

Don't fight the system, use it to your advantage. :]
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT +2. The time now is 04:47.
Provided By AppWork GmbH | Privacy | Imprint
Parts of the Design are used from Kirsch designed by Andrew & Austin
Powered by vBulletin® Version 3.8.10 Beta 1
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.