Skip to content
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

make multiple directories as single output file #53

Closed
refresz opened this issue Jun 13, 2013 · 11 comments
Closed

make multiple directories as single output file #53

refresz opened this issue Jun 13, 2013 · 11 comments
Labels
Enhancement New feature or request

Comments

@refresz
Copy link
Contributor

refresz commented Jun 13, 2013

Hi, when I download manga using e.g. DomDomSoft Manga Downloader from any site (like mangafox) each chapter has it's own directory. In order to make multi-chapter output file I need to copy all the jpg files into one directory (which also includes changing the name of the files) and then add this one directory to process by kcc. My suggestion would be to implement a flag which would indicate that the passed list of directories should be processed as one output file. Additional nice feature could include creation of chapters in the file based on directories.
The option should be available only for a list of directories.

@refresz
Copy link
Contributor Author

refresz commented Jun 13, 2013

I've tried to do it myself and wrote some lines in older version (2.6 I think) but I'm not phyton-compatible I guess, I prefer Java/C# ;) Something along these lines:

def getWorkFolderForList(aListOfDirs):
workdir = tempfile.mkdtemp();
for adir in aListOfDirs:
if os.path.isdir(adir):
# strip from last slash/backslash to have the correct dirname upon calling basename()
adir = adir.rstrip("")
adir = adir.rstrip("//")
basename = os.path.basename(adir)
try:
os.rmdir(os.path.join(workdir, basename))
copytree(adir, os.path.join(workdir, basename))
except OSError:
raise
else:
raise TypeError("Folder list works only with directories")
move(workdir, workdir + "_temp")
move(workdir + "_temp", os.path.join(workdir, 'OEBPS', 'Images'))
return workdir

etc.

@AcidWeb
Copy link
Collaborator

AcidWeb commented Jun 13, 2013

KCC already process sub-directories. Also create chapters based on directory tree.

Also don't use MangaFox. They compress images and that highly impact quality of conversion.

@AcidWeb AcidWeb closed this as completed Jun 13, 2013
@refresz
Copy link
Contributor Author

refresz commented Jun 13, 2013

I'm not talking about sub-directories. I'm talking about arguments passed to processor: if you pass multiple arguments which are all directories (meaning add multiple folders to the list in GUI) AND check a flag "treat as single output file" they will all together generate one epub/mobi file. Right now each directory creates separate output result.
In the following screen example there should be one result file generated if my proposed flag would be accepted.
kindle_comic_converter_v2 10_2013-06-13_22-55-55

@AcidWeb
Copy link
Collaborator

AcidWeb commented Jun 13, 2013

Just add D:/Dokumenty/Manga/Shin Angyo Onsgi/ and you will get one output file.

@refresz
Copy link
Contributor Author

refresz commented Jun 13, 2013

Will not work, as it has too much files/is too big to be converted epub -> mobi.

I know I can create temp folders and move the directories I want to have as one-file output to them, but it requires additional work from user (and actually messes up the cataloging). That's why I made this suggestion, which as far as my knowledge of your code goes doesn't actually require too much code change, even with the tree-building scenarios (just create one additional folder in %temp% where you put all the passed directories). The Title creation is also not a problem as you can use os.path.commonprefix(list) to get the biggest chunk of common prefix of submitted arguments - directories and then process it further.

@AcidWeb
Copy link
Collaborator

AcidWeb commented Jun 13, 2013

I don't see any reason to implement that.

That don't decrease amount of work for the user. You still need to split input files in too smaller batches. Considering that new GUI (That will be released soon) will not support adding multiple directories at once spliting directories manually will be faster way.

@AcidWeb
Copy link
Collaborator

AcidWeb commented Jun 14, 2013

BTW personally I use another layer of sub-directories - manga/volume/chapter. This way they are small enough to be converted as one file.

Also - more important I forget thank you for the feedback :-P I understand your problem but your arguments just simply not convince me. I would prefer to fully automate this process - automatically divide too big batches - but that problem not have any practical solution.

@refresz
Copy link
Contributor Author

refresz commented Jun 14, 2013

No problem ;) Are you using some application for downloading manga in such subdirs structure? Because it is exactly how I'd like to have my collection organized as well, but the downloader I use (the one from first post) doesn't provide such functionality.

Also - if you ever want to rewrite this to java or c# feel free to contact me, I'd be more than happy to help :P

BR,
Mateusz

@AcidWeb
Copy link
Collaborator

AcidWeb commented Jun 14, 2013

I wrote my own scrapper in Ruby. But that require a source that properly mark volumes and chapters.

Part of KCC was is C#. We just dropped it and rewrite it in Python to be 100% multi-os :-P

@matthiasdg
Copy link

@refresz since you mentioned mangafox: some time ago I wrote a scraper/proxy webserver in node.js for that site, which integrates the KCC script. Surfing to the node server from within the kindle browser allows you to search for manga, generate and download the epub or mobi straight from there (per chapter or per volume). Image quality in Panel View mode is indeed not that great, but I rarely use that.

@AcidWeb
Copy link
Collaborator

AcidWeb commented Jun 17, 2013

Quality of images on MangaFox (and most similar crappy online readers) is catastrophic. They re-size and compress every page. That seriously decrease quality of converted images.

That is really nice work @matthiasdg but you if still using it - update KCC inside. You running ancient version - no multithreading :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants