SenorSmartyPants / Comixology-Scraper

GNU General Public License v3.0
35 stars 3 forks source link

Not really an issue...may in the read me #5

Closed xthephreakx closed 3 years ago

xthephreakx commented 3 years ago

How do I use this for Mylar ? Is there a small how to available for that

SenorSmartyPants commented 3 years ago

I updated the main README with setup instructions for mylar. And updated the mylar-wrapper.sh in the mylar branch.

Let me know if that works for you.

xthephreakx commented 3 years ago

Thnx for the update unfortunately I'm running Mylar on windows. But if I understand correctly I just have to move the Mylar-wrapper.sh to a location and in Mylar set run script after post-processing pointing to that scripts?

SenorSmartyPants commented 3 years ago

And you will have to update the file paths in *.sh script files.

Try to run mylar.sh <comic book.cbz> manually and get that running before teething to set up automatic post processing.

xthephreakx commented 3 years ago

Thnx will try that keep you updated.

Update: well i feel really stupid but cant get it to run ... C:\scraper>python mylar-wrapper.sh "T:\SCANFOLDER\X-Factor 009 (2021) (Digital) (Zone-Empire) (1).cbr" File "mylar-wrapper.sh", line 8 /usr/bin/python3 C:\ProgramData\mylar3\comictagger.py -S C:\scraper\mylar.py "$4" ^ SyntaxError: invalid syntax

changed *.sh to

!/bin/sh

$1 nzbname = original nzb name

$2 nzbpath = path to the nzb before Mylar moves it

$3 newfilename = the name given to the file by Mylar

$4 newpath = c:\temp

$5 metadata = seriesmetadata { name, comicyear, comicid , issueid, issueyear, issue, publisher } (didn't use it but appears to be the same as you state from a casual glance).

python C:\ProgramData\mylar3\comictagger.py -S C:\scraper\mylar.py "$4"

i'm probably doing something wrong... facepalm but cant figure out what it is...

i tried "" the paths aswell but that didnt work either

xthephreakx commented 3 years ago

oke solved 1 parts was trying to run bash with python .... duh

just tried again by running python C:\ProgramData\mylar3\comictagger.py -S C:\scraper\mylar.py "$4" "T:\SCANFOLDER\X-Factor V2020 009 (2020).cbr" directly

this is the output now Script raised an unhandled exception: No module named 'comictaggerlib' Traceback (most recent call last): File "C:\ProgramData\mylar3\lib\comictaggerlib\options.py", line 235, in launch_script script = import(module_name) File "C:\scraper\mylar.py", line 8, in from mylar_utils import File "C:\scraper\mylar_utils.py", line 11, in from comictaggerlib.settings import ModuleNotFoundError: No module named 'comictaggerlib'

dont really understand whats going wrong here.

SenorSmartyPants commented 3 years ago

Python isn't finding the comictaggerlib module. This is included with mylar, but the path settings for python may not know where to look to load that module. They should be in the lib subdirectory of your mylar install. You could update the python path to include that directory.

probably C:\ProgramData\mylar3\lib for you

I had to do a path insert to get it to work right for me for some reason.

https://github.com/SenorSmartyPants/Comixology-Scraper/blob/8d12b90b688efdda45cc71dc3d2a46ce0c4262fd/mylar_utils.py#L6-L9

xthephreakx commented 3 years ago

Awesome sorry for all my noob question will try that :)

xthephreakx commented 3 years ago

that seemed to work i guess...

i assume this is an suspected output

C:\Users\maurizio>python C:\ProgramData\mylar3\comictagger.py -S C:\scraper\mylar.py "$4" "T:\SCANFOLDER\X-men Legacy 214.cbr"
**$4: not found**!

just trying to figure out now how to turn the .sh file in a batch file cuze cant run bash in windows...

SenorSmartyPants commented 3 years ago

Remove the $4 from your manual test.

$4 is the 4th parameter passed into the mylar-wrapper.sh

xthephreakx commented 3 years ago

when removing the $4 i get this output C:\Users\maurizio>python C:\ProgramData\mylar3\comictagger.py -S C:\scraper\mylar.py "T:\SCANFOLDER\X-Factor V2020 009 (2020).cbr" readArchiveFile(): [[WinError 87] The parameter is incorrect] T:\SCANFOLDER\X-Factor V2020 009 (2020).cbr:ComicInfo.xml attempt#1 readArchiveFile(): [[WinError 87] The parameter is incorrect] T:\SCANFOLDER\X-Factor V2020 009 (2020).cbr:ComicInfo.xml attempt#2 readArchiveFile(): [[WinError 87] The parameter is incorrect] T:\SCANFOLDER\X-Factor V2020 009 (2020).cbr:ComicInfo.xml attempt#3 readArchiveFile(): [[WinError 87] The parameter is incorrect] T:\SCANFOLDER\X-Factor V2020 009 (2020).cbr:ComicInfo.xml attempt#4 readArchiveFile(): [[WinError 87] The parameter is incorrect] T:\SCANFOLDER\X-Factor V2020 009 (2020).cbr:ComicInfo.xml attempt#5 readArchiveFile(): [[WinError 87] The parameter is incorrect] T:\SCANFOLDER\X-Factor V2020 009 (2020).cbr:ComicInfo.xml attempt#6 readArchiveFile(): [[WinError 87] The parameter is incorrect] T:\SCANFOLDER\X-Factor V2020 009 (2020).cbr:ComicInfo.xml attempt#7 Error reading in raw CIX! None None #None (None) Notes=None Script raised an unhandled exception: expected string or bytes-like object Traceback (most recent call last): File "C:\ProgramData\mylar3\lib\comictaggerlib\options.py", line 239, in launch_script script.main() File "C:\scraper\mylar.py", line 84, in main processArchive(ca, style) File "C:\scraper\mylar.py", line 56, in processArchive CMXID = getCMXIDFromString(md.notes) File "C:\scraper\utils.py", line 5, in getCMXIDFromString match = re.search('[CMXDB(\d+)]', possibleCMXID) File "C:\Users\maurizio\AppData\Local\Programs\Python\Python37\lib\re.py", line 183, in search return _compile(pattern, flags).search(string) TypeError: expected string or bytes-like object

xthephreakx commented 3 years ago

Remove the $4 from your manual test.

$4 is the 4th parameter passed into the mylar-wrapper.sh

ha you were faster then me :D

SenorSmartyPants commented 3 years ago

This script needs to have comicinfo.xml already in the archive. I think it is failing because there isn't one.

Also, you should probably convert them to CBR before running this script as updating CBR isn't supported by the ComicTagger library. I could be wrong on this.

ComicTagger and both convert to CBZ and write a comicinfo.xml file for you.

xthephreakx commented 3 years ago

well first time i ran it on a comic with no comicinfo.xml file in there and got this: C:\Users\maurizio>python C:\ProgramData\mylar3\comictagger.py -S C:\scraper\mylar.py "T:\SCANFOLDER\X-men Legacy 214.cbr" Comic archive does not have metadata

so took a comic which had 1 and got the other output posted above also tried cbz same output there i will check the line it is mentioning maybe i need to change some paths there aswell

does it need winrar ? cuze i have 7zip installed ?

xthephreakx commented 3 years ago

i guess winrar was the issue installed winrar and its running now awesome !

just have to figure out now how to use this

!/bin/sh

$1 nzbname = original nzb name

$2 nzbpath = path to the nzb before Mylar moves it

$3 newfilename = the name given to the file by Mylar

$4 newpath = path to the file after Mylar has processed it

$5 metadata = seriesmetadata { name, comicyear, comicid , issueid, issueyear, issue, publisher } (didn't use it but appears to be the same as you state from a casual glance).

SenorSmartyPants commented 3 years ago

Probably make a batch file version, or a python script version of the bash provided.

Batch files use %1 %2 etc for command line parameters.

xthephreakx commented 3 years ago

awesome if i have a working version i will send it to you. although i think you'll probably make a better 1 then me hahaha

xthephreakx commented 3 years ago

Small update. I have given up can't make it a batch or Python script which it understands facepalm haha.

Might try the docker version

SenorSmartyPants commented 3 years ago

Maybe ask in the mylar forums for general windows mylar script help?

https://forum.mylarcomics.com/viewforum.php?f=4